Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The following code runs in groovy2, but not 3
class A { def a = "a"; } class B extends A { } class C extends B { void setProperty(String name, Object value) { super.setProperty(name, value); } } def newC = new C(); newC.setProperty("a", "b"); newC.a
groovy 3 output:
groovy.lang.MissingMethodException: No signature of method: B.setProperty() is applicable for argument types: (String, String) values: [a, b] Possible solutions: hasProperty(java.lang.String), getProperties() at C.setProperty(ConsoleScript10:11) at ConsoleScript10.run(ConsoleScript10:16) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)