Supported propagation of upper bounds of method type parameters.
#KT-2776 in progress
This commit is contained in:
+59
-1
@@ -39,24 +39,34 @@ import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import java.util.*;
|
||||
|
||||
public class SignaturesPropagationData {
|
||||
private final List<TypeParameterDescriptor> modifiedTypeParameters;
|
||||
private final JavaDescriptorResolver.ValueParameterDescriptors modifiedValueParameters;
|
||||
private final JetType modifiedReturnType;
|
||||
|
||||
private final List<String> signatureErrors = Lists.newArrayList();
|
||||
private final List<FunctionDescriptor> superFunctions;
|
||||
private final Map<TypeParameterDescriptor, TypeParameterDescriptorImpl> autoTypeParameterToModified;
|
||||
|
||||
public SignaturesPropagationData(
|
||||
@NotNull JetType autoReturnType, // type built by JavaTypeTransformer from Java signature and @NotNull annotations
|
||||
@NotNull JavaDescriptorResolver.ValueParameterDescriptors autoValueParameters, // descriptors built by parameters resolver
|
||||
@NotNull List<TypeParameterDescriptor> autoTypeParameters, // descriptors built by signature resolver
|
||||
@NotNull PsiMethodWrapper method,
|
||||
@NotNull BindingTrace trace
|
||||
) {
|
||||
superFunctions = getSuperFunctionsForMethod(method, trace);
|
||||
|
||||
autoTypeParameterToModified = SignaturesUtil.recreateTypeParametersAndReturnMapping(autoTypeParameters);
|
||||
|
||||
modifiedTypeParameters = modifyTypeParametersAccordingToSuperMethods(autoTypeParameters);
|
||||
modifiedReturnType = modifyReturnTypeAccordingToSuperMethods(autoReturnType);
|
||||
modifiedValueParameters = modifyValueParametersAccordingToSuperMethods(autoValueParameters);
|
||||
}
|
||||
|
||||
public List<TypeParameterDescriptor> getModifiedTypeParameters() {
|
||||
return modifiedTypeParameters;
|
||||
}
|
||||
|
||||
public JavaDescriptorResolver.ValueParameterDescriptors getModifiedValueParameters() {
|
||||
return modifiedValueParameters;
|
||||
}
|
||||
@@ -91,6 +101,41 @@ public class SignaturesPropagationData {
|
||||
return modifyTypeAccordingToSuperMethods(autoType, typesFromSuperMethods, true);
|
||||
}
|
||||
|
||||
private List<TypeParameterDescriptor> modifyTypeParametersAccordingToSuperMethods(List<TypeParameterDescriptor> autoTypeParameters) {
|
||||
List<TypeParameterDescriptor> result = Lists.newArrayList();
|
||||
|
||||
for (TypeParameterDescriptor autoParameter : autoTypeParameters) {
|
||||
int index = autoParameter.getIndex();
|
||||
TypeParameterDescriptorImpl modifiedTypeParameter = autoTypeParameterToModified.get(autoParameter);
|
||||
|
||||
List<Iterator<JetType>> upperBoundFromSuperFunctionsIterators = Lists.newArrayList();
|
||||
for (FunctionDescriptor superFunction : superFunctions) {
|
||||
upperBoundFromSuperFunctionsIterators.add(superFunction.getTypeParameters().get(index).getUpperBounds().iterator());
|
||||
}
|
||||
|
||||
for (JetType autoUpperBound : autoParameter.getUpperBounds()) {
|
||||
List<JetType> upperBoundsFromSuperFunctions = Lists.newArrayList();
|
||||
|
||||
for (Iterator<JetType> iterator : upperBoundFromSuperFunctionsIterators) {
|
||||
assert iterator.hasNext();
|
||||
upperBoundsFromSuperFunctions.add(iterator.next());
|
||||
}
|
||||
|
||||
JetType modifiedUpperBound = modifyTypeAccordingToSuperMethods(autoUpperBound, upperBoundsFromSuperFunctions, false);
|
||||
modifiedTypeParameter.addUpperBound(modifiedUpperBound);
|
||||
}
|
||||
|
||||
for (Iterator<JetType> iterator : upperBoundFromSuperFunctionsIterators) {
|
||||
assert !iterator.hasNext();
|
||||
}
|
||||
|
||||
modifiedTypeParameter.setInitialized();
|
||||
result.add(modifiedTypeParameter);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private JavaDescriptorResolver.ValueParameterDescriptors modifyValueParametersAccordingToSuperMethods(
|
||||
@NotNull JavaDescriptorResolver.ValueParameterDescriptors parameters // descriptors built by parameters resolver
|
||||
) {
|
||||
@@ -126,7 +171,16 @@ public class SignaturesPropagationData {
|
||||
));
|
||||
}
|
||||
|
||||
return new JavaDescriptorResolver.ValueParameterDescriptors(parameters.getReceiverType(), resultParameters);
|
||||
JetType originalReceiverType = parameters.getReceiverType();
|
||||
if (originalReceiverType != null) {
|
||||
JetType substituted = SignaturesUtil.createSubstitutorForFunctionTypeParameters(autoTypeParameterToModified)
|
||||
.substitute(originalReceiverType, Variance.INVARIANT);
|
||||
assert substituted != null;
|
||||
return new JavaDescriptorResolver.ValueParameterDescriptors(substituted, resultParameters);
|
||||
}
|
||||
else {
|
||||
return new JavaDescriptorResolver.ValueParameterDescriptors(null, resultParameters);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<FunctionDescriptor> getSuperFunctionsForMethod(
|
||||
@@ -414,6 +468,10 @@ public class SignaturesPropagationData {
|
||||
ClassifierDescriptor classifier = autoType.getConstructor().getDeclarationDescriptor();
|
||||
if (!(classifier instanceof ClassDescriptor)) {
|
||||
assert classifier != null : "no declaration descriptor for type " + autoType;
|
||||
|
||||
if (classifier instanceof TypeParameterDescriptor && autoTypeParameterToModified.containsKey(classifier)) {
|
||||
return autoTypeParameterToModified.get(classifier);
|
||||
}
|
||||
return classifier;
|
||||
}
|
||||
ClassDescriptor clazz = (ClassDescriptor) classifier;
|
||||
|
||||
+2
-1
@@ -142,11 +142,12 @@ public final class JavaFunctionResolver {
|
||||
final List<String> signatureErrors = Lists.newArrayList();
|
||||
|
||||
SignaturesPropagationData signaturesPropagationData =
|
||||
new SignaturesPropagationData(returnType, valueParameterDescriptors, method, trace);
|
||||
new SignaturesPropagationData(returnType, valueParameterDescriptors, methodTypeParameters, method, trace);
|
||||
List<FunctionDescriptor> superFunctions = signaturesPropagationData.getSuperFunctions();
|
||||
|
||||
returnType = signaturesPropagationData.getModifiedReturnType();
|
||||
valueParameterDescriptors = signaturesPropagationData.getModifiedValueParameters();
|
||||
methodTypeParameters = signaturesPropagationData.getModifiedTypeParameters();
|
||||
|
||||
signatureErrors.addAll(signaturesPropagationData.getSignatureErrors());
|
||||
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
public interface InheritMutability {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A: MutableList<String>> foo(a: A)")
|
||||
<A extends List<String>> void foo(A a);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B extends List<String>> void foo(B b);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait InheritMutability: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A: MutableList<String>> foo(p0: A)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B: MutableList<String>> foo(p0: B)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.InheritMutability : java.lang.Object {
|
||||
public abstract trait test.InheritMutability.Sub : test.InheritMutability.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.MutableList<jet.String>>foo(/*0*/ p0: B): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.InheritMutability.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.MutableList<jet.String>>foo(/*0*/ p0: A): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface InheritNullability {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A: CharSequence> foo(a: A)")
|
||||
<A extends CharSequence> void foo(A a);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B extends CharSequence> void foo(B b);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait InheritNullability: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A: CharSequence> foo(p0: A)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B: CharSequence> foo(p0: B)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.InheritNullability : java.lang.Object {
|
||||
public abstract trait test.InheritNullability.Sub : test.InheritNullability.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.CharSequence>foo(/*0*/ p0: B): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.InheritNullability.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.CharSequence>foo(/*0*/ p0: A): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
import java.util.*;
|
||||
|
||||
public interface InheritReadOnliness {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A: List<String>> foo(a: A)")
|
||||
<A extends List<String>> void foo(A a);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B extends List<String>> void foo(B b);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait InheritReadOnliness: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A: List<String>> foo(p0: A)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B: List<String>> foo(p0: B)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.InheritReadOnliness : java.lang.Object {
|
||||
public abstract trait test.InheritReadOnliness.Sub : test.InheritReadOnliness.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.List<jet.String>>foo(/*0*/ p0: B): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.InheritReadOnliness.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.List<jet.String>>foo(/*0*/ p0: A): jet.Tuple0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.Cloneable;
|
||||
|
||||
public interface TwoBounds {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A: CharSequence> foo(a: A) where A: Cloneable")
|
||||
<A extends CharSequence & Cloneable> void foo(A a);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B extends CharSequence & Cloneable> void foo(B b);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait TwoBounds: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A: CharSequence> foo(p0: A) where A: Cloneable
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B: CharSequence> foo(p0: B) where B: Cloneable
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TwoBounds : java.lang.Object {
|
||||
public abstract trait test.TwoBounds.Sub : test.TwoBounds.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : java.lang.Cloneable & jet.CharSequence>foo(/*0*/ p0: B): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.TwoBounds.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : java.lang.Cloneable & jet.CharSequence>foo(/*0*/ p0: A): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface TwoSuperclasses {
|
||||
|
||||
public interface Super1 {
|
||||
@KotlinSignature("fun <A: CharSequence> foo(a: A)")
|
||||
<A extends CharSequence> void foo(A a);
|
||||
}
|
||||
|
||||
public interface Super2 {
|
||||
@KotlinSignature("fun <B: CharSequence> foo(a: B)")
|
||||
<B extends CharSequence> void foo(B a);
|
||||
}
|
||||
|
||||
public interface Sub extends Super1, Super2 {
|
||||
<C extends CharSequence> void foo(C c);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclasses: Object {
|
||||
|
||||
public trait Super1: Object {
|
||||
public fun <A: CharSequence> foo(p0: A)
|
||||
}
|
||||
|
||||
public trait Super2: Object {
|
||||
public fun <B: CharSequence> foo(p0: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
override fun <C: CharSequence> foo(p0: C)
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TwoSuperclasses : java.lang.Object {
|
||||
public abstract trait test.TwoSuperclasses.Sub : test.TwoSuperclasses.Super1, test.TwoSuperclasses.Super2 {
|
||||
public abstract override /*2*/ fun </*0*/ C : jet.CharSequence>foo(/*0*/ p0: C): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.TwoSuperclasses.Super1 : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.CharSequence>foo(/*0*/ p0: A): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.TwoSuperclasses.Super2 : java.lang.Object {
|
||||
public abstract fun </*0*/ B : jet.CharSequence>foo(/*0*/ p0: B): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface TwoTypeParameters {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A: CharSequence, B: Cloneable> foo(a: A, b: B)")
|
||||
<A extends CharSequence, B extends Cloneable> void foo(A a, B b);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B extends CharSequence, A extends Cloneable> void foo(B b, A a);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait TwoTypeParameters: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A: CharSequence, B: Cloneable> foo(p0: A, p1: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B: CharSequence, A: Cloneable> foo(p0: B, p1: A)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TwoTypeParameters : java.lang.Object {
|
||||
public abstract trait test.TwoTypeParameters.Sub : test.TwoTypeParameters.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.CharSequence, /*1*/ A : java.lang.Cloneable>foo(/*0*/ p0: B, /*1*/ p1: A): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.TwoTypeParameters.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.CharSequence, /*1*/ B : java.lang.Cloneable>foo(/*0*/ p0: A, /*1*/ p1: B): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package test;
|
||||
|
||||
import java.util.List;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface UseParameterAsUpperBound {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A, B: A> foo(a: A, b: B)")
|
||||
<A, B extends A> void foo(A a, B b);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B, A extends B> void foo(B b, A a);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait UseParameterAsUpperBound: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A, B: A> foo(p0: A, p1: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B, A: B> foo(p0: B, p1: A)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.UseParameterAsUpperBound : java.lang.Object {
|
||||
public abstract trait test.UseParameterAsUpperBound.Sub : test.UseParameterAsUpperBound.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.Any?, /*1*/ A : B>foo(/*0*/ p0: B, /*1*/ p1: A): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.UseParameterAsUpperBound.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.Any?, /*1*/ B : A>foo(/*0*/ p0: A, /*1*/ p1: B): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package test;
|
||||
|
||||
import java.util.List;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface UseParameterInUpperBound {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A, B: List<A>> foo(a: A, b: B)")
|
||||
<A, B extends List<A>> void foo(A a, B b);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B, A extends List<B>> void foo(B b, A a);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait UseParameterInUpperBound: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A, B: List<A>> foo(p0: A, p1: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B, A: List<B>> foo(p0: B, p1: A)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.UseParameterInUpperBound : java.lang.Object {
|
||||
public abstract trait test.UseParameterInUpperBound.Sub : test.UseParameterInUpperBound.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.Any?, /*1*/ A : jet.List<B>>foo(/*0*/ p0: B, /*1*/ p1: A): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.UseParameterInUpperBound.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.Any?, /*1*/ B : jet.List<A>>foo(/*0*/ p0: A, /*1*/ p1: B): jet.Tuple0
|
||||
}
|
||||
}
|
||||
@@ -439,7 +439,7 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadJava/kotlinSignature/propagation")
|
||||
@InnerTestClasses({Propagation.Parameter.class, Propagation.Return.class})
|
||||
@InnerTestClasses({Propagation.Parameter.class, Propagation.Return.class, Propagation.TypeParameter.class})
|
||||
public static class Propagation extends AbstractLoadJavaTest {
|
||||
public void testAllFilesPresentInPropagation() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadJava/kotlinSignature/propagation"), "java", true);
|
||||
@@ -656,11 +656,60 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter")
|
||||
public static class TypeParameter extends AbstractLoadJavaTest {
|
||||
public void testAllFilesPresentInTypeParameter() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter"), "java", true);
|
||||
}
|
||||
|
||||
@TestMetadata("InheritMutability.java")
|
||||
public void testInheritMutability() throws Exception {
|
||||
doTest("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/InheritMutability.java");
|
||||
}
|
||||
|
||||
@TestMetadata("InheritNullability.java")
|
||||
public void testInheritNullability() throws Exception {
|
||||
doTest("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/InheritNullability.java");
|
||||
}
|
||||
|
||||
@TestMetadata("InheritReadOnliness.java")
|
||||
public void testInheritReadOnliness() throws Exception {
|
||||
doTest("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/InheritReadOnliness.java");
|
||||
}
|
||||
|
||||
@TestMetadata("TwoBounds.java")
|
||||
public void testTwoBounds() throws Exception {
|
||||
doTest("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/TwoBounds.java");
|
||||
}
|
||||
|
||||
@TestMetadata("TwoSuperclasses.java")
|
||||
public void testTwoSuperclasses() throws Exception {
|
||||
doTest("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/TwoSuperclasses.java");
|
||||
}
|
||||
|
||||
@TestMetadata("TwoTypeParameters.java")
|
||||
public void testTwoTypeParameters() throws Exception {
|
||||
doTest("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/TwoTypeParameters.java");
|
||||
}
|
||||
|
||||
@TestMetadata("UseParameterAsUpperBound.java")
|
||||
public void testUseParameterAsUpperBound() throws Exception {
|
||||
doTest("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/UseParameterAsUpperBound.java");
|
||||
}
|
||||
|
||||
@TestMetadata("UseParameterInUpperBound.java")
|
||||
public void testUseParameterInUpperBound() throws Exception {
|
||||
doTest("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/UseParameterInUpperBound.java");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Test innerSuite() {
|
||||
TestSuite suite = new TestSuite("Propagation");
|
||||
suite.addTestSuite(Propagation.class);
|
||||
suite.addTestSuite(Parameter.class);
|
||||
suite.addTestSuite(Return.class);
|
||||
suite.addTestSuite(TypeParameter.class);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
+50
-1
@@ -1329,7 +1329,7 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadJava/kotlinSignature/propagation")
|
||||
@InnerTestClasses({Propagation.Parameter.class, Propagation.Return.class})
|
||||
@InnerTestClasses({Propagation.Parameter.class, Propagation.Return.class, Propagation.TypeParameter.class})
|
||||
public static class Propagation extends AbstractLazyResolveNamespaceComparingTest {
|
||||
public void testAllFilesPresentInPropagation() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadJava/kotlinSignature/propagation"), "kt", true);
|
||||
@@ -1546,11 +1546,60 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter")
|
||||
public static class TypeParameter extends AbstractLazyResolveNamespaceComparingTest {
|
||||
public void testAllFilesPresentInTypeParameter() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter"), "kt", true);
|
||||
}
|
||||
|
||||
@TestMetadata("InheritMutability.kt")
|
||||
public void testInheritMutability() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/InheritMutability.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InheritNullability.kt")
|
||||
public void testInheritNullability() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/InheritNullability.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InheritReadOnliness.kt")
|
||||
public void testInheritReadOnliness() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/InheritReadOnliness.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("TwoBounds.kt")
|
||||
public void testTwoBounds() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/TwoBounds.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("TwoSuperclasses.kt")
|
||||
public void testTwoSuperclasses() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/TwoSuperclasses.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("TwoTypeParameters.kt")
|
||||
public void testTwoTypeParameters() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/TwoTypeParameters.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("UseParameterAsUpperBound.kt")
|
||||
public void testUseParameterAsUpperBound() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/UseParameterAsUpperBound.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("UseParameterInUpperBound.kt")
|
||||
public void testUseParameterInUpperBound() throws Exception {
|
||||
doTestSinglePackage("compiler/testData/loadJava/kotlinSignature/propagation/typeParameter/UseParameterInUpperBound.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Test innerSuite() {
|
||||
TestSuite suite = new TestSuite("Propagation");
|
||||
suite.addTestSuite(Propagation.class);
|
||||
suite.addTestSuite(Parameter.class);
|
||||
suite.addTestSuite(Return.class);
|
||||
suite.addTestSuite(TypeParameter.class);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user