Kapt: add JVM IR expectations for some tests
All of these have a different order of declarations and/or extra `@NotNull` annotations on fields, both of which doesn't seem like a problem. #KT-49682
This commit is contained in:
+10
-1
@@ -332,7 +332,16 @@ open class AbstractClassFileToSourceStubConverterTest : AbstractKotlinKapt3Test(
|
||||
}
|
||||
}
|
||||
}
|
||||
KotlinTestUtils.assertEqualsToFile(txtFile, actual)
|
||||
|
||||
val irTxtFile = File(txtFile.parentFile, txtFile.nameWithoutExtension + "_ir.txt")
|
||||
val expectedFile =
|
||||
if (backend.isIR && irTxtFile.exists()) irTxtFile
|
||||
else txtFile
|
||||
KotlinTestUtils.assertEqualsToFile(expectedFile, actual)
|
||||
|
||||
if (backend.isIR && txtFile.exists() && irTxtFile.exists() && txtFile.readText() == irTxtFile.readText()) {
|
||||
fail("JVM and JVM_IR golden files are identical. Remove $irTxtFile.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
data class User(val firstName: String, val secondName: String, val age: Int) {
|
||||
fun procedure() {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class User {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String firstName = null;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String secondName = null;
|
||||
private final int age = 0;
|
||||
|
||||
public User(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String firstName, @org.jetbrains.annotations.NotNull()
|
||||
java.lang.String secondName, int age) {
|
||||
super();
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getFirstName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getSecondName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final int getAge() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public final void procedure() {
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String component1() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String component2() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final int component3() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final User copy(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String firstName, @org.jetbrains.annotations.NotNull()
|
||||
java.lang.String secondName, int age) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@java.lang.Override()
|
||||
public boolean equals(@org.jetbrains.annotations.Nullable()
|
||||
java.lang.Object other) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@java.lang.Override()
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
@java.lang.Override()
|
||||
public java.lang.String toString() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
inline class Cl(val a: String)
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
@kotlin.jvm.JvmInline()
|
||||
public final class Cl {
|
||||
|
||||
public Cl() {
|
||||
super();
|
||||
}
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String a = null;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getA() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@java.lang.Override()
|
||||
public boolean equals(java.lang.Object other) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@java.lang.Override()
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@java.lang.Override()
|
||||
public java.lang.String toString() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
class Test {
|
||||
private var a = FilterValueDelegate<Float>()
|
||||
private inner class FilterValueDelegate<T>
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Test {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private Test.FilterValueDelegate<java.lang.Float> a;
|
||||
|
||||
public Test() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
final class FilterValueDelegate<T extends java.lang.Object> {
|
||||
|
||||
public FilterValueDelegate() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Test2 {
|
||||
|
||||
public Test2() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class FilterValueDelegate<T extends java.lang.Object> {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private Test2.FilterValueDelegate<T>.Filter2<java.lang.String> a;
|
||||
|
||||
public FilterValueDelegate() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Filter2<X extends java.lang.Object> {
|
||||
|
||||
public Filter2() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Test3 {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private Test3.FilterValueDelegate<java.lang.Float> a;
|
||||
|
||||
public Test3() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
static final class FilterValueDelegate<T extends java.lang.Object> {
|
||||
|
||||
public FilterValueDelegate() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
package test
|
||||
|
||||
internal class MutableEntry<K, V>(
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package test;
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class MutableEntry<K extends java.lang.Object, V extends java.lang.Object> implements java.util.Map.Entry<K, V>, kotlin.jvm.internal.markers.KMutableMap.Entry {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.util.Map<K, V> internal = null;
|
||||
private final K key = null;
|
||||
|
||||
public MutableEntry(@org.jetbrains.annotations.NotNull()
|
||||
java.util.Map<K, V> internal, K key, V value) {
|
||||
super();
|
||||
}
|
||||
|
||||
@java.lang.Override()
|
||||
public K getKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
package test
|
||||
|
||||
class Test<T : CharSequence, N : Number> {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package test;
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public abstract interface ListUpdateCallback {
|
||||
|
||||
public abstract void onInserted(int position, int count);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
package test;
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Test<T extends java.lang.CharSequence, N extends java.lang.Number> {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final test.ListUpdateCallback x = null;
|
||||
|
||||
public Test() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
package test
|
||||
|
||||
class Test<T : CharSequence, N : Number> {
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package test;
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Test<T extends java.lang.CharSequence, N extends java.lang.Number> {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final test.TypedListUpdateCallback<java.lang.String, java.lang.Long> x = null;
|
||||
|
||||
public Test() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
package test;
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public abstract interface TypedListUpdateCallback<T extends java.lang.Object, C extends java.lang.Number> {
|
||||
|
||||
public abstract void onInserted(@org.jetbrains.annotations.NotNull()
|
||||
C position, @org.jetbrains.annotations.NotNull()
|
||||
C count, @org.jetbrains.annotations.NotNull()
|
||||
T item);
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// STRICT
|
||||
|
||||
class Foo(private val string: String) {
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Foo {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String string = null;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Foo.Bar bar = null;
|
||||
|
||||
public Foo(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String string) {
|
||||
super();
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final Foo.Bar getBar() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class Bar {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String string = null;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.util.ArrayList<Foo.Bar.Bar> bars = null;
|
||||
|
||||
public Bar(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String string) {
|
||||
super();
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getString() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.util.ArrayList<Foo.Bar.Bar> getBars() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// WITH_STDLIB
|
||||
|
||||
interface Intf
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Foo {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final kotlin.Lazy foo$delegate = null;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final kotlin.Lazy bar$delegate = null;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final kotlin.Lazy baz$delegate = null;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final kotlin.Lazy generic1$delegate = null;
|
||||
|
||||
public Foo() {
|
||||
super();
|
||||
}
|
||||
|
||||
private final java.lang.Runnable getFoo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private final java.lang.Object getBar() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private final java.lang.Object getBaz() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private final GenericIntf<java.lang.CharSequence> getGeneric1() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public abstract interface GenericIntf<T extends java.lang.Object> {
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public abstract interface Intf {
|
||||
}
|
||||
Reference in New Issue
Block a user