Skip to content

Indentation forbidden before polymorphic functions #7655

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

Closed
Blaisorblade opened this issue Dec 1, 2019 · 1 comment
Closed

Indentation forbidden before polymorphic functions #7655

Blaisorblade opened this issue Dec 1, 2019 · 1 comment

Comments

@Blaisorblade
Copy link
Contributor

Blaisorblade commented Dec 1, 2019

minimized code

object bug2 {
  //works:
  val id: [U] => U => U =
  [U] => (none: U) => none
  //fails to parse:
  val id2: [U] => U => U =
    [U] => (none: U) => none
}

expectation

id2 parses correctly.

actual

With version 0.20.0-RC1:

[info] Compiling 1 Scala source to /Users/pgiarrusso/git/Coq/silr-dot/code/target/scala-0.20/classes ...
[error] -- [E103] Syntax Error: /Users/pgiarrusso/git/Coq/silr-dot/code/Bug2.scala:7:4 -
[error] 7 |    [U] => (none: U) => none
[error]   |    ^
[error]   |    Illegal start of statement
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 0 s, completed Dec 1, 2019 4:00:04 PM

Ditto with sbt repl on master (eeb092524530c14dc3a110b38179e24f3c208776):

scala> val id: [U] => U => U =
     |   [U] => (none: U) => none
2 |  [U] => (none: U) => none
  |  ^
  |  Illegal start of statement
@odersky
Copy link
Contributor

odersky commented Dec 2, 2019

It also fails if the function is put in braces:

3 |  val id: [U] => U => U = { [U] => (none: U) => none }
  |                            ^
  |                            Illegal start of statement

odersky added a commit to dotty-staging/dotty that referenced this issue Dec 2, 2019
@smarter smarter closed this as completed in 011321e Dec 2, 2019
smarter added a commit that referenced this issue Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants