‘Primitive null’ sounds very much like an insult to null, which I approve.
-
-
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 -
Replying to @propensive @gabro27 and
Would be expect a different result in Scala.js or Scala native?
1 reply 0 retweets 0 likes -
Replying to @Kamugo @propensive and
The empty field values are decided by the runtime, so at least in theory I wouldn't rule out the chance of a different result. I don't think there's a shared spec.
1 reply 0 retweets 1 like -
There's a shared spec, insofar as reproducing the JVM behavior is the default definition of spec for Scala.js. Scala.js produces exactly the same result: https://scalafiddle.io/sf/7LsTeOQ/1 . I think we even have tests for that somewhere.
1 reply 0 retweets 3 likes -
Replying to @sjrdoeraene @Kamugo and
TIL :-) Is the spec shared for scala-native too?
1 reply 0 retweets 1 like
/cc @den_sh
-
-
Replying to @propensive @gabro27 and
Yep, it's the same on SN.https://gist.github.com/densh/3799ef55de1ff0d4cf138751a78e8049 …
0 replies 0 retweets 4 likesThanks. 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.