Skip to content

Inconsistency in calling methods without dot selector #15686

Closed as not planned
Closed as not planned
@WojciechMazur

Description

@WojciechMazur

Community build bug found in https://github.com/vladkopanev/cats-saga
Based on Open Community Build #2371
Part of #15647 regressions tracker

Compiler version

All Scala 3 versions
Compiles with Scala 2 (2.13.8)

Minimized code

class Foo{
  def bar[T](fn: () => T): T = ???
}

object Test {
  val x = new Foo
  x bar(() => "hello")  // is fine
  x bar[String](() => "world") // does not compile
}

Output

[error] ./test.scala:8:8: expression expected but '[' found
[error]   x bar[String](() => "hello")
[error]       

Expectation

Should compile

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions