You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug blocks #5684.
There is a difference between compiling a java annotation and loading it from the class file and letting scalac parse it:
$ scalac -version
Scala compiler version 2.10.0-20120423-023931-3b61d19cdc --Copyright2002-2011, LAMP/EPFL
$ cat MyAnnotation.java
public @interface MyAnnotation { String value(); }
$ scalac -Ystop-after:typer -Xprint:typer MyAnnotation.java
[[syntax trees at end of typer]]// Scala source: MyAnnotation.javapackage<empty> {
objectMyAnnotationextends {
def<init>() = _
};
classMyAnnotationextends scala.Annotationwith _root_.java.lang.annotation.Annotationwith scala.ClassfileAnnotation {
def<init>(x$1: String) = _;
def<init>() = _;
defvalue():String
}
}
But then:
$ javac MyAnnotation.java
$ scala
Welcome to Scala version 2.10.0-20120423-023931-3b61d19cdc (JavaHotSpot(TM) 64-BitServerVM, Java1.6.0_26).
Type in expressions to have them evaluated.
Type:help for more information.
scala>:power
**PowerUser mode enabled -BEEPWHIRGYVE****:phase has been set to 'typer'. **** scala.tools.nsc._ has been imported **** global._, definitions._ also imported ****Try:help, :vals, power.<tab> **
scala>?[MyAnnotation].info
res0: $r.power.intp.global.Type=
scala.annotation.Annotationwith scala.annotation.ClassfileAnnotationwith java.lang.annotation.Annotation {
defvalue():Stringdef<init>():MyAnnotation
}
So this leaves us with:
parsed MyAnnotation.java:
def<init>():MyAnnotation
loaded MyAnnotation.class:
def<init>(x$1: String) = _; // this is the default constructordef<init>() = _;
The text was updated successfully, but these errors were encountered:
@jrudolph said:
'parsed MyAnnotation.java' vs. 'loaded MyAnnotation.class' signatures: from the snippets above it seems it is exactly the other way round, no?
This bug blocks #5684.
There is a difference between compiling a java annotation and loading it from the class file and letting scalac parse it:
But then:
So this leaves us with:
The text was updated successfully, but these errors were encountered: