mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Introduce ProtocolDecl::get{AssociatedType,ProtocolRequirement}()
This commit is contained in:
@@ -6856,16 +6856,15 @@ ConstraintSystem::simplifyDynamicCallableApplicableFnConstraint(
|
||||
ctx.getProtocol(KnownProtocolKind::ExpressibleByArrayLiteral);
|
||||
addConstraint(ConstraintKind::ConformsTo, tvParam,
|
||||
arrayLitProto->getDeclaredType(), locator);
|
||||
auto elementAssocType = cast<AssociatedTypeDecl>(
|
||||
arrayLitProto->lookupDirect(ctx.Id_ArrayLiteralElement).front());
|
||||
auto elementAssocType = arrayLitProto->getAssociatedType(
|
||||
ctx.Id_ArrayLiteralElement);
|
||||
argumentType = DependentMemberType::get(tvParam, elementAssocType);
|
||||
} else {
|
||||
auto dictLitProto =
|
||||
ctx.getProtocol(KnownProtocolKind::ExpressibleByDictionaryLiteral);
|
||||
addConstraint(ConstraintKind::ConformsTo, tvParam,
|
||||
dictLitProto->getDeclaredType(), locator);
|
||||
auto valueAssocType = cast<AssociatedTypeDecl>(
|
||||
dictLitProto->lookupDirect(ctx.Id_Value).front());
|
||||
auto valueAssocType = dictLitProto->getAssociatedType(ctx.Id_Value);
|
||||
argumentType = DependentMemberType::get(tvParam, valueAssocType);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user