Skip to content

Commit

Permalink
Drop redundant check for AnyClass
Browse files Browse the repository at this point in the history
  • Loading branch information
Linyxus committed Nov 10, 2023
1 parent a1d7059 commit 7307f34
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions compiler/src/dotty/tools/dotc/cc/Setup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down

0 comments on commit 7307f34

Please sign in to comment.