We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8904c96 + 0274907 commit e8749afCopy full SHA for e8749af
tests/pos/i8083.scala
@@ -0,0 +1,26 @@
1
+trait A {
2
+ class B
3
+}
4
+abstract class Test2 { val a: A; val b: a.B }
5
+object Test2 {
6
+ def unapply(that: Test2): Option[(that.a.type, that.a.B)] = Some((that.a, that.b))
7
8
+object anA extends A
9
+object Test extends App {
10
+ val t: Test2 { val a: anA.type; val b: anA.B } = new Test2 { val a: anA.type = anA; val b = new a.B }
11
+ t match {
12
+ case Test2(u, v) =>
13
+ u: A
14
+ u: t.a.type // error
15
+ v: t.a.B // error
16
+ }
17
18
+object Test1 extends App {
19
+ object t extends Test2 { val a = anA; val b = new a.B }
20
21
22
23
24
25
26
0 commit comments