Skip to content

Commit 6932023

Browse files
ErikPohl444adpi2
andauthored
Update _tour/singleton-objects.md
Thank you for the edit. Accepted. Co-authored-by: adpi2 <[email protected]>
1 parent c7a4158 commit 6932023

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_tour/singleton-objects.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ A note about `Option`, `Some`, and `None` in the code above:
201201
* `Some` above represents a match: the emailString, when split by a @, returns an array with two components. This allows creation of a valid instance of class Email.
202202
* `None` above represents no match: the emailString, when split by a @, did not return an array with two components. It could not allow creation of a valid instance of class Email.
203203
* The `Option` return type can then be used in a match/case:
204-
* For a `Some` result, the match knows the return type is a valid instance of Email and can populate the value email with that instance.
205-
* For a `None` result, the match knows the return type is not a valid instance of Email, so it can print an appropriate error message.
204+
* For a `Some` result, the match knows the returned value is an instance of `Email`, so it can access the inner `username` and `domainName`.
205+
* For a `None` result, the match knows the returned value is not an instance of `Email`, so it prints an appropriate error message.
206206

207207
Note: If a class or object has a companion, both must be defined in the same file. To define companions in the REPL, either define them on the same line or enter `:paste` mode.
208208

0 commit comments

Comments
 (0)