You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Mario Garcia <ma...@gmail.com> on 2016/05/22 12:33:50 UTC

Problem creating groovy-macro spec files

Hi:

I'm trying to write some examples about the new features coming in the new
'groovy-macro' but I'm experiencing some issues.

In order to use 'groovy-macro' in the specs I've added the following line
in the root build.gradle:

   testCompile project(':groovy-macro')

But when running tests using "./gradlew test" two tests are failing:

   -
   org.codehaus.groovy.classgen.asm.sc.bugs.Groovy6757Bug#testExplicitTypeHint
   -
   org.codehaus.groovy.classgen.asm.sc.bugs.Groovy7316Bug#testTypeCheckingBypassUsingExplicitTypeHint

I've removed my examples to isolate the issue. And it turns out it just
fails adding the testCompile dependency. Once I remove the dependency all
tests succeed.

Any ideas ? Should I've been doing the dependency management in some other
way? Maybe a bug ?

Mario

Re: Problem creating groovy-macro spec files

Posted by Mario Garcia <ma...@gmail.com>.
I'm debugging now *Groovy7316Bug*

So far, the test passes if we assume that the AST should be correct in a
later phase:

void testTypeCheckingBypassUsingExplicitTypeHint() {
    assertScript '''
        public <T> T getSomething() { null }

        public List getList() {
            @ASTTest(phase=FINALIZATION,value={
                def ift = node.getNodeMetaData(INFERRED_TYPE)
                def makeList = make(List)

                assert ift == makeList
            })
            def list = this.<List>getSomething()
        }
    '''
}

The tests fails if we assume both expressions should return the same value
at SEMANTIC_ANALYSIS phase.

2016-05-22 16:05 GMT+02:00 Guillaume Laforge <gl...@gmail.com>:

> You might want to ping Sergei, Groovy Macro's creator.
> I've added Sergei in CC.
>
> Guillaume
>
> On Sun, May 22, 2016 at 3:29 PM, Mario Garcia <ma...@gmail.com>
> wrote:
>
>> Yep, that's what I thought, but I was hoping somebody telling me It was
>> my fault :P
>>
>> I'll take a further look to see if I'm able to see what's happening.
>> Thanks anyway :)
>>
>> 2016-05-22 15:25 GMT+02:00 Pascal Schumacher <pa...@gmx.net>:
>>
>>> Hi Mario,
>>>
>>> as far as I remember groovy-macro is global ast-transformation. I guess
>>> here is some side-effect/bug which causes the test failures. Sadly I lack
>>> the necessary knowledge to investigate further.
>>>
>>> -Pascal
>>>
>>>
>>> Am 22.05.2016 um 14:33 schrieb Mario Garcia:
>>>
>>> Hi:
>>>
>>> I'm trying to write some examples about the new features coming in the
>>> new 'groovy-macro' but I'm experiencing some issues.
>>>
>>> In order to use 'groovy-macro' in the specs I've added the following
>>> line in the root build.gradle:
>>>
>>>    testCompile project(':groovy-macro')
>>>
>>> But when running tests using "./gradlew test" two tests are failing:
>>>
>>>    -
>>>    org.codehaus.groovy.classgen.asm.sc.bugs.Groovy6757Bug#testExplicitTypeHint
>>>    -
>>>    org.codehaus.groovy.classgen.asm.sc.bugs.Groovy7316Bug#testTypeCheckingBypassUsingExplicitTypeHint
>>>
>>> I've removed my examples to isolate the issue. And it turns out it just
>>> fails adding the testCompile dependency. Once I remove the dependency all
>>> tests succeed.
>>>
>>> Any ideas ? Should I've been doing the dependency management in some
>>> other way? Maybe a bug ?
>>>
>>> Mario
>>>
>>>
>>>
>>>
>>
>
>
> --
> Guillaume Laforge
> Apache Groovy committer & PMC Vice-President
> Product Ninja & Advocate at Restlet <http://restlet.com>
>
> Blog: http://glaforge.appspot.com/
> Social: @glaforge <http://twitter.com/glaforge> / Google+
> <https://plus.google.com/u/0/114130972232398734985/posts>
>

Re: Problem creating groovy-macro spec files

Posted by Guillaume Laforge <gl...@gmail.com>.
You might want to ping Sergei, Groovy Macro's creator.
I've added Sergei in CC.

Guillaume

On Sun, May 22, 2016 at 3:29 PM, Mario Garcia <ma...@gmail.com> wrote:

