Tuesday, January 28, 2014

Switch on String shouldn't this work in GWT 2.6 / Java 7 ?

Something like ;

switch (book) {

case "Harry Potter":
break;
case "Hitch Hikers Guide To The Galaxy":
break; 

Should now work with the latest GWT from here;
https://code.google.com/p/google-web-toolkit/downloads/list

Correct?

Because I am still getting a "   [ERROR] Line 1971: Cannot switch on a value of type String. Only convertible int values or enum constants are permitted "
error.
Screenshot;



Have I somehow setup GWT 2.6 wrongly?

Thanks,
-Thomas

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment