You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Jamie Echlin <ja...@gmail.com> on 2015/09/22 18:00:10 UTC

return type and generics

This compiles OK:

@TypeChecked
class C extends Script {

    @Override
    List<String> run() {
        [11, 12]
    }
}

however, in IDEA, with @TypeChecked, it's highlighted as an error. I didn't
really expect this to produce an error in static type checking, but I'm
just wondering if IDEA is going more here than @TypeChecked does.

Or is there some way to get type checking to flag this as an error?
cheers, jamie

Re: return type and generics

Posted by Jamie Echlin <ja...@gmail.com>.
Cheers Cedric: https://issues.apache.org/jira/browse/GROOVY-7598

Pretty minimal report but I think it has all it needs.

On Tue, Sep 22, 2015 at 5:03 PM, Cédric Champeau <ce...@gmail.com>
wrote:

> Yes, there's a way: please file a bug report :) It should have been
> caught. I'm actually very surprised it doesn't :)
>
> 2015-09-22 18:00 GMT+02:00 Jamie Echlin <ja...@gmail.com>:
>
>> This compiles OK:
>>
>> @TypeChecked
>> class C extends Script {
>>
>>     @Override
>>     List<String> run() {
>>         [11, 12]
>>     }
>> }
>>
>> however, in IDEA, with @TypeChecked, it's highlighted as an error. I
>> didn't really expect this to produce an error in static type checking, but
>> I'm just wondering if IDEA is going more here than @TypeChecked does.
>>
>> Or is there some way to get type checking to flag this as an error?
>> cheers, jamie
>>
>
>

Re: return type and generics

Posted by Cédric Champeau <ce...@gmail.com>.
Yes, there's a way: please file a bug report :) It should have been caught.
I'm actually very surprised it doesn't :)

2015-09-22 18:00 GMT+02:00 Jamie Echlin <ja...@gmail.com>:

> This compiles OK:
>
> @TypeChecked
> class C extends Script {
>
>     @Override
>     List<String> run() {
>         [11, 12]
>     }
> }
>
> however, in IDEA, with @TypeChecked, it's highlighted as an error. I
> didn't really expect this to produce an error in static type checking, but
> I'm just wondering if IDEA is going more here than @TypeChecked does.
>
> Or is there some way to get type checking to flag this as an error?
> cheers, jamie
>