mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
Introduce an abstract factory class ReflectionFactory which is responsible for creating reflection objects (KClass, KProperty, ...). The meaningful implementation is located in "reflection.jvm" where KClassImpl/KPropertyImpl/... are accessible and can be instantiated. The default implementation will be used in the lite runtime with no reflection and will return nulls / throw exceptions there. Put all functions, calls to which are generated by JVM back-end, in one place: the class named Reflection which contains only static methods. Previously these functions were scattered across different files in module "reflection.jvm". The code using reflection may now be compiled against either runtime, but reflection features will work if and only if reflection is accessible at runtime