[
https://issues.apache.org/jira/browse/GROOVY-7922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King updated GROOVY-7922:
------------------------------
Description:
This example:
{code}
import groovy.transform.CompileStatic
interface FooA {}
interface FooB {}
class FooAB implements FooA, FooB {}
@CompileStatic
class TestGroovy {
static void test() { println new TestGroovy().foo(new FooAB()) }
def foo(FooB x) { 43 }
def foo(FooA x) { 42 }
}
TestGroovy.test()
{code}
Should probably throw some kind of ambiguous method error during compilation to
match Java (and dynamic Groovy's runtime error).
was:
This example:
{code}
import groovy.transform.CompileStatic
interface FooA {}
interface FooB {}
class FooAB implements FooA, FooB {}
@CompileStatic
class TestGroovy {
static void test() { println new TestGroovy().foo(new FooAB()) }
def foo(FooB x) { 43 }
def foo(FooA x) { 42 }
}
TestGroovy.test()
{code}
Should probably throw some kind of ambiguous method error during compilation to
match Java (and dynamic Groovy).
> Static type checking not strict enough in the presence of ambiguous method
> matching
> -----------------------------------------------------------------------------------
>
> Key: GROOVY-7922
> URL: https://issues.apache.org/jira/browse/GROOVY-7922
> Project: Groovy
> Issue Type: Bug
> Reporter: Paul King
>
> This example:
> {code}
> import groovy.transform.CompileStatic
> interface FooA {}
> interface FooB {}
> class FooAB implements FooA, FooB {}
> @CompileStatic
> class TestGroovy {
> static void test() { println new TestGroovy().foo(new FooAB()) }
> def foo(FooB x) { 43 }
> def foo(FooA x) { 42 }
> }
> TestGroovy.test()
> {code}
> Should probably throw some kind of ambiguous method error during compilation
> to match Java (and dynamic Groovy's runtime error).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)