class Super class Sub extends Super implicit val s1 = new Super implicit val s2 = new Sub implicitly[Super] What do you think happens?
-
-
Replying to @sinisalouc
s2. AFAIU, the disambiguation mechanism chooses the most specific available implicit (http://eed3si9n.com/revisiting-implicits-without-import-tax …). But very confusing anyway.
1 reply 0 retweets 0 likes -
Replying to @ivan0yu
Yep. Both are valid Super values, yet Sub is more specific, hence not only there is no error but it's the one being used.
1 reply 0 retweets 0 likes -
Replying to @sinisalouc @ivan0yu
I could live with no error, but I would intuitively expect the exact match to be used, not its subtype. Another reason to avoid subtyping.
1 reply 0 retweets 0 likes -
Replying to @sinisalouc
Well, fortunately at least implicit val s1: Super = new Super implicit val s2: Super = new Sub gives an error :)
1 reply 0 retweets 0 likes -
Replying to @ivan0yu
Yeah. BTW there's also a rule for concrete vs abstract types, but that feels more logical (Foo[Bar] comes before Foo[T]).
1 reply 0 retweets 0 likes -
Replying to @sinisalouc @ivan0yu
BTW thx
@propensive for the yesterday's chat and explanation regarding this issue.1 reply 0 retweets 1 like
It was a pleasure!
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.