diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 1 | ||||
-rw-r--r-- | test/files/pos/t3429/A.scala | 12 | ||||
-rw-r--r-- | test/files/pos/t3429/Test.java | 3 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 31490c0609..aad80c1d8c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2618,6 +2618,7 @@ trait Typers { self: Analyzer => (nme.ERROR, None) } else { names -= sym + if(isJava) sym.cookJavaRawInfo() // #3429 val annArg = tree2ConstArg(rhs, sym.tpe.resultType) (sym.name, annArg) } diff --git a/test/files/pos/t3429/A.scala b/test/files/pos/t3429/A.scala new file mode 100644 index 0000000000..80785db51d --- /dev/null +++ b/test/files/pos/t3429/A.scala @@ -0,0 +1,12 @@ +class A { + @Test(exc = classOf[Exception]) + def myTestMethod = 0 +} +// rytz@chara:~/scala/trunk/sandbox$ javac Test.java +// rytz@chara:~/scala/trunk/sandbox$ ../build/pack/bin/scalac A.scala +// A.scala:2: error: type mismatch; +// found : java.lang.Class[Exception](classOf[java.lang.Exception]) +// required: java.lang.Class +// @Test(exc = classOf[Exception]) +// ^ +// one error found
\ No newline at end of file diff --git a/test/files/pos/t3429/Test.java b/test/files/pos/t3429/Test.java new file mode 100644 index 0000000000..e7c57c90c5 --- /dev/null +++ b/test/files/pos/t3429/Test.java @@ -0,0 +1,3 @@ +public @interface Test { + public Class exc() default Exception.class; +}
\ No newline at end of file |