From 08a5e03280e305bf19904a1a4f80ab328eeaacab Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Sat, 28 Dec 2013 22:39:08 +0300 Subject: makes well-known packages and package classes consistent with each other As discovered in https://groups.google.com/forum/#!topic/scala-user/RckXE90LoXo, RootClass.sourceModule and EmptyPackageClass.sourceModule used to incorrectly return NoSymbol instead of RootModule and EmptyPackage. This is now fixed. --- test/junit/scala/reflect/internal/MirrorsTest.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/junit/scala/reflect/internal/MirrorsTest.scala (limited to 'test') diff --git a/test/junit/scala/reflect/internal/MirrorsTest.scala b/test/junit/scala/reflect/internal/MirrorsTest.scala new file mode 100644 index 0000000000..9108af139f --- /dev/null +++ b/test/junit/scala/reflect/internal/MirrorsTest.scala @@ -0,0 +1,18 @@ +package scala.reflect.internal + +import org.junit.Assert._ +import org.junit.Test +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 + +@RunWith(classOf[JUnit4]) +class MirrorsTest { + @Test def rootCompanionsAreConnected(): Unit = { + val cm = scala.reflect.runtime.currentMirror + import cm._ + assertEquals("RootPackage.moduleClass == RootClass", RootClass, RootPackage.moduleClass) + assertEquals("RootClass.module == RootPackage", RootPackage, RootClass.module) + assertEquals("EmptyPackage.moduleClass == EmptyPackageClass", EmptyPackageClass, EmptyPackage.moduleClass) + assertEquals("EmptyPackageClass.module == EmptyPackage", EmptyPackage, EmptyPackageClass.module) + } +} \ No newline at end of file -- cgit v1.2.3