1. ConstantValue
* just holds some value and its type
* implementations for concrete constants
2. CompileTimeConstant
* is only produced by ConstantExpressionEvaluator
* has additional flags (canBeUsedInAnnotation etc)
* has two implementations TypedCompileTimeConstant containing a constant value
and IntegerValueConstant which does not have exact type
* can be converted to ConstantValue
Adjustt usages to use ConstantValue if flags are not needed
Add tests for some uncovered cases
Reporting the warning on each "::", as ReflectionNotFoundInspection did, is not
correct anymore, because for example name/get/set on properties works perfectly
without kotlin-reflect.jar in the classpath. So instead we report the warning
on calls to functions from reflection interfaces. This is not perfect either
because it's wrong in projects with custom implementations of reflection
interfaces, but this case is so rare that the users can suppress the warning
there anyway
#KT-7176 Fixed
Each property reference obtained by the '::' operator now causes back-end to
generate an anonymous subclass of the corresponding KProperty class, with the
customized behavior. This fixes a number of issues:
- get/set/name of property references now works without kotlin-reflect.jar in
the classpath
- get/set/name methods are now overridden with statically-generated property
access instead of the default KPropertyImpl's behavior of using Java
reflection, which should be a lot faster
- references to private/protected properties now work without the need to set
'accessible' flag, because corresponding synthetic accessors are generated at
compile-time near the target property
#KT-6870 Fixed
#KT-6873 Fixed
#KT-7033 Fixed
Get rid of all classes except kotlin.reflect.KFunction, which will be used to
represent all kinds of simple functions.
Lots of changes to test data are related to the fact that KFunction is not an
extension function (as opposed to KMemberFunction and KExtensionFunction who
were) and so a member or an extension function reference now requires all
arguments be passed to it in the parentheses, including receivers. This is
probably temporary until we support calling any function both as a free
function and as an extension. In JS, functions and extension functions are not
interchangeable, so tests on this behavior are removed until this is supported
The information includes the owner (class, package, script, or null for local
functions) and the JVM signature -- this information will be used by reflection
to locate the symbol
If lower bound of flexible is nullable treat it like Kotlin nullable type
Anyway appropriate errors are reported outside JavaNullabilityWarningsChecker
It's needed to enhace types when loading descriptors via reflection.
Also get rid of `enhanceSignatures` method in ExternalSignatureResolver as enhancement does not use external signature at all
This was happening on the upcoming hierarchy of property getters and setters in
kotlin.reflect. No test added because it's not so easy to come up with a small
example, and because the fix itself is rather trivial