8000 Update 2014-04-08-language-pitfalls.md · yutaono/scala.github.com@2bb9197 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2bb9197

Browse files
committed
Update 2014-04-08-language-pitfalls.md
solution baseon on early definitions added
1 parent 4e404af commit 2bb9197

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

overviews/core/_posts/2014-04-08-language-pitfalls.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Be aware of the order or use lazy vals or defs.
6262

6363
**Example 2 solution:**
6464

65-
// no solution for safely overriding a concrete val in parent class.
66-
// Use a def in the parent class as in Example 3
65+
// early definitions (SRS 5.1.6)
66+
new { override val x = 6 } with Foo
6767

6868
**Example 3:**
6969

0 commit comments

Comments
 (0)
0