Skip to content

Commit a342a51

Browse files
committed
Optimizations
1 parent e33ef57 commit a342a51

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -981,13 +981,13 @@ class Definitions {
981981
}
982982

983983
def isPhantomAnyClass(sym: Symbol)(implicit ctx: Context): Boolean =
984-
sym.exists && (sym.owner eq PhantomClass) && sym.name == tpnme.Any
984+
sym.name == tpnme.Any && (sym.owner eq PhantomClass)
985985

986986
def isPhantomNothingClass(sym: Symbol)(implicit ctx: Context): Boolean =
987-
sym.exists && (sym.owner eq PhantomClass) && sym.name == tpnme.Nothing
987+
sym.name == tpnme.Nothing && (sym.owner eq PhantomClass)
988988

989989
def isPhantomAssume(sym: Symbol)(implicit ctx: Context): Boolean =
990-
sym.exists && (sym.owner eq PhantomClass) && sym.name == nme.assume_
990+
sym.name == nme.assume_ && (sym.owner eq PhantomClass)
991991

992992
def topOf(tp: Type)(implicit ctx: Context): Type = tp.phantomTopClass match {
993993
case top: ClassInfo => top.prefix.select(tpnme.Any)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ object Types {
185185
}
186186

187187
private def isPhantomClass(sym: Symbol)(implicit ctx: Context): Boolean =
188-
sym.isClass && (sym.owner eq defn.PhantomClass) && (sym.name == tpnme.Any || sym.name == tpnme.Nothing)
188+
sym.isClass && (sym.owner eq defn.PhantomClass)
189189

190190
/** Is this type guaranteed not to have `null` as a value?
191191
* For the moment this is only true for modules, but it could

0 commit comments

Comments
 (0)