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

GADT, pattern matching anon fun inference regression #10085

Open
scabug opened this issue Dec 1, 2016 · 1 comment
Open

GADT, pattern matching anon fun inference regression #10085

scabug opened this issue Dec 1, 2016 · 1 comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) gadt regression typer
Milestone

Comments

@scabug
Copy link

scabug commented Dec 1, 2016

sealed trait Op[A]
case class IntOp(i: Int) extends Op[Int]

object Test {
  def run[A](op: Op[A]): Int => A = op match {
    case IntOp(i) => 
      {case x => i} // broken
  }
  // def runOkay[A](op: Op[A]): Int => A = op match {
  //   case IntOp(i) =>
  //     x => i // okay
  // }
}

This no longer typechecks ("found A required Int"). I bisected the regression to http://github.com/scala/scala/pull/4971, support for SAM types.

@scabug
Copy link
Author

scabug commented Dec 1, 2016

Imported From: https://issues.scala-lang.org/browse/SI-10085?orig=1
Reporter: @retronym
Affected Versions: 2.12.0-M4, 2.12.0

@scabug scabug added this to the Backlog milestone Apr 7, 2017
@SethTisue SethTisue added gadt fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) labels Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) gadt regression typer
Projects
None yet
Development

No branches or pull requests

2 participants