ajwang / groovypptest

Automatically exported from code.google.com/p/groovypptest
0 stars 0 forks source link

Method selection - inconsistent with core groovy #347

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The code below (http://gppconsole.appspot.com/edit/19001) selects method:

* Parent-bar() - with @Typed enabled
* Child-bar() - with @Typed disabled

---------------------------------------------------------------------
@Typed 
package test

class A {}
class B extends A{}

class Parent {
    def foo() {
        bar(new B())
    }
    def bar(A a) {println "Parent-bar()"}
}
class Child extends Parent {
    def bar(B a) {println "Child-bar()"}
}

def s = new Child()
s.foo()
​
---------------------------------------------------------------------

Original issue reported on code.google.com by roshanda...@gmail.com on 8 Mar 2011 at 6:30