Skip to content

Commit 11976c5

Browse files
committed
[Embedded] Document untyped throws restriction
1 parent a16c9f7 commit 11976c5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

userdocs/diagnostics/embedded-restrictions.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ Diagnostics in the `EmbeddedRestrictions` group describe those language features
4848
value.doSomething(on: i) // warning: cannot use generic instance method 'doSomething(on:)' on a value of type 'any P' in Embedded Swift
4949
}
5050

51+
* Use of untyped throws, which depends on `any Error` and is not available in Embedded Swift. Use typed throws instead:
52+
53+
func mayFail() throws { } // error: untyped throws is not available in Embedded Swift; add a thrown error type with '(type)'
54+
func mayFail() throws(MyError) // okay
55+
5156
## See Also
5257

5358
- [A Vision for Embedded Swift](https://github.com/swiftlang/swift-evolution/blob/main/visions/embedded-swift.md)

0 commit comments

Comments
 (0)