Skip to content

Commit a4c11eb

Browse files
committed
Drop NotNull class and associated code.
1 parent 179b9cc commit a4c11eb

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

src/dotty/tools/dotc/TypeErasure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class TypeErasure(isJava: Boolean, isSemi: Boolean, isConstructor: Boolean, wild
374374

375375
private def normalizeClass(cls: ClassSymbol)(implicit ctx: Context): ClassSymbol = {
376376
if (cls.owner == defn.ScalaPackageClass) {
377-
if (cls == defn.AnyClass || cls == defn.AnyValClass || cls == defn.SingletonClass || cls == defn.NotNullClass)
377+
if (cls == defn.AnyClass || cls == defn.AnyValClass || cls == defn.SingletonClass)
378378
return defn.ObjectClass
379379
if (cls == defn.UnitClass)
380380
return defn.BoxedUnitClass

src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ class ScalaSettings extends Settings.SettingGroup {
140140
val Ybuilderdebug = ChoiceSetting("-Ybuilder-debug", "manager", "Compile using the specified build manager.", List("none", "refined", "simple"), "none")
141141
val Yreifycopypaste = BooleanSetting("-Yreify-copypaste", "Dump the reified trees in copypasteable representation.")
142142
val Yreplsync = BooleanSetting("-Yrepl-sync", "Do not use asynchronous code for repl startup")
143-
val Ynotnull = BooleanSetting("-Ynotnull", "Enable (experimental and incomplete) scala.NotNull.")
144143
val YmethodInfer = BooleanSetting("-Yinfer-argument-types", "Infer types for arguments of overriden methods.")
145144
val etaExpandKeepsStar = BooleanSetting("-Yeta-expand-keeps-star", "Eta-expand varargs methods to T* rather than Seq[T]. This is a temporary option to ease transition.")
146145
val Yinvalidate = StringSetting("-Yinvalidate", "classpath-entry", "Invalidate classpath entry before run", "")

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ class Definitions {
177177
RootClass, nme.dummyApply, 1,
178178
pt => MethodType(List(FunctionType(Nil, PolyParam(pt, 0))), PolyParam(pt, 0)))
179179

180-
lazy val NotNullClass = ctx.requiredClass("scala.NotNull")
181-
182180
lazy val NothingClass: ClassSymbol = newCompleteClassSymbol(
183181
ScalaPackageClass, tpnme.Nothing, AbstractFinal, List(AnyClass.typeRef))
184182
lazy val NullClass: ClassSymbol = newCompleteClassSymbol(
@@ -348,7 +346,6 @@ class Definitions {
348346
def AnyValType: Type = AnyValClass.typeRef
349347
def ObjectType: Type = ObjectClass.typeRef
350348
def AnyRefType: Type = AnyRefAlias.typeRef
351-
def NotNullType: Type = NotNullClass.typeRef
352349
def NothingType: Type = NothingClass.typeRef
353350
def NullType: Type = NullClass.typeRef
354351
def SeqType: Type = SeqClass.typeRef

src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,7 @@ class TypeComparer(initctx: Context) extends DotClass {
648648
if (cls2.isClass) {
649649
val base = tp1.baseTypeRef(cls2)
650650
if (base.exists && (base ne tp1)) return isSubType(base, tp2)
651-
if ( cls2 == defn.SingletonClass && tp1.isStable
652-
|| cls2 == defn.NotNullClass && tp1.isNotNull) return true
651+
if (cls2 == defn.SingletonClass && tp1.isStable) return true
653652
}
654653
tryRebase3rd
655654
}

0 commit comments

Comments
 (0)