Skip to content

Auto-approximating bound for match types caused changes in erasure, which are TASTy- and binary incompatible #21258

Closed
@sjrd

Description

@sjrd

Compiler version

From < 3.4.2 to >= 3.4.2

Minimized code

object Test {
  type MT[X] = X match {
    case Int => String
  }

  def unboundUnreducibleSig[X](x: X): MT[X] = ???
}

Output

With -Xprint:erasure:

With Scala 3.4.1:

def unboundUnreducibleSig(x: Object): Object = ???()

With Scala 3.4.2:

def unboundUnreducibleSig(x: Object): String = ???()

Expectation

We should not have broken binary and TASTy compatibility for the exact same source code.

IMO we need to revert #19761 ASAP. This is the most egregious of a list of issues with it, such as #21256 and regressions like #21013.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions