KAPT+IR: support IR error types

#KT-49682
This commit is contained in:
Mikhael Bogdanov
2022-05-27 13:39:57 +02:00
committed by Space
parent 41d6f0dca4
commit 162ca4ac2b
21 changed files with 290 additions and 25 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// CORRECT_ERROR_TYPES
@file:Suppress("UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST", "NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION")
@@ -28,6 +27,6 @@ class ErrorInDeclarations {
annotation class Anno(val a: KClass<Any>)
// EXPECTED_ERROR(kotlin:11:1) cannot find symbol
// EXPECTED_ERROR(kotlin:6:1) cannot find symbol
// EXPECTED_ERROR(kotlin:12:1) cannot find symbol
// EXPECTED_ERROR(kotlin:7:1) cannot find symbol
// EXPECTED_ERROR(kotlin:13:1) cannot find symbol
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// CORRECT_ERROR_TYPES
// NO_VALIDATION
// WITH_STDLIB
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// CORRECT_ERROR_TYPES
// FILE: a.kt
@@ -53,4 +52,4 @@ interface TestC {
fun e(): LibFooBar
}
// EXPECTED_ERROR(kotlin:17:5) cannot find symbol
// EXPECTED_ERROR(kotlin:16:5) cannot find symbol
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// CORRECT_ERROR_TYPES
// FILE: te/st/a/JavaClass
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// CORRECT_ERROR_TYPES
// JAVAC_OPTION -Xmaxerrs=1
@@ -12,4 +11,4 @@ class Test {
// There are two errors (unresolved identifier ABC, BCD) actually.
// But we specified the max error count, so the error output is limited.
// EXPECTED_ERROR(kotlin:8:5) cannot find symbol
// EXPECTED_ERROR(kotlin:7:5) cannot find symbol
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// CORRECT_ERROR_TYPES
// NON_EXISTENT_CLASS
// NO_VALIDATION
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// NON_EXISTENT_CLASS
// NO_VALIDATION
@@ -0,0 +1,129 @@
import java.lang.System;
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
@kotlin.Metadata()
public final class NonExistentClassWIthoutCorrectionKt {
}
////////////////////
import java.lang.System;
@kotlin.Metadata()
public final class NonExistentType {
@org.jetbrains.annotations.Nullable()
private static final error.NonExistentClass a = null;
@org.jetbrains.annotations.Nullable()
private static final java.util.List<error.NonExistentClass> b = null;
@org.jetbrains.annotations.NotNull()
private static final kotlin.jvm.functions.Function1<error.NonExistentClass, kotlin.Unit> c = null;
@org.jetbrains.annotations.Nullable()
private static final error.NonExistentClass d = null;
public static java.lang.String string2;
public static error.NonExistentClass coocoo;
public static error.NonExistentClass coocoo2;
public static error.NonExistentClass coocoo21;
public static error.NonExistentClass coocoo3;
public static error.NonExistentClass coocoo31;
@org.jetbrains.annotations.NotNull()
public static final NonExistentType INSTANCE = null;
private NonExistentType() {
super();
}
@org.jetbrains.annotations.Nullable()
public final error.NonExistentClass getA() {
return null;
}
@org.jetbrains.annotations.Nullable()
public final java.util.List<error.NonExistentClass> getB() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final kotlin.jvm.functions.Function1<error.NonExistentClass, kotlin.Unit> getC() {
return null;
}
@org.jetbrains.annotations.Nullable()
public final error.NonExistentClass getD() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getString2() {
return null;
}
public final void setString2(@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
@org.jetbrains.annotations.NotNull()
public final error.NonExistentClass getCoocoo() {
return null;
}
public final void setCoocoo(@org.jetbrains.annotations.NotNull()
error.NonExistentClass p0) {
}
@org.jetbrains.annotations.NotNull()
public final error.NonExistentClass getCoocoo2() {
return null;
}
public final void setCoocoo2(@org.jetbrains.annotations.NotNull()
error.NonExistentClass p0) {
}
@org.jetbrains.annotations.NotNull()
public final error.NonExistentClass getCoocoo21() {
return null;
}
public final void setCoocoo21(@org.jetbrains.annotations.NotNull()
error.NonExistentClass p0) {
}
@org.jetbrains.annotations.NotNull()
public final error.NonExistentClass getCoocoo3() {
return null;
}
public final void setCoocoo3(@org.jetbrains.annotations.NotNull()
error.NonExistentClass p0) {
}
@org.jetbrains.annotations.NotNull()
public final error.NonExistentClass getCoocoo31() {
return null;
}
public final void setCoocoo31(@org.jetbrains.annotations.NotNull()
error.NonExistentClass p0) {
}
@org.jetbrains.annotations.NotNull()
public final error.NonExistentClass a(@org.jetbrains.annotations.NotNull()
error.NonExistentClass a, @org.jetbrains.annotations.NotNull()
java.lang.String s) {
return null;
}
@org.jetbrains.annotations.NotNull()
public final error.NonExistentClass b(@org.jetbrains.annotations.NotNull()
java.lang.String s) {
return null;
}
}
////////////////////
package error;
public final class NonExistentClass {
}
@@ -0,0 +1,65 @@
import java.lang.System;
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
@kotlin.Metadata()
public final class NonExistentType {
@org.jetbrains.annotations.Nullable()
private static final ABCDEF a = null;
@org.jetbrains.annotations.Nullable()
private static final java.util.List<ABCDEF> b = null;
@org.jetbrains.annotations.NotNull()
private static final Function1<ABCDEF, kotlin.Unit> c = null;
@org.jetbrains.annotations.Nullable()
private static final ABCDEF<java.lang.String, Function1<java.util.List<ABCDEF>, kotlin.Unit>> d = null;
@org.jetbrains.annotations.NotNull()
public static final NonExistentType INSTANCE = null;
private NonExistentType() {
super();
}
@org.jetbrains.annotations.Nullable()
public final ABCDEF getA() {
return null;
}
@org.jetbrains.annotations.Nullable()
public final java.util.List<ABCDEF> getB() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final Function1<ABCDEF, kotlin.Unit> getC() {
return null;
}
@org.jetbrains.annotations.Nullable()
public final ABCDEF<java.lang.String, Function1<java.util.List<ABCDEF>, kotlin.Unit>> getD() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final Foo getFoo() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final ABCDEF a(@org.jetbrains.annotations.NotNull()
ABCDEF a, @org.jetbrains.annotations.NotNull()
java.lang.String s) {
return null;
}
@org.jetbrains.annotations.NotNull()
public final ABCDEF b(@org.jetbrains.annotations.NotNull()
java.lang.String s) {
return null;
}
}
////////////////////
package error;
public final class NonExistentClass {
}