Skip to content

Instantly share code, notes, and snippets.

@gjoseph
Created January 5, 2012 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gjoseph/1565938 to your computer and use it in GitHub Desktop.
Save gjoseph/1565938 to your computer and use it in GitHub Desktop.
Did i just find a bug in @canonical or am i thick ? #groovy
#!/usr/bin/env groovy
import groovy.transform.Canonical
def weird = new CanonicalIsWeird(a: 'first letter', b: 'second letter')
println "a: ${weird.a}"
println "b: ${weird.b}"
assert weird.a == 'first letter'
assert weird.b == 'second letter'
@Canonical
class CanonicalIsWeird {
def a, b
}
@paulk-asert
Copy link

Can you raise a Jira please. The workaround is to give types to your properties, e.g. String in this case - for at least the first property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment