File tree 2 files changed +54
-1
lines changed
compiler/src/dotty/tools/dotc/core 2 files changed +54
-1
lines changed Original file line number Diff line number Diff line change @@ -2361,7 +2361,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
2361
2361
x && {
2362
2362
t match {
2363
2363
case tp : TypeRef if tp.symbol.isAbstractOrParamType => false
2364
- case _ : SkolemType | _ : TypeVar | _ : TypeParamRef => false
2364
+ case _ : SkolemType | _ : TypeVar => false
2365
2365
case _ => foldOver(x, t)
2366
2366
}
2367
2367
}
Original file line number Diff line number Diff line change
1
+ final class Two [A , B ]()
2
+
3
+ final class Blaaa
4
+
5
+ final class Bla [X ]
6
+
7
+ object Test1 {
8
+
9
+ type Foo [X ] = X match
10
+ case Two [Blaaa , _] =>
11
+ String
12
+ case Two [String , _] =>
13
+ Int
14
+
15
+ def test : Foo [Two [String , String ]] = 1
16
+ }
17
+
18
+ object Test2 {
19
+ type Foo [X ] = X match
20
+ case Two [Bla [_], _] =>
21
+ String
22
+ case Two [String , _] =>
23
+ Int
24
+
25
+ def test : Foo [Two [String , String ]] = 1
26
+ }
27
+
28
+
29
+ object Test3 {
30
+ type Id [W ] = W
31
+
32
+ type M [X , Y ] = X match {
33
+ case Int => String
34
+ case Id [x] => Y match {
35
+ case Two [Bla [a], _] => Int
36
+ case _ => String
37
+ }
38
+ }
39
+ val x : M [Boolean , Two [Boolean , Boolean ]] = " "
40
+ }
41
+
42
+ object Test4 {
43
+ type Id [W ] = W
44
+
45
+ type M [X , Y ] = X match {
46
+ case Int => String
47
+ case Id [x] => Y match {
48
+ case Two [Bla [`x`], _] => Int
49
+ case _ => String
50
+ }
51
+ }
52
+ val x : M [Boolean , Two [Bla [Boolean ], Boolean ]] = 1
53
+ }
You can’t perform that action at this time.
0 commit comments