mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Introduce primitive AnyObject type
Add a 'hasExplicitAnyObject()' bit to ProtocolCompositionType to represent canonical composition types containing '& AnyObject'. Serialize this bit and take it into account when building ExistentialLayouts. Rename ProtocolCompositionType::getProtocols() to getMembers() since it can contain classes now, and update a few usages that need further attention with FIXMEs or asserts. For now, nothing actually constructs these types, and they will trigger arounds asserts. Upcoming patches will introduce support for this.
This commit is contained in:
@@ -477,7 +477,7 @@ static void passInherits(ArrayRef<TypeLoc> InheritedTypes,
|
||||
|
||||
if (auto ProtoComposition
|
||||
= Inherited.getType()->getAs<ProtocolCompositionType>()) {
|
||||
for (auto T : ProtoComposition->getProtocols())
|
||||
for (auto T : ProtoComposition->getMembers())
|
||||
passInherits(TypeLoc::withoutLoc(T), Consumer);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user