groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Sarov <izvanz3mn...@yahoo.com>
Subject Re: GroovyShell Binding with TypeChecked
Date Thu, 04 Feb 2016 09:10:32 GMT
Hi Pascal,
I realize that the binding is just a map but I still do not see the implication. The type
checker could very well take the variable name - in my case "util" and look it up in the map/binding
- just to see if there is such a key.
Now I am having the feeling that the type checker does not use the binding/map at all. Am
I correct?
Best regardsAnton


    On Wednesday, February 3, 2016 10:43 PM, Pascal Schumacher <pascalschumacher@gmx.net>
wrote:
 

  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