Skip to content

Commit b66a396

Browse files
committed
Merge pull request scala#3491 from retronym/backport/7902
[backport] SI-7902 Fix spurious kind error due to an unitialized symbol
2 parents 5720e97 + 5f4011e commit b66a396

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/reflect/scala/reflect/internal/Kinds.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ trait Kinds {
184184
)
185185
}
186186
else {
187+
hkarg.initialize // SI-7902 otherwise hkarg.typeParams yields List(NoSymbol)!
187188
debuglog("checkKindBoundsHK recursing to compare params of "+ hkparam +" with "+ hkarg)
188189
kindErrors ++= checkKindBoundsHK(
189190
hkarg.typeParams,
@@ -229,4 +230,4 @@ trait Kinds {
229230
}
230231
}
231232
}
232-
}
233+
}

test/files/pos/t7902.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import scala.language.higherKinds
2+
3+
object Bug {
4+
class Tag[W[M1[X1]]]
5+
6+
def ofType[W[M2[X2]]]: Tag[W] = ???
7+
type InSeq [M3[X3]] = Some[M3[Any]]
8+
9+
// fail
10+
val x = ofType[InSeq]
11+
12+
// okay
13+
val y: Any = ofType[InSeq]
14+
object T {
15+
val z = ofType[InSeq]
16+
}
17+
}

0 commit comments

Comments
 (0)