groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal Schumacher <pascalschumac...@gmx.net>
Subject Re: GroovyShell Binding with TypeChecked
Date Wed, 03 Feb 2016 21:43:09 GMT
Hi Anton,

Binding is essentially just a map. The typ checker does not know which 
values will be present. Therefore it flags "util" as undeclared.

Cheers,
Pascal

Am 03.02.2016 um 16:24 schrieb Anton Sarov:
> Hello,
>
> I have the following case where I want to make use of the type 
> checking feature:
>
> http://groovyconsole.appspot.com/script/5121843795066880
>
>
> Unfortunately I get an error like: "The variable [util] is undeclared".
>
> Why is this happening? I defined a variable in the provided binding 
> but apparently this is somehow not relevant to the Groovy Shell...
>
> Best regards
> Anton
> startup failed:
> Script1.groovy: 7: [Static type checking] - The variable [util] is undeclared.
>   @ line 7, column 17.
>             def a = util.test();
>                     ^
>
> 1 error
> startup failed:
> Script1.groovy: 7: [Static type checking] - The variable [util] is undeclared.
>   @ line 7, column 17.
>             def a = util.test();
>                     ^
>
> 1 error
> startup failed:
> Script1.groovy: 7: [Static type checking] - The variable [util] is undeclared.
>   @ line 7, column 17.
>             def a = util.test();
>                     ^
>
> 1 errorstartup failed:
> Script1.groovy: 7: [Static type checking] - The variable [util] is undeclared.
>   @ line 7, column 17.
>             def a = util.test();
>                     ^
>
> 1 error
> startup failed:
> Script1.groovy: 7: [Static type checking] - The variable [util] is undeclared.
>   @ line 7, column 17.
>             def a = util.test();
>                     ^
>
> 1 error


Mime
View raw message