From 21e5f3c40a156043622f2d400e2cb51cc138bab9 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Tue, 12 Nov 2024 12:01:35 +0000 Subject: [PATCH] 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 --- compiler/src/dotty/tools/dotc/core/TypeOps.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/core/TypeOps.scala b/compiler/src/dotty/tools/dotc/core/TypeOps.scala index 79eac7bde38d..697e50c6a2a8 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeOps.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeOps.scala @@ -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