I have this code in a Grail controller action closure:
Set allNameRefs = TauUtil.makeHashSet()
NameRef allNameRefsA = allNameRefs.toArray(new NameRef[allNameRefs.size()]);
The entire call to allNameRefs.toArray is hilighted in dirty yellow and the diagnostic "Cannot assign T to tau.cl.CLIFCollectorXR.NameRef" is shown. All the requisite imports are present.
Clearly this code is fine in Java (which is where it originated, actually). Is it not OK in Groovy? It does actually run correctly and is not flagged as ereroneous or questionable in Java.
(Incidentally, TauUtil.makeHashSet() is a generic method no diagnostic is associated with that assignment, either in Groovy or in Java.)