The ticket is to provide some suggestion to tweak the fix of GROOVY-10034 ( https://github.com/apache/groovy/pull/1556 ):
It seems that we could make the check simpler, we do not add extra checks but tweak the existing check.
if (targetType == top) return;
if (ClassNodeUtils.isCompatibleWith(top, targetType)) return;
Compiler writes extra cast for Type to Object