Skip to content

Commit 29cca16

Browse files
Merge pull request #8704 from dotty-staging/fix-8647
Fix #8647: Remove TypeParamRef from instantiated test
2 parents 102284b + 2a7296e commit 29cca16

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
23612361
x && {
23622362
t match {
23632363
case tp: TypeRef if tp.symbol.isAbstractOrParamType => false
2364-
case _: SkolemType | _: TypeVar | _: TypeParamRef => false
2364+
case _: SkolemType | _: TypeVar => false
23652365
case _ => foldOver(x, t)
23662366
}
23672367
}

tests/pos/8647.scala

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
}

0 commit comments

Comments
 (0)