Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't see how this would make much sense.</p> <p>Let's just talk of what it sould mean for <code>implicitly</code>. It's supposed to fail to compile if there is no such implicit, or more than one eligeable. But because the actual type represented by <code>tpe</code> is not known until runtime, making <code>implicitly</code> work with a type instance would make it impossible to emit any kind of compile error. The best you could do is to arrange for any call to <code>implicitly</code> to always compile, have the compiler store somewhere a list of all the implicit values in scope (for any type), and at runtime lookup in this list and throw an exception if none matches the type represented by <code>tpe</code> (or if there are several). This could only make some kind of sense if we are talking about an alternate implementation of <code>implicitly</code>, say <code>dynamicImplicitly</code>. </p> <p>Note that this would require the explicit support from the compiler (to capture all the implicits in scope at each call to <code>dynamicImplicitly</code>, which would thus not be a mere simple function), and be very inefficient in terms of space (how many implicits can be in scope at one given point? Yes, a lot, and they would all need to be referenced somehow in the bytecode at each call to <code>dynamicImplicitly</code>).</p> <p>So my short answer is: don't hold your breath for this feature to be implemented anytime soon. Technically it might be possible to implement <code>dynamicImplicitly</code> as a scala macro (provided that it is possible to get all the implicits in scope from scala macros, which I'm not even sure)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload