We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In JPlainBuilder.genMethod() the exceptions an (ICode) IMethod m throws are obtained via
JPlainBuilder.genMethod()
m
val (excs, others) = m.symbol.annotations partition (_.symbol == ThrowsClass)
The test added in commit 02dd4c97 includes a source file (reproduced below)
class ScalaClassWithCheckedExceptions_1[E1 <: Exception] @throws[NullPointerException]("") () { @throws[E1]("") def bar() {} @throws[IllegalStateException]("") def baz(x: Int) {} // FIXME: SI-7066 // @throws[E2]("") def foo[E2 <: Exception] {} }
that results in an AbstractTypeSymbol "E1" reaching GenASM, as part of
AbstractTypeSymbol
@throws[E1]("") def bar() {}
In terms of ASM's Textify the resulting class file includes:
// class version 50.0 (50) // access flags 0x21 // signature <E1:Ljava/lang/Exception;>Ljava/lang/Object; // declaration: ScalaClassWithCheckedExceptions_1<E1 extends java.lang.Exception> public class ScalaClassWithCheckedExceptions_1 { ... public bar()V throws E1 RETURN MAXSTACK = 0 MAXLOCALS = 1
Although there's no "E1" class file the bytecode verifier doesn't complain.
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-7122?orig=1 Reporter: @magarciaEPFL See #6860
Sorry, something went wrong.
@magarciaEPFL said: It would be great if the outcome for this bug also makes it to the scaladoc for scala.throws
scala.throws
For comparison, Java:
class S<E1 extends Error> { public void bar() throws E1 { } }
Resulting bytecode, displayed by javap -c -private -s S
javap -c -private -s S
Compiled from "S.java" class S extends java.lang.Object{ S(); Signature: ()V Code: 0: aload_0 1: invokespecial #1; //Method java/lang/Object."<init>":()V 4: return public void bar() throws java.lang.Error; Signature: ()V Code: 0: return }
closing stale backend tickets; comment/reopen if you have evidence this is still applicable
gkossakowski
No branches or pull requests
In
JPlainBuilder.genMethod()
the exceptions an (ICode) IMethodm
throws are obtained viaThe test added in commit 02dd4c97 includes a source file (reproduced below)
that results in an
AbstractTypeSymbol
"E1" reaching GenASM, as part ofIn terms of ASM's Textify the resulting class file includes:
Although there's no "E1" class file the bytecode verifier doesn't complain.
The text was updated successfully, but these errors were encountered: