resolve type parameters that reference type variables declared after
like Aaa<B extends Bbb<C>, C> #KT-1731 fixed
This commit is contained in:
+7
-1
@@ -869,10 +869,16 @@ public class JavaDescriptorResolver {
|
||||
|
||||
private void initializeTypeParameters(List<TypeParameterDescriptorInitialization> typeParametersInitialization, @NotNull DeclarationDescriptor typeParametersOwner, @NotNull String context) {
|
||||
List<TypeParameterDescriptor> prevTypeParameters = new ArrayList<TypeParameterDescriptor>();
|
||||
|
||||
List<TypeParameterDescriptor> typeParameters = Lists.newArrayList();
|
||||
for (TypeParameterDescriptorInitialization typeParameterDescriptor : typeParametersInitialization) {
|
||||
typeParameters.add(typeParameterDescriptor.descriptor);
|
||||
}
|
||||
|
||||
for (TypeParameterDescriptorInitialization psiTypeParameter : typeParametersInitialization) {
|
||||
prevTypeParameters.add(psiTypeParameter.descriptor);
|
||||
initializeTypeParameter(psiTypeParameter,
|
||||
TypeVariableResolvers.typeVariableResolverFromTypeParameters(prevTypeParameters, typeParametersOwner, context));
|
||||
TypeVariableResolvers.typeVariableResolverFromTypeParameters(typeParameters, typeParametersOwner, context));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package test;
|
||||
|
||||
interface Foo<Q> {
|
||||
}
|
||||
|
||||
class ClassWithTypePRefNext<R extends Foo<P>, P> {
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package test
|
||||
|
||||
trait Foo<erased Q> : java.lang.Object
|
||||
|
||||
open class ClassWithTypePRefNext<erased R : Foo<P>?, erased P>() : java.lang.Object()
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace test
|
||||
|
||||
abstract trait test.Foo</*0*/ Q : jet.Any?> : java.lang.Object {
|
||||
}
|
||||
open class test.ClassWithTypePRefNext</*0*/ R : test.Foo<P>?, /*1*/ P : jet.Any?> : java.lang.Object {
|
||||
final /*constructor*/ fun </*0*/ R : test.Foo<P>?, /*1*/ P : jet.Any?><init>(): test.ClassWithTypePRefNext<R, P>
|
||||
}
|
||||
Reference in New Issue
Block a user