When resolving arguments on inner classifier, one can omit the arguments
for outer class 'Outer' if they are present implicitly in the scope:
- One of the supertypes of current class is Outer
- One of the outer classes or one of their supertypes is Outer
Relevant arguments are obtained from the first type found by
the algorithm above
Note that before this commit implicit arguments were only been searched
in containing classes
#KT-11123 Fixed
Writing source annotations enables incremental compilation for kapt2.
However they are not needed in bytecode, so we remove them when
copying classes.
# Conflicts:
# compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt
# compiler/frontend.java/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java
Delete KAnnotatedElementImpl because it's not possible to make it a class (its
subclasses have other classes in supertypes) to cache annotations in a property
23 invokes in KFunctionFromReferenceImpl (and consequently, in FunctionImpl)
were needed before 1576160390: a wrapped function
reference must have had the necessary invoke to be called as an instance of a
specific function type. After 1576160390, this is
not needed anymore because KFunctionFromReferenceImpl is now an internal
implementation detail of reflection, and no invoke is ever called on it.
Also store name in KPropertyImpl, so that calling 'name' on a KProperty
instance in the property delegate does not result in unnecessary descriptor
computation
The only place where their get/set methods were used was in
KPropertyNImpl.Getter.invoke, and it's fine if that results in a reflective
call instead (KPropertyN#getter is not available without kotlin-reflect.jar
anyway). The test data has been changed because a package local Java field is
not accessible via reflection
They are overridden in all subclasses anyway: either in the corresponding
(Mutable)PropertyReferenceNImpl class, or in the anonymous class for a
reference, generated by the compiler.
Most of KClassImpl operations should be cached, but creating a lazy value for
each operation would significantly increase memory footprint of a KClassImpl
instance. Therefore we decide to store all lazy values under a single lazy
value named 'data' which is stored in KClassImpl. There's a minor overhead of
indirection on any operation now, however it'll allow us to substantially
increase reflection performance by caching everything we can