In case something looks like a TypeTag and works like a TypeTag it may be considered as a replacement for the TypeTag
izumi-reflect
is a fast, lightweight, portable and efficient alternative for TypeTag
from scala-reflect
.
izumi-reflect
uses its own lightweight model of Scala types and provides a simulator of an important part of Scala typechecker.
izumi-reflect
compiles and initializes lot faster thanscala-reflect
tags,izumi-reflect
supports ScalaJS and ScalaNative,izumi-reflect
allows you to obtain tags for unapplied types (F[_]
) and combine them in runtime.
izumi-reflect
has been implemented by 7mind as part of Izumi and donated to ZIO.
This repository contains an independent and more conservative copy of the code comparing to Izumi one.
izumi-reflect
model is imperfect, though "good enough" for the vast majority of the usecases.
Known limitations are:
- Type boundaries support is very limited because of a problematic behavior of Scala 2.13 compiler,
- Recursive type boundaries/existentials are not supported,
- Path-Dependent Types are handled by symbolic names and may cause unexpected false-positives (comparing to Scala typer).
build.sbt
is generated by sbtgen. During development you may not want to mess with ScalaJS and ScalaNative, you may generate a pure-JVM Scala project:
./sbtgen.sc
Once you finished tinkering with the code you may want to generate full project and test it for all the platforms:
./sbtgen.sc --js --native