Skip to content

Commit 10bf032

Browse files
committed
Sema: Curried functions cannot be represented in Objective-C because they don't exist
1 parent 88742f5 commit 10bf032

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3515,9 +3515,6 @@ WARNING(witness_swift3_objc_inference,none,
35153515
(DescriptiveDeclKind, DeclName, Type))
35163516

35173517

3518-
ERROR(objc_invalid_on_func_curried,none,
3519-
"method cannot be %" OBJC_ATTR_SELECT "0 because curried functions "
3520-
"cannot be represented in Objective-C", (unsigned))
35213518
ERROR(objc_observing_accessor, none,
35223519
"observing accessors are not allowed to be marked @objc", ())
35233520
ERROR(objc_addressor, none,

lib/Sema/TypeCheckType.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3601,20 +3601,6 @@ bool TypeChecker::isRepresentableInObjC(
36013601
llvm_unreachable("bad kind");
36023602
}
36033603

3604-
if (auto *FD = dyn_cast<FuncDecl>(AFD)) {
3605-
unsigned ExpectedParamPatterns = 1;
3606-
if (FD->getImplicitSelfDecl())
3607-
ExpectedParamPatterns++;
3608-
if (FD->getParameterLists().size() != ExpectedParamPatterns) {
3609-
if (Diagnose) {
3610-
diagnose(AFD->getLoc(), diag::objc_invalid_on_func_curried,
3611-
getObjCDiagnosticAttrKind(Reason));
3612-
describeObjCReason(*this, AFD, Reason);
3613-
}
3614-
return false;
3615-
}
3616-
}
3617-
36183604
// As a special case, an initializer with a single, named parameter of type
36193605
// '()' is always representable in Objective-C. This allows us to cope with
36203606
// zero-parameter methods with selectors that are longer than "init". For

0 commit comments

Comments
 (0)