From e22d801a539f951422e91519844c7cb9ce81b413 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Thu, 24 Jan 2013 16:36:23 -0800 Subject: Test case for SI-7009. The next commit fixes the problem itself and it's easier to see in diff what's being fixed exactly. --- test/files/jvm/throws-annot-from-java.check | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 test/files/jvm/throws-annot-from-java.check (limited to 'test/files/jvm/throws-annot-from-java.check') diff --git a/test/files/jvm/throws-annot-from-java.check b/test/files/jvm/throws-annot-from-java.check new file mode 100644 index 0000000000..376061be2e --- /dev/null +++ b/test/files/jvm/throws-annot-from-java.check @@ -0,0 +1,47 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> :power +** Power User mode enabled - BEEP WHIR GYVE ** +** :phase has been set to 'typer'. ** +** scala.tools.nsc._ has been imported ** +** global._, definitions._ also imported ** +** Try :help, :vals, power. ** + +scala> :paste +// Entering paste mode (ctrl-D to finish) + +{ + val clazz = rootMirror.getClassByName(newTermName("test.ThrowsDeclaration_2")); + { + val method = clazz.info.member(newTermName("foo")) + val throwsAnn = method.annotations.head + val atp = throwsAnn.atp + println("foo") + println("atp.typeParams.isEmpty: " + atp.typeParams.isEmpty) + println(throwsAnn) + } + println + + { + val method = clazz.info.member(newTermName("bar")) + val throwsAnn = method.annotations.head + val Literal(const) = throwsAnn.args.head + val tp = const.typeValue + println("bar") + println("tp.typeParams.isEmpty: " + tp.typeParams.isEmpty) + println(throwsAnn) + } +} + +// Exiting paste mode, now interpreting. + +foo +atp.typeParams.isEmpty: false +throws(classOf[java.lang.IllegalStateException]) + +bar +tp.typeParams.isEmpty: false +throws(classOf[test.PolymorphicException]) + +scala> -- cgit v1.2.3