Skip to content

Commit 3c2816a

Browse files
committed
Add inference rule for generics/associated types
1 parent ac8a86d commit 3c2816a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

TSPL.docc/ReferenceManual/Types.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@ As a result of these subtype relationships:
376376
- You can use a function that throws a more specific error type
377377
in the same places as a function that throws a more general error type.
378378

379+
If you use an associated type or a generic type parameter
380+
as the thrown error type in a function type,
381+
then that associated type or generic type parameter
382+
is implicitly required to conform to the `Error` protocol.
383+
379384
Throwing and rethrowing functions are described in
380385
<doc:Declarations#Throwing-Functions-and-Methods>
381386
and <doc:Declarations#Rethrowing-Functions-and-Methods>.

0 commit comments

Comments
 (0)