[Opaque result types] Fix mangling issues with opaque result types.

Fix a trio of issues involving mangling for opaque result types:
* Symbolic references to opaque type descriptors are not substitutions
* Mangle protocol extension contexts correctly
* Mangle generic arguments for opaque result types of generic functions

The (de-)serialization of generic parameter lists for opaque type
declarations is important for the last bullet, to ensure that the
mangling of generic arguments of opaque result types works across
module boundaries.

Fixes the rest of rdar://problem/50038754.
This commit is contained in:
Doug Gregor
2019-04-22 16:56:03 -07:00
parent 502a7bf3d7
commit e29469b9c0
8 changed files with 36 additions and 7 deletions

View File

@@ -52,7 +52,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 = 486; // Last change: Opaque result types
const uint16_t SWIFTMODULE_VERSION_MINOR = 487; // Last change: Opaque result types generic params
using DeclIDField = BCFixed<31>;
@@ -1101,6 +1101,7 @@ namespace decls_block {
TypeIDField, // interface type for opaque type
GenericEnvironmentIDField, // generic environment
SubstitutionMapIDField // optional substitution map for underlying type
// trailed by generic parameters
>;
// TODO: remove the unnecessary FuncDecl components here