The following will infer the type from the list:
however, the following will not:
I didn't even know that was a valid expression. I'll have a look at the meaning of each to see how it really works and then I can make some changes to how the inferencing engine interprets it.
I see that in org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.asCollection(Object), the last line is this:
// let's assume it's a collection of 1
So, it appears this is a nice heuristic for the inferencing engine, that if a target of an iteration block is not itself iterable, then just return the type of self.
Fixed with regression tests.