[jira] [Created] (GROOVY-8787) Inconsistency in method selection with @CompileStatic

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] [Created] (GROOVY-8787) Inconsistency in method selection with @CompileStatic

JIRA jira@apache.org
Daniil Ovchinnikov created GROOVY-8787:

             Summary: Inconsistency in method selection with @CompileStatic
                 Key: GROOVY-8787
                 URL: https://issues.apache.org/jira/browse/GROOVY-8787
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
    Affects Versions: 2.5.2, 2.4.15
            Reporter: Daniil Ovchinnikov

class A {
    void bar(String s) {

class B extends A {
    void bar(Object o) {

void usage() {
    new B().bar("")
prints {{A#bar(String)}} which is correct.

And with uncommented {{@CompileStatic}}:
Cannot choose between [void B#bar(java.lang.Object), void A#bar(java.lang.String)]

This message was sent by Atlassian JIRA