> Yep, that's what I thought, but I was hoping somebody telling me It was my
> fault :P
>
> I'll take a further look to see if I'm able to see what's happening.
> Thanks anyway :)
>
> 2016-05-22 15:25 GMT+02:00 Pascal Schumacher <pa...@gmx.net>:
>
>> Hi Mario,
>>
>> as far as I remember groovy-macro is global ast-transformation. I guess
>> here is some side-effect/bug which causes the test failures. Sadly I lack
>> the necessary knowledge to investigate further.
>>
>> -Pascal
>>
>>
>> Am 22.05.2016 um 14:33 schrieb Mario Garcia:
>>
>> Hi:
>>
>> I'm trying to write some examples about the new features coming in the
>> new 'groovy-macro' but I'm experiencing some issues.
>>
>> In order to use 'groovy-macro' in the specs I've added the following line
>> in the root build.gradle:
>>
>>    testCompile project(':groovy-macro')
>>
>> But when running tests using "./gradlew test" two tests are failing:
>>
>>    -
>>    org.codehaus.groovy.classgen.asm.sc.bugs.Groovy6757Bug#testExplicitTypeHint
>>    -
>>    org.codehaus.groovy.classgen.asm.sc.bugs.Groovy7316Bug#testTypeCheckingBypassUsingExplicitTypeHint
>>
>> I've removed my examples to isolate the issue. And it turns out it just
>> fails adding the testCompile dependency. Once I remove the dependency all
>> tests succeed.
>>
>> Any ideas ? Should I've been doing the dependency management in some
>> other way? Maybe a bug ?
>>
>> Mario
>>
>>
>>
>>
>


-- 
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Product Ninja & Advocate at Restlet <http://restlet.com>

Blog: http://glaforge.appspot.com/
Social: @glaforge <http://twitter.com/glaforge> / Google+
<https://plus.google.com/u/0/114130972232398734985/posts>

Re: Problem creating groovy-macro spec files

Posted by Mario Garcia <ma...@gmail.com>.
Yep, that's what I thought, but I was hoping somebody telling me It was my
fault :P

I'll take a further look to see if I'm able to see what's happening.
Thanks anyway :)

2016-05-22 15:25 GMT+02:00 Pascal Schumacher <pa...@gmx.net>:

> Hi Mario,
>
> as far as I remember groovy-macro is global ast-transformation. I guess
> here is some side-effect/bug which causes the test failures. Sadly I lack
> the necessary knowledge to investigate further.
>
> -Pascal
>
>
> Am 22.05.2016 um 14:33 schrieb Mario Garcia:
>
> Hi:
>
> I'm trying to write some examples about the new features coming in the new
> 'groovy-macro' but I'm experiencing some issues.
>
> In order to use 'groovy-macro' in the specs I've added the following line
> in the root build.gradle:
>
>    testCompile project(':groovy-macro')
>
> But when running tests using "./gradlew test" two tests are failing:
>
>    -
>    org.codehaus.groovy.classgen.asm.sc.bugs.Groovy6757Bug#testExplicitTypeHint
>    -
>    org.codehaus.groovy.classgen.asm.sc.bugs.Groovy7316Bug#testTypeCheckingBypassUsingExplicitTypeHint
>
> I've removed my examples to isolate the issue. And it turns out it just
> fails adding the testCompile dependency. Once I remove the dependency all
> tests succeed.
>
> Any ideas ? Should I've been doing the dependency management in some other
> way? Maybe a bug ?
>
> Mario
>
>
>
>

Re: Problem creating groovy-macro spec files

Posted by Pascal Schumacher <pa...@gmx.net>.
Hi Mario,

as far as I remember groovy-macro is global ast-transformation. I guess 
here is some side-effect/bug which causes the test failures. Sadly I 
lack the necessary knowledge to investigate further.

-Pascal

Am 22.05.2016 um 14:33 schrieb Mario Garcia:
> Hi:
>
> I'm trying to write some examples about the new features coming in the 
> new 'groovy-macro' but I'm experiencing some issues.
>
> In order to use 'groovy-macro' in the specs I've added the following 
> line in the root build.gradle:
>
>    testCompile project(':groovy-macro')
>
> But when running tests using "./gradlew test" two tests are failing:
>
>   * org.codehaus.groovy.classgen.asm.sc.bugs.Groovy6757Bug#testExplicitTypeHint
>   * org.codehaus.groovy.classgen.asm.sc.bugs.Groovy7316Bug#testTypeCheckingBypassUsingExplicitTypeHint
>
> I've removed my examples to isolate the issue. And it turns out it 
> just fails adding the testCompile dependency. Once I remove the 
> dependency all tests succeed.
>
> Any ideas ? Should I've been doing the dependency management in some 
> other way? Maybe a bug ?
>
> Mario
>
>


Re: Problem creating groovy-macro spec files

Posted by Mario Garcia <ma...@gmail.com>.
BTW I'm using

Linux Debian
open-jdk 1.8.0_72

2016-05-22 14:33 GMT+02:00 Mario Garcia <ma...@gmail.com>:

> Hi:
>
> I'm trying to write some examples about the new features coming in the new
> 'groovy-macro' but I'm experiencing some issues.
>
> In order to use 'groovy-macro' in the specs I've added the following line
> in the root build.gradle:
>
>    testCompile project(':groovy-macro')
>
> But when running tests using "./gradlew test" two tests are failing:
>
>    -
>    org.codehaus.groovy.classgen.asm.sc.bugs.Groovy6757Bug#testExplicitTypeHint
>    -
>    org.codehaus.groovy.classgen.asm.sc.bugs.Groovy7316Bug#testTypeCheckingBypassUsingExplicitTypeHint
>
> I've removed my examples to isolate the issue. And it turns out it just
> fails adding the testCompile dependency. Once I remove the dependency all
> tests succeed.
>
> Any ideas ? Should I've been doing the dependency management in some other
> way? Maybe a bug ?
>
> Mario
>
>
>