Skip to content

Commit 49b7e0d

Browse files
authored
Merge pull request #65979 from kavon/5.9-defensive-objc-async-property-import
[5.9🍒] account for errors importing ObjC method as async prop
2 parents f60d855 + ce26094 commit 49b7e0d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,13 +2864,17 @@ ImportedType ClangImporter::Implementation::importEffectfulPropertyType(
28642864

28652865
// Import the parameter list and result type.
28662866
ParameterList *bodyParams = nullptr;
2867-
ImportedType importedType;
2868-
28692867
auto methodReturnType = importMethodParamsAndReturnType(
28702868
dc, decl, decl->parameters(), false,
28712869
isFromSystemModule, &bodyParams, name,
28722870
asyncConvention, errorConvention, kind);
28732871

2872+
// was there a problem during import?
2873+
if (!methodReturnType)
2874+
return ImportedType();
2875+
2876+
assert(bodyParams);
2877+
28742878
// getter mustn't have any parameters!
28752879
if (bodyParams->size() != 0) {
28762880
return ImportedType();

0 commit comments

Comments
 (0)