'bytecodeText' test for synthetic accessor generic signature converted to 'writeSignature' test

This commit is contained in:
Mikhael Bogdanov
2016-05-04 14:40:11 +03:00
parent ee7bbbf530
commit cd6b709ef5
4 changed files with 26 additions and 39 deletions
@@ -1,24 +0,0 @@
class MyList<T> {
private fun noSignature(): T? = null
fun withSignature(): T? = null
fun removeHeader() {
fun a () {
noSignature()
}
}
}
/*
Class signature,
local fun class signature,
'noSignature' and 'withSignature' fun signatures
*/
// 4 signature
// 2 signature \(\)TT\;
// 1 signature Lkotlin/jvm/internal/Lambda\;Lkotlin/jvm/functions/Function0<Lkotlin/Unit\;>\;
// 1 signature <T:Ljava/lang/Object\;>Ljava/lang/Object\;
// 1 public final static synthetic access\$noSignature\(LMyList\;\)Ljava/lang/Object
@@ -0,0 +1,20 @@
class MyList<T> {
private fun noSignature(): T? = null
fun withSignature(): T? = null
fun removeHeader() {
fun a () {
noSignature()
}
}
}
// method: MyList::withSignature
// jvm signature: ()Ljava/lang/Object;
// generic signature: ()TT;
// method: MyList::access$noSignature
// jvm signature: (LMyList;)Ljava/lang/Object;
// generic signature: null
@@ -1106,21 +1106,6 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/signature")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Signature extends AbstractBytecodeTextTest {
public void testAllFilesPresentInSignature() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/signature"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("noSignatureInSyntheticAccessor.kt")
public void testNoSignatureInSyntheticAccessor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/signature/noSignatureInSyntheticAccessor.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/statements")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -137,6 +137,12 @@ public class WriteSignatureTestGenerated extends AbstractWriteSignatureTest {
doTest(fileName);
}
@TestMetadata("syntheticAccessorForGeneric.kt")
public void testSyntheticAccessorForGeneric() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeSignature/syntheticAccessorForGeneric.kt");
doTest(fileName);
}
@TestMetadata("VarargCharSequence.kt")
public void testVarargCharSequence() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeSignature/VarargCharSequence.kt");