diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2014-09-02 16:33:48 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2014-09-02 16:33:48 +0200 |
commit | f196ee2ee7807f007d2397a4d6168800900ae7fa (patch) | |
tree | 475de2822a89d25217acc0b7ff0fbc7f3d798519 /test/files/pos | |
parent | 61dbf4ac711094db38a4b2dfb853d88499c2b1a5 (diff) | |
parent | 01f2d279e84fda300176e83ee94c17c08ad1dc3f (diff) | |
download | scala-f196ee2ee7807f007d2397a4d6168800900ae7fa.tar.gz scala-f196ee2ee7807f007d2397a4d6168800900ae7fa.tar.bz2 scala-f196ee2ee7807f007d2397a4d6168800900ae7fa.zip |
Merge commit '01f2d27' into merge/2.11-to-2.12-is-it-really-sept-2-already-where-was-summer
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/macro-attachments/Macros_1.scala | 19 | ||||
-rw-r--r-- | test/files/pos/macro-attachments/Test_2.scala | 3 | ||||
-rw-r--r-- | test/files/pos/t8736-b.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8736-b.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t8736.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8736.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t8743.scala | 15 |
7 files changed, 53 insertions, 0 deletions
diff --git a/test/files/pos/macro-attachments/Macros_1.scala b/test/files/pos/macro-attachments/Macros_1.scala new file mode 100644 index 0000000000..38d05d5b85 --- /dev/null +++ b/test/files/pos/macro-attachments/Macros_1.scala @@ -0,0 +1,19 @@ +import scala.language.experimental.macros +import scala.reflect.macros.whitebox.Context + +trait Base +class Att extends Base + +object Macros { + def impl(c: Context) = { + import c.universe._ + import c.internal._ + import decorators._ + val dummy = q"x" + dummy.updateAttachment(new Att) + if (dummy.attachments.get[Base].isEmpty) c.abort(c.enclosingPosition, "that's not good") + q"()" + } + + def foo: Any = macro impl +}
\ No newline at end of file diff --git a/test/files/pos/macro-attachments/Test_2.scala b/test/files/pos/macro-attachments/Test_2.scala new file mode 100644 index 0000000000..acfddae942 --- /dev/null +++ b/test/files/pos/macro-attachments/Test_2.scala @@ -0,0 +1,3 @@ +object Test extends App { + Macros.foo +}
\ No newline at end of file diff --git a/test/files/pos/t8736-b.flags b/test/files/pos/t8736-b.flags new file mode 100644 index 0000000000..1ad4eabe0f --- /dev/null +++ b/test/files/pos/t8736-b.flags @@ -0,0 +1 @@ +-feature -language:_ -Xfatal-warnings diff --git a/test/files/pos/t8736-b.scala b/test/files/pos/t8736-b.scala new file mode 100644 index 0000000000..903292d232 --- /dev/null +++ b/test/files/pos/t8736-b.scala @@ -0,0 +1,7 @@ +// scalac: -feature -language:_ -Xfatal-warnings +// showing that all are set +class X { + def hk[M[_]] = ??? + + implicit def imp(x: X): Int = x.hashCode +} diff --git a/test/files/pos/t8736.flags b/test/files/pos/t8736.flags new file mode 100644 index 0000000000..7fe42f7340 --- /dev/null +++ b/test/files/pos/t8736.flags @@ -0,0 +1 @@ +-feature -language:implicitConversions -language:higherKinds -language:-implicitConversions -Xfatal-warnings diff --git a/test/files/pos/t8736.scala b/test/files/pos/t8736.scala new file mode 100644 index 0000000000..46c0cdfd00 --- /dev/null +++ b/test/files/pos/t8736.scala @@ -0,0 +1,7 @@ +// scalac: -feature -language:implicitConversions -language:higherKinds -language:-implicitConversions -Xfatal-warnings +// showing that multiple settings are respected, and explicit enablement has precedence +class X { + def hk[M[_]] = ??? + + implicit def imp(x: X): Int = x.hashCode +} diff --git a/test/files/pos/t8743.scala b/test/files/pos/t8743.scala new file mode 100644 index 0000000000..03b0cd7044 --- /dev/null +++ b/test/files/pos/t8743.scala @@ -0,0 +1,15 @@ +import annotation.varargs + +object VarArgs { + @varargs + def foo[A](x: A, xs: String*): A = ??? + + @varargs + def bar[A](x: List[A], xs: String*): A = ??? + + @varargs + def baz[A](x: List[A], xs: String*): A = ??? + + @varargs + def boz[A](x: A, xs: String*): Nothing = ??? +} |