Erase non-reified type parameters by-default when inlining.

Substitution of type arguments to non-reified type parameters may lead
to accidental reification, which should not be done (see ^KT-60174 for
examples). So, we should erase them, except the few cases.

^KT-60174: Fixed
^KT-60175: Fixed
This commit is contained in:
vladislav.grechko
2023-07-27 18:30:50 +02:00
committed by Space Team
parent 29ecc4d987
commit f318b5969d
89 changed files with 2369 additions and 280 deletions
+10 -9
View File
@@ -81,7 +81,7 @@ fun box() {
// Array.kt:76 $kotlin.Array.set (5, 5, 5, 5)
// String.kt:149 $kotlin.stringLiteral (11, 4, 11, 4, 11, 4, 11, 4)
// Library.kt:3 $<init properties test.kt> (0, 0, 0, 0, 6, 6, 6, 6, 11, 11, 11, 11)
// Library.kt:39 $<init properties test.kt>
// Library.kt:39 $<init properties test.kt> (62, 82)
// test.kt:1 $box
// test.kt:8 $box (14, 14, 14, 14, 14, 4, 14, 4, 4, 4, 14, 9, 14, 4, 14, 4, 4, 4, 14, 9, 14, 4, 14, 4, 4, 4, 14, 9, 14, 4, 14, 4, 4, 4, 14, 9, 14, 4, 14, 4, 4, 4)
// test.kt:5 $<get-strings>
@@ -103,10 +103,10 @@ fun box() {
// String.kt:66 $kotlin.String.equals (15, 8, 15, 8, 15, 8, 15, 8)
// String.kt:111 $kotlin.String.equals (31, 25, 8, 31, 25, 8)
// String.kt:112 $kotlin.String.equals (8, 8)
// Standard.kt:124 $kotlin.String.equals (2, 32, 46, 42, 53, 32, 32, 32, 46, 42, 53, 32, 32, 2, 32, 46, 42, 53, 32, 32)
// Standard.kt:152 $kotlin.String.equals (4, 4)
// Standard.kt:154 $kotlin.String.equals (18, 4, 26, 4, 18, 9, 18, 4, 26, 4, 4, 18, 9, 18, 18, 4, 26, 4, 18, 9, 18)
// Standard.kt:155 $kotlin.String.equals (8, 8, 8)
// Standard.kt:124 $kotlin.String.equals (32, 46, 42, 53, 32, 32, 32, 46, 42, 53, 32, 32, 32, 46, 42, 53, 32, 32)
// Standard.kt:155 $kotlin.String.equals (8, 15, 8, 15, 8, 15)
// Standard.kt:126 $kotlin.String.equals (1, 1, 13, 6, 1, 13, 6)
// Standard.kt:125 $kotlin.String.equals (3, 3, 3)
// test.kt:12 $box (12, 18, 18, 18, 18, 12, 12, 18, 18, 18, 18, 12)
@@ -116,9 +116,11 @@ fun box() {
// String.kt:119 $kotlin.String.toString
// ExternalWrapper.kt:200 $kotlin.wasm.internal.kotlinToJsStringAdapter
// ExternalWrapper.kt:201 $kotlin.wasm.internal.kotlinToJsStringAdapter
// Strings.kt:161 $kotlin.wasm.internal.kotlinToJsStringAdapter
// Strings.kt:296 $kotlin.wasm.internal.kotlinToJsStringAdapter (52, 62, 52, 63)
// String.kt:18 $kotlin.String.<get-length>
// ExternalWrapper.kt:203 $kotlin.wasm.internal.kotlinToJsStringAdapter
// String.kt:150 $kotlin.wasm.internal.kotlinToJsStringAdapter
// String.kt:63 $kotlin.wasm.internal.kotlinToJsStringAdapter
// String.kt:66 $kotlin.wasm.internal.kotlinToJsStringAdapter (15, 8)
// ExternalWrapper.kt:204 $kotlin.wasm.internal.kotlinToJsStringAdapter (23, 32, 4)
@@ -137,7 +139,7 @@ fun box() {
// MemoryAllocation.kt:142 $kotlin.wasm.unsafe.ScopedMemoryAllocator.<init>
// MemoryAllocation.kt:71 $kotlin.wasm.unsafe.createAllocatorInTheNewScope (23, 4)
// MemoryAllocation.kt:72 $kotlin.wasm.unsafe.createAllocatorInTheNewScope (11, 4)
// MemoryAllocation.kt:58 $kotlin.wasm.internal.kotlinToJsStringAdapter
// MemoryAllocation.kt:58 $kotlin.wasm.internal.kotlinToJsStringAdapter (8, 14)
// MemoryAllocation.kt:160 $kotlin.wasm.internal.kotlinToJsStringAdapter (828, 739, 758, 784, 771, 803, 758, 739, 749, 749, 749, 820, 8580, 8584, 723, 882, 845, 915, 895, 932, 948, 963, 948, 932, 932, 932, 1251, 1261, 1276, 1291, 1276, 1306, 1220, 1353, 1364, 1379, 1364, 1394, 1332, 1325, 1325)
// _Ranges.kt:1321 $kotlin.ranges.coerceAtMost (15, 22, 15, 54, 4)
// MemoryAllocation.kt:99 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate (8, 8)
@@ -157,10 +159,11 @@ fun box() {
// MemoryAllocation.kt:125 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate (8, 8)
// Preconditions.kt:144 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate (456, 475, 494, 475, 456)
// Preconditions.kt:80 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate
// Preconditions.kt:83 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate
// Preconditions.kt:83 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate (4, 10)
// Preconditions.kt:27 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate
// Preconditions.kt:29 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate (3, 2)
// MemoryAllocation.kt:127 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate (30, 15, 8)
// UInt.kt:105 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate
// UInt.kt:414 $kotlin.wasm.unsafe.ScopedMemoryAllocator.allocate (44, 39, 49)
// UInt.kt:17 $kotlin.<UInt__<init>-impl>
// MemoryAccess.kt:16 $kotlin.wasm.unsafe.<Pointer__<init>-impl>
@@ -173,12 +176,10 @@ fun box() {
// Runtime.kt:36 $kotlin.wasm.internal.unsafeWasmCharArrayToRawMemory (25, 34, 42, 38, 8)
// Runtime.kt:37 $kotlin.wasm.internal.unsafeWasmCharArrayToRawMemory (8, 19, 8, 8)
// Runtime.kt:38 $kotlin.wasm.internal.unsafeWasmCharArrayToRawMemory (8, 8)
// Primitives.kt:43 $kotlin.wasm.internal.unsafeWasmCharArrayToRawMemory
// Primitives.kt:1150 $kotlin.wasm.internal.unsafeWasmCharArrayToRawMemory (8, 15, 8, 16)
// Runtime.kt:40 $kotlin.wasm.internal.unsafeWasmCharArrayToRawMemory
// ExternalWrapper.kt:225 $kotlin.wasm.internal.jsCheckIsNullOrUndefinedAdapter (6, 31)
// Standard.kt:123 $kotlin.wasm.internal.jsCheckIsNullOrUndefinedAdapter
// Standard.kt:126 $kotlin.wasm.internal.jsCheckIsNullOrUndefinedAdapter (15, 32, 4)
// Standard.kt:158 $kotlin.wasm.internal.jsCheckIsNullOrUndefinedAdapter (1728, 1718, 1717, 1717)
// ExternalWrapper.kt:226 $kotlin.wasm.internal.jsCheckIsNullOrUndefinedAdapter (18, 8, 32, 33)
// MemoryAllocation.kt:60 $kotlin.wasm.internal.kotlinToJsStringAdapter (8, 18)
// MemoryAllocation.kt:139 $kotlin.wasm.unsafe.ScopedMemoryAllocator.destroy (8, 20, 8)
// MemoryAllocation.kt:140 $kotlin.wasm.unsafe.ScopedMemoryAllocator.destroy