diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-02-17 17:10:49 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-02-17 22:57:12 +0100 |
commit | e9926a5207aadcfe3831b51b1cd6164757278013 (patch) | |
tree | d388f1445054b6007af493ad6d263f9d585299ff /test/files/neg | |
parent | 91148376049a152edec12348ff9b7e9e93e6ebe1 (diff) | |
download | scala-e9926a5207aadcfe3831b51b1cd6164757278013.tar.gz scala-e9926a5207aadcfe3831b51b1cd6164757278013.tar.bz2 scala-e9926a5207aadcfe3831b51b1cd6164757278013.zip |
Fixes miscellaneous macro bugs
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/macro-argtype-mismatch.check | 6 | ||||
-rw-r--r-- | test/files/neg/macro-argtype-mismatch.flags | 1 | ||||
-rw-r--r-- | test/files/neg/macro-argtype-mismatch/Macros_1.scala | 3 | ||||
-rw-r--r-- | test/files/neg/macro-argtype-mismatch/Test_2.scala | 4 | ||||
-rw-r--r-- | test/files/neg/macro-noexpand.check | 4 | ||||
-rw-r--r-- | test/files/neg/macro-noexpand.flags | 1 | ||||
-rw-r--r-- | test/files/neg/macro-noexpand/Macros_1.scala | 3 | ||||
-rw-r--r-- | test/files/neg/macro-noexpand/Test_2.scala | 4 | ||||
-rw-r--r-- | test/files/neg/macro-noncompilertree.check | 6 | ||||
-rw-r--r-- | test/files/neg/macro-noncompilertree.flags | 1 | ||||
-rw-r--r-- | test/files/neg/macro-noncompilertree/Macros_1.scala | 3 | ||||
-rw-r--r-- | test/files/neg/macro-nontree.check | 6 | ||||
-rw-r--r-- | test/files/neg/macro-nontree.flags | 1 | ||||
-rw-r--r-- | test/files/neg/macro-nontree/Macros_1.scala | 3 |
14 files changed, 46 insertions, 0 deletions
diff --git a/test/files/neg/macro-argtype-mismatch.check b/test/files/neg/macro-argtype-mismatch.check new file mode 100644 index 0000000000..dd867be804 --- /dev/null +++ b/test/files/neg/macro-argtype-mismatch.check @@ -0,0 +1,6 @@ +Test_2.scala:3: error: type mismatch;
+ found : String("2")
+ required: Int
+ foo("2")
+ ^
+one error found
diff --git a/test/files/neg/macro-argtype-mismatch.flags b/test/files/neg/macro-argtype-mismatch.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/files/neg/macro-argtype-mismatch.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/files/neg/macro-argtype-mismatch/Macros_1.scala b/test/files/neg/macro-argtype-mismatch/Macros_1.scala new file mode 100644 index 0000000000..4b5f98ba37 --- /dev/null +++ b/test/files/neg/macro-argtype-mismatch/Macros_1.scala @@ -0,0 +1,3 @@ +object Macros { + def macro foo(x: Int) = x +}
\ No newline at end of file diff --git a/test/files/neg/macro-argtype-mismatch/Test_2.scala b/test/files/neg/macro-argtype-mismatch/Test_2.scala new file mode 100644 index 0000000000..18feb69425 --- /dev/null +++ b/test/files/neg/macro-argtype-mismatch/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + import Macros._ + foo("2") +}
\ No newline at end of file diff --git a/test/files/neg/macro-noexpand.check b/test/files/neg/macro-noexpand.check new file mode 100644 index 0000000000..c15d54bb32 --- /dev/null +++ b/test/files/neg/macro-noexpand.check @@ -0,0 +1,4 @@ +Test_2.scala:3: error: not found: value x
+ foo(x)
+ ^
+one error found
diff --git a/test/files/neg/macro-noexpand.flags b/test/files/neg/macro-noexpand.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/files/neg/macro-noexpand.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/files/neg/macro-noexpand/Macros_1.scala b/test/files/neg/macro-noexpand/Macros_1.scala new file mode 100644 index 0000000000..7a6aadf6a1 --- /dev/null +++ b/test/files/neg/macro-noexpand/Macros_1.scala @@ -0,0 +1,3 @@ +object Macros { + def macro foo(x: Any) = ??? +}
\ No newline at end of file diff --git a/test/files/neg/macro-noexpand/Test_2.scala b/test/files/neg/macro-noexpand/Test_2.scala new file mode 100644 index 0000000000..0bed592883 --- /dev/null +++ b/test/files/neg/macro-noexpand/Test_2.scala @@ -0,0 +1,4 @@ +object Test extends App { + import Macros._ + foo(x) +}
\ No newline at end of file diff --git a/test/files/neg/macro-noncompilertree.check b/test/files/neg/macro-noncompilertree.check new file mode 100644 index 0000000000..616765a39e --- /dev/null +++ b/test/files/neg/macro-noncompilertree.check @@ -0,0 +1,6 @@ +Macros_1.scala:2: error: type mismatch;
+ found : reflect.mirror.Literal
+ required: _context.Tree
+ def macro foo = scala.reflect.mirror.Literal(scala.reflect.mirror.Constant(2))
+ ^
+one error found
diff --git a/test/files/neg/macro-noncompilertree.flags b/test/files/neg/macro-noncompilertree.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/files/neg/macro-noncompilertree.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/files/neg/macro-noncompilertree/Macros_1.scala b/test/files/neg/macro-noncompilertree/Macros_1.scala new file mode 100644 index 0000000000..eb1253e5e9 --- /dev/null +++ b/test/files/neg/macro-noncompilertree/Macros_1.scala @@ -0,0 +1,3 @@ +object Macros { + def macro foo = scala.reflect.mirror.Literal(scala.reflect.mirror.Constant(2)) +}
\ No newline at end of file diff --git a/test/files/neg/macro-nontree.check b/test/files/neg/macro-nontree.check new file mode 100644 index 0000000000..a1c7139580 --- /dev/null +++ b/test/files/neg/macro-nontree.check @@ -0,0 +1,6 @@ +Macros_1.scala:2: error: type mismatch;
+ found : Int(2)
+ required: _context.Tree
+ def macro foo = 2
+ ^
+one error found
diff --git a/test/files/neg/macro-nontree.flags b/test/files/neg/macro-nontree.flags new file mode 100644 index 0000000000..7fea2ff901 --- /dev/null +++ b/test/files/neg/macro-nontree.flags @@ -0,0 +1 @@ +-Xmacros
\ No newline at end of file diff --git a/test/files/neg/macro-nontree/Macros_1.scala b/test/files/neg/macro-nontree/Macros_1.scala new file mode 100644 index 0000000000..2433974a85 --- /dev/null +++ b/test/files/neg/macro-nontree/Macros_1.scala @@ -0,0 +1,3 @@ +object Macros { + def macro foo = 2 +}
\ No newline at end of file |