Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.3.2
-
None
-
None
Description
Compiling this code:
@Grab('ch.qos.logback:logback-classic:1.0.13') @groovy.util.logging.Slf4j class MyClass { static myMethod() { String message = 'hello' // internal param name p1 from InnerClassVisitor#visitConstructorCallExpression String audience = 'world' // p2 new Runnable() { void run() { println "$message $audience" } } } } MyClass.myMethod().run()
Gives this error message:
2 compilation errors: Apparent variable 'p2' was found in a static scope but doesn't refer to a local variable, static field or class. Possible causes: You attempted to reference a variable in the binding or an instance variable from a static context. You misspelled a classname or statically imported field. Please check the spelling. You attempted to use a method 'p2' but left out brackets in a place not allowed by the grammar. at line: -1, column: -1 Apparent variable 'p1' was found in a static scope but doesn't refer to a local variable, static field or class. Possible causes: You attempted to reference a variable in the binding or an instance variable from a static context. You misspelled a classname or statically imported field. Please check the spelling. You attempted to use a method 'p1' but left out brackets in a place not allowed by the grammar. at line: -1, column: -1