tests for KT-606 dependents & duplicates

#KT-1489 fixed
 #KT-1728 fixed
This commit is contained in:
Svetlana Isakova
2012-05-04 14:54:02 +04:00
parent 652b9e78c3
commit 53397d7130
2 changed files with 72 additions and 2 deletions
@@ -0,0 +1,30 @@
package kt606_dependents
//KT-1489 Code analyzer fails with assertion
trait AutoCloseable{
fun close()
}
class C {
class Resource : AutoCloseable {
override fun close() {
throw UnsupportedOperationException()
}
}
fun foo<X : AutoCloseable>(<!UNUSED_PARAMETER!>x<!> : X, <!UNUSED_PARAMETER!>body<!> : (X) -> Unit) {
}
fun p() : Resource? = null
fun bar() {
<!TYPE_INFERENCE_FAILED!>foo(<!TYPE_MISMATCH!>p()<!>) {
}<!>
}
}
//KT-1728 Can't invoke extension property as a function
val Int.ext : () -> Int = { 5 }
val x = 1.ext()