You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (JIRA)" <ji...@apache.org> on 2019/04/23 14:52:00 UTC

[jira] [Updated] (GROOVY-8686) STC: type inferencing for (a instanceof C && a...) bleeds into enclosing scope

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

Eric Milles updated GROOVY-8686:
--------------------------------
    Description: 
Expecting type checking error for the following:
{code:groovy}
@groovy.transform.TypeChecked
def m(def obj) {
  def isA = (obj instanceof String && obj.equalsIgnoreCase('a'))
  obj.toLowerCase() // should be STC error; if above line is commented out, error shows
}
{code}
Same for {{@CompileStatic}}.

  was:
Expecting type checking error for the following:
{code:groovy}
@groovy.transform.TypeChecked
def m(def obj) {
  def a = (obj instanceof String && a.equalsIgnoreCase('a'))
  a.toLowerCase() // should be STC error; if above line is commented out, error shows
}
{code}
Same for {{@CompileStatic}}.


> STC: type inferencing for (a instanceof C && a...) bleeds into enclosing scope
> ------------------------------------------------------------------------------
>
>                 Key: GROOVY-8686
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8686
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Eric Milles
>            Priority: Minor
>
> Expecting type checking error for the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> def m(def obj) {
>   def isA = (obj instanceof String && obj.equalsIgnoreCase('a'))
>   obj.toLowerCase() // should be STC error; if above line is commented out, error shows
> }
> {code}
> Same for {{@CompileStatic}}.



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