summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-26 08:17:38 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-27 15:49:02 +0200
commit1839c1b5528e706c280e7d81031499f3d46826ec (patch)
tree565ba4bcfe78515f79c73a02ba386aa4ce1fb7e0
parent95fd70ed1d2a3f4688c10a0e44509631d93d9afd (diff)
downloadscala-1839c1b5528e706c280e7d81031499f3d46826ec.tar.gz
scala-1839c1b5528e706c280e7d81031499f3d46826ec.tar.bz2
scala-1839c1b5528e706c280e7d81031499f3d46826ec.zip
merges macros.CapturedVariables into macros.Universe
Back then we didn't have a notion of a macro-specific universe, so I had to expose these methods in Context. Now we have our very own macros.Universe, so capturing methods have landed there.
-rw-r--r--src/compiler/scala/reflect/macros/runtime/CapturedVariables.scala15
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Context.scala1
-rw-r--r--src/reflect/scala/reflect/macros/CapturedVariables.scala21
-rw-r--r--src/reflect/scala/reflect/macros/Context.scala1
-rw-r--r--src/reflect/scala/reflect/macros/Universe.scala13
5 files changed, 13 insertions, 38 deletions
diff --git a/src/compiler/scala/reflect/macros/runtime/CapturedVariables.scala b/src/compiler/scala/reflect/macros/runtime/CapturedVariables.scala
deleted file mode 100644
index 78fb7100b0..0000000000
--- a/src/compiler/scala/reflect/macros/runtime/CapturedVariables.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-package scala.reflect.macros
-package runtime
-
-trait CapturedVariables {
- self: Context =>
-
- import mirror._
- import universe._
-
- def captureVariable(vble: Symbol): Unit = universe.captureVariable(vble)
-
- def referenceCapturedVariable(vble: Symbol): Tree = universe.referenceCapturedVariable(vble)
-
- def capturedVariableType(vble: Symbol): Type = universe.capturedVariableType(vble)
-} \ No newline at end of file
diff --git a/src/compiler/scala/reflect/macros/runtime/Context.scala b/src/compiler/scala/reflect/macros/runtime/Context.scala
index 1c6313c930..aa5dfc47b2 100644
--- a/src/compiler/scala/reflect/macros/runtime/Context.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Context.scala
@@ -5,7 +5,6 @@ import scala.tools.nsc.Global
abstract class Context extends scala.reflect.macros.Context
with Aliases
- with CapturedVariables
with Infrastructure
with Enclosures
with Names
diff --git a/src/reflect/scala/reflect/macros/CapturedVariables.scala b/src/reflect/scala/reflect/macros/CapturedVariables.scala
deleted file mode 100644
index 60ed6f5e7b..0000000000
--- a/src/reflect/scala/reflect/macros/CapturedVariables.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-package scala.reflect
-package macros
-
-trait CapturedVariables {
- self: Context =>
-
- import mirror._
-
- /** Mark a variable as captured; i.e. force boxing in a *Ref type.
- */
- def captureVariable(vble: Symbol): Unit
-
- /** Mark given identifier as a reference to a captured variable itself
- * suppressing dereferencing with the `elem` field.
- */
- def referenceCapturedVariable(vble: Symbol): Tree
-
- /** Convert type of a captured variable to *Ref type.
- */
- def capturedVariableType(vble: Symbol): Type
-} \ No newline at end of file
diff --git a/src/reflect/scala/reflect/macros/Context.scala b/src/reflect/scala/reflect/macros/Context.scala
index 75f2e459b6..16ebbe7259 100644
--- a/src/reflect/scala/reflect/macros/Context.scala
+++ b/src/reflect/scala/reflect/macros/Context.scala
@@ -6,7 +6,6 @@ package macros
// the full context should include all traits from scala.reflect.macros (and probably reside in scala-compiler.jar)
trait Context extends Aliases
- with CapturedVariables
with Enclosures
with Infrastructure
with Names
diff --git a/src/reflect/scala/reflect/macros/Universe.scala b/src/reflect/scala/reflect/macros/Universe.scala
index f84c11ee63..233033f35b 100644
--- a/src/reflect/scala/reflect/macros/Universe.scala
+++ b/src/reflect/scala/reflect/macros/Universe.scala
@@ -109,4 +109,17 @@ abstract class Universe extends scala.reflect.api.Universe {
trait IdentContextApi extends IdentApi { this: Ident =>
def isBackquoted: Boolean
}
+
+ /** Mark a variable as captured; i.e. force boxing in a *Ref type.
+ */
+ def captureVariable(vble: Symbol): Unit
+
+ /** Mark given identifier as a reference to a captured variable itself
+ * suppressing dereferencing with the `elem` field.
+ */
+ def referenceCapturedVariable(vble: Symbol): Tree
+
+ /** Convert type of a captured variable to *Ref type.
+ */
+ def capturedVariableType(vble: Symbol): Type
} \ No newline at end of file