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

Eric Milles edited comment on GROOVY-10981 at 3/27/23 3:05 PM:
---------------------------------------------------------------

https://github.com/apache/groovy/commit/d8836463f03629e1ed27d132a26b43b669c1b9e9
https://github.com/apache/groovy/commit/a29ce1ce64d565526b70e145ace665dd0617ec9b


was (Author: emilles):
https://github.com/apache/groovy/commit/d8836463f03629e1ed27d132a26b43b669c1b9e9

> 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