Canonical name (#99)

* TEST: enabled testRetainAll

* Method resolution spared of annotations and generics

* TEST: test for canonical names "interface+generic" added

* Methods' canonical names support:

- Recursive iteration of method argument types
- Arguments in question are delivered from topmost overriden ancestor of this method
This commit is contained in:
KonstantinAnisimov
2016-11-30 16:19:28 +03:00
committed by Nikolay Igotti
parent e9b0ebb95e
commit 90b6a12a5c
4 changed files with 63 additions and 8 deletions
@@ -0,0 +1,33 @@
interface I<U, T> {
fun foo(a: U): T
fun qux(a: T): U
}
//-----------------------------------------------------------------------------//
class A1
class A2
//-----------------------------------------------------------------------------//
class A : I<A1, A2> {
override fun foo(a: A1): A2 { println("A:foo"); return A2() }
override fun qux(a: A2): A1 { println("A:qux"); return A1() }
}
//-----------------------------------------------------------------------------//
fun <U, V> baz(i: I<U, V>, u: U, v:V) {
i.foo(u)
i.qux(v)
}
//-----------------------------------------------------------------------------//
fun main(args: Array<String>) {
baz<A1, A2>(A(), A1(), A2())
}