[ https://issues.apache.org/jira/browse/GROOVY-8260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16169542#comment-16169542 ]
ASF GitHub Bot commented on GROOVY-8260: ---------------------------------------- GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/603 GROOVY-8260: Static compilation requires casting inside instanceof check You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8260 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/603.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #603 ---- commit e8fd90ae974fa97817682c1c4f8936feef2d2a66 Author: paulk <pa...@asert.com.au> Date: 2017-09-18T03:37:59Z GROOVY-8260: Static compilation requires casting inside instanceof check ---- > 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. This is the line in question: > https://github.com/grails/gorm-graphql/blob/ea6887bef0ced75d9cc0d01dc7b94d4fc0520266/core/src/main/groovy/org/grails/gorm/graphql/fetcher/impl/EntityDataFetcher.groovy#L45 > 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)