summary refs log tree commit diff stats
path: root/doc/manual.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/manual.txt')
-rw-r--r--doc/manual.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/doc/manual.txt b/doc/manual.txt
index 10fe78336..144a3b2c0 100644
--- a/doc/manual.txt
+++ b/doc/manual.txt
@@ -3671,8 +3671,8 @@ once for each tested type and any static code included within them will also be
 executed once.
 
 
-Return Type Inference
----------------------
+Type inference with type classes
+--------------------------------
 
 If a type class is used as the return type of a proc and it won't be bound to
 a concrete type by some of the proc params, Nim will infer the return type
@@ -3681,13 +3681,18 @@ from the proc body. This is usually used with the ``auto`` type class:
 .. code-block:: nim
   proc makePair(a, b): auto = (first: a, second: b)
 
-The return type will be treated as additional generic param and can be
+The return type will be treated as an additional generic param and can be
 explicitly specified at call sites as any other generic param.
 
 Future versions of Nim may also support overloading based on the return type
 of the overloads. In such settings, the expected result type at call sites may 
 also influence the inferred return type.
 
+Likewise, if a type class is used in another position where Nim expects a
+concrete type (e.g. a variable declaration or a type coercion), Nim will try to
+infer the concrete type by applying the sane matching algorithm also used in
+overload resolution.
+
 
 Symbol lookup in generics
 -------------------------