mod/module,cue/load,internal/filetypes: reject version in import qualifier
Give a clear error when a version appears inside the package qualifier
of an import path, such as "foo.com/bar:baz@v0" or "foo.com/bar@v0:baz@v1",
rather than confusing messages like "no files in package directory with
package name other@v0" or "cannot combine scope with file".
The validation is in CheckImportPath, with an early check in the loader
for CLI arguments that may not reach CheckImportPath (e.g. no module).
IsPackage uses the presence of "/" in the path to distinguish package
paths from filetype scopes when the qualifier isn't a valid identifier.
Fixes #2859.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I92e4e9e50e6f56dc35bf51c97f073ca83b1248c5
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1233779
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>