Support class reference expressions without kotlin-reflect.jar in classpath

Currently not much you can do with them, but in the future '.java' extension
property will allow to get the Class instance from it.

Also introduce codegen tests with stdlib but without reflection in the
classpath.

Based on the work by @dnpetrov
This commit is contained in:
Alexander Udalov
2015-07-29 23:20:35 +03:00
parent 0b30758987
commit 628bb774fd
8 changed files with 101 additions and 21 deletions
@@ -31,18 +31,16 @@ import org.jetbrains.kotlin.serialization.jvm.JvmProtoBuf.JvmType.PrimitiveType.
import java.lang.reflect.Constructor
import java.lang.reflect.Field
import java.lang.reflect.Method
import kotlin.jvm.internal.DeclarationContainerImpl
import kotlin.reflect.KCallable
import kotlin.reflect.KDeclarationContainer
import kotlin.reflect.KotlinReflectionInternalError
abstract class KCallableContainerImpl : KDeclarationContainer {
abstract class KCallableContainerImpl : DeclarationContainerImpl {
// Note: this is stored here on a soft reference to prevent GC from destroying the weak reference to it in the moduleByClassLoader cache
val moduleData by ReflectProperties.lazySoft {
jClass.getOrCreateModule()
}
abstract val jClass: Class<*>
abstract val scope: JetScope
abstract val constructorDescriptors: Collection<ConstructorDescriptor>