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(allocWithZone)
IDENTIFIER(allZeros) IDENTIFIER(allZeros)
IDENTIFIER(Any) IDENTIFIER(Any)
IDENTIFIER(ArrayLiteralElement)
IDENTIFIER(atIndexedSubscript) IDENTIFIER(atIndexedSubscript)
IDENTIFIER_(bridgeToObjectiveC) IDENTIFIER_(bridgeToObjectiveC)
IDENTIFIER_WITH_NAME(code_, "_code") IDENTIFIER_WITH_NAME(code_, "_code")

View File

@@ -429,7 +429,7 @@ static bool resolveKnownTypeWitness(NormalProtocolConformance *conformance,
// ExpressibleByArrayLiteral.ArrayLiteralElement // ExpressibleByArrayLiteral.ArrayLiteralElement
if (*knownKind == KnownProtocolKind::ExpressibleByArrayLiteral) { if (*knownKind == KnownProtocolKind::ExpressibleByArrayLiteral) {
assert(assocType->getName() == ctx.getIdentifier("ArrayLiteralElement")); assert(assocType->getName() == ctx.Id_ArrayLiteralElement);
return resolveViaLookup(); return resolveViaLookup();
} }

View File

@@ -5223,10 +5223,8 @@ SwiftDeclConverter::importAsOptionSetType(DeclContext *dc, Identifier name,
makeStructRawValued(Impl, structDecl, underlyingType, makeStructRawValued(Impl, structDecl, underlyingType,
{KnownProtocolKind::OptionSet}, protocols); {KnownProtocolKind::OptionSet}, protocols);
auto selfType = structDecl->getDeclaredInterfaceType(); auto selfType = structDecl->getDeclaredInterfaceType();
addSynthesizedTypealias(structDecl, ctx.Id_Element, addSynthesizedTypealias(structDecl, ctx.Id_Element, selfType);
selfType); addSynthesizedTypealias(structDecl, ctx.Id_ArrayLiteralElement, selfType);
addSynthesizedTypealias(structDecl, ctx.getIdentifier("ArrayLiteralElement"),
selfType);
return structDecl; return structDecl;
} }

View File

@@ -8190,7 +8190,7 @@ bool FailureDiagnosis::visitArrayExpr(ArrayExpr *E) {
contextualElementType = contextualElementType =
ProtocolConformanceRef::getTypeWitnessByName( ProtocolConformanceRef::getTypeWitnessByName(
contextualType, *Conformance, contextualType, *Conformance,
CS.getASTContext().getIdentifier("ArrayLiteralElement"), &CS.TC) CS.getASTContext().Id_ArrayLiteralElement, &CS.TC)
->getDesugaredType(); ->getDesugaredType();
elementTypePurpose = CTP_ArrayElement; elementTypePurpose = CTP_ArrayElement;
} }