Closest class found for the type or for a LUB of all intersection members in case of an intersection type.
Closest class found for the type or for a LUB of all intersection members in case of an intersection type.
A Scala type may not have an associated JVM class, as such
this class may not be sufficient to create instances of T
Only if tag.hasPreciseClass
returns true
it may be safe to reflect on closestClass
(Since version ) see corresponding Javadoc for more information.
Like scala.reflect.api.TypeTags.TypeTag, but supports higher-kinded type tags via
TagK
type class.In context of DI this lets you define modules parameterized by higher-kinded type parameters. This is especially helpful for applying
tagless final
styleExample:
Without a
TagK
constraint above, this example would fail withno TypeTag available for MyService[F]
errorCurrently some limitations apply as to when a
Tag
will be correctly constructed: * Type Parameters do not yet resolve inside structural refinements, e.g. T inTag[{ def x: T}]
* TagK* does not resolve for constructors with bounded parameters, e.g. S in
(You can still have a bound in partial application: e.g.
* Further details at https://github.com/7mind/izumi/issues/374
izumi.reflect.macrortti.LTag.Weak - summoner for izumi.reflect.macrortti.LightTypeTag that does not resolve type parameters and allows unresolved ("weak") type parameters to be part of a tag
izumi.reflect.macrortti.LTag - summoner for izumi.reflect.macrortti.LightTypeTag that does not resolve type parameters
"Lightweight Scala Reflection and why Dotty needs TypeTags reimplemented" https://blog.7mind.io/lightweight-reflection.html