Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sjrd opened this issue Jul 24, 2024 · 1 comment · Fixed by #21336

Comments

@sjrd
Copy link
Member

sjrd commented Jul 24, 2024

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.

@Gedochao Gedochao added regression This worked in a previous version but doesn't anymore prio:blocker labels Jul 24, 2024
WojciechMazur added a commit that referenced this issue Jul 29, 2024
…ive" in 3.4.3 (#21268)

Reverts #19761 in 3.4.3-RC1 as discussed in #21258 and accepted by the
core compiler team.
WojciechMazur added a commit that referenced this issue Jul 29, 2024
…ive" in 3.5.0 (#21266)

Reverts #19761 in 3.5.0-RC6 as discussed in #21258 and accepted by the
core compiler team.
WojciechMazur added a commit that referenced this issue Jul 29, 2024
…ive" in 3.5.1 (#21267)

Reverts #19761 in 3.5.1-RC2 as discussed in #21258 and accepted by the
core compiler team.
@Gedochao Gedochao added prio:high and removed prio:blocker regression This worked in a previous version but doesn't anymore labels Aug 5, 2024
@dwijnand
Copy link
Member

dwijnand commented Aug 5, 2024

I need to add a migration warning, indicating the upper bound change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants