diff options
Diffstat (limited to 'tests/untried/pos/t5022.scala')
-rw-r--r-- | tests/untried/pos/t5022.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/untried/pos/t5022.scala b/tests/untried/pos/t5022.scala new file mode 100644 index 000000000..5db71c656 --- /dev/null +++ b/tests/untried/pos/t5022.scala @@ -0,0 +1,22 @@ +class ForSomeVsUnapply { + def test: Unit = { + 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 }) |