From a4c11eb0004736fd10fa500d7ef0edc7044e5444 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 13 Dec 2014 11:59:35 +0100 Subject: Drop NotNull class and associated code. --- src/dotty/tools/dotc/TypeErasure.scala | 2 +- src/dotty/tools/dotc/config/ScalaSettings.scala | 1 - src/dotty/tools/dotc/core/Definitions.scala | 3 --- src/dotty/tools/dotc/core/TypeComparer.scala | 3 +-- 4 files changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/dotty/tools/dotc/TypeErasure.scala b/src/dotty/tools/dotc/TypeErasure.scala index 162c869b4..2407b9e2a 100644 --- a/src/dotty/tools/dotc/TypeErasure.scala +++ b/src/dotty/tools/dotc/TypeErasure.scala @@ -374,7 +374,7 @@ class TypeErasure(isJava: Boolean, isSemi: Boolean, isConstructor: Boolean, wild private def normalizeClass(cls: ClassSymbol)(implicit ctx: Context): ClassSymbol = { if (cls.owner == defn.ScalaPackageClass) { - if (cls == defn.AnyClass || cls == defn.AnyValClass || cls == defn.SingletonClass || cls == defn.NotNullClass) + if (cls == defn.AnyClass || cls == defn.AnyValClass || cls == defn.SingletonClass) return defn.ObjectClass if (cls == defn.UnitClass) return defn.BoxedUnitClass diff --git a/src/dotty/tools/dotc/config/ScalaSettings.scala b/src/dotty/tools/dotc/config/ScalaSettings.scala index 05b936136..9afe96c96 100644 --- a/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -140,7 +140,6 @@ class ScalaSettings extends Settings.SettingGroup { val Ybuilderdebug = ChoiceSetting("-Ybuilder-debug", "manager", "Compile using the specified build manager.", List("none", "refined", "simple"), "none") val Yreifycopypaste = BooleanSetting("-Yreify-copypaste", "Dump the reified trees in copypasteable representation.") val Yreplsync = BooleanSetting("-Yrepl-sync", "Do not use asynchronous code for repl startup") - val Ynotnull = BooleanSetting("-Ynotnull", "Enable (experimental and incomplete) scala.NotNull.") val YmethodInfer = BooleanSetting("-Yinfer-argument-types", "Infer types for arguments of overriden methods.") 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.") val Yinvalidate = StringSetting("-Yinvalidate", "classpath-entry", "Invalidate classpath entry before run", "") diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala index 311b27717..19d175088 100644 --- a/src/dotty/tools/dotc/core/Definitions.scala +++ b/src/dotty/tools/dotc/core/Definitions.scala @@ -177,8 +177,6 @@ class Definitions { RootClass, nme.dummyApply, 1, pt => MethodType(List(FunctionType(Nil, PolyParam(pt, 0))), PolyParam(pt, 0))) - lazy val NotNullClass = ctx.requiredClass("scala.NotNull") - lazy val NothingClass: ClassSymbol = newCompleteClassSymbol( ScalaPackageClass, tpnme.Nothing, AbstractFinal, List(AnyClass.typeRef)) lazy val NullClass: ClassSymbol = newCompleteClassSymbol( @@ -348,7 +346,6 @@ class Definitions { def AnyValType: Type = AnyValClass.typeRef def ObjectType: Type = ObjectClass.typeRef def AnyRefType: Type = AnyRefAlias.typeRef - def NotNullType: Type = NotNullClass.typeRef def NothingType: Type = NothingClass.typeRef def NullType: Type = NullClass.typeRef def SeqType: Type = SeqClass.typeRef diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala index eddf0b3e9..a7f50c369 100644 --- a/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/src/dotty/tools/dotc/core/TypeComparer.scala @@ -648,8 +648,7 @@ class TypeComparer(initctx: Context) extends DotClass { if (cls2.isClass) { val base = tp1.baseTypeRef(cls2) if (base.exists && (base ne tp1)) return isSubType(base, tp2) - if ( cls2 == defn.SingletonClass && tp1.isStable - || cls2 == defn.NotNullClass && tp1.isNotNull) return true + if (cls2 == defn.SingletonClass && tp1.isStable) return true } tryRebase3rd } -- cgit v1.2.3