Fix computation of erased receiver for intersection types

#KT-9630 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2016-12-26 18:07:38 +03:00
parent f7d64ac807
commit 38a2518498
14 changed files with 205 additions and 1 deletions
@@ -0,0 +1,16 @@
interface FirstTrait
interface SecondTrait
fun <T> T.doSomething(): String where T : FirstTrait, T : SecondTrait {
return "OK"
}
class Foo : FirstTrait, SecondTrait {
fun bar(): String {
return doSomething()
}
}
fun box(): String {
return Foo().bar()
}
@@ -0,0 +1,13 @@
interface Foo<T>
interface Bar<T>
class Baz<T> : Foo<T>, Bar<T>
fun <T, S> S.bip(): String where S : Foo<T>, S: Bar<T> {
return "OK"
}
fun box(): String {
val baz = Baz<String>()
return baz.bip()
}
@@ -0,0 +1,12 @@
interface A
interface B
class C : A, B
fun <T> T.foo(): String where T : A, T : B {
return "OK"
}
fun box(): String {
return C().foo()
}