Skip to content

Commit 6a6dd7b

Browse files
authored
Merge pull request #13517 from dotty-staging/fix-i13513
Fix crash on uninstantiated field access
2 parents b3ef04f + 3f25f89 commit 6a6dd7b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -3876,6 +3876,8 @@ object Types {
38763876
x.declaredVariance == y.declaredVariance))
38773877
&& {
38783878
val bs1 = new BinderPairs(this, that, bs)
3879+
// `paramInfos` and `resType` might still be uninstantiated at this point
3880+
paramInfos != null && resType != null &&
38793881
paramInfos.equalElements(that.paramInfos, bs1) &&
38803882
resType.equals(that.resType, bs1)
38813883
}

tests/neg/i13513.scala

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
final case class TwoTypes[F, A](value: A)
2+
class Minimal {
3+
def x[C[_]]: C[Int] = ???
4+
x[TwoTypes].value // error: Type argument TwoTypes does not conform to upper bound [_] =>> Any
5+
}

0 commit comments

Comments
 (0)