summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-04-24 15:56:33 -0700
committerPaul Phillips <paulp@improving.org>2012-04-24 15:56:33 -0700
commit7f083d8d25dad2af9675521cc1daee35b4029769 (patch)
tree49122d7abfd1288d93afc628a26a2b64b69d3365
parent996f96fb3f84b87d8761cb360d441a57a3db60ee (diff)
parentf32d301fb556e006ae40b27175c4a4ca0e548616 (diff)
downloadscala-7f083d8d25dad2af9675521cc1daee35b4029769.tar.gz
scala-7f083d8d25dad2af9675521cc1daee35b4029769.tar.bz2
scala-7f083d8d25dad2af9675521cc1daee35b4029769.zip
Merge commit 'refs/pull/433/head' into develop
-rw-r--r--src/compiler/scala/reflect/runtime/ToolBoxes.scala2
-rw-r--r--test/files/run/t5704.check1
-rw-r--r--test/files/run/t5704.flags1
-rw-r--r--test/files/run/t5704.scala16
4 files changed, 19 insertions, 1 deletions
diff --git a/src/compiler/scala/reflect/runtime/ToolBoxes.scala b/src/compiler/scala/reflect/runtime/ToolBoxes.scala
index 21a90326cf..7b1fc9fc0d 100644
--- a/src/compiler/scala/reflect/runtime/ToolBoxes.scala
+++ b/src/compiler/scala/reflect/runtime/ToolBoxes.scala
@@ -113,7 +113,7 @@ trait ToolBoxes extends { self: Universe =>
override def transform(tree: Tree): Tree =
tree match {
case Ident(name) if reversedFreeTermNames contains name =>
- Ident(reversedFreeTermNames(name))
+ Ident(reversedFreeTermNames(name)) setType tree.tpe
case _ =>
super.transform(tree)
}
diff --git a/test/files/run/t5704.check b/test/files/run/t5704.check
new file mode 100644
index 0000000000..7b56bf2bfd
--- /dev/null
+++ b/test/files/run/t5704.check
@@ -0,0 +1 @@
+String \ No newline at end of file
diff --git a/test/files/run/t5704.flags b/test/files/run/t5704.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/run/t5704.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/run/t5704.scala b/test/files/run/t5704.scala
new file mode 100644
index 0000000000..25a6575dc3
--- /dev/null
+++ b/test/files/run/t5704.scala
@@ -0,0 +1,16 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class MyQuerycollection{
+ def findUserByName( name:String ) = {
+ val tree = reify{ "test" == name }
+ val toolbox = mkToolBox()
+ toolbox.typeCheck(tree) match{
+ case Apply(Select(lhs,op),rhs::Nil) =>
+ println(rhs.tpe)
+ }
+ }
+ }
+ val qc = new MyQuerycollection
+ qc.findUserByName("some value")
+}