Skip to content

Commit 12da43d

Browse files
committed
Set flags of scala.Phantom to be NoInitsTrait.
1 parent 2384348 commit 12da43d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ class Definitions {
967967
// ----- Phantoms ---------------------------------------------------------
968968

969969
lazy val PhantomClass: ClassSymbol = {
970-
val cls = completeClass(enterCompleteClassSymbol(ScalaPackageClass, tpnme.Phantom, Abstract, List(AnyType)))
970+
val cls = completeClass(enterCompleteClassSymbol(ScalaPackageClass, tpnme.Phantom, NoInitsTrait, List(AnyType)))
971971

972972
val any = enterCompleteClassSymbol(cls, tpnme.Any, Protected | Final | NoInitsTrait, Nil)
973973
val nothing = enterCompleteClassSymbol(cls, tpnme.Nothing, Protected | Final | NoInitsTrait, List(any.typeRef))

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
403403
else classParents.mapConserve(eraseTypeRef) match {
404404
case tr :: trs1 =>
405405
assert(!tr.classSymbol.is(Trait), cls)
406-
val tr1 = if (cls.is(Trait) || (tr.symbol eq defn.PhantomClass)) defn.ObjectType else tr
406+
val tr1 = if (cls is Trait) defn.ObjectType else tr
407407
tr1 :: trs1.filterNot(x => x.isRef(defn.ObjectClass) || x.isRef(defn.PhantomClass))
408408
case nil => nil
409409
}

library/src/scala/Phantom.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ trait Phantom {
55
/** Phantom.Any does not extend scala.Any */
66
protected /*final*/ trait Any
77
8-
protected final abstract class Nothing extends Any
8+
protected final trait Nothing extends this.Any
99
1010
protected final def assume: this.Nothing
1111
}

0 commit comments

Comments
 (0)