You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (JIRA)" <ji...@apache.org> on 2017/02/07 21:50:41 UTC
[jira] [Created] (GROOVY-8081) Compiler does not give error for
ambiguous type or member due to multiple star imports
Eric Milles created GROOVY-8081:
-----------------------------------
Summary: Compiler does not give error for ambiguous type or member due to multiple star imports
Key: GROOVY-8081
URL: https://issues.apache.org/jira/browse/GROOVY-8081
Project: Groovy
Issue Type: Bug
Components: Compiler
Reporter: Eric Milles
If two or more star imports bring in the same name, the compiler is choosing the first match. Java handles the same situation by emitting an error for an ambiguous reference.
Examples:
{code}
import javax.swing.*
import javax.xml.ws.*
class C { Action a }
{code}
{code}
interface A
{
String VALUE = 'from A'
}
interface B
{
String VALUE = 'from B'
}
import static com.trgr.cobalt.search.A.*
import static com.trgr.cobalt.search.B.*
println VALUE
{code}
Also, no mention of the policy can be found here or in related subsections.
http://docs.groovy-lang.org/latest/html/documentation/#_star_import
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)