Skip to content

Commit addb432

Browse files
[TypeCheckType] Avoid diagnose convention representation when function type has error type
1 parent b5a8b51 commit addb432

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2705,7 +2705,8 @@ Type TypeResolver::resolveASTFunctionType(
27052705
switch (representation) {
27062706
case AnyFunctionType::Representation::Block:
27072707
case AnyFunctionType::Representation::CFunctionPointer:
2708-
if (!fnTy->isRepresentableIn(ForeignLanguage::ObjectiveC, DC)) {
2708+
if (!fnTy->hasError() &&
2709+
!fnTy->isRepresentableIn(ForeignLanguage::ObjectiveC, DC)) {
27092710
StringRef strName =
27102711
(representation == AnyFunctionType::Representation::Block)
27112712
? "block"

0 commit comments

Comments
 (0)