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

Regression: scalac is wrong about type parameters (inside GADT pattern match) #10117

Closed
scabug opened this issue Dec 22, 2016 · 3 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Dec 22, 2016

The following used to work in 2.11.8:

$ scala-2.12.1/bin/scala
Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_102).
Type in expressions for evaluation. Or try :help.

scala> :paste
// Entering paste mode (ctrl-D to finish)

import scala.language.higherKinds

case class Const[A, B](value: A)

trait Foo[F[_], A]
case class Bar[F[_]]() extends Foo[F, Unit]

def f[F[_], A](foo: Foo[F, A]): Unit = foo match {
  case Bar() => Const[Unit, F[Unit]](()).value
}

// Exiting paste mode, now interpreting.

<console>:19: error: F does not take type parameters
         case Bar() => Const[Unit, F[Unit]](()).value
                                   ^

scala> 
@scabug
Copy link
Author

scabug commented Dec 22, 2016

Imported From: https://issues.scala-lang.org/browse/SI-10117?orig=1
Reporter: Tomas Mikula (tomas.mikula-at-gmail.com)
Affected Versions: 2.12.1

@scabug
Copy link
Author

scabug commented Dec 22, 2016

@retronym said:
Thanks for the small reproduction of the problem.

Using that, I've identified some problems in our implementation of GADT with higher kinds.

Your test case compiles under: https://github.com/retronym/scala/tree/ticket/10117

@scabug
Copy link
Author

scabug commented Feb 17, 2017

Tomas Mikula (tomas.mikula-at-gmail.com) said:
That was quick! (Didn't see your reply before, as the notification email ended in spam folder.)

@scabug scabug added this to the 2.12.3 milestone Apr 7, 2017
@retronym retronym modified the milestones: 2.12.3, 2.12.4 Jul 8, 2017
@adriaanm adriaanm modified the milestones: 2.12.4, 2.12.5 Oct 10, 2017
@SethTisue SethTisue modified the milestones: 2.12.5, Backlog Mar 1, 2018
@SethTisue SethTisue modified the milestones: Backlog, 2.13.0-RC1 Jan 28, 2019
@SethTisue SethTisue assigned joroKr21 and unassigned retronym Jan 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants