Permalink
Browse files

introduces api.JavaMirrors

This trait carries mirror-related changes of the API that happen
when api.Universe transforms into api.JavaUniverse.

From a coding standpoint this is a mere rehashing of the code, but
from a documentation standpoint this provides additional insights
into what's going on in reflection.
  • Loading branch information...
1 parent c868038 commit cfae88959153996c25ba1a93f2456e3e4912194c @xeno-by xeno-by committed Oct 3, 2012
Showing with 17 additions and 12 deletions.
  1. +16 −0 src/reflect/scala/reflect/api/JavaMirrors.scala
  2. +1 −12 src/reflect/scala/reflect/api/JavaUniverse.scala
@@ -0,0 +1,16 @@
+package scala.reflect
+package api
+
+trait JavaMirrors { self: JavaUniverse =>
+
+ type RuntimeClass = java.lang.Class[_]
+
+ override type Mirror >: Null <: JavaMirror
+
+ trait JavaMirror extends scala.reflect.api.Mirror[self.type] with RuntimeMirror {
+ val classLoader: ClassLoader
+ override def toString = s"JavaMirror with ${runtime.ReflectionUtils.show(classLoader)}"
+ }
+
+ def runtimeMirror(cl: ClassLoader): Mirror
+}
@@ -1,18 +1,7 @@
package scala.reflect
package api
-trait JavaUniverse extends Universe with Mirrors { self =>
-
- type RuntimeClass = java.lang.Class[_]
-
- override type Mirror >: Null <: JavaMirror
-
- trait JavaMirror extends scala.reflect.api.Mirror[self.type] with RuntimeMirror {
- val classLoader: ClassLoader
- override def toString = s"JavaMirror with ${runtime.ReflectionUtils.show(classLoader)}"
- }
-
- def runtimeMirror(cl: ClassLoader): Mirror
+trait JavaUniverse extends Universe with JavaMirrors { self =>
override def typeTagToManifest[T: ClassTag](mirror0: Any, tag: Universe # TypeTag[T]): Manifest[T] = {
// SI-6239: make this conversion more precise

0 comments on commit cfae889

Please sign in to comment.