"Illegal assignment to class literal 'Buggy.class'");
}
public void testCyclicReferences() {
{
MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
"class Buggy {",
" static int anint = 3;",
" native void jsniMeth() /*-{",
" $wnd.alert(@Extra::along);",
" }-*/;",
"}");
MockJavaResource extra = JavaResourceBase.createMockJavaResource("Extra",
"class Extra {",
" static long along = 3;",
" native void jsniMeth() /*-{",
" $wnd.alert(@Buggy::anint);",
" }-*/;",
"}");
shouldGenerateError(buggy, extra, 4, "Referencing field 'Extra.along': "
+ "type 'long' is not safe to access in JSNI code");
}
{
MockJavaResource buggy = JavaResourceBase.createMockJavaResource("Buggy",
"class Buggy {",
" Extra anExtra = new Extra();",
" static int anint = 3;",
" native void jsniMeth() /*-{",
" $wnd.alert(@Extra::along);",
" }-*/;",
"}");
MockJavaResource extra = JavaResourceBase.createMockJavaResource("Extra",
"class Extra {",
" Buggy mattress = new Buggy();",
" static long along = 3;",
" native void jsniMeth() /*-{",
" $wnd.alert(@Buggy::anint);",