diff options
Diffstat (limited to 'test/pending/neg/t6680a.scala')
-rw-r--r-- | test/pending/neg/t6680a.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/pending/neg/t6680a.scala b/test/pending/neg/t6680a.scala new file mode 100644 index 0000000000..745334b1cd --- /dev/null +++ b/test/pending/neg/t6680a.scala @@ -0,0 +1,13 @@ +case class Cell[A](var x: A) +object Test { + def f1(x: Any) = x match { case y @ Cell(_) => y } // Inferred type is Cell[Any] + // def f2(x: Cell[_]) = x match { case y @ Cell(_) => y } // Inferred type is Cell[_] + // def f3[A](x: Cell[A]) = x match { case y @ Cell(_) => y } // Inferred type is Cell[A] + + def main(args: Array[String]): Unit = { + // val x = new Cell(1) + // val y = f1(x) + // y.x = "abc" + // println(x.x + 1) + } +}
\ No newline at end of file |