Yup :) And false for `Boolean`, \u0000 for char and null for all references types Gotta love trait initialization!
My assumption is that in the case of the trivial def, or the val which points at a stack frame, the compiler is faced with the immediate problem of what to compile this to, given there's nothing to compile.
-
-
Hm? `def x = x` is a perfectly cromulent recursive definition. Local `val`, I agree.
-
I wish it were opt-in for the recursive definition, and the default were... name-shadowing (as I'm a big fan). Gimme: `val username = username.toLowerCase` please. So I don't have to call them username1, _username, or whatever.
- Show replies
New conversation -
-
-
In other cases, there is always something to compile, which makes it basically impossible for the compiler to reason about whether it's correct or not, so it doesn't emit a warning.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.