Skip to content

Commit 4ae5d61

Browse files
authored
Revert "Drop inaccessible subclasses from refineUsingParent" (scala#21895)
Reverts scala#21799 The following changes were merged at the ~same time as adding the `tests/warn/i21860.scala` test, which are breaking that test. We revert it for now to unblock merging to `main`.
2 parents 63849a0 + cecd053 commit 4ae5d61

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ object Decorators {
292292
case _ => String.valueOf(x).nn
293293

294294
/** Returns the simple class name of `x`. */
295-
def className: String = if x == null then "<null>" else x.getClass.getSimpleName.nn
295+
def className: String = x.getClass.getSimpleName.nn
296296

297297
extension [T](x: T)
298298
def assertingErrorsReported(using Context): T = {

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -930,11 +930,7 @@ object TypeOps:
930930
for tp <- mixins.reverseIterator do
931931
protoTp1 <:< tp
932932
maximizeType(protoTp1, NoSpan)
933-
val inst = wildApprox(protoTp1)
934-
if !inst.classSymbol.exists then
935-
// E.g. i21790, can't instantiate S#CA as a subtype of O.A, because O.CA isn't accessible
936-
NoType
937-
else inst
933+
wildApprox(protoTp1)
938934
}
939935

940936
if (protoTp1 <:< tp2) instantiate()

tests/pos/i21790.scala

-14
This file was deleted.

0 commit comments

Comments
 (0)