We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8828d79 commit 288b3d8Copy full SHA for 288b3d8
_overviews/scala3-book/types-dependent-function.md
@@ -33,7 +33,7 @@ The following calls to method `get` would now type check:
33
```scala
34
val db: DB = ...
35
val res1: Option[String] = db.get(Name)
36
-val res2: Option[String] = db.get(Age)
+val res2: Option[Int] = db.get(Age)
37
```
38
Calling the method `db.get(Name)` returns a value of type `Option[String]`, while calling `db.get(Age)` returns a value of type `Option[Int]`.
39
The return type _depends_ on the concrete type of the argument passed to `get`---hence the name _dependent type_.
0 commit comments