Updated manual

This commit is contained in:
Mattia Giambirtone 2022-12-15 15:30:18 +01:00
parent d3220de5bf
commit 19076ee4a1
1 changed files with 2 additions and 1 deletions

View File

@ -190,7 +190,8 @@ fn identity[T: int | int32](x: T): T {
This code will, again, fail to compile: this is because as far as peon is concerned, `foo` is not
defined for both `int` and `int32` _at the same time_. In order for that to work, `foo` would need
to be rewritten with `T: int32 | int` as its generic argument type in order to avoid the ambiguity.
to be rewritten with `T: int32 | int` as its generic argument type in order to avoid the ambiguity
(or `identity` could be rewritten to use automatic types instead, both are viable options).
#### More generics