Skip to content

Commit 878066b

Browse files
authored
Merge pull request #65937 from kavon/defensive-objc-async-property-import
account for errors importing ObjC method as async prop
2 parents a987861 + f3c4996 commit 878066b

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
@@ -2873,13 +2873,17 @@ ImportedType ClangImporter::Implementation::importEffectfulPropertyType(
28732873

28742874
// Import the parameter list and result type.
28752875
ParameterList *bodyParams = nullptr;
2876-
ImportedType importedType;
2877-
28782876
auto methodReturnType = importMethodParamsAndReturnType(
28792877
dc, decl, decl->parameters(), false,
28802878
isFromSystemModule, &bodyParams, name,
28812879
asyncConvention, errorConvention, kind);
28822880

2881+
// was there a problem during import?
2882+
if (!methodReturnType)
2883+
return ImportedType();
2884+
2885+
assert(bodyParams);
2886+
28832887
// getter mustn't have any parameters!
28842888
if (bodyParams->size() != 0) {
28852889
return ImportedType();

0 commit comments

Comments
 (0)