Skip to content

Commit ca128fd

Browse files
committed
Optimizations
1 parent f161678 commit ca128fd

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
@@ -979,13 +979,13 @@ class Definitions {
979979
}
980980

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

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

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

990990
def topOf(tp: Type)(implicit ctx: Context): Type = tp.phantomTopClass match {
991991
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)