Remove KotlinSignature from tests, spec, delete tests with errors

This commit is contained in:
Alexander Udalov
2015-11-13 18:36:48 +03:00
parent 9cdeac7839
commit d472154ea7
153 changed files with 30 additions and 1876 deletions
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.resolve.jvm.kotlinSignature;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor;
@@ -43,8 +42,6 @@ import static org.jetbrains.kotlin.load.java.components.TypeUsage.TYPE_ARGUMENT;
import static org.jetbrains.kotlin.types.Variance.INVARIANT;
public class TypeTransformingVisitor extends KtVisitor<KotlinType, Void> {
private static boolean strictMode = false;
private final KotlinType originalType;
private final Map<TypeParameterDescriptor, TypeParameterDescriptorImpl> originalToAltTypeParameters;
@@ -195,13 +192,7 @@ public class TypeTransformingVisitor extends KtVisitor<KotlinType, Void> {
}
if (altProjectionKind != INVARIANT && parameter.getVariance() != INVARIANT) {
if (altProjectionKind == parameter.getVariance()) {
if (strictMode) {
throw new AlternativeSignatureMismatchException("Projection kind '%s' is redundant",
altProjectionKind, DescriptorUtils.getFqName(typeConstructor.getDeclarationDescriptor()));
}
else {
altProjectionKind = projectionKind;
}
altProjectionKind = projectionKind;
}
else {
throw new AlternativeSignatureMismatchException("Projection kind '%s' is conflicting with variance of %s",
@@ -241,9 +232,4 @@ public class TypeTransformingVisitor extends KtVisitor<KotlinType, Void> {
private static boolean isSameName(String qualifiedName, String fullyQualifiedName) {
return fullyQualifiedName.equals(qualifiedName) || fullyQualifiedName.endsWith("." + qualifiedName);
}
@TestOnly
public static void setStrictMode(boolean strictMode) {
TypeTransformingVisitor.strictMode = strictMode;
}
}
-4
View File
@@ -1,4 +0,0 @@
$TESTDATA_DIR$/wrongKotlinSignature.kt
$TESTDATA_DIR$/wrongKotlinSignatureLib
-d
$TEMP_DIR$
-6
View File
@@ -1,6 +0,0 @@
package test
import library.ClassWithWrongKotlinSignatures
val x = ClassWithWrongKotlinSignatures.foo()
val y = ClassWithWrongKotlinSignatures.bar()
-7
View File
@@ -1,7 +0,0 @@
error: the following Java entities have annotations with wrong Kotlin signatures:
library.ClassWithWrongKotlinSignatures java.lang.String foo():
Function names mismatch, original: foo, alternative: bar
library.ClassWithWrongKotlinSignatures java.lang.String bar():
Function names mismatch, original: bar, alternative: foo
COMPILATION_ERROR
@@ -1,15 +0,0 @@
package library
import jet.runtime.typeinfo.KotlinSignature;
public class ClassWithWrongKotlinSignatures {
@KotlinSignature("fun bar() : String")
public static String foo() {
throw new UnsupportedOperationException();
}
@KotlinSignature("fun foo() : String")
public static String bar() {
throw new UnsupportedOperationException();
}
}
@@ -1,12 +0,0 @@
// FILE: A.java
import kotlin.jvm.KotlinSignature;
public class A {
@KotlinSignature("fun A(x: Int, y: String)")
public A(int x, String y) {}
}
// FILE: 1.kt
val test = A(<!NAMED_ARGUMENTS_NOT_ALLOWED!>x<!> = 1, <!NAMED_ARGUMENTS_NOT_ALLOWED!>y<!> = "2")
@@ -1,10 +0,0 @@
package
public val test: A
public open class A {
public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String!)
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -1,18 +0,0 @@
// FILE: A.java
import kotlin.jvm.KotlinSignature;
interface A {
@KotlinSignature("fun foo(kotlinSignatureName: String): Unit")
void foo(String javaName);
}
// FILE: 1.kt
class B : A {
override fun foo(kotlinName: String) {}
}
class C : A {
override fun foo(kotlinSignatureName: String) {}
}
@@ -1,26 +0,0 @@
package
public/*package*/ /*synthesized*/ fun A(/*0*/ function: (kotlin.String!) -> kotlin.Unit): A
public/*package*/ interface A {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(/*0*/ javaName: kotlin.String!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class B : A {
public constructor B()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ fun foo(/*0*/ kotlinName: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class C : A {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ fun foo(/*0*/ kotlinSignatureName: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -1,11 +1,8 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import java.io.Serializable;
public class AllBoundsInWhen {
@KotlinSignature("fun <T> foo() where T: Serializable")
public <T extends Serializable> void foo() {
throw new UnsupportedOperationException();
}
@@ -1,9 +1,6 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
public class ArrayType {
@KotlinSignature("fun foo(): Array<String>")
public String[] foo() {
throw new UnsupportedOperationException();
}
@@ -1,10 +1,6 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class ConstructorWithNewTypeParams<T> {
@KotlinSignature("fun ConstructorWithNewTypeParams(first : Any)") // TODO: first : U doesn't work
public <U>ConstructorWithNewTypeParams(U first) {
public <U> ConstructorWithNewTypeParams(U first) {
}
}
@@ -1,10 +1,6 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class ConstructorWithParentTypeParams<T> {
@KotlinSignature("fun ConstructorWithParentTypeParams(first: T)")
public ConstructorWithParentTypeParams(T first) {
}
}
@@ -1,10 +1,8 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class ConstructorWithSeveralParams {
@KotlinSignature("fun ConstructorWithSeveralParams(integer : Int, intField : Int, collection: ArrayList<String>)")
public ConstructorWithSeveralParams(Integer integer, int intBasic, ArrayList<String> collection) {
}
}
@@ -1,10 +1,6 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class ConstructorWithoutParams {
@KotlinSignature("fun ConstructorWithoutParams()")
public ConstructorWithoutParams() {
}
}
@@ -2,10 +2,7 @@ package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class CustomProjectionKind {
@KotlinSignature("fun foo(): MutableList<out Number>")
public List<Number> foo() {
throw new UnsupportedOperationException();
}
@@ -1,13 +1,8 @@
package test;
import java.lang.String;
import java.lang.UnsupportedOperationException;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import kotlin.jvm.functions.*;
public class MethodWithFunctionTypes {
@KotlinSignature("fun foo(f : (String?) -> String) : (() -> String?)?")
public Function0<String> foo(Function1<String, String> f) {
throw new UnsupportedOperationException();
}
@@ -1,11 +1,8 @@
package test;
import java.lang.UnsupportedOperationException;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class MethodWithGenerics {
@KotlinSignature("fun foo(a : String, b : List<Entry<String?, String>?>) : String")
public String foo(String a, List<Map.Entry<String, String>> b) {
throw new UnsupportedOperationException();
}
@@ -1,11 +1,8 @@
package test;
import java.lang.UnsupportedOperationException;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class MethodWithMappedClasses {
@KotlinSignature("fun <T> copy(dest : MutableList<in T>, src : List<T>)")
public <T> void copy(List<? super T> dest, List<T> src) {
throw new UnsupportedOperationException();
}
@@ -1,14 +1,8 @@
package test;
import java.lang.UnsupportedOperationException;
import java.util.*;
import java.util.BitSet;
import java.util.List;
import jet.runtime.typeinfo.KotlinSignature;
public class MethodWithTypeParameters {
@KotlinSignature("fun <A, B : Runnable> foo(a : A, b : List<B>, c: MutableList<in String?>) where B : List<Cloneable>")
public <A, B extends Runnable & List<Cloneable>> void foo(A a, List<? extends B> b, List<? super String> list) {
}
}
@@ -1,15 +1,6 @@
package test;
import java.lang.String;
import java.lang.UnsupportedOperationException;
import java.util.*;
import java.util.BitSet;
import java.util.List;
import jet.runtime.typeinfo.KotlinSignature;
public class MethodWithVararg {
@KotlinSignature("fun foo(vararg s : String)")
public void foo(String... s) {
}
}
@@ -1,17 +1,9 @@
package test;
import java.lang.String;
import java.util.ArrayList;
import jet.runtime.typeinfo.KotlinSignature;
public class PropertyArrayTypes<T> {
@KotlinSignature("var arrayOfArrays : Array<Array<String>>")
public String[][] arrayOfArrays;
@KotlinSignature("var array : Array<String>")
public String[] array;
@KotlinSignature("var genericArray : Array<T>")
public T[] genericArray;
}
@@ -1,20 +1,13 @@
package test;
import java.lang.String;
import java.util.ArrayList;
import jet.runtime.typeinfo.KotlinSignature;
public class PropertyComplexTypes<T> {
@KotlinSignature("var genericType : T")
public T genericType;
@KotlinSignature("var listDefinedGeneric : ArrayList<String>")
public ArrayList<String> listDefinedGeneric;
@KotlinSignature("var listGeneric : ArrayList<T>")
public ArrayList<T> listGeneric;
@KotlinSignature("var listOfGenericList : ArrayList<ArrayList<T>>")
public ArrayList<ArrayList<T>> listOfGenericList;
}
@@ -1,12 +1,7 @@
package test;
import java.lang.String;
import jet.runtime.typeinfo.KotlinSignature;
public class PropertySimpleType {
@KotlinSignature("var fieldOne : String")
public String fieldOne;
@KotlinSignature("var fieldTwo : String?")
public String fieldTwo;
}
@@ -1,9 +1,6 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
public final class StarProjection {
@KotlinSignature("fun foo(): MyClass<*>")
public final MyClass<?> foo() {
throw new UnsupportedOperationException();
}
@@ -1,12 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class AddingNullability {
@ExpectLoadError("Auto type 'kotlin.Int' is not-null, while type in alternative signature is nullable: 'Int?'")
@KotlinSignature("fun foo() : Int?")
public int foo() {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class AddingNullability {
public constructor AddingNullability()
public open fun foo(): kotlin.Int
}
@@ -1,15 +0,0 @@
package test;
import java.lang.Number;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class ConflictingProjectionKind {
@ExpectLoadError("Projection kind 'in' is conflicting with variance of kotlin.List")
@KotlinSignature("fun foo(list: List<in Number>)")
public void foo(List<Number> list) {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class ConflictingProjectionKind {
public constructor ConflictingProjectionKind()
public open fun foo(/*0*/ p0: kotlin.(Mutable)List<kotlin.Number!>!): kotlin.Unit
}
@@ -1,10 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class ExplicitFieldGettersAndSetters {
@ExpectLoadError("Field annotation for shouldn't have getters and setters")
@KotlinSignature("var foo: String get() { return \"hello\" }")
public String foo;
}
@@ -1,6 +0,0 @@
package test
public open class ExplicitFieldGettersAndSetters {
public constructor ExplicitFieldGettersAndSetters()
public final var foo: kotlin.String!
}
@@ -1,12 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class ExtraUpperBound {
@ExpectLoadError("Upper bound number mismatch for A. Expected 1, but found 2")
@KotlinSignature("fun <A : Runnable> foo() : String where A : Cloneable")
public <A extends Runnable> String foo() {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class ExtraUpperBound {
public constructor ExtraUpperBound()
public open fun </*0*/ A : java.lang.Runnable!> foo(): kotlin.String!
}
@@ -1,12 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class MissingUpperBound {
@ExpectLoadError("Upper bound number mismatch for A. Expected 2, but found 1")
@KotlinSignature("fun <A : Runnable> foo() : String")
public <A extends Runnable & Cloneable> String foo() {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class MissingUpperBound {
public constructor MissingUpperBound()
public open fun </*0*/ A : java.lang.Runnable!> foo(): kotlin.String! where A : kotlin.Cloneable!
}
@@ -1,10 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class NoFieldTypeRef {
@ExpectLoadError("Field annotation for shouldn't have type reference")
@KotlinSignature("var foo")
public String foo;
}
@@ -1,6 +0,0 @@
package test
public open class NoFieldTypeRef {
public constructor NoFieldTypeRef()
public final var foo: kotlin.String!
}
@@ -1,13 +0,0 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class NotVarargReplacedWithVararg {
@ExpectLoadError("Parameter in method signature is not vararg, but in alternative signature it is vararg")
@KotlinSignature("fun foo(vararg s : String)")
public void foo(String s) {
}
}
@@ -1,6 +0,0 @@
package test
public open class NotVarargReplacedWithVararg {
public constructor NotVarargReplacedWithVararg()
public open fun foo(/*0*/ p0: kotlin.String!): kotlin.Unit
}
@@ -1,14 +0,0 @@
package test;
import java.lang.Number;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class RedundantProjectionKind {
@KotlinSignature("fun foo(list: List<out Number>)")
public void foo(List<Number> list) {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class RedundantProjectionKind {
public constructor RedundantProjectionKind()
public open fun foo(/*0*/ p0: kotlin.(Mutable)List<kotlin.Number!>!): kotlin.Unit
}
@@ -1,12 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class ReturnTypeMissing {
@ExpectLoadError("Return type in alternative signature is missing, while in real signature it is 'kotlin.Int'")
@KotlinSignature("fun foo(a : String)")
public int foo(String a) {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class ReturnTypeMissing {
public constructor ReturnTypeMissing()
public open fun foo(/*0*/ p0: kotlin.String!): kotlin.Int
}
@@ -1,12 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class SyntaxError {
@ExpectLoadError("Alternative signature has 2 syntax errors, first is at 8: Expecting a parameter declaration")
@KotlinSignature("fun foo(,) : Int")
public Integer foo() {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class SyntaxError {
public constructor SyntaxError()
public open fun foo(): kotlin.Int!
}
@@ -1,10 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class SyntaxErrorInFieldAnnotation {
@ExpectLoadError("Alternative signature has syntax error at 10: Type expected")
@KotlinSignature("var foo : ")
public String foo;
}
@@ -1,6 +0,0 @@
package test
public open class SyntaxErrorInFieldAnnotation {
public constructor SyntaxErrorInFieldAnnotation()
public final var foo: kotlin.String!
}
@@ -1,13 +0,0 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class VarargReplacedWithNotVararg {
@ExpectLoadError("Parameter in method signature is vararg, but in alternative signature it is not")
@KotlinSignature("fun foo(s : String)")
public void foo(String... s) {
}
}
@@ -1,6 +0,0 @@
package test
public open class VarargReplacedWithNotVararg {
public constructor VarargReplacedWithNotVararg()
public open fun foo(/*0*/ vararg p0: kotlin.String! /*kotlin.Array<(out) kotlin.String!>!*/): kotlin.Unit
}
@@ -1,10 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongFieldInitializer {
@ExpectLoadError("Default value is not expected in annotation for field")
@KotlinSignature("var foo : String = \"Test\"")
public String foo;
}
@@ -1,6 +0,0 @@
package test
public open class WrongFieldInitializer {
public constructor WrongFieldInitializer()
public final var foo: kotlin.String!
}
@@ -1,14 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongFieldMutability {
@ExpectLoadError("Wrong mutability in annotation for field")
@KotlinSignature("val fooNotFinal : String")
public String fooNotFinal;
@ExpectLoadError("Wrong mutability in annotation for field")
@KotlinSignature("var fooFinal : String")
public final String fooFinal = "Test";
}
@@ -1,7 +0,0 @@
package test
public open class WrongFieldMutability {
public constructor WrongFieldMutability()
public final val fooFinal: kotlin.String! = "Test"
public final var fooNotFinal: kotlin.String!
}
@@ -1,10 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongFieldName {
@ExpectLoadError("Field name mismatch, original: foo, alternative: bar")
@KotlinSignature("var bar: String")
public String foo;
}
@@ -1,6 +0,0 @@
package test
public open class WrongFieldName {
public constructor WrongFieldName()
public final var foo: kotlin.String!
}
@@ -1,12 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongMethodName {
@ExpectLoadError("Function names mismatch, original: foo, alternative: bar")
@KotlinSignature("fun bar() : String")
public String foo() {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class WrongMethodName {
public constructor WrongMethodName()
public open fun foo(): kotlin.String!
}
@@ -1,14 +1,8 @@
package test;
import java.lang.Number;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongProjectionKind {
//@ExpectLoadError("Projection kind mismatch, actual: out, in alternative signature: ")
@KotlinSignature("fun copy(a : Array<out Number>, b : Array<Number>) : MutableList<Number>")
public List<Number> copy(Number[] from, Number[] to) {
throw new UnsupportedOperationException();
}
@@ -1,12 +1,8 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongReturnTypeStructure {
//@ExpectLoadError("'kotlin.String?' type in method signature has 0 type arguments, while 'String<Int>' in alternative signature has 1 of them")
@KotlinSignature("fun foo(a : String, b : List<Map.Entry<String?, String>?>) : String<Int>?")
public String foo(String a, List<Map.Entry<String, String>> b) {
throw new UnsupportedOperationException();
}
@@ -1,13 +0,0 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongTypeName1 {
@ExpectLoadError("Alternative signature type mismatch, expected: Unit, actual: kotlin.String")
@KotlinSignature("fun foo(a : String) : Unit")
public String foo(String a) {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class WrongTypeName1 {
public constructor WrongTypeName1()
public open fun foo(/*0*/ p0: kotlin.String!): kotlin.String!
}
@@ -1,13 +0,0 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongTypeName2 {
@ExpectLoadError("Alternative signature type mismatch, expected: Something.String, actual: kotlin.String")
@KotlinSignature("fun foo(a : Something.String) : String")
public String foo(String a) {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class WrongTypeName2 {
public constructor WrongTypeName2()
public open fun foo(/*0*/ p0: kotlin.String!): kotlin.String!
}
@@ -1,13 +0,0 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongTypeName3 {
@ExpectLoadError("Alternative signature type mismatch, expected: List, actual: kotlin.String")
@KotlinSignature("fun foo(a : String) : List")
public String foo(String a) {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class WrongTypeName3 {
public constructor WrongTypeName3()
public open fun foo(/*0*/ p0: kotlin.String!): kotlin.String!
}
@@ -2,12 +2,7 @@ package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongTypeParameterBoundStructure1 {
//@ExpectLoadError("'java.lang.Runnable?' type in method signature has 0 type arguments, while 'Runnable<Int>' in alternative signature has 1 of them")
@KotlinSignature("fun <A, B : Runnable<Int>> foo(a : A, b : List<B>) where B : List<Cloneable>")
public <A, B extends Runnable & List<Cloneable>> void foo(A a, List<? extends B> b) {
}
}
@@ -1,13 +0,0 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongTypeParameterBoundStructure2 {
//@ExpectLoadError("'kotlin.List<kotlin.Cloneable>?' type in method signature has 1 type arguments, while 'List' in alternative signature has 0 of them")
@KotlinSignature("fun <A, B : Runnable> foo(a : A, b : List<B>) where B : List")
public <A, B extends Runnable & List<Cloneable>> void foo(A a, List<? extends B> b) {
}
}
@@ -1,6 +0,0 @@
package test
public open class WrongTypeParameterBoundStructure2 {
public constructor WrongTypeParameterBoundStructure2()
public open fun </*0*/ A : kotlin.Any!, /*1*/ B : java.lang.Runnable!> foo(/*0*/ p0: A!, /*1*/ p1: (kotlin.MutableList<out B!>..kotlin.List<B!>?)): kotlin.Unit where B : kotlin.(Mutable)List<kotlin.Cloneable!>!
}
@@ -1,13 +0,0 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongTypeParametersCount {
@ExpectLoadError("Method signature has 2 type parameters, but alternative signature has 3")
@KotlinSignature("fun <A, B, C> foo(a : A, b : List<B>)")
public <A, B> void foo(A a, List<? extends B> b) {
}
}
@@ -1,6 +0,0 @@
package test
public open class WrongTypeParametersCount {
public constructor WrongTypeParametersCount()
public open fun </*0*/ A : kotlin.Any!, /*1*/ B : kotlin.Any!> foo(/*0*/ p0: A!, /*1*/ p1: (kotlin.MutableList<out B!>..kotlin.List<B!>?)): kotlin.Unit
}
@@ -1,12 +1,8 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongValueParameterStructure1 {
//@ExpectLoadError("'kotlin.String?' type in method signature has 0 type arguments, while 'String<Int?>' in alternative signature has 1 of them")
@KotlinSignature("fun foo(a : String<Int?>, b : List<Map.Entry<String?, String>?>) : String")
public String foo(String a, List<Map.Entry<String, String>> b) {
throw new UnsupportedOperationException();
}
@@ -1,13 +0,0 @@
package test;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongValueParameterStructure2 {
//@ExpectLoadError("'kotlin.Map.Entry<kotlin.String, kotlin.String>' type in method signature has 2 type arguments, while 'Map.Entry<String?>' in alternative signature has 1 of them")
@KotlinSignature("fun foo(a : String, b : List<Map.Entry<String?>?>) : String")
public String foo(String a, List<Map.Entry<String, String>> b) {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class WrongValueParameterStructure2 {
public constructor WrongValueParameterStructure2()
public open fun foo(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.(Mutable)List<kotlin.(Mutable)Map.(Mutable)Entry<kotlin.String!, kotlin.String!>!>!): kotlin.String!
}
@@ -1,12 +0,0 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public class WrongValueParametersCount {
@ExpectLoadError("Method signature has 0 value parameters, but alternative signature has 1")
@KotlinSignature("fun foo(a : Int) : Int")
public Integer foo() {
throw new UnsupportedOperationException();
}
}
@@ -1,6 +0,0 @@
package test
public open class WrongValueParametersCount {
public constructor WrongValueParametersCount()
public open fun foo(): kotlin.Int!
}
@@ -1,28 +1,20 @@
package test;
import java.util.List;
import jet.runtime.typeinfo.KotlinSignature;
public interface PropagateTypeArgumentNullable {
public interface Super {
@KotlinSignature("fun outS(p : List<String?>)")
void outS(List<String> p);
@KotlinSignature("fun invOutS(p : MutableList<List<String?>>)")
void invOutS(List<List<String>> p);
@KotlinSignature("fun outOutS(p : List<List<String?>>)")
void outOutS(List<List<String>> p);
@KotlinSignature("fun outR() : List<String?>")
List<String> outR();
@KotlinSignature("fun invR() : MutableList<String?>")
List<String> invR();
@KotlinSignature("fun invOutR() : MutableList<List<String?>>")
List<List<String>> invOutR();
}
@@ -1,22 +1,16 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
import java.util.*;
public interface ChangeProjectionKind1 {
public interface Super {
@KotlinSignature("fun foo(p: MutableList<in String>)")
void foo(List<String> p);
void dummy(); // to avoid loading as SAM interface
}
public interface Sub extends Super {
//@ExpectLoadError("Projection kind mismatch, actual: in, in alternative signature: ")
@KotlinSignature("fun foo(p: MutableList<String>)")
void foo(List<String> p);
}
}
@@ -1,22 +0,0 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
import java.util.*;
public interface ChangeProjectionKind2 {
public interface Super {
@KotlinSignature("fun foo(p: MutableList<String>)")
void foo(List<String> p);
void dummy(); // to avoid loading as SAM interface
}
public interface Sub extends Super {
//@ExpectLoadError("Parameter type changed for method which overrides another: MutableList<in String>, was: MutableList<String>")
@KotlinSignature("fun foo(p: MutableList<in String>)")
void foo(List<String> p);
}
}
@@ -1,14 +0,0 @@
package test
public interface ChangeProjectionKind2 {
public interface Sub : test.ChangeProjectionKind2.Super {
public abstract override /*1*/ /*fake_override*/ fun dummy(): kotlin.Unit
public abstract override /*1*/ fun foo(/*0*/ p0: kotlin.(Mutable)List<kotlin.String!>!): kotlin.Unit
}
public interface Super {
public abstract fun dummy(): kotlin.Unit
public abstract fun foo(/*0*/ p0: kotlin.(Mutable)List<kotlin.String!>!): kotlin.Unit
}
}
@@ -1,12 +1,8 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
public interface DeeplySubstitutedClassParameter {
public interface Super<T> {
@KotlinSignature("fun foo(t: T)")
void foo(T p);
void dummy(); // to avoid loading as SAM interface
@@ -1,12 +1,8 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
public interface DeeplySubstitutedClassParameter2 {
public interface Super<T> {
@KotlinSignature("fun foo(t: T)")
void foo(T p);
void dummy(); // to avoid loading as SAM interface
@@ -1,20 +0,0 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
import java.util.*;
public interface InheritMutability {
public interface Super {
@KotlinSignature("fun foo(p: MutableList<String>)")
void foo(List<String> p);
void dummy(); // to avoid loading as SAM interface
}
public interface Sub extends Super {
void foo(List<String> p);
}
}
@@ -1,14 +0,0 @@
package test
public interface InheritMutability {
public interface Sub : test.InheritMutability.Super {
public abstract override /*1*/ /*fake_override*/ fun dummy(): kotlin.Unit
public abstract override /*1*/ fun foo(/*0*/ p0: kotlin.(Mutable)List<kotlin.String!>!): kotlin.Unit
}
public interface Super {
public abstract fun dummy(): kotlin.Unit
public abstract fun foo(/*0*/ p0: kotlin.(Mutable)List<kotlin.String!>!): kotlin.Unit
}
}
@@ -1,11 +1,8 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
public interface InheritNotVarargNotNull {
public interface Super {
@KotlinSignature("fun foo(p: Array<out String>)")
void foo(String[] p);
void dummy(); // to avoid loading as SAM interface
@@ -1,21 +0,0 @@
//ALLOW_AST_ACCESS
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
import java.util.*;
public interface InheritProjectionKind {
public interface Super {
@KotlinSignature("fun foo(p: MutableList<in String>)")
void foo(List<String> p);
void dummy(); // to avoid loading as SAM interface
}
public interface Sub extends Super {
void foo(List<String> p);
}
}
@@ -1,14 +0,0 @@
package test
public interface InheritProjectionKind {
public interface Sub : test.InheritProjectionKind.Super {
public abstract override /*1*/ /*fake_override*/ fun dummy(): kotlin.Unit
public abstract override /*1*/ fun foo(/*0*/ p0: kotlin.(Mutable)List<kotlin.String!>!): kotlin.Unit
}
public interface Super {
public abstract fun dummy(): kotlin.Unit
public abstract fun foo(/*0*/ p0: kotlin.(Mutable)List<kotlin.String!>!): kotlin.Unit
}
}
@@ -1,20 +0,0 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
import java.util.*;
public interface InheritReadOnliness {
public interface Super {
@KotlinSignature("fun foo(p: List<String>)")
void foo(List<String> p);
void dummy(); // to avoid loading as SAM interface
}
public interface Sub extends Super {
void foo(List<String> p);
}
}
@@ -1,14 +0,0 @@
package test
public interface InheritReadOnliness {
public interface Sub : test.InheritReadOnliness.Super {
public abstract override /*1*/ /*fake_override*/ fun dummy(): kotlin.Unit
public abstract override /*1*/ fun foo(/*0*/ p0: kotlin.(Mutable)List<kotlin.String!>!): kotlin.Unit
}
public interface Super {
public abstract fun dummy(): kotlin.Unit
public abstract fun foo(/*0*/ p0: kotlin.(Mutable)List<kotlin.String!>!): kotlin.Unit
}
}
@@ -1,11 +1,8 @@
package test;
import jet.runtime.typeinfo.KotlinSignature;
public interface InheritVarargNotNull {
public interface Super {
@KotlinSignature("fun foo(vararg p: String)")
void foo(String... p);
void dummy(); // to avoid loading as SAM interface
@@ -1,7 +1,6 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
// See SubclassFromGenericAndNot, as well
public interface Kt3302 {
@@ -12,7 +11,6 @@ public interface Kt3302 {
}
public interface LinkedHashMap<K, V> {
@KotlinSignature("fun put(key : K, value : V) : V?")
public V put(K key, V value);
void dummy(); // to avoid loading as SAM interface
@@ -1,22 +1,16 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
import java.util.*;
public interface MutableToReadOnly {
public interface Super {
@KotlinSignature("fun foo(p: MutableList<String>)")
void foo(List<String> p);
void dummy(); // to avoid loading as SAM interface
}
public interface Sub extends Super {
//@ExpectLoadError("Parameter type changed for method which overrides another: List<String>, was: MutableList<String>")
@KotlinSignature("fun foo(p: List<String>)")
void foo(List<String> p);
}
}
@@ -1,8 +1,6 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public interface NotNullToNullable {
@@ -13,8 +11,6 @@ public interface NotNullToNullable {
}
public interface Sub extends Super {
//@ExpectLoadError("Auto type 'kotlin.String' is not-null, while type in alternative signature is nullable: 'String?'")
@KotlinSignature("fun foo(p: String?)")
void foo(String p);
}
}
@@ -1,8 +1,6 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public interface NullableToNotNull {
@@ -13,7 +11,6 @@ public interface NullableToNotNull {
}
public interface Sub extends Super {
//@ExpectLoadError("In superclass type is nullable: [String?], in subclass it is not: String")
void foo(@NotNull String p);
}
}
@@ -1,21 +1,16 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public interface NullableToNotNullKotlinSignature {
public interface Super {
@KotlinSignature("fun foo(p: String?)")
void foo(String p);
void dummy(); // to avoid loading as SAM interface
}
public interface Sub extends Super {
//@ExpectLoadError("Parameter type changed for method which overrides another: String, was: String?")
@KotlinSignature("fun foo(p: String)")
void foo(String p);
}
}
@@ -1,22 +1,17 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
import java.util.*;
public interface ReadOnlyToMutable {
public interface Super {
@KotlinSignature("fun foo(p: List<String>)")
void foo(List<String> p);
void dummy(); // to avoid loading as SAM interface
}
public interface Sub extends Super {
//@ExpectLoadError("Parameter type changed for method which overrides another: MutableList<String>, was: List<String>")
@KotlinSignature("fun foo(p: MutableList<String>)")
void foo(List<String> p);
}
}
@@ -1,7 +1,6 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
// Extracted from KT-3302, see Kt3302 test, as well
public interface SubclassFromGenericAndNot {
@@ -13,7 +12,6 @@ public interface SubclassFromGenericAndNot {
}
public interface Generic<T> {
@KotlinSignature("fun foo(key : T)")
public void foo(T key);
void dummy(); // to avoid loading as SAM interface
@@ -1,12 +1,8 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
public interface SubstitutedClassParameter {
public interface Super<T> {
@KotlinSignature("fun foo(t: T)")
void foo(T p);
void dummy(); // to avoid loading as SAM interface
@@ -1,19 +1,14 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
public interface SubstitutedClassParameters {
public interface Super1<T> {
@KotlinSignature("fun foo(t: T)")
void foo(T p);
void dummy(); // to avoid loading as SAM interface
}
public interface Super2<E> {
@KotlinSignature("fun foo(t: E)")
void foo(E p);
void dummy(); // to avoid loading as SAM interface
@@ -1,8 +1,6 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public interface AddNullabilityJavaSubtype {
@@ -14,8 +12,6 @@ public interface AddNullabilityJavaSubtype {
}
public interface Sub extends Super {
//@ExpectLoadError("Auto type 'kotlin.String' is not-null, while type in alternative signature is nullable: 'String?'")
@KotlinSignature("fun foo(): String?")
String foo();
}
}
@@ -1,22 +1,16 @@
package test;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.kotlin.jvm.compiler.annotation.ExpectLoadError;
public interface AddNullabilitySameGenericType1 {
public interface Super {
@KotlinSignature("fun foo(): MutableList<String>")
List<String> foo();
void dummy(); // to avoid loading as SAM interface
}
public interface Sub extends Super {
//@ExpectLoadError("Return type is changed to not subtype for method which overrides another: MutableList<String?>, was: MutableList<String>")
@KotlinSignature("fun foo(): MutableList<String?>")
List<String> foo();
}
}

Some files were not shown because too many files have changed in this diff Show More