Skip to content

Indentation forbidden before polymorphic functions #7655

@Blaisorblade

Description

@Blaisorblade

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions