mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #72324 from hborla/extract-function-isolation-expr
[Concurrency] Add a `.isolation` member on dynamically isolated function values.
This commit is contained in:
@@ -2890,6 +2890,7 @@ Type ConstraintSystem::getEffectiveOverloadType(ConstraintLocator *locator,
|
||||
case OverloadChoiceKind::KeyPathApplication:
|
||||
case OverloadChoiceKind::TupleIndex:
|
||||
case OverloadChoiceKind::MaterializePack:
|
||||
case OverloadChoiceKind::ExtractFunctionIsolation:
|
||||
return Type();
|
||||
}
|
||||
|
||||
@@ -3569,6 +3570,7 @@ void ConstraintSystem::bindOverloadType(
|
||||
case OverloadChoiceKind::DeclViaUnwrappedOptional:
|
||||
case OverloadChoiceKind::TupleIndex:
|
||||
case OverloadChoiceKind::MaterializePack:
|
||||
case OverloadChoiceKind::ExtractFunctionIsolation:
|
||||
case OverloadChoiceKind::KeyPathApplication:
|
||||
bindTypeOrIUO(openedType);
|
||||
return;
|
||||
@@ -3829,6 +3831,15 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
|
||||
break;
|
||||
}
|
||||
|
||||
case OverloadChoiceKind::ExtractFunctionIsolation: {
|
||||
// The type of `.isolation` is `(any Actor)?`
|
||||
auto actor = getASTContext().getProtocol(KnownProtocolKind::Actor);
|
||||
adjustedRefType =
|
||||
OptionalType::get(actor->getDeclaredExistentialType());
|
||||
refType = adjustedRefType;
|
||||
break;
|
||||
}
|
||||
|
||||
case OverloadChoiceKind::KeyPathApplication: {
|
||||
// Key path application looks like a subscript(keyPath: KeyPath<Base, T>).
|
||||
// The element type is T or @lvalue T based on the key path subtype and
|
||||
@@ -4466,6 +4477,7 @@ DeclName OverloadChoice::getName() const {
|
||||
|
||||
case OverloadChoiceKind::MaterializePack:
|
||||
case OverloadChoiceKind::TupleIndex:
|
||||
case OverloadChoiceKind::ExtractFunctionIsolation:
|
||||
llvm_unreachable("no name!");
|
||||
}
|
||||
|
||||
@@ -5830,6 +5842,7 @@ bool ConstraintSystem::diagnoseAmbiguity(ArrayRef<Solution> solutions) {
|
||||
|
||||
case OverloadChoiceKind::TupleIndex:
|
||||
case OverloadChoiceKind::MaterializePack:
|
||||
case OverloadChoiceKind::ExtractFunctionIsolation:
|
||||
// FIXME: Actually diagnose something here.
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user