summaryrefslogtreecommitdiff
path: root/test/files/pos/t7461
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-05-09 12:55:15 +0200
committerEugene Burmako <xeno.by@gmail.com>2013-05-27 23:29:25 +0200
commit43249001a566c46d6bb3b515045ab477b42a0c77 (patch)
tree80664084865127baa61c6b2e501f2bc17b700d30 /test/files/pos/t7461
parent81e7389ed813c815b7a6bcdddb36b622bf458cca (diff)
downloadscala-43249001a566c46d6bb3b515045ab477b42a0c77.tar.gz
scala-43249001a566c46d6bb3b515045ab477b42a0c77.tar.bz2
scala-43249001a566c46d6bb3b515045ab477b42a0c77.zip
SI-7461 c.typeCheck(silent = true) now suppresses ambiguous errors
Otherwise use cases like the one shown in the attached test (trying to typecheck something, which leads to an ambiguous overload error) will mysteriously fail compilation.
Diffstat (limited to 'test/files/pos/t7461')
-rw-r--r--test/files/pos/t7461/Macros_1.scala13
-rw-r--r--test/files/pos/t7461/Test_2.scala3
2 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/t7461/Macros_1.scala b/test/files/pos/t7461/Macros_1.scala
new file mode 100644
index 0000000000..353dec66d7
--- /dev/null
+++ b/test/files/pos/t7461/Macros_1.scala
@@ -0,0 +1,13 @@
+import scala.reflect.macros.Context
+import language.experimental.macros
+
+object Macros {
+ def impl(c: Context) = {
+ import c.universe._
+ val wut = c.typeCheck(Select(Literal(Constant(10)), newTermName("$minus")), silent = true)
+ // println(showRaw(wut, printIds = true, printTypes = true))
+ c.literalUnit
+ }
+
+ def foo = macro impl
+} \ No newline at end of file
diff --git a/test/files/pos/t7461/Test_2.scala b/test/files/pos/t7461/Test_2.scala
new file mode 100644
index 0000000000..3839659c9a
--- /dev/null
+++ b/test/files/pos/t7461/Test_2.scala
@@ -0,0 +1,3 @@
+class C {
+ def foo = Macros.foo
+} \ No newline at end of file