diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 65a53c19dece..379b18b77a02 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -355,13 +355,11 @@ class Definitions { @tu lazy val NothingClass: ClassSymbol = enterCompleteClassSymbol( ScalaPackageClass, tpnme.Nothing, AbstractFinal, List(AnyClass.typeRef)) def NothingType: TypeRef = NothingClass.typeRef - @tu lazy val RuntimeNothingModuleRef: TermRef = ctx.requiredModuleRef("scala.runtime.Nothing") @tu lazy val NullClass: ClassSymbol = { val parent = if (ctx.explicitNulls) AnyType else ObjectType enterCompleteClassSymbol(ScalaPackageClass, tpnme.Null, AbstractFinal, parent :: Nil) } def NullType: TypeRef = NullClass.typeRef - @tu lazy val RuntimeNullModuleRef: TermRef = ctx.requiredModuleRef("scala.runtime.Null") /** An alias for null values that originate in Java code. * This type gets special treatment in the Typer. Specifically, `UncheckedNull` can be selected through: diff --git a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala index 7f2b8ef43c1e..77ab2e8bc7d6 100644 --- a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala +++ b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala @@ -202,9 +202,9 @@ object GenericSignatures { else if (sym == defn.UnitClass || sym == defn.BoxedUnitModule) jsig(defn.BoxedUnitClass.typeRef) else if (sym == defn.NothingClass) - jsig(defn.RuntimeNothingModuleRef) + builder.append("Lscala/runtime/Nothing$;") else if (sym == defn.NullClass) - jsig(defn.RuntimeNullModuleRef) + builder.append("Lscala/runtime/Null$;") else if (sym.isPrimitiveValueClass) if (!primitiveOK) jsig(defn.ObjectType) else if (sym == defn.UnitClass) jsig(defn.BoxedUnitClass.typeRef) diff --git a/tests/pos-java-interop/i8936/A.scala b/tests/pos-java-interop/i8936/A.scala new file mode 100644 index 000000000000..62aa2f39946a --- /dev/null +++ b/tests/pos-java-interop/i8936/A.scala @@ -0,0 +1,3 @@ +class A { + def no: List[Nothing] = Nil +} diff --git a/tests/pos-java-interop/i8936/B.java b/tests/pos-java-interop/i8936/B.java new file mode 100644 index 000000000000..a2cf2e493bef --- /dev/null +++ b/tests/pos-java-interop/i8936/B.java @@ -0,0 +1,8 @@ +import scala.collection.immutable.List; + +class B { + void Nothingness(){ + A a = new A(); + List strings = a.no(); + } +}