diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-06-19 10:49:37 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-06-19 10:49:37 -0700 |
commit | 16ea58b34b37947f40b3d9f90356a64099b250a7 (patch) | |
tree | d9029dfb0c619d74047850ac6d990afe74fe6486 /test/files/pos/t5022.scala | |
parent | e2b4db06f20894b6f14b929c1d2c7f15e1af68ee (diff) | |
parent | 8c0f444ba550dbd2aa7071cf840aec7b6ada03cb (diff) | |
download | scala-16ea58b34b37947f40b3d9f90356a64099b250a7.tar.gz scala-16ea58b34b37947f40b3d9f90356a64099b250a7.tar.bz2 scala-16ea58b34b37947f40b3d9f90356a64099b250a7.zip |
Merge pull request #2631 from retronym/ticket/5022
SI-5022 Retain precise existentials through pattern matching
Diffstat (limited to 'test/files/pos/t5022.scala')
-rw-r--r-- | test/files/pos/t5022.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/files/pos/t5022.scala b/test/files/pos/t5022.scala new file mode 100644 index 0000000000..b9a085fb35 --- /dev/null +++ b/test/files/pos/t5022.scala @@ -0,0 +1,22 @@ +class ForSomeVsUnapply { + def test { + def makeWrap: Wrap = ??? + def useRep[e](rep: (e, X[e])) = () + + val repUnapply = Wrap.unapply(makeWrap).get + useRep(repUnapply) // okay + + val Wrap(rep0) = makeWrap + useRep(rep0) // error + + val rep = makeWrap match { + case Wrap(r) => r + }; + + useRep(rep) // error + } +} + +class X[e] + +case class Wrap(rep: (e, X[e]) forSome { type e }) |