Right. Primitive null.
-
-
‘Primitive null’ sounds very much like an insult to null, which I approve.
1 reply 0 retweets 10 likes -
But, did you see that it's finding the implicit in B, not the one in A? You can delete the trait, extends and override and you get the same answer.
1 reply 0 retweets 1 like -
Ah, yes of course. I've minimized the example from a real case that happened at work, but it's not as minimal as I thought!
1 reply 0 retweets 0 likes -
I mean, val a: Int = a is even more minimal!
2 replies 0 retweets 2 likes -
Holy, does that compile? I thought implicit search was part of the issue
2 replies 0 retweets 1 like -
val a: Int = a, step-by-step: 1. First ask the JVM for an empty int-field 2. Now, calculate the value to set it to 3. Look up the value in the field, a; turns out it's 0 4. Save the result in the field, a
2 replies 1 retweet 4 likes -
Any reason why the compiler allows such a circular reference? It's seems pretty easy to catch, but I'm sure I'm missing the complications.
1 reply 0 retweets 2 likes -
Replying to @gabro27 @propensive
You'll have to ask the compiler engineers. There are some limited checks in place for similar situations: > def x: Int = x <console>:11: warning: method x does nothing other than call itself recursively
2 replies 0 retweets 1 like -
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.
2 replies 0 retweets 0 likes
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.
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.