mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add support for multiple designated types for an operator declaration.
Add parsing, type checking, serialization, and deserialization support for specifying multiple types as "designated" for operator lookup for a given operator declaration. The constraint solver still considers only the first type when deciding the order to attempt the elements of a disjunction, so this doesn't really change behavior yet.
This commit is contained in:
@@ -55,7 +55,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// 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.
|
||||
/// Don't worry about adhering to the 80-column limit for this line.
|
||||
const uint16_t VERSION_MINOR = 452; // Last change: nominal types for operators
|
||||
const uint16_t VERSION_MINOR = 453; // Last change: multiple nominal types for operators
|
||||
|
||||
using DeclIDField = BCFixed<31>;
|
||||
|
||||
@@ -1099,7 +1099,7 @@ namespace decls_block {
|
||||
Code, // ID field
|
||||
IdentifierIDField, // name
|
||||
DeclContextIDField, // context decl
|
||||
DeclIDField // protocol
|
||||
BCArray<DeclIDField> // designated types
|
||||
>;
|
||||
|
||||
using PrefixOperatorLayout = UnaryOperatorLayout<PREFIX_OPERATOR_DECL>;
|
||||
@@ -1110,7 +1110,7 @@ namespace decls_block {
|
||||
IdentifierIDField, // name
|
||||
DeclContextIDField,// context decl
|
||||
DeclIDField, // precedence group
|
||||
DeclIDField // protocol
|
||||
BCArray<DeclIDField> // designated types
|
||||
>;
|
||||
|
||||
using PrecedenceGroupLayout = BCRecordLayout<
|
||||
|
||||
Reference in New Issue
Block a user