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:
@@ -54,7 +54,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// in source control, you should also update the comment to briefly
|
||||
/// describe what change you made. The content of this comment isn't important;
|
||||
/// it just ensures a conflict if two people change the module format.
|
||||
const uint16_t VERSION_MINOR = 333; // Last change: AST constant_string_literal
|
||||
const uint16_t VERSION_MINOR = 334; // Last change: AnyObject bit in ProtocolCompositionType
|
||||
|
||||
using DeclID = PointerEmbeddedInt<unsigned, 31>;
|
||||
using DeclIDField = BCFixed<31>;
|
||||
@@ -660,6 +660,7 @@ namespace decls_block {
|
||||
|
||||
using ProtocolCompositionTypeLayout = BCRecordLayout<
|
||||
PROTOCOL_COMPOSITION_TYPE,
|
||||
BCFixed<1>, // has AnyObject constraint
|
||||
BCArray<TypeIDField> // protocols
|
||||
>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user