Skip to content

Commit

Permalink
Tweak refineUsingParent drop conditions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dwijnand committed Nov 12, 2024
1 parent 3d79d40 commit 21e5f3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/TypeOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ object TypeOps:
protoTp1 <:< tp
maximizeType(protoTp1, NoSpan)
val inst = wildApprox(protoTp1)
if !inst.classSymbol.exists then
if inst.classSymbols.isEmpty then
// E.g. i21790, can't instantiate S#CA as a subtype of O.A, because O.CA isn't accessible
NoType
else inst
Expand Down

0 comments on commit 21e5f3c

Please sign in to comment.