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

value class regression trying to do lub/glb of typevar #8602

Closed
scabug opened this issue May 18, 2014 · 5 comments · Fixed by scala/scala#6492
Closed

value class regression trying to do lub/glb of typevar #8602

scabug opened this issue May 18, 2014 · 5 comments · Fixed by scala/scala#6492
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented May 18, 2014

Related to #5559 obviously but a regression from 2.10.

class Foo[CC[X], D <: CC[Int]](val xs: D) extends AnyVal
// error: trying to do lub/glb of typevar ?D
// error: scala.reflect.internal.FatalError:
//   trying to do lub/glb of typevar ?D
//      while compiling: ./a.scala
//         during phase: typer
//      library version: version 2.11.0
//     compiler version: version 2.11.0
@scabug
Copy link
Author

scabug commented May 18, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8602?orig=1
Reporter: @paulp
Affected Versions: 2.11.0
See #5559

@scabug
Copy link
Author

scabug commented Jun 9, 2014

@adriaanm said:
#8651 shows how to simplify the repro

case class Foo[CC[X], D <: CC[Int]](val xs: D)

@scabug
Copy link
Author

scabug commented Apr 15, 2015

@retronym said (edited on Apr 15, 2015 11:23:56 AM UTC):
Another reproduction (crashed in 2.10 and 2.11):

trait Matcher[X <: AnyRef] {}

object Problem2 {
  def allOf[X](x: Matcher[_ >: X], y: Matcher[_ >: X]) = new Matcher[X]() {}
  def allOf[X](x: Matcher[_ >: X]*) = new Matcher[X]() {}
}

object ProblemMaker {
  def equalTo[X](x: X) = new Matcher[X]() {}
  val b = Problem2.allOf(equalTo("f"), equalTo("g"))
}

@scabug
Copy link
Author

scabug commented Apr 15, 2015

@retronym said:
Analysis of that one over in #5559.

@joroKr21
Copy link
Member

The original example compiles now, although it's useless. We need to be able to infer CC in order to trigger the crash (at call site):

case class Foo[CC[X], D <: CC[Int]](d: D, cc: CC[Int])
Foo(Nil, List(1, 2, 3))

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