[Deserialization] Weakened DeclContext asssertion in maybeReadGenericParams.

An over-eager assertion in ModuleFile::maybeReadGenericParams() rejected
deserialization into the context of a generic subscript for a generic
parameter within one of its accessors. Weaken the assertion; the
DeclContext of the generic parameter will be overwritten with the
correct context later.

Fixes rdar://problem/37408205.
This commit is contained in:
Doug Gregor
2018-02-12 11:57:28 -08:00
parent 3888b5b054
commit ba8e86d2fb
2 changed files with 6 additions and 1 deletions

View File

@@ -738,7 +738,8 @@ GenericParamList *ModuleFile::maybeReadGenericParams(DeclContext *DC,
// precede SIL linkage, we should be ok.
assert((genericParam->getDeclContext()->isModuleScopeContext() ||
DC->isModuleScopeContext() ||
genericParam->getDeclContext() == DC) &&
genericParam->getDeclContext() == DC ||
genericParam->getDeclContext()->isChildContextOf(DC)) &&
"Mismatched decl context for generic types.");
params.push_back(genericParam);
break;