Skip to content

Ycheck failure on applied PolyFunction #16622

Open
@nicolasstucki

Description

@nicolasstucki

Compiler version

3.2

Minimized code

  ([Z] => (arg: Z) => { arg }).apply[Int](2)

Output

Using -Ycheck:all

** error while checking tests.scala after phase typer ***
java.lang.AssertionError: assertion failed: Types differ
Original type : [Z] => (arg: Int) => Int
After checking: [Z] => (arg: Z) => Z
Original tree : {
  final class $anon() extends Object(), PolyFunction {
    def apply[Z >: Nothing <: Any](arg: Z): Z =
      {
        arg
      }
  }
  new $anon():([Z] => (arg: Z) => Z)
}

Expectation

Should work

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions