This looks like a legitimate JSNI validation bug. Could you file an issue in GWT's issue tracker? http://code.google.com/p/google-web-toolkit/issues
On Sat, May 23, 2009 at 2:51 PM, hartmut.honi...@googlemail.com < hartmut.honi...@googlemail.com> wrote: > > When trying to call the "values()" method on an enum type inside a > JSNI method, Eclipse complains about the type not containing that > method: It lists an error on the "problems" page, and it produces a > warning when trying to launch GWT hosted mode. However, when I ignore > the warning, the code runs fine, and compiling to JavaScript doesn't > produce an error. > > To reproduce the bug, add this simple enum to your GWT project: > > package com.example.enumTest.client; > public enum DaysEnum { > SUNDAY, MONDAY, TUESDAY, WEDNESDAY, > THURSDAY, FRIDAY, SATURDAY > } > > and add this simple JSNI method somewhere: > > private native DaysEnum[] getDays() /*-{ > return @com.example.enumTest.client.DaysEnum::values()(); > }-*/; > > Eclipse will report "DaysEnum does not contain a method named values" > on the problems page and complain about "Errors in workspace" when > trying to run the project in debug mode. But after ignoring the > warning, any code that calls getDays() runs fine, and compiling to > JavaScript doesn't produce any errors. > For example, getDays()[0].toString() correctly returns "SUNDAY". > > Can anyone confirm this behaviour? Is this a (known) bug? Should I > file an issue? > > > > > > -- Miguel --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---