diff --git a/doc/docs.md b/doc/docs.md index ca0933224a..2e96c002fa 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -3774,10 +3774,10 @@ fn (r Repo[T]) find_by_id(id int) ?T { } db := new_db() -users_repo := new_repo(db) // returns Repo -posts_repo := new_repo(db) // returns Repo -user := users_repo.find_by_id(1)? // find_by_id -post := posts_repo.find_by_id(1)? // find_by_id +users_repo := new_repo[User](db) // returns Repo[User] +posts_repo := new_repo[Post](db) // returns Repo[Post] +user := users_repo.find_by_id(1)? // find_by_id[User] +post := posts_repo.find_by_id(1)? // find_by_id[Post] ``` Currently generic function definitions must declare their type parameters, but in