You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "John Wagenleitner (JIRA)" <ji...@apache.org> on 2017/01/01 04:17:58 UTC

[jira] [Commented] (GROOVY-7614) BUG! exception in phase 'semantic analysis' in source unit

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

John Wagenleitner commented on GROOVY-7614:
-------------------------------------------

I can replicate this with v1.2.2 of the Shadow plugin, but it compiles successfully with v1.2.3 and v1.2.4.

Using javap to examine the compiled version of the {{ShadowCopyAction}} class it looks like it was somehow incorrectly compiled for v1.2.2.

{code:title=ShadowCopyAction v1.2.2}
private static <T extends java.io.Closeable> void withResource(T, org.gradle.api.Action<? super java.io.Closeable<T>>);
{code}

Since {{java.io.Closeable}} is not a parameterized type that is causing {{java.lang.reflect.MalformedParameterizedTypeException}} exception to be thrown as Groovy attempts to reflect on the {{ShadowCopyAction}} class.  The same class from v1.2.3 has the correct signature.

{code:title=ShadowCopyAction v1.2.3}
private static <T extends java.io.Closeable> void withResource(T, org.gradle.api.Action<? super T>);
{code}

> BUG! exception in phase 'semantic analysis' in source unit
> ----------------------------------------------------------
>
>                 Key: GROOVY-7614
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7614
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.5
>            Reporter: R. Tyler Croy
>
> I'm unable to compile the following code:
> {code}
> import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowCopyAction
> class Main extends ShadowCopyAction {
> }
> {code}
> Built with the following {{build.gradle}} for what it's worth:
> {code}
> apply plugin: 'groovy'
> repositories { jcenter() }
> dependencies {
>     compile 'org.codehaus.groovy:groovy:2.4.5'
>     compile gradleApi()
>     compile 'com.github.jengelman.gradle.plugins:shadow:[1.2.2,2.0)'
> }
> {code}
> The source code for this can be found [in this repository|https://github.com/rtyler/groovy-7614-reproduction] and can be compiled just by invoking {{./gradlew}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)