Kapt: Support also erroneous super interface names

This commit is contained in:
Yan Zhulanow
2018-09-04 22:30:45 +03:00
parent dfff00d55f
commit c517b85de1
11 changed files with 449 additions and 73 deletions
@@ -1,14 +1,16 @@
// CORRECT_ERROR_TYPES
// EXPECTED_ERROR(kotlin:16:1) cannot find symbol
// EXPECTED_ERROR(kotlin:19:34) cannot find symbol
// EXPECTED_ERROR(kotlin:19:50) cannot find symbol
// EXPECTED_ERROR(kotlin:19:62) cannot find symbol
// EXPECTED_ERROR(kotlin:26:5) cannot find symbol
// EXPECTED_ERROR(kotlin:27:5) cannot find symbol
// EXPECTED_ERROR(kotlin:30:5) cannot find symbol
// EXPECTED_ERROR(kotlin:18:1) cannot find symbol
// EXPECTED_ERROR(kotlin:21:34) cannot find symbol
// EXPECTED_ERROR(kotlin:21:50) cannot find symbol
// EXPECTED_ERROR(kotlin:21:62) cannot find symbol
// EXPECTED_ERROR(kotlin:23:1) cannot find symbol
// EXPECTED_ERROR(kotlin:24:1) cannot find symbol
// EXPECTED_ERROR(kotlin:28:5) cannot find symbol
// EXPECTED_ERROR(kotlin:29:5) cannot find symbol
// EXPECTED_ERROR(kotlin:32:5) cannot find symbol
// EXPECTED_ERROR(kotlin:35:5) cannot find symbol
// EXPECTED_ERROR(kotlin:34:5) cannot find symbol
// EXPECTED_ERROR(kotlin:37:5) cannot find symbol
@file:Suppress("UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST", "NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION")
import kotlin.reflect.KClass
@@ -134,7 +134,7 @@ public final class ErrorInDeclarations {
import kotlin.reflect.KClass;
@kotlin.Metadata()
public final class ErrorInSupertype {
public final class ErrorInSupertype implements ABC {
public ErrorInSupertype() {
super();
@@ -147,7 +147,7 @@ public final class ErrorInSupertype {
import kotlin.reflect.KClass;
@kotlin.Metadata()
public final class ErrorInSupertype2 {
public final class ErrorInSupertype2 extends ABC<java.lang.String> {
public ErrorInSupertype2() {
super();
@@ -0,0 +1,7 @@
package test
internal annotation class Anno
@Anno
@Suppress("UNRESOLVED_REFERENCE")
internal class ClassWithParent: Foo(), Bar, Baz, CharSequence
@@ -0,0 +1,38 @@
package test;
import java.lang.System;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
}
////////////////////
package test;
import java.lang.System;
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
@kotlin.Metadata()
@Anno()
public final class ClassWithParent implements java.lang.CharSequence {
public ClassWithParent() {
super();
}
@java.lang.Override()
public final int length() {
return 0;
}
public abstract int getLength();
@java.lang.Override()
public final char charAt(int p0) {
return '\u0000';
}
public abstract char get(int p0);
}
@@ -0,0 +1,45 @@
// CORRECT_ERROR_TYPES
// NO_VALIDATION
@file:Suppress("UNRESOLVED_REFERENCE", "DELEGATION_NOT_TO_INTERFACE", "SUPERTYPE_NOT_INITIALIZED")
package test
interface Intf
open class Cl
class TFooBarBaz: Foo(), Bar, Baz
// Error, two ()
class TFooBarBaz2: Foo(), Bar(), Baz, Intf
class TFooBarBaz3 : Foo, Bar, Baz
class TFooBarBaz4() : Foo, Bar, Baz
class TFooBarBaz5() : Foo, Bar, Baz {
constructor(s: String) {}
}
class TFooBarBaz6 : Foo, Bar, Baz {
constructor(s: String) : super(s)
}
class TClBarBaz : Cl, Bar, Baz
class TBarBazCl : Bar, Baz, Cl
class TFooBar(val a: X) : Foo(), Bar by a, Intf
class TFooBar2(val a: X): Foo by a, Bar by a
class TxFooxBarxBaz : x.Foo(), x.Bar, x.Baz, Intf
// Error, two ()
class TxFooxBarxBaz2 : x.Foo(), x.Bar, x.Baz()
class Generics1 : Foo<String>()
class Generics2 : Foo<String>
class Generics3 : Foo<Bar, Baz, Boo<Baz, List<*>>, String>
@@ -0,0 +1,253 @@
package test;
import java.lang.System;
@kotlin.Metadata()
public class Cl {
public Cl() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class Generics1 extends Foo<java.lang.String> {
public Generics1() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class Generics2 implements Foo<java.lang.String> {
public Generics2() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class Generics3 implements Foo<Bar, Baz, Boo<Baz, java.util.List<?>>, java.lang.String> {
public Generics3() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public abstract interface Intf {
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TBarBazCl extends test.Cl implements Bar, Baz {
public TBarBazCl() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TClBarBaz extends test.Cl implements Bar, Baz {
public TClBarBaz() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TFooBar extends Foo implements Bar, test.Intf {
@org.jetbrains.annotations.NotNull()
private final X a = null;
@org.jetbrains.annotations.NotNull()
public final X getA() {
return null;
}
public TFooBar(@org.jetbrains.annotations.NotNull()
X a) {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TFooBar2 implements Foo, Bar {
@org.jetbrains.annotations.NotNull()
private final X a = null;
@org.jetbrains.annotations.NotNull()
public final X getA() {
return null;
}
public TFooBar2(@org.jetbrains.annotations.NotNull()
X a) {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TFooBarBaz extends Foo implements Bar, Baz {
public TFooBarBaz() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TFooBarBaz2 implements test.Intf {
public TFooBarBaz2() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TFooBarBaz3 implements Foo, Bar, Baz {
public TFooBarBaz3() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TFooBarBaz4 implements Foo, Bar, Baz {
public TFooBarBaz4() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TFooBarBaz5 implements Foo, Bar, Baz {
public TFooBarBaz5() {
super();
}
public TFooBarBaz5(@org.jetbrains.annotations.NotNull()
java.lang.String s) {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TFooBarBaz6 extends Foo implements Bar, Baz {
public TFooBarBaz6(@org.jetbrains.annotations.NotNull()
java.lang.String s) {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TxFooxBarxBaz extends x.Foo implements x.Bar, x.Baz, test.Intf {
public TxFooxBarxBaz() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TxFooxBarxBaz2 {
public TxFooxBarxBaz2() {
super();
}
}
@@ -1,30 +0,0 @@
package error;
public final class NonExistentClass {
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
@MyAnnotation()
public final class ClassWithParent extends FooBar {
public ClassWithParent() {
super();
}
}
////////////////////
package test;
import java.lang.System;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface MyAnnotation {
}
@@ -1,7 +0,0 @@
package test
internal annotation class MyAnnotation
@MyAnnotation
internal class ClassWithParent: FooBar() {
}