[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

@@ -3099,6 +3099,9 @@ public:
sig, interfaceType);
declOrOffset = opaqueDecl;
if (auto genericParams = MF.maybeReadGenericParams(opaqueDecl))
opaqueDecl->setGenericParams(genericParams);
auto genericEnv = MF.getGenericEnvironment(genericEnvID);
opaqueDecl->setGenericEnvironment(genericEnv);
if (underlyingTypeID)