mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -738,7 +738,8 @@ GenericParamList *ModuleFile::maybeReadGenericParams(DeclContext *DC,
|
|||||||
// precede SIL linkage, we should be ok.
|
// precede SIL linkage, we should be ok.
|
||||||
assert((genericParam->getDeclContext()->isModuleScopeContext() ||
|
assert((genericParam->getDeclContext()->isModuleScopeContext() ||
|
||||||
DC->isModuleScopeContext() ||
|
DC->isModuleScopeContext() ||
|
||||||
genericParam->getDeclContext() == DC) &&
|
genericParam->getDeclContext() == DC ||
|
||||||
|
genericParam->getDeclContext()->isChildContextOf(DC)) &&
|
||||||
"Mismatched decl context for generic types.");
|
"Mismatched decl context for generic types.");
|
||||||
params.push_back(genericParam);
|
params.push_back(genericParam);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -10,4 +10,8 @@ public class A<T> {
|
|||||||
@_versioned
|
@_versioned
|
||||||
@_inlineable
|
@_inlineable
|
||||||
init() {}
|
init() {}
|
||||||
|
|
||||||
|
@_inlineable public subscript<U>(value: T) -> U? {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user