diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-12-28 22:39:08 +0300 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-12-29 10:24:19 +0300 |
commit | 08a5e03280e305bf19904a1a4f80ab328eeaacab (patch) | |
tree | b70fd6785d72f4bc62342bbdf5b94d9fa005f8d8 /test | |
parent | 9f0594c57716ed551918e15be6da843982e8ba12 (diff) | |
download | scala-08a5e03280e305bf19904a1a4f80ab328eeaacab.tar.gz scala-08a5e03280e305bf19904a1a4f80ab328eeaacab.tar.bz2 scala-08a5e03280e305bf19904a1a4f80ab328eeaacab.zip |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/junit/scala/reflect/internal/MirrorsTest.scala | 18 |
1 files changed, 18 insertions, 0 deletions
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 |