Skip to content

Commit 958420e

Browse files
authored
Merge pull request #84864 from nkcsgexi/typed_throw_in_objc_forbidden-interface
sema: avoid diagnosing typed_throw_in_objc_forbidden in textual interface files
2 parents 232323a + 052da16 commit 958420e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/TypeCheckDeclObjC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ bool swift::isRepresentableInLanguage(
846846
}
847847

848848
// Check that @objc functions can't have typed throw.
849-
if (AFD->hasThrows()) {
849+
if (!AFD->getDeclContext()->isInSwiftinterface() && AFD->hasThrows()) {
850850
Type thrownType = AFD->getThrownInterfaceType();
851851
// TODO: only `throws(Error)` is allowed.
852852
// Throwing `any MyError` that confronts `Error` is not implemented yet.

0 commit comments

Comments
 (0)