mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Always create initializer contexts for pattern binding entries in non-local scopes.
We were optimizing away unused pattern binding initializer contexts in both the parser and in semantic analysis, which led to a somewhat-unpredictable set of DeclContexts in the AST. Normalize everything by always creating these contexts.
This commit is contained in:
@@ -53,7 +53,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 = 265; // Last change: pattern binding initializer index
|
||||
const uint16_t VERSION_MINOR = 266; // Last change: pattern binding init contexts
|
||||
|
||||
using DeclID = PointerEmbeddedInt<unsigned, 31>;
|
||||
using DeclIDField = BCFixed<31>;
|
||||
@@ -927,9 +927,9 @@ namespace decls_block {
|
||||
BCFixed<1>, // implicit flag
|
||||
BCFixed<1>, // static?
|
||||
StaticSpellingKindField, // spelling of 'static' or 'class'
|
||||
BCVBR<3> // numpatterns
|
||||
|
||||
// The pattern trails the record.
|
||||
BCVBR<3>, // numpatterns
|
||||
BCArray<DeclContextIDField> // init contexts
|
||||
// The patterns and decl-contexts trail the record.
|
||||
>;
|
||||
|
||||
template <unsigned Code>
|
||||
|
||||
Reference in New Issue
Block a user