diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-04-21 19:29:53 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-04-21 19:33:19 +0200 |
commit | 1dba0583fabb55757ba141d399bb3e492e358c17 (patch) | |
tree | b0b8d8a4430e2be78b3ce51a9cf979d115a0356c /test/files/neg | |
parent | 3c9c18ddccc17c2b0e62195315ba2abb72d3b761 (diff) | |
download | scala-1dba0583fabb55757ba141d399bb3e492e358c17.tar.gz scala-1dba0583fabb55757ba141d399bb3e492e358c17.tar.bz2 scala-1dba0583fabb55757ba141d399bb3e492e358c17.zip |
fixes SI-5689
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t5689.check | 7 | ||||
-rw-r--r-- | test/files/neg/t5689.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t5689.scala | 6 |
3 files changed, 14 insertions, 0 deletions
diff --git a/test/files/neg/t5689.check b/test/files/neg/t5689.check new file mode 100644 index 0000000000..f286d08cfa --- /dev/null +++ b/test/files/neg/t5689.check @@ -0,0 +1,7 @@ +t5689.scala:4: error: macro implementation has wrong shape:
+ required: (c: scala.reflect.makro.Context)(i: c.Expr[Double]): c.Expr[String]
+ found : (c: scala.reflect.makro.Context)(i: c.Expr[Double]): c.Expr[Int]
+type mismatch for return type : c.Expr[String] does not conform to c.Expr[Int]
+ def returnsString(i: Double): String = macro returnsIntImpl
+ ^
+one error found
diff --git a/test/files/neg/t5689.flags b/test/files/neg/t5689.flags new file mode 100644 index 0000000000..cd66464f2f --- /dev/null +++ b/test/files/neg/t5689.flags @@ -0,0 +1 @@ +-language:experimental.macros
\ No newline at end of file diff --git a/test/files/neg/t5689.scala b/test/files/neg/t5689.scala new file mode 100644 index 0000000000..ef7a45b364 --- /dev/null +++ b/test/files/neg/t5689.scala @@ -0,0 +1,6 @@ +import scala.reflect.makro.Context + +object Macros { + def returnsString(i: Double): String = macro returnsIntImpl + def returnsIntImpl(c: Context)(i: c.Expr[Double]): c.Expr[Int] = ??? +} |