Add tests for Obsolete issues
#KT-18977 Obsolete
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
// NO_CHECK_LAMBDA_INLINING
|
// NO_CHECK_LAMBDA_INLINING
|
||||||
|
package test
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
val foo = fun(call: () -> Unit) =
|
val foo = fun(call: () -> Unit) =
|
||||||
ext {
|
ext {
|
||||||
@@ -24,6 +26,7 @@ class A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FILE: 2.kt
|
// FILE: 2.kt
|
||||||
|
import test.*
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
var result = "fail"
|
var result = "fail"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
// IGNORE_BACKEND: JS
|
// IGNORE_BACKEND: JS
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
package test
|
||||||
|
|
||||||
public inline fun <T> T.myalso(block: (T) -> Unit): T {
|
public inline fun <T> T.myalso(block: (T) -> Unit): T {
|
||||||
block(this)
|
block(this)
|
||||||
return this
|
return this
|
||||||
@@ -12,6 +14,8 @@ public inline fun <T, R : Any> Iterable<T>.mymapNotNull(transform: (T) -> R?): L
|
|||||||
|
|
||||||
// FILE: 2.kt
|
// FILE: 2.kt
|
||||||
// NO_CHECK_LAMBDA_INLINING
|
// NO_CHECK_LAMBDA_INLINING
|
||||||
|
import test.*
|
||||||
|
|
||||||
var result = -1;
|
var result = -1;
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// IGNORE_BACKEND: JVM_IR
|
// IGNORE_BACKEND: JVM_IR
|
||||||
// FILE: 1.kt
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
var field = 0
|
var field = 0
|
||||||
|
|
||||||
@@ -28,6 +30,9 @@ class A {
|
|||||||
|
|
||||||
// FILE: 2.kt
|
// FILE: 2.kt
|
||||||
// NO_CHECK_LAMBDA_INLINING
|
// NO_CHECK_LAMBDA_INLINING
|
||||||
|
|
||||||
|
import test.*
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
val a = A()
|
val a = A()
|
||||||
a.c ({ "OK" })
|
a.c ({ "OK" })
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
class AbstractTreeNode<T>(val value: T, val parent: AbstractTreeNode<T>?)
|
||||||
|
|
||||||
|
internal inline fun <reified T : Any> AbstractTreeNode<*>.findNotNullValueOfType(strict: Boolean = false): T {
|
||||||
|
return findValueOfType(strict)!!
|
||||||
|
}
|
||||||
|
|
||||||
|
internal inline fun <reified T : Any> AbstractTreeNode<*>.findValueOfType(strict: Boolean = true): T? {
|
||||||
|
var current: AbstractTreeNode<*>? = if (strict) this.parent else this
|
||||||
|
while (current != null) {
|
||||||
|
val value = current.value
|
||||||
|
if (value is T) return value
|
||||||
|
current = current.parent
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return AbstractTreeNode("OK", null).findNotNullValueOfType<String>()!!
|
||||||
|
}
|
||||||
+5
@@ -2578,6 +2578,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
|||||||
runTest("compiler/testData/codegen/boxInline/reified/kt15997_2.kt");
|
runTest("compiler/testData/codegen/boxInline/reified/kt15997_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt18977.kt")
|
||||||
|
public void testKt18977() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/reified/kt18977.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt6988.kt")
|
@TestMetadata("kt6988.kt")
|
||||||
public void testKt6988() throws Exception {
|
public void testKt6988() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/reified/kt6988.kt");
|
runTest("compiler/testData/codegen/boxInline/reified/kt6988.kt");
|
||||||
|
|||||||
Generated
+5
@@ -2578,6 +2578,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
|
|||||||
runTest("compiler/testData/codegen/boxInline/reified/kt15997_2.kt");
|
runTest("compiler/testData/codegen/boxInline/reified/kt15997_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt18977.kt")
|
||||||
|
public void testKt18977() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/reified/kt18977.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt6988.kt")
|
@TestMetadata("kt6988.kt")
|
||||||
public void testKt6988() throws Exception {
|
public void testKt6988() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/reified/kt6988.kt");
|
runTest("compiler/testData/codegen/boxInline/reified/kt6988.kt");
|
||||||
|
|||||||
+5
@@ -2578,6 +2578,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
|
|||||||
runTest("compiler/testData/codegen/boxInline/reified/kt15997_2.kt");
|
runTest("compiler/testData/codegen/boxInline/reified/kt15997_2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt18977.kt")
|
||||||
|
public void testKt18977() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/boxInline/reified/kt18977.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt6988.kt")
|
@TestMetadata("kt6988.kt")
|
||||||
public void testKt6988() throws Exception {
|
public void testKt6988() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/reified/kt6988.kt");
|
runTest("compiler/testData/codegen/boxInline/reified/kt6988.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user