Skip to content

Commit 6486cbc

Browse files
committed
Update documentation
1 parent 8a03b54 commit 6486cbc

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,10 +1049,22 @@ class Typer extends Namer
10491049
*/
10501050
var paramIndex = Map[Name, Int]()
10511051

1052-
/** If function is of the form
1052+
/** Infer parameter type from the body of the function
1053+
*
1054+
* 1. If function is of the form
1055+
*
10531056
* (x1, ..., xN) => f(... x1, ..., XN, ...)
1057+
*
10541058
* where each `xi` occurs exactly once in the argument list of `f` (in
10551059
* any order), the type of `f`, otherwise NoType.
1060+
*
1061+
* 2. If the function is of the form
1062+
*
1063+
* (using x1, ..., xN) => f
1064+
*
1065+
* where `f` is a contextual function type of the form `(T1, ..., TN) ?=> T`,
1066+
* then `xi` takes the type `Ti`.
1067+
*
10561068
* Updates `fnBody` and `paramIndex` as a side effect.
10571069
* @post: If result exists, `paramIndex` is defined for the name of
10581070
* every parameter in `params`.

0 commit comments

Comments
 (0)