Skip to content

Commit

Permalink
[TypeCheckType] Lift malformed type check for fnType in resolveASTFun…
Browse files Browse the repository at this point in the history
…ctionType
  • Loading branch information
LucianoPAlmeida committed Jun 12, 2020
1 parent 0c33206 commit b2e8a60
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Sema/TypeCheckType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2700,13 +2700,16 @@ Type TypeResolver::resolveASTFunctionType(
}

auto fnTy = FunctionType::get(params, outputTy, extInfo);

if (fnTy->hasError())
return fnTy;

// If the type is a block or C function pointer, it must be representable in
// ObjC.
switch (representation) {
case AnyFunctionType::Representation::Block:
case AnyFunctionType::Representation::CFunctionPointer:
if (!fnTy->hasError() &&
!fnTy->isRepresentableIn(ForeignLanguage::ObjectiveC, DC)) {
if (!fnTy->isRepresentableIn(ForeignLanguage::ObjectiveC, DC)) {
StringRef strName =
(representation == AnyFunctionType::Representation::Block)
? "block"
Expand Down

0 comments on commit b2e8a60

Please sign in to comment.