From 606a553e12dbc1bda25939dbda3e7fcaaaa678b9 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Tue, 5 Aug 2014 23:03:41 -0700 Subject: SI-8512 Infer Any for the q Avoid the widening bug for q. This resolution also suffers from the inference of Any, which can trigger a warning and an anxiety attack. But that's still better than doing the wrong thing. Right? --- test/junit/scala/reflect/QTest.scala | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/junit/scala/reflect/QTest.scala (limited to 'test/junit') diff --git a/test/junit/scala/reflect/QTest.scala b/test/junit/scala/reflect/QTest.scala new file mode 100644 index 0000000000..24c35dc401 --- /dev/null +++ b/test/junit/scala/reflect/QTest.scala @@ -0,0 +1,23 @@ + +package scala.reflect + +import org.junit.Test +import org.junit.Assert._ +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 + +import scala.tools.testing.AssertUtil._ + +@RunWith(classOf[JUnit4]) +class QTest { + + import reflect.runtime._ + import universe._ + @Test def qConstantsNotHomogenized() = { + //Apply(Select(Literal(Constant(1.0)), TermName("$plus")), List(Literal(Constant(1.0)))) + val t = q"${1} + ${1.0}" + val Apply(Select(Literal(Constant(i)), TermName("$plus")), List(Literal(Constant(j)))) = t + assertEquals(1, i) + assertEquals(1.0, j) + } +} -- cgit v1.2.3