Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
When faced we multiple star imports, dynamic Groovy has a rule whereby first seen match wins. With type checking, we might want to consider tightening up the rules and giving an error if duplicates are found, e.g.:
import java.awt.*; import java.util.*; @groovy.transform.CompileStatic static void main(args) { println List }
The Java equivalent would complain with something like:
error: reference to List is ambiguous System.out.println(List.class); ^ both interface java.util.List in java.util and class java.awt.List in java.awt match 1 error
This might have performance impacts though, so we'd need to investigate that as part of the analysis.