Skip to content

Commit 21e5f3c

Browse files
committed
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
1 parent 3d79d40 commit 21e5f3c

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
@@ -931,7 +931,7 @@ object TypeOps:
931931
protoTp1 <:< tp
932932
maximizeType(protoTp1, NoSpan)
933933
val inst = wildApprox(protoTp1)
934-
if !inst.classSymbol.exists then
934+
if inst.classSymbols.isEmpty then
935935
// E.g. i21790, can't instantiate S#CA as a subtype of O.A, because O.CA isn't accessible
936936
NoType
937937
else inst

0 commit comments

Comments
 (0)