Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
I have following code:
A.groovy
package test.groovy class A<T> { protected String getText(T arg){ System.out.println( "A does something else"); return "Class A. -> "; } }
B.groovy
package test.groovy class B extends A<String> { @Override protected String getText(String arg) { System.out.println("B does something else"); return super.getText(arg) + "Class B. -> "; } }
C.groovy
package test.groovy class C extends B { @Override protected String getText(String arg) { System.out.println("C does something else"); return super.getText(arg) + "Class C. "; } public static void main(String[] args) { def c = new C() println(c.getText(null)) } }
I expected to receive next result:
Expected output
C does something else B does something else A does something else Class A. -> Class B. -> Class C.
But got the following output:
Actual output
C does something else A does something else Class A. -> Class C.
This issue might have same cause and can duplicate GROOVY-6653 issue.