summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-10-08 21:52:15 +0200
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-10-08 21:52:15 +0200
commitff051e29eae9139a688664f3531028cd89df4c75 (patch)
tree259bff55d00a912c69c9536b2f64e719402ebace /test/files/pos
parentc038732f1b302dd128b32512aab4cf0826752599 (diff)
downloadscala-ff051e29eae9139a688664f3531028cd89df4c75.tar.gz
scala-ff051e29eae9139a688664f3531028cd89df4c75.tar.bz2
scala-ff051e29eae9139a688664f3531028cd89df4c75.zip
SI-8894 dealias when looking at tuple components
Classic bait-and-switch: `isTupleType` dealiases, but `typeArgs` does not. When deciding with `isTupleType`, process using `tupleComponents`. Similar for other combos. We should really enforce this using extractors, and only decouple when performance is actually impacted.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t8894.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/pos/t8894.scala b/test/files/pos/t8894.scala
new file mode 100644
index 0000000000..3b26f1ae7e
--- /dev/null
+++ b/test/files/pos/t8894.scala
@@ -0,0 +1,12 @@
+class CC(val i: Int, val s: String)
+object CC extends {
+ type P = (Int, String)
+
+ //def unapply(c: CC): Option[(Int, String)] = Some((c.i, c.s)) // OK
+ def unapply(c: CC): Option[P] = Some((c.i, c.s)) // fails (because of the type alias)
+}
+
+class Test {
+ val cc = new CC(23, "foo")
+ val CC(i, s) = cc
+} \ No newline at end of file