Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/genericInlineClassSynthMembers.kt
T
Alexander Udalov 8dee36d420 Tests: do not add transitive dependencies in multi-module tests
Prefer to have all module dependencies, including dependencies on
stdlib/reflect, declared explicitly. This allows to have tests on
situations like the one in KT-45308: three modules A<-B<-C, where C
doesn't depend on A, which was compiling correctly with the old JVM
backend before 1.5, but started to fail with JVM IR in 1.5.

Also simplify the code a bit, remove duplicated logic.
2021-05-20 15:58:05 +02:00

24 lines
368 B
Kotlin
Vendored

// MODULE: lib1
// FILE: lib1.kt
class C<T>(val t: T) {
override fun hashCode(): Int = t as Int
}
// MODULE: lib2(lib1)
// FILE: lib2.kt
inline class IC<TT>(val c: C<TT>) {
fun foo(): Int = c.hashCode()
}
// MODULE: main(lib1, lib2)
// FILE: main.kt
fun box(): String {
val ic = IC<Int>(C(42))
if (ic.foo() != 42) return "FAIL"
return "OK"
}