Closed GoogleCodeExporter closed 9 years ago
`s instanceof clazz` isn't valid Groovy (or Java). You'll have to use
`clazz.isInstance(s)` instead.
Original comment by pnied...@gmail.com
on 13 Jun 2013 at 11:51
Thank you, Peter. I discovered that another workaround in Groovy is to use the
"in" operator: "s in clazz" would also work correctly.
Could you explain why "s instanceof clazz" is not valid? If we assert against
an inline class name, not a data variable, it works fine ("s instanceof
String"). This type comparison operator is available both in Java
(http://docs.oracle.com/javase/tutorial/java/nutsandbolts/op2.html) and Groovy
(http://groovy.codehaus.org/Operators).
Original comment by cyprush...@gmail.com
on 14 Jun 2013 at 10:49
Original issue reported on code.google.com by
cyprush...@gmail.com
on 13 Jun 2013 at 8:53