Implement top-down completion for nested builder inference calls

^KT-42742 Fixed
This commit is contained in:
Victor Petukhov
2021-03-18 14:18:21 +03:00
parent 8068a5439f
commit 7a66e22bb2
20 changed files with 339 additions and 172 deletions
@@ -57,7 +57,7 @@ public class ReceiverParameterDescriptorImpl extends AbstractReceiverParameterDe
}
public void setOutType(@NotNull KotlinType outType) {
assert TypeUtilsKt.shouldBeSubstituted(this.value.getType());
assert TypeUtilsKt.shouldBeUpdated(this.value.getType());
this.value = value.replaceType(outType);
}
}
@@ -50,7 +50,7 @@ public abstract class VariableDescriptorImpl extends DeclarationDescriptorNonRoo
}
public void setOutType(KotlinType outType) {
assert this.outType == null || TypeUtilsKt.shouldBeSubstituted(this.outType);
assert this.outType == null || TypeUtilsKt.shouldBeUpdated(this.outType);
this.outType = outType;
}
@@ -308,4 +308,4 @@ private fun NewCapturedType.unCaptureTopLevelType(): UnwrappedType {
return constructor.projection.type.unwrap()
}
fun KotlinType.shouldBeSubstituted() = contains { it is StubType || it.constructor is TypeVariableTypeConstructorMarker }
fun KotlinType.shouldBeUpdated() = contains { it is StubType || it.constructor is TypeVariableTypeConstructorMarker || it.isError }