Added @ExpectLoadErrors annotations to test data.
Also, fixed syntax error in AddNullabilitySameJavaType.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class AddingNullability {
|
||||
@ExpectLoadError("Auto type 'jet.Int' is not-null, while type in alternative signature is nullable: 'Int?'")
|
||||
@KotlinSignature("fun foo() : Int?")
|
||||
public int foo() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
import org.jetbrains.jet.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,8 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class ExtraUpperBound {
|
||||
@ExpectLoadError("Extra upper bound #1 for type parameter A")
|
||||
@KotlinSignature("fun <A : Runnable> foo() : String where A : Cloneable")
|
||||
public <A extends Runnable> String foo() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class MissingUpperBound {
|
||||
@ExpectLoadError("Upper bound #1 for type parameter A is missing")
|
||||
@KotlinSignature("fun <A : Runnable> foo() : String")
|
||||
public <A extends Runnable & Cloneable> String foo() {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class NoFieldTypeRef {
|
||||
@ExpectLoadError("Field annotation for shouldn't have type reference")
|
||||
@KotlinSignature("var foo")
|
||||
public String foo;
|
||||
}
|
||||
|
||||
@@ -1,30 +1,12 @@
|
||||
/*
|
||||
* Copyright 2010-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
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;
|
||||
import org.jetbrains.jet.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,26 +1,10 @@
|
||||
/*
|
||||
* Copyright 2010-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class ReturnTypeMissing {
|
||||
@ExpectLoadError("Return type in alternative signature is missing, while in real signature it is 'jet.Int'")
|
||||
@KotlinSignature("fun foo(a : String)")
|
||||
public int foo(String a) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.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,10 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class SyntaxErrorInFieldAnnotation {
|
||||
@ExpectLoadError("Alternative signature has syntax error at 10: Type expected")
|
||||
@KotlinSignature("var foo : ")
|
||||
public String foo;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
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;
|
||||
import org.jetbrains.jet.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,10 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
import org.jetbrains.jet.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,13 +1,14 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
import org.jetbrains.jet.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,10 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class WrongFieldName {
|
||||
@ExpectLoadError("Field name mismatch, original: foo, alternative: bar")
|
||||
@KotlinSignature("var bar: String")
|
||||
public String foo;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.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,10 +1,11 @@
|
||||
package test;
|
||||
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class WrongReturnTypeStructure {
|
||||
@ExpectLoadError("'jet.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,10 +1,11 @@
|
||||
package test;
|
||||
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class WrongTypeName1 {
|
||||
@ExpectLoadError("Alternative signature type mismatch, expected: jet.Tuple0, actual: jet.String")
|
||||
@KotlinSignature("fun foo(a : String) : Unit")
|
||||
public String foo(String a) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package test;
|
||||
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class WrongTypeName2 {
|
||||
@ExpectLoadError("Alternative signature type mismatch, expected: Something.String, actual: jet.String")
|
||||
@KotlinSignature("fun foo(a : Something.String) : String")
|
||||
public String foo(String a) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package test;
|
||||
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class WrongTypeName3 {
|
||||
@ExpectLoadError("Alternative signature type mismatch, expected: List, actual: jet.String")
|
||||
@KotlinSignature("fun foo(a : String) : List")
|
||||
public String foo(String a) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
+2
-3
@@ -1,13 +1,12 @@
|
||||
package test;
|
||||
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.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<out B>, c: List<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) {
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,13 +1,12 @@
|
||||
package test;
|
||||
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class WrongTypeParameterBoundStructure2 {
|
||||
@ExpectLoadError("'jet.List<java.lang.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<out B>, c: List<in String?>) where B : List")
|
||||
public <A, B extends Runnable & List<Cloneable>> void foo(A a, List<? extends B> b, List<? super String> list) {
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package test;
|
||||
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.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<out B>)")
|
||||
public <A, B> void foo(A a, List<? extends B> b) {
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package test;
|
||||
|
||||
import java.lang.Number;
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class WrongTypeVariance {
|
||||
@ExpectLoadError("Variance mismatch, actual: in, in alternative signature: ")
|
||||
@KotlinSignature("fun copy(a : List<out Number>, b : List<Number>) : MutableList<Number>")
|
||||
public List<Number> copy(List<? extends Number> from, List<? super Number> to) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package test;
|
||||
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class WrongValueParameterStructure1 {
|
||||
@ExpectLoadError("'jet.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,10 +1,11 @@
|
||||
package test;
|
||||
|
||||
import java.lang.UnsupportedOperationException;
|
||||
import java.util.*;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class WrongValueParameterStructure2 {
|
||||
@ExpectLoadError("'jet.Map.Entry<jet.String?, jet.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,8 +1,10 @@
|
||||
package test;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.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();
|
||||
|
||||
+2
@@ -2,6 +2,7 @@ package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public interface AddNullabilityJavaSubtype {
|
||||
|
||||
@@ -11,6 +12,7 @@ public interface AddNullabilityJavaSubtype {
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
@ExpectLoadError("Alternative signature has 2 syntax errors, first is at 10: Expecting '(")
|
||||
@KotlinSignature("fun String? foo()")
|
||||
String foo();
|
||||
}
|
||||
|
||||
+2
@@ -3,6 +3,7 @@ package test;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import java.util.List;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public interface AddNullabilitySameGenericType1 {
|
||||
|
||||
@@ -12,6 +13,7 @@ public interface AddNullabilitySameGenericType1 {
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
@ExpectLoadError("Auto type 'jet.String' is not-null, while type in alternative signature is nullable: 'String?'")
|
||||
@KotlinSignature("fun foo(): MutableList<String?>")
|
||||
List<String> foo();
|
||||
}
|
||||
|
||||
+2
@@ -3,6 +3,7 @@ package test;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import java.util.List;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public interface AddNullabilitySameGenericType2 {
|
||||
|
||||
@@ -12,6 +13,7 @@ public interface AddNullabilitySameGenericType2 {
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
@ExpectLoadError("Auto type 'jet.MutableList<jet.String>' is not-null, while type in alternative signature is nullable: 'MutableList<String>?'")
|
||||
@KotlinSignature("fun foo(): MutableList<String>?")
|
||||
List<String> foo();
|
||||
}
|
||||
|
||||
+3
-1
@@ -3,6 +3,7 @@ package test;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import java.lang.CharSequence;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public interface AddNullabilitySameJavaType {
|
||||
|
||||
@@ -12,7 +13,8 @@ public interface AddNullabilitySameJavaType {
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
@KotlinSignature("fun CharSequence? foo()")
|
||||
@ExpectLoadError("Auto type 'jet.CharSequence' is not-null, while type in alternative signature is nullable: 'CharSequence?'")
|
||||
@KotlinSignature("fun foo(): CharSequence?")
|
||||
CharSequence foo();
|
||||
}
|
||||
}
|
||||
+2
@@ -2,6 +2,7 @@ package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -18,6 +19,7 @@ public interface TwoSuperclassesConflictingProjectionKinds {
|
||||
}
|
||||
|
||||
public interface Sub extends Super1, Super2 {
|
||||
@ExpectLoadError("Incompatible projection kinds in type arguments of super methods' return types: [CharSequence, out CharSequence]")
|
||||
public Collection<CharSequence> foo();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user