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

James Kleeh updated GROOVY-8260:
--------------------------------
    Description: 
There are many times I find myself having to cast variables directly inside an 
{{instanceof Class}} check.

In addition, I have found a specific problem with a generic {{<T extends 
SomeClass>}} where a method in the class that returns {{T}}, Groovy believes a 
collection is being returned.

The goal of this issue is to have the following codebase compile without 
changes.

{{git clone -b broken_compilation https://github.com/grails/gorm-graphql}}

Attempt to compile with {{./gradlew clean classes}}

  was:
There are many times I find myself having to cast variables directly inside an 
`instanceof Class` check.

In addition, I have found a specific problem with a generic `<T extends 
SomeClass>` where a method in the class that returns `T`, Groovy believes a 
collection is being returned.

The goal of this issue is to have the following codebase compile without 
changes.

`git clone -b broken_compilation https://github.com/grails/gorm-graphql`

Attempt to compile with `./gradlew clean classes`


> Static compilation requires casting inside instanceof check
> -----------------------------------------------------------
>
>                 Key: GROOVY-8260
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8260
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.12
>         Environment: macOS JDK 1.8
>            Reporter: James Kleeh
>
> There are many times I find myself having to cast variables directly inside 
> an {{instanceof Class}} check.
> In addition, I have found a specific problem with a generic {{<T extends 
> SomeClass>}} where a method in the class that returns {{T}}, Groovy believes 
> a collection is being returned.
> The goal of this issue is to have the following codebase compile without 
> changes.
> {{git clone -b broken_compilation https://github.com/grails/gorm-graphql}}
> Attempt to compile with {{./gradlew clean classes}}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to