diff options
author | Martin Odersky <odersky@gmail.com> | 2015-05-15 12:17:29 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-05-21 17:41:12 +0200 |
commit | 89145d0e166a3042d7530b037a5664f3b1d4f22e (patch) | |
tree | 9391f1ea85094aba6ea87f7b1dfeee99eb435b31 /tests/pos/annot.scala | |
parent | 1f908b420e4efe944ea764bbba239472c9c3cc92 (diff) | |
download | dotty-89145d0e166a3042d7530b037a5664f3b1d4f22e.tar.gz dotty-89145d0e166a3042d7530b037a5664f3b1d4f22e.tar.bz2 dotty-89145d0e166a3042d7530b037a5664f3b1d4f22e.zip |
Disallow {...} arguments for annotations
This mimics scalac's behavior (but not the official syntax; in fact the
official syntax seems to be ambiguous.
Diffstat (limited to 'tests/pos/annot.scala')
-rw-r--r-- | tests/pos/annot.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/pos/annot.scala b/tests/pos/annot.scala index c3a17ff1d..106057258 100644 --- a/tests/pos/annot.scala +++ b/tests/pos/annot.scala @@ -1,7 +1,10 @@ import java.beans.Transient +import annotation.unchecked.uncheckedVariance class Test { +// testing combinations of annotation syntax + @SuppressWarnings(Array("hi")) def foo() = ??? // evalutation of annotation on type cannot be deferred as requires implicit resolution(only generic Array$.apply applies here) @SuppressWarnings(Array("hi", "foo")) def foo2() = ??? //can be deferred as there is a non-generic method @@ -11,5 +14,15 @@ class Test { @Transient(false) def bar = ??? @Transient() def baz = ??? + +// testing annotations in types + + class A + trait B + + val x: A @uncheckedVariance with B @uncheckedVariance = ??? + + //class C extends A @uncheckedVariance () with B @uncheckedVariance { val x = 10 } + } |