[Native][tests] Add partial linkage tests (muted) for replacement-of-return-type case
^KT-51707
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
class Foo(val seed: Int) {
|
||||||
|
override fun toString() = "Foo[$seed]"
|
||||||
|
fun doCommon() = seed - 1
|
||||||
|
fun doSpecificFoo() = seed - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
class Bar(val seed: Int) {
|
||||||
|
override fun toString() = "Bar[$seed]"
|
||||||
|
fun doCommon() = seed + 1
|
||||||
|
fun doSpecificBar() = seed + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
val topLevelProperty = Foo(42)
|
||||||
|
fun topLevelFunction() = Foo(42)
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// same
|
||||||
|
class Foo(val seed: Int) {
|
||||||
|
override fun toString() = "Foo[$seed]"
|
||||||
|
fun doCommon() = seed - 1
|
||||||
|
fun doSpecificFoo() = seed - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
// same
|
||||||
|
class Bar(val seed: Int) {
|
||||||
|
override fun toString() = "Bar[$seed]"
|
||||||
|
fun doCommon() = seed + 1
|
||||||
|
fun doSpecificBar() = seed + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
//val topLevelProperty = Foo(42)
|
||||||
|
val topLevelProperty = Bar(42)
|
||||||
|
//fun topLevelFunction() = Foo(42)
|
||||||
|
fun topLevelFunction() = Bar(42)
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
STEP 0:
|
||||||
|
dependencies: stdlib
|
||||||
|
STEP 1:
|
||||||
|
dependencies: stdlib
|
||||||
|
modifications:
|
||||||
|
U : l1.kt.1 -> l1.kt
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
fun doCommonViaProperty() = topLevelProperty.doCommon()
|
||||||
|
fun doSpecificViaProperty() = topLevelProperty.doSpecificFoo() // Because, initially topLevelProperty had type Foo.
|
||||||
|
|
||||||
|
fun doCommonViaFunction() = topLevelFunction().doCommon()
|
||||||
|
fun doSpecificViaFunction() = topLevelFunction().doSpecificFoo() // Because, initially topLevelFunction had return type Foo.
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
STEP 0:
|
||||||
|
dependencies: stdlib, lib1
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import abitestutils.abiTest
|
||||||
|
|
||||||
|
fun box() = abiTest {
|
||||||
|
expectFailure(prefixed("???")) { doCommonViaProperty() }
|
||||||
|
expectFailure(prefixed("???")) { doSpecificViaProperty() }
|
||||||
|
expectFailure(prefixed("???")) { doCommonViaFunction() }
|
||||||
|
expectFailure(prefixed("???")) { doSpecificViaFunction() }
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
STEP 0:
|
||||||
|
dependencies: stdlib, lib1, lib2
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
MUTED
|
||||||
|
MODULES: lib1, lib2, main
|
||||||
|
|
||||||
|
STEP 0:
|
||||||
|
libs: lib1, lib2, main
|
||||||
|
|
||||||
|
STEP 1:
|
||||||
|
libs: lib1
|
||||||
+5
@@ -145,6 +145,11 @@ public class JsKLibABINoICTestCaseGenerated extends AbstractJsKLibABINoICTestCas
|
|||||||
runTest("compiler/testData/klibABI/removeProperty/");
|
runTest("compiler/testData/klibABI/removeProperty/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("replaceCallableReturnType")
|
||||||
|
public void testReplaceCallableReturnType() throws Exception {
|
||||||
|
runTest("compiler/testData/klibABI/replaceCallableReturnType/");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("typeAliasRHSTypeChange")
|
@TestMetadata("typeAliasRHSTypeChange")
|
||||||
public void testTypeAliasRHSTypeChange() throws Exception {
|
public void testTypeAliasRHSTypeChange() throws Exception {
|
||||||
runTest("compiler/testData/klibABI/typeAliasRHSTypeChange/");
|
runTest("compiler/testData/klibABI/typeAliasRHSTypeChange/");
|
||||||
|
|||||||
+5
@@ -145,6 +145,11 @@ public class JsKLibABIWithICTestCaseGenerated extends AbstractJsKLibABIWithICTes
|
|||||||
runTest("compiler/testData/klibABI/removeProperty/");
|
runTest("compiler/testData/klibABI/removeProperty/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("replaceCallableReturnType")
|
||||||
|
public void testReplaceCallableReturnType() throws Exception {
|
||||||
|
runTest("compiler/testData/klibABI/replaceCallableReturnType/");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("typeAliasRHSTypeChange")
|
@TestMetadata("typeAliasRHSTypeChange")
|
||||||
public void testTypeAliasRHSTypeChange() throws Exception {
|
public void testTypeAliasRHSTypeChange() throws Exception {
|
||||||
runTest("compiler/testData/klibABI/typeAliasRHSTypeChange/");
|
runTest("compiler/testData/klibABI/typeAliasRHSTypeChange/");
|
||||||
|
|||||||
Generated
+6
@@ -162,6 +162,12 @@ public class KlibABITestGenerated extends AbstractNativeKlibABITest {
|
|||||||
runTest("compiler/testData/klibABI/removeProperty/");
|
runTest("compiler/testData/klibABI/removeProperty/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("replaceCallableReturnType")
|
||||||
|
public void testReplaceCallableReturnType() throws Exception {
|
||||||
|
runTest("compiler/testData/klibABI/replaceCallableReturnType/");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("typeAliasRHSTypeChange")
|
@TestMetadata("typeAliasRHSTypeChange")
|
||||||
public void testTypeAliasRHSTypeChange() throws Exception {
|
public void testTypeAliasRHSTypeChange() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user