added tests for resolve

(to test performance issues)
This commit is contained in:
Svetlana Isakova
2012-11-17 18:30:22 +04:00
parent 837cf38e91
commit 993d3a3469
3 changed files with 59 additions and 1 deletions
@@ -0,0 +1,20 @@
package a
class A {
val testVal : A = A()
}
//inappropriate but participating in resolve functions
fun foo<T>(a: T, <!UNUSED_PARAMETER!>b<!>: T, <!UNUSED_PARAMETER!>i<!>: Int) = a
fun foo(a: Any) = a
fun foo<T>(a: T, <!UNUSED_PARAMETER!>b<!>: String) = a
fun foo<T>(a: T, <!UNUSED_PARAMETER!>b<!>: T, <!UNUSED_PARAMETER!>s<!>: String) = a
//appropriate function
fun foo<T>(a: T, <!UNUSED_PARAMETER!>b<!>: T) = a
fun test(a: A) {
//the problem occurs if there are nested function invocations to resolve (resolve for them is repeated now)
//to copy this invocation many times (and to comment/uncomment inappropriate functions) to see the difference
foo(foo(a, foo(a, foo(a, a.testVal))), a)
}
@@ -0,0 +1,19 @@
package c
class A {
val testVal : A = A()
}
//inappropriate but participating in resolve functions
fun foo(a: A, <!UNUSED_PARAMETER!>b<!>: A, <!UNUSED_PARAMETER!>i<!>: Int) = a
fun foo(a: Any) = a
fun foo(a: A, <!UNUSED_PARAMETER!>b<!>: Any) = a
fun foo(a: A, <!UNUSED_PARAMETER!>b<!>: A, <!UNUSED_PARAMETER!>s<!>: String) = a
//appropriate function
fun foo(a: A, <!UNUSED_PARAMETER!>b<!>: A) = a
fun test(a: A) {
//the problem occurs if there are nested function invocations to resolve (resolve for them is repeated now)
//to copy this invocation many times (and to comment/uncomment inappropriate functions) to see the difference
foo(foo(a, foo(a, foo(a, a.testVal))), a)
}