-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Nonsensical imports treated cause weird error messages #19413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Currently, the error is completely anonymous. This is clean build at
Full disclosure
|
in 3.4.0-RC1 repl I get this error: -- [E008] Not Found Error: -----------------------------------------------------
10 |import kla.bla.ra1
| ^^^^^^^
| value bla is not a member of object kla
1 error found if I remove the import and incorrect call to test now I have another error which also makes sense, but its different, it looks like it tried to apply an extension method? scala> import hello.bla.*
|
| @main def hello =
| ???
|
| object kla:
| def ra = ???
|
| //import kla.bla.ra1
| @main def test =
| ???
|
-- [E007] Type Mismatch Error: -------------------------------------------------
1 |import hello.bla.*
| ^^^^^
|Found: (hello : => Nothing)
|Required: ?{ bla: ? }
|Note that implicit conversions were not tried because the result of an implicit conversion
|must be more specific than ?{ bla: a type that can be selected or applied }
|
| longer explanation available when compiling with `-explain`
1 error found |
On the command line now,
|
if the def is not
as opposed to
On the happy unhappy path, it notices the problem
I don't even know what it means for a path to be immutable, as opposed to stable. |
This was fixed in 3.4.2, which was in May. Illustrating import from method result but see #21788
|
Tests for scala#19413, scala#20070 and scala#23122
Tests for scala#19413, scala#20070 and scala#23122 [Cherry-picked dfabe4f][modified]
Compiler version
3.3.1
Minimized code
Output
Expectation
I would expect
hello.bla
import highlighted first, as it makes no sense - import from a functionBut if you comment out everything after the
hello
function, you get only "test not found" error.The "Cyclic reference" error is also confusing.
The text was updated successfully, but these errors were encountered: