Details
-
Type:
Wish
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.7.3, 1.8-beta-1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Describe a class
class Foo {
static def getBar(){}
static def setBar(def bar){}
}
and a script
import static Foo.bar print bar print getBar()
Now 'print getBar()' throws MissingMethodException.
IMHO 'getBar()' should be resolved to Foo.getBar() without explicit import
The same thing is with setters and aliased imports.
import static Foo.bar setBar(2)
import static Foo.bar as baz setBaz(2) print getBaz()
import static Foo.getBar print bar
import static Foo.setBar bar = 2
Issue Links
- is related to
-
GROOVY-3945
Statically imported closure field is not resolved
-
-
GROOVY-4145
Statically imported fields & properties
-
Initial support for statically importing properties is now in trunk and the 1_7_X branch. It still needs some finessing when public fields and property accessors are used in combo but I wanted to give others the chance to test usage for normal properties.