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

Eric Milles updated GROOVY-11195:
---------------------------------
    Description: 
Consider the following:
{code:groovy}
@TypeChecked
class C {
  static String typeName = this.getName() // instance method from Class
}
{code}

This emits error "Non-static method Class#getName cannot be called from a 
static context".

  was:
Consider the following:
{code:groovy}
@TypeChecked
class C {
  static String p = this.getName() // instance method from Class
}
{code}

This emits error "Non-static method Class#getName cannot be called from a 
static context".


> STC: false positive for Class method called from static context
> ---------------------------------------------------------------
>
>                 Key: GROOVY-11195
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11195
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.19
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>
> Consider the following:
> {code:groovy}
> @TypeChecked
> class C {
>   static String typeName = this.getName() // instance method from Class
> }
> {code}
> This emits error "Non-static method Class#getName cannot be called from a 
> static context".



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

Reply via email to