Fix signature mapping for built-in methods inside erased inline class

This commit is contained in:
Mikhail Zarechenskiy
2018-06-18 15:09:27 +03:00
parent 8503194e0d
commit 6431934c13
9 changed files with 85 additions and 1 deletions
@@ -0,0 +1,25 @@
// !LANGUAGE: +InlineClasses
// WITH_RUNTIME
// TARGET_BACKEND: JVM
inline class MyUInt(val x: Int)
inline class MyUIntArray(private val storage: IntArray) : Collection<MyUInt> {
public override val size: Int get() = storage.size
override operator fun iterator() = TODO()
override fun contains(element: MyUInt): Boolean = storage.contains(element.x)
override fun containsAll(elements: Collection<MyUInt>): Boolean = elements.all { storage.contains(it.x) }
override fun isEmpty(): Boolean = TODO()
}
fun box(): String {
val uints = MyUIntArray(intArrayOf(0, 1, 42))
if (MyUInt(42) !in uints) return "Fail 1"
val ints = listOf(MyUInt(1), MyUInt(0))
if (!uints.containsAll(ints)) return "Fail 2"
return "OK"
}
@@ -0,0 +1,12 @@
// !LANGUAGE: +InlineClasses
inline class UInt(val x: Int)
inline class UIntArray(private val storage: IntArray) : Collection<UInt> {
public override val size: Int get() = storage.size
override operator fun iterator() = TODO()
override fun contains(element: UInt): Boolean = TODO()
override fun containsAll(elements: Collection<UInt>): Boolean = TODO()
override fun isEmpty(): Boolean = TODO()
}
@@ -0,0 +1,22 @@
package
public final inline class UInt {
public constructor UInt(/*0*/ x: kotlin.Int)
public final val x: kotlin.Int
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final inline class UIntArray : kotlin.collections.Collection<UInt> {
public constructor UIntArray(/*0*/ storage: kotlin.IntArray)
public open override /*1*/ val size: kotlin.Int
private final val storage: kotlin.IntArray
public open override /*1*/ fun contains(/*0*/ element: UInt): kotlin.Boolean
public open override /*1*/ fun containsAll(/*0*/ elements: kotlin.collections.Collection<UInt>): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ fun isEmpty(): kotlin.Boolean
public open override /*1*/ fun iterator(): kotlin.Nothing
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}