-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Bad indentation parsing at code misalignment #8256
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
Labels
Comments
package <empty> {
import collection.immutable._
trait Test[A] {
module object Test {
implicit def ev[A]: Test[A] =
new Test[A] {
<empty>
}
}
val fetch = implicitly[Test[1.type]]
}
@main() def main(): Unit =
{
<empty>
}
} Notice the object Test appears inside the trait Test, that's unexpected to say the least /cc @odersky |
This is a nice example to illustrate why we should not just observe indentation without a specific leading token. This will be fixed once we allow only the currently specced indentation syntax, and drop supporting the old experiments. |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Feb 9, 2020
The new syntax requires a `:`. The old syntax was still supported under a Config option which was on by default. But the test is further confirmation that silent identation without a specific leading token is a bad idea.
odersky
added a commit
that referenced
this issue
Feb 10, 2020
Fix #8256: Disallow silent indent for template bodies
gabro
pushed a commit
to gabro/dotty
that referenced
this issue
Feb 11, 2020
The new syntax requires a `:`. The old syntax was still supported under a Config option which was on by default. But the test is further confirmation that silent identation without a specific leading token is a bad idea.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
minimized code
Important! Keep the indentation as set in this example.
See scastie: https://scastie.scala-lang.org/Ixn7YUAZSjSCPgKbNQR5Wg
Compilation output
expectation
No error.
The text was updated successfully, but these errors were encountered: