Skip to content

Commit ef83bd2

Browse files
dwijnandtgodzik
authored andcommitted
Tweak refineUsingParent drop conditions
In tests/pos/i21790.scala, O.A has no class symbol, because it's an inaccessible private class of S. But in tests/warn/i21860.scala, Shape.Triangle doesn't have a "classSymbol" because it has multiple - Shape and Corners. So use .classSymbols.isEmpty instead of !.classSymbol.exists [Cherry-picked 21e5f3c]
1 parent 185188c commit ef83bd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ object TypeOps:
944944
protoTp1 <:< tp
945945
maximizeType(protoTp1, NoSpan)
946946
val inst = wildApprox(protoTp1)
947-
if !inst.classSymbol.exists then
947+
if inst.classSymbols.isEmpty then
948948
// E.g. i21790, can't instantiate S#CA as a subtype of O.A, because O.CA isn't accessible
949949
NoType
950950
else inst

0 commit comments

Comments
 (0)