Improved detail in secondary import statement error message #17874
Replies: 0 comments 3 replies
-
Definitely a bug of some kind. It's too late on a Sunday for me to understand that everything is in
|
Beta Was this translation helpful? Give feedback.
-
Has anyone written a tool to output ascii banners, but the banner is entirely legal Scala 3 code that exploits indentation edge cases? |
Beta Was this translation helpful? Give feedback.
-
I also think this is a bug rather than an enhancement, as the compiler should be able to be more helpful At least all "{ expected" should be changed to "{ or : expected" inline with the new syntactic options. |
Beta Was this translation helpful? Give feedback.
-
When I incorrectly write code like this:
the compiler shows this error message:
As I initially pointed out on Gitter, and Bjorn Regnell clarifies here, the error message could be more helpful, especially when using the significant indentation syntax. Bjorn’s suggests this:
I think it would be even more clear to state that the
package
statement needs to end with a:
and possibly that thetrait
line needs to be indented, but I don’t know what information is available. I’ve seen some other Scala 3 error messages that are really terrific and helpful — varargs, match expressions, trait inheritance, etc. — which is why I mention all of this.Beta Was this translation helpful? Give feedback.
All reactions