Running dryad-front -i Main.java on the file below fails with an error. No error occurs if the param.longValue() line is replaced by <param = 10L;> for example.

Error message:
[ dryad-front | error ] Ambiguous construct cannot be reclassified:
AmbName(Id(“param”))

Main.java:

abstract class Main {
abstract void method(Long param);

 static Main anon = new Main() {
     void method(Long param) {
         param.longValue();
     }
 };

}

Submitted on 20 June 2006 at 17:46

On 20 June 2006 at 19:34 Jira commented:

DRY-237, justme84:

A shorter failing example:

class Main {
Main anon = new Main() {
void method(Long param) {
param.longValue();
}
};
}


On 22 June 2006 at 17:25 Jira commented:

DRY-237, lennartkats:

Note that this problem actually extends to all inner class parameter references. In the below example the parameter is incorrectly disambiguated to Field(Id(“param”)), and therefore fails to type-annotate:

class Foo {
Object anonymous = new Object() {
String foo(String param) {
return param;
}
};
}

Log in to post comments