diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-08-17 15:49:38 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-08-18 09:00:55 +0200 |
commit | ac430ac8ba554d1b976d44598400d95ce5cf3816 (patch) | |
tree | 92f709ec56cca5895cd960e82a1ebd10a34ad98a /test/files/neg | |
parent | 7fc860963a4f76cb18e44c20f2bdfb49641033f3 (diff) | |
download | scala-ac430ac8ba554d1b976d44598400d95ce5cf3816.tar.gz scala-ac430ac8ba554d1b976d44598400d95ce5cf3816.tar.bz2 scala-ac430ac8ba554d1b976d44598400d95ce5cf3816.zip |
cleanup for macroExpand
Error reporting is moved to ContextErrors to disentangle stuff in Macros.scala.
With logics and error reporting intertwined it was an awful mess.
Exceptions are used for the same reason. Instead of threading failures through
the code polluting it with options/ifs, I outline the success path.
It worked much better for typedMacroBody, but I'm also happy with the resulting
code of macroExpand. To me a major factor towards applicability of exceptions
was that they are short-lived and that there might be max one error per domain,
after which we unconditionally bail.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/macro-invalidusage-badbounds-a.check (renamed from test/files/neg/macro-invalidusage-badbounds.check) | 0 | ||||
-rw-r--r-- | test/files/neg/macro-invalidusage-badbounds-a.flags (renamed from test/files/neg/macro-invalidusage-badbounds.flags) | 0 | ||||
-rw-r--r-- | test/files/neg/macro-invalidusage-badbounds-a/Impls_1.scala (renamed from test/files/neg/macro-invalidusage-badbounds/Impls_1.scala) | 2 | ||||
-rw-r--r-- | test/files/neg/macro-invalidusage-badbounds-a/Macros_Test_2.scala (renamed from test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala) | 0 |
4 files changed, 1 insertions, 1 deletions
diff --git a/test/files/neg/macro-invalidusage-badbounds.check b/test/files/neg/macro-invalidusage-badbounds-a.check index fd0b64533e..fd0b64533e 100644 --- a/test/files/neg/macro-invalidusage-badbounds.check +++ b/test/files/neg/macro-invalidusage-badbounds-a.check diff --git a/test/files/neg/macro-invalidusage-badbounds.flags b/test/files/neg/macro-invalidusage-badbounds-a.flags index cd66464f2f..cd66464f2f 100644 --- a/test/files/neg/macro-invalidusage-badbounds.flags +++ b/test/files/neg/macro-invalidusage-badbounds-a.flags diff --git a/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala b/test/files/neg/macro-invalidusage-badbounds-a/Impls_1.scala index 89020de7dd..6ee71a3628 100644 --- a/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-badbounds-a/Impls_1.scala @@ -1,5 +1,5 @@ import scala.reflect.macros.{Context => Ctx} object Impls { - def foo[U <: String](c: Ctx) = ??? + def foo[U <: String](c: Ctx) = c.literalUnit } diff --git a/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-badbounds-a/Macros_Test_2.scala index 3139599108..3139599108 100644 --- a/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidusage-badbounds-a/Macros_Test_2.scala |