mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Serialization] Pass up deserialization errors under generic type params
There is no related test as we don't have reproducer code and we've seen it only in the debugger, but I believe the fix is sound on its own. rdar://106430304
This commit is contained in:
@@ -6323,9 +6323,12 @@ DESERIALIZE_TYPE(GENERIC_TYPE_PARAM_TYPE)(
|
||||
scratch, parameterPack, declIDOrDepth, indexPlusOne);
|
||||
|
||||
if (indexPlusOne == 0) {
|
||||
auto genericParam =
|
||||
dyn_cast_or_null<GenericTypeParamDecl>(MF.getDecl(declIDOrDepth));
|
||||
auto genericParamOrError = MF.getDeclChecked(declIDOrDepth);
|
||||
if (!genericParamOrError)
|
||||
return genericParamOrError.takeError();
|
||||
|
||||
auto genericParam =
|
||||
dyn_cast_or_null<GenericTypeParamDecl>(genericParamOrError.get());
|
||||
if (!genericParam)
|
||||
return MF.diagnoseFatal();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user