Fix computation of erased receiver for intersection types
#KT-9630 Fixed
This commit is contained in:
+16
@@ -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()
|
||||
}
|
||||
+13
@@ -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()
|
||||
}
|
||||
+12
@@ -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()
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
public interface FirstTrait
|
||||
|
||||
public final class Foo {
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.NotNull method bar(): java.lang.String
|
||||
}
|
||||
|
||||
public final class IntersectionTypeMultipleBoundsImplicitReceiverKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method doSomething(@org.jetbrains.annotations.NotNull p0: FirstTrait): java.lang.String
|
||||
}
|
||||
|
||||
public interface SecondTrait
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
public interface Bar
|
||||
|
||||
public final class Baz {
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
public interface Foo
|
||||
|
||||
public final class IntersectionTypeWithMultipleBoundsAsReceiverKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method bip(@org.jetbrains.annotations.NotNull p0: Foo): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
public interface A
|
||||
|
||||
public interface B
|
||||
|
||||
public final class C {
|
||||
public method <init>(): void
|
||||
}
|
||||
|
||||
public final class IntersectionTypeWithoutGenericsAsReceiverKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method foo(@org.jetbrains.annotations.NotNull p0: A): java.lang.String
|
||||
}
|
||||
Reference in New Issue
Block a user