mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Add ASTContext::Id_ArrayLiteralElement
This commit is contained in:
@@ -26,6 +26,7 @@ IDENTIFIER(alloc)
|
||||
IDENTIFIER(allocWithZone)
|
||||
IDENTIFIER(allZeros)
|
||||
IDENTIFIER(Any)
|
||||
IDENTIFIER(ArrayLiteralElement)
|
||||
IDENTIFIER(atIndexedSubscript)
|
||||
IDENTIFIER_(bridgeToObjectiveC)
|
||||
IDENTIFIER_WITH_NAME(code_, "_code")
|
||||
|
||||
@@ -429,7 +429,7 @@ static bool resolveKnownTypeWitness(NormalProtocolConformance *conformance,
|
||||
|
||||
// ExpressibleByArrayLiteral.ArrayLiteralElement
|
||||
if (*knownKind == KnownProtocolKind::ExpressibleByArrayLiteral) {
|
||||
assert(assocType->getName() == ctx.getIdentifier("ArrayLiteralElement"));
|
||||
assert(assocType->getName() == ctx.Id_ArrayLiteralElement);
|
||||
return resolveViaLookup();
|
||||
}
|
||||
|
||||
|
||||
@@ -5223,10 +5223,8 @@ SwiftDeclConverter::importAsOptionSetType(DeclContext *dc, Identifier name,
|
||||
makeStructRawValued(Impl, structDecl, underlyingType,
|
||||
{KnownProtocolKind::OptionSet}, protocols);
|
||||
auto selfType = structDecl->getDeclaredInterfaceType();
|
||||
addSynthesizedTypealias(structDecl, ctx.Id_Element,
|
||||
selfType);
|
||||
addSynthesizedTypealias(structDecl, ctx.getIdentifier("ArrayLiteralElement"),
|
||||
selfType);
|
||||
addSynthesizedTypealias(structDecl, ctx.Id_Element, selfType);
|
||||
addSynthesizedTypealias(structDecl, ctx.Id_ArrayLiteralElement, selfType);
|
||||
return structDecl;
|
||||
}
|
||||
|
||||
|
||||
@@ -8190,7 +8190,7 @@ bool FailureDiagnosis::visitArrayExpr(ArrayExpr *E) {
|
||||
contextualElementType =
|
||||
ProtocolConformanceRef::getTypeWitnessByName(
|
||||
contextualType, *Conformance,
|
||||
CS.getASTContext().getIdentifier("ArrayLiteralElement"), &CS.TC)
|
||||
CS.getASTContext().Id_ArrayLiteralElement, &CS.TC)
|
||||
->getDesugaredType();
|
||||
elementTypePurpose = CTP_ArrayElement;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user