File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
docs/docs/reference/new-types Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ trait Entry { type Key; val key: Key }
1111def extractKey (e : Entry ): e.Key = e.key // a dependent method
1212val extractor : (e : Entry ) => e.Key = extractKey // a dependent function value
1313// ║ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ⇓ ║
14- // ║ Dependent ║
15- // ║ Function Type ║
16- // ╚═══════════════════ ╝
14+ // ║ Dependent ║
15+ // ║ Function Type ║
16+ // ╚═══════════════╝
1717```
1818Scala already has _ dependent methods_ , i.e. methods where the result
1919type refers to some of the parameters of the method. Method
20- ` extractKey ` is an example. Its result type, ` e.Key ` refers its
20+ ` extractKey ` is an example. Its result type, ` e.Key ` refers to its
2121parameter ` e ` (we also say, ` e.Key ` _ depends_ on ` e ` ). But so far it
2222was not possible to turn such methods into function values, so that
2323they can be passed as parameters to other functions, or returned as
You can’t perform that action at this time.
0 commit comments