Why this does not work with groovy?
('a' as char) ^ ('b' as char)
It raises
groovy.lang.MissingMethodException: No signature of method: java.lang.Character.xor() is applicable for argument types: (java.lang.Character) values: [b]
Possible solutions: div(java.lang.Character), any(), any(groovy.lang.Closure), plus(java.lang.Character), is(java.lang.Object), use([Ljava.lang.Object;)
at Script1.run(Script1.groovy:2)
As far as i know it breaks compatible source with java.
Works with Groovy 1.8.4:
prints
Groovy has quite a few places where the source is incompatible from Java. A list can be found here, there are also things like no
do...whileloop, etc…Edit
Jochen Theodorou, the Groovy Project Tech Lead replied to the mail on the list:
Edit #2
This is looking like an issue that only shows itself with certain implementations of the JVM. As such, I have posted an issue to the Groovy Jira, so hopefully future versions of Groovy will smooth out the differences a bit 🙂