Skip to content

Commit 8f5bd77

Browse files
committed
GADT test
This one failed in getters before because a (previously unchecked) assignment was turned into a checked application. Now it passes.
1 parent 23d1bfb commit 8f5bd77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/pending/pos/gadts2.scala renamed to tests/pos/gadts2.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ object Test {
88
case class Cell[a](var x: a) extends Term[a]
99
final case class NumTerm(val n: Number) extends Term[Number]
1010

11-
def f[a](t: Term[a], c: Cell[a]): Unit = {
11+
def f[A](t: Term[A], c: Cell[A]): Unit = {
1212
t match {
13-
case NumTerm(n) => c.x = MyDouble(1.0)
13+
case NumTerm(n) => c.x = MyDouble(1.0) // problem is: this assignment is not type correct, since gadt variable is forgotten
1414
}
1515
}
1616

0 commit comments

Comments
 (0)