mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CSBindings] Check literal coverage as new bindings/requirements are discovered
One more step towards incrementality of binding inference. Instead of trying to determine literal protocol coverage during finalization of the bindings, let's do that as soon as new bindings and/or literal protocol requirements are discovered.
This commit is contained in:
@@ -5330,11 +5330,7 @@ bool ConstraintSystem::isReadOnlyKeyPathComponent(
|
||||
TypeVarBindingProducer::TypeVarBindingProducer(
|
||||
ConstraintSystem::PotentialBindings &bindings)
|
||||
: BindingProducer(bindings.CS, bindings.TypeVar->getImpl().getLocator()),
|
||||
TypeVar(bindings.TypeVar),
|
||||
CanBeNil(llvm::any_of(bindings.Literals, [](const auto &literal) {
|
||||
return literal.first->isSpecificProtocol(
|
||||
KnownProtocolKind::ExpressibleByNilLiteral);
|
||||
})) {
|
||||
TypeVar(bindings.TypeVar), CanBeNil(bindings.canBeNil()) {
|
||||
if (bindings.isDirectHole()) {
|
||||
auto *locator = getLocator();
|
||||
// If this type variable is associated with a code completion token
|
||||
|
||||
Reference in New Issue
Block a user