Skip to content

Unary identifier has undue expectation of subsequent expression #7910

Closed
@som-snytt

Description

@som-snytt

minimized code

  def k = {
    object + extends Function1[Int, Int] { def apply(i: Int): Int = i + 1 }
    val g: Int => Int = +
    g(1)
  }

13 |    val g: Int => Int = +
   |                         ^
   |                         expression expected but end of statement found

@hrhino said his tests for scala/scala#8617 worked, so I tried mine, too.

  final val x = 42
  def f = {
    import x._
    val g: Int => Int = +
    g(1)
  }

expectation

Unary ids are ordinary identifiers.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions