Rework TypeSubstituion, now it applies to types instead of constructors
Also introduce IndexedParametersSubstitution
This commit is contained in:
@@ -141,6 +141,7 @@ public class JavaResolverUtils {
|
||||
typeSubstitutionContext.put(originalToAltTypeParameter.getKey().getTypeConstructor(),
|
||||
new TypeProjectionImpl(originalToAltTypeParameter.getValue().getDefaultType()));
|
||||
}
|
||||
// TODO: Use IndexedParametersSubstitution here instead of map creation
|
||||
return TypeSubstitutor.create(typeSubstitutionContext);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -271,7 +271,7 @@ class JavaSyntheticExtensionsScope(storageManager: StorageManager) : JetScope by
|
||||
init {
|
||||
val classTypeParams = ownerClass.typeConstructor.parameters
|
||||
val typeParameters = ArrayList<TypeParameterDescriptor>(classTypeParams.size())
|
||||
val typeSubstitutor = DescriptorSubstitutor.substituteTypeParameters(classTypeParams, TypeSubstitutor.EMPTY, this, typeParameters)
|
||||
val typeSubstitutor = DescriptorSubstitutor.substituteTypeParameters(classTypeParams, TypeSubstitution.EMPTY, this, typeParameters)
|
||||
|
||||
val propertyType = typeSubstitutor.safeSubstitute(type, Variance.INVARIANT)
|
||||
val receiverType = typeSubstitutor.safeSubstitute(ownerClass.defaultType, Variance.INVARIANT)
|
||||
|
||||
Reference in New Issue
Block a user