Files
kotlin/compiler/testData/codegen/box/inlineClasses/interfaceMethodCalls/genericInterfaceMethodCall.kt
Dmitry Petrov 8d2b1950e6 Fix Kotlin default interface methods calls for inline classes
When mapping callable method signature for erased inline class methods,
use original function descriptor instead of super declaration
(otherwise it would map to a default interface method with mismatching
signature).

When generating delegates to Kotlin default interface methods, keep
track of the original Kotlin types for delegating method arguments and
interface method arguments.

'original' for value parameters of fake overrides points to the
overridden function value parameters instead of the value parameter of
the unsubstituted function. This causes inconsistent type mapping for
inline classes implementing generic interfaces with default methods.

 #KT-25295 Fixed Target versions 1.3.20
 #KT-26931 Fixed Target versions 1.3.20
2018-09-21 09:48:11 +03:00

13 lines
219 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
interface IFoo<T> {
fun foo(x: T): String
}
inline class Z(val x: Int) : IFoo<Z> {
override fun foo(x: Z) = "OK"
}
fun box(): String =
Z(1).foo(Z(2))