Filter annotations while substituting compound type
This commit is contained in:
@@ -240,7 +240,7 @@ public class TypeSubstitutor {
|
||||
return containedOrCapturedTypeParameters.contains(key.getConstructor()) ? substitution.get(key) : null;
|
||||
}
|
||||
};
|
||||
KotlinType substitutedType = KotlinTypeImpl.create(type.getAnnotations(), // Old annotations. This is questionable
|
||||
KotlinType substitutedType = KotlinTypeImpl.create(substitution.filterAnnotations(type.getAnnotations()), // Old annotations. This is questionable
|
||||
type.getConstructor(), // The same constructor
|
||||
type.isMarkedNullable(), // Same nullability
|
||||
substitutedArguments,
|
||||
|
||||
@@ -101,7 +101,7 @@ fun TypeProjection.substitute(doSubstitute: (KotlinType) -> KotlinType): TypePro
|
||||
}
|
||||
|
||||
fun KotlinType.replaceAnnotations(newAnnotations: Annotations): KotlinType {
|
||||
if (newAnnotations.isEmpty()) return this
|
||||
if (annotations.isEmpty() && newAnnotations.isEmpty()) return this
|
||||
return object : DelegatingType() {
|
||||
override fun getDelegate() = this@replaceAnnotations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user