groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniil Ovchinnikov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8787) Inconsistency in method selection with @CompileStatic
Date Thu, 13 Sep 2018 11:47:00 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-8787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613362#comment-16613362
] 

Daniil Ovchinnikov commented on GROOVY-8787:
--------------------------------------------

I'd like to know what would be the correct behaviour, so I would be able to update resolution
in IntelliJ.

> 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.4.15, 2.5.2
>            Reporter: Daniil Ovchinnikov
>            Priority: Major
>
> Running
> {code:title=playground.groovy}
> class A {
>     void bar(String s) {
>         println("A#bar(String)")
>     }
> }
> class B extends A {
>     void bar(Object o) {
>         println("B#bar(Object)")
>     }
> }
> //@groovy.transform.CompileStatic
> void usage() {
>     new B().bar("") 
> }
> usage()
> {code}
> prints {{A#bar(String)}} which is correct.
> And with uncommented {{@CompileStatic}}:
> {noformat}
> Cannot choose between [void B#bar(java.lang.Object), void A#bar(java.lang.String)]
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message