AST: Add ASTContext::Id_ArrayLiteralElement

This commit is contained in:
Slava Pestov
2017-09-11 21:20:57 -07:00
parent 091da16929
commit defb9cd5b6
4 changed files with 5 additions and 6 deletions

View File

@@ -26,6 +26,7 @@ IDENTIFIER(alloc)
IDENTIFIER(allocWithZone)
IDENTIFIER(allZeros)
IDENTIFIER(Any)
IDENTIFIER(ArrayLiteralElement)
IDENTIFIER(atIndexedSubscript)
IDENTIFIER_(bridgeToObjectiveC)
IDENTIFIER_WITH_NAME(code_, "_code")

View File

@@ -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();
}

View File

@@ -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;
}

View File

@@ -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;
}