scalamacros / paradise

(No longer actively maintained.)
http://scalamacros.org/
BSD 3-Clause "New" or "Revised" License
158 stars 53 forks source link

Liftable and Unliftable companion objects aren't available in 2.10.x #39

Closed xeno-by closed 8 years ago

xeno-by commented 10 years ago

Paradise for 2.10.x successfully injected Liftable and Unliftable traits into the Universe cake, but term injection is much harder, since everything I can think of involves overwriting existing bytecode in scala-reflect.jar, which is very bad thing to do.

Luckily, we have a really simple workaround here:

  1. Liftable.apply and Unliftable.apply can be easily emulated by creating instances of Liftable and Unliftable.
  2. Standard instances of Liftable and Unliftable, which constitute for the rest of members of the objects in question, don't live in companions in 2.10.x, but can still be summoned via implicitly without any imports.
xeno-by commented 8 years ago

As our experience shows, there's little demand for this feature, so I'll be recommending either an upgrade to 2.11.x (which is by now well-established in the community) or using the aforementioned workaround.