Skip to content

Commit a82a6ab

Browse files
author
Adriaan Moors
committed
Merge pull request scala#804 from scalamacros/topic/reflectglobal
moves reflective compiler into scala.tools.reflect
2 parents 0a9cea6 + 105d3ef commit a82a6ab

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

src/compiler/scala/tools/nsc/ReflectGlobal.scala renamed to src/compiler/scala/tools/reflect/ReflectGlobal.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
package scala.tools.nsc
1+
package scala.tools
2+
package reflect
23

3-
import reporters.Reporter
4+
import scala.tools.nsc.Global
5+
import scala.tools.nsc.reporters.Reporter
6+
import scala.tools.nsc.Settings
47

58
/** A version of Global that uses reflection to get class
69
* infos, instead of reading class or source files.
710
*/
811
class ReflectGlobal(currentSettings: Settings, reporter: Reporter, override val rootClassLoader: ClassLoader)
9-
extends Global(currentSettings, reporter) with scala.tools.nsc.ReflectSetup with scala.reflect.runtime.SymbolTable {
12+
extends Global(currentSettings, reporter) with scala.tools.reflect.ReflectSetup with scala.reflect.runtime.SymbolTable {
1013

1114
override def transformedType(sym: Symbol) =
1215
erasure.transformInfo(sym,

src/compiler/scala/tools/nsc/ReflectMain.scala renamed to src/compiler/scala/tools/reflect/ReflectMain.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
package scala.tools.nsc
1+
package scala.tools
2+
package reflect
23

3-
import tools.util.PathResolver
4-
import util.ClassPath.DefaultJavaContext
5-
import util.ScalaClassLoader
4+
import scala.tools.nsc.Driver
5+
import scala.tools.nsc.Global
6+
import scala.tools.nsc.Settings
7+
import scala.tools.nsc.util.ClassPath.DefaultJavaContext
8+
import scala.tools.nsc.util.ScalaClassLoader
9+
import scala.tools.util.PathResolver
610

711
object ReflectMain extends Driver {
812

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
package scala.tools.nsc
1+
package scala.tools
2+
package reflect
3+
4+
import scala.tools.nsc.Global
25

36
/** A helper trait to initialize things that need to be set before JavaMirrors and other
47
* reflect specific traits are initialized */
5-
private[nsc] trait ReflectSetup { this: Global =>
8+
private[reflect] trait ReflectSetup { this: Global =>
69
phase = new Run().typerPhase
710
}

src/compiler/scala/tools/reflect/ToolBoxFactory.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package scala.tools
22
package reflect
33

44
import scala.tools.nsc.reporters._
5-
import scala.tools.nsc.ReflectGlobal
65
import scala.tools.nsc.CompilerCommand
76
import scala.tools.nsc.Global
87
import scala.tools.nsc.typechecker.Modes

src/reflect/scala/reflect/runtime/SymbolTable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package runtime
44
/**
55
* This symbol table trait fills in the definitions so that class information is obtained by refection.
66
* It can be used either from a reflexive universe (class scala.reflect.runtime.JavaUniverse), or else from
7-
* a runtime compiler that uses reflection to get a class information (class scala.tools.nsc.ReflectGlobal)
7+
* a runtime compiler that uses reflection to get a class information (class scala.tools.reflect.ReflectGlobal)
88
*/
99
trait SymbolTable extends internal.SymbolTable with JavaMirrors with SymbolLoaders with SynchronizedOps {
1010

0 commit comments

Comments
 (0)