mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Rip designated types out of the AST
Designated types were removed from the constraint solver in #34315, but they are currently still represented in the AST and fully checked. This change removes them as completely as possible without breaking source compatibility (mainly with old swiftinterfaces) or changing the SwiftSyntax tree. Designated types are still parsed, but they are dropped immediately and a warning is diagnosed. During decl checking we also still check if the precedence group is really a designated type, but only so that we can diagnose a warning and fall back to DefaultPrecedence. This change also fixes an apparent bug in the parser where we did not diagnose operator declarations that contained a `:` followed by a non-identifier token.
This commit is contained in:
@@ -56,7 +56,7 @@ const uint16_t SWIFTMODULE_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 SWIFTMODULE_VERSION_MINOR = 622; // builtin conformance kind
|
||||
const uint16_t SWIFTMODULE_VERSION_MINOR = 623; // remove designated types
|
||||
|
||||
/// A standard hash seed used for all string hashes in a serialized module.
|
||||
///
|
||||
@@ -1427,8 +1427,7 @@ namespace decls_block {
|
||||
using UnaryOperatorLayout = BCRecordLayout<
|
||||
Code, // ID field
|
||||
IdentifierIDField, // name
|
||||
DeclContextIDField, // context decl
|
||||
BCArray<DeclIDField> // designated types
|
||||
DeclContextIDField // context decl
|
||||
>;
|
||||
|
||||
using PrefixOperatorLayout = UnaryOperatorLayout<PREFIX_OPERATOR_DECL>;
|
||||
@@ -1438,8 +1437,7 @@ namespace decls_block {
|
||||
INFIX_OPERATOR_DECL,
|
||||
IdentifierIDField, // name
|
||||
DeclContextIDField,// context decl
|
||||
DeclIDField, // precedence group
|
||||
BCArray<DeclIDField> // designated types
|
||||
DeclIDField // precedence group
|
||||
>;
|
||||
|
||||
using PrecedenceGroupLayout = BCRecordLayout<
|
||||
|
||||
Reference in New Issue
Block a user