Skip to content

Commit aee907b

Browse files
committed
comments about using 'vars' in case class fields.
1 parent bc8cf17 commit aee907b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: tutorials/tour/case-classes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ val title = emailFromJohn.title
3939
println(title) // prints "Greetings From John!"
4040
```
4141

42-
With case classes, you cannot mutate their fields directly.
42+
With case classes, you cannot mutate their fields directly. (unless you insert `var` before a field, but doing so is generally discouraged).
4343

4444
```tut:fail
4545
emailFromJohn.title = "Goodbye From John!" // This is a compilation error. We cannot assign another value to val fields, which all case classes fields are by default.

0 commit comments

Comments
 (0)