[ 
https://issues.apache.org/jira/browse/GROOVY-10981?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King closed GROOVY-10981.
------------------------------

> STC: type inference of variable expression with superclass field and access 
> method
> ----------------------------------------------------------------------------------
>
>                 Key: GROOVY-10981
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10981
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 2.5.22, 3.0.17, 4.0.11
>
>
> Consider the following:
> {code:groovy}
> abstract class A {
>   protected Object thing = 'field'
>   String getThing() { 'property' }
> }
> @groovy.transform.CompileStatic
> class C extends A {
>   void test() {
>     print thing.toUpperCase()
>   }
> }
> new C().test()
> {code}
> If ".toUpperCase()" is removed, the script prints "property".  However the 
> STC type recorded comes from the field.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to