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(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")
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user