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:
Becca Royal-Gordon
2021-08-03 16:13:59 -07:00
parent 700b11daef
commit 627ecbdfff
15 changed files with 175 additions and 348 deletions

View File

@@ -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<