Skip to content

Commit

Permalink
Update docs/docs/language_concepts/01_functions.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher authored Oct 24, 2023
1 parent 06ccf55 commit 451f4c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/docs/language_concepts/01_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ fn main() {
}
```

Also note that impls with the same method name defined in them cannot overlap. For example, if we already have `foo` defined for `Foo<u32>` and `Foo<u64>` like we do above, we cannot also define `foo` in an `impl<T> Foo<T>` since it would be ambiguous which version of `foo` to choose.

```rs
// Including this impl in the same project as the above snippet would
// cause an overlapping impls error
impl<T> Foo<T> {
fn foo(self) -> Field { 3 }
}
## Lambdas

Lambdas are anonymous functions. They follow the syntax of Rust - `|arg1, arg2, ..., argN| return_expression`.
Expand Down

0 comments on commit 451f4c6

Please sign in to comment.