Oddbean new post about | logout
 nostr:npub1mwg4m445e2md4prxxg8ewtt0gdpmx22gf7kxr9maaemvv9pt745sealagv Ah, in this case it's all compile time, Type being an intrinsic.

You do have quite powerful compile-time reflection. For one there is ClassTag – this is weaker, but it allows you to create reified Arrays.

https://scala-lang.org/api/3.3.1/scala/reflect/ClassTag.html

Scala 2.x had TypeTag, with everything, but it was exposing compiler info so it was removed. You can use ClassTag for more depth, like what I did here, e.g.:

https://github.com/monix/newtypes/blob/main/core/shared/src/main/scala/monix/newtypes/TypeInfo.scala

Or smth like this is probably more complete: https://github.com/zio/izumi-reflect