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
+4
View File
@@ -268,6 +268,10 @@ task local_variable(type: UnitKonanTest) {
source = "codegen/basics/local_variable.kt"
}
task canonical_name(type: RunKonanTest) {
goldValue = "A:foo\nA:qux\n"
source = "codegen/basics/canonical_name.kt"
}
task cast_simple(type: UnitKonanTest) {
source = "codegen/basics/cast_simple.kt"
@@ -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())
}
@@ -266,6 +266,7 @@ fun testIteratorRemove() {
}
it.next()
}
assertEquals(makeList135(), a)
}
@@ -288,8 +289,7 @@ fun main(args : Array<String>) {
testIterator()
testRemove()
testRemoveAll()
// Fails due to unknown virtual method call!
// testRetainAll()
testRetainAll()
testEquals()
testHashCode()
testToString()
@@ -299,8 +299,7 @@ fun main(args : Array<String>) {
testSubListContains()
testSubListIndexOf()
testSubListLastIndexOf()
// Fails due to unknown virtual method call!
// testIteratorAdd()
// testIteratorRemove()
// testIteratorAdd() runtime assert: Throwing is unsupported
// testIteratorRemove() assertEquals fails
println("OK")
}