-
Notifications
You must be signed in to change notification settings - Fork 1.1k
non-informative error message for a transparent
soft keyword with multiple new lines after it
#11712
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
If there are multiple newlines after |
@odersky
Which contradicts to:
Also, if so, why the compiler then says "expected start of definition" and doesn't treat object A {
def transparent: Int = {
println("transparent method called")
42
}
transparent
println()
transparent
inline def f1 = 2
transparent
inline def f2 = 2
transparent
def f3 = 2
} It seems that implementation should be patched in any case. |
Thanks, unkarjedy. I had to re-read the spec (both of them). All the I see that the language about "sequence of newline tokens and soft mods" could be misconstrued as "arbitrary sequence". Probably it just means they can be "stacked". I agree intuitively that if Here, As an aspirational footnote, it would be nice to visualize It's worth adding that "people don't write code like this", except when they are in the middle of an edit. Extra feedback might be helpful or annoying, depending on personal preferences. |
So are you implying that we should leave the compiler implementation & specification as is, without any changes?
I agree that probability to see such code is low. |
I intended to agree with you, and say the "orphan" I also think the phrase "sequence of newlines" you pointed out in the reference should be more specific (and in the grammar). However, although I periodically re-read the rules about newlines, I never retain them; I rely just on common practices or style. |
Ok, why I am asking is that I am trying to understand whether it is ok to continue keeping this ticket as "Closed" if any clarifications in the spec are going to be made |
@unkarjedy I think you are right, it needs a clarification or a software fix. Maybe it's simplest to try a software fix to accept these as soft modifiers. |
Compiler version
3.0.0-RC1
Minimized code
Output
Ther actually IS "start of definition" though the error says that there is no
Expectation
More informative message? (maybe better parsing? not sure)
The text was updated successfully, but these errors were encountered: