diff --git a/compiler/src/dotty/tools/dotc/cc/Setup.scala b/compiler/src/dotty/tools/dotc/cc/Setup.scala index d29a00a52f56..1620e54c0530 100644 --- a/compiler/src/dotty/tools/dotc/cc/Setup.scala +++ b/compiler/src/dotty/tools/dotc/cc/Setup.scala @@ -553,10 +553,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI: case tp: (TypeRef | AppliedType) => val sym = tp.typeSymbol if sym.isClass then - sym == defn.AnyClass - // we assume Any is a shorthand of {cap} Any, so if Any is an upper - // bound, the type is taken to be impure. - || !sym.isPureClass + !sym.isPureClass else sym != defn.Caps_Cap && instanceCanBeImpure(tp.superType) case tp: (RefinedOrRecType | MatchType) =>