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
Annotation arguments with default values are rendered as ... if renderDefaultAnnotationArguments is true.
Tests: java retention does not taken into account by Descriptor comparator.
Java retentinon changed to kotlin retention in some tests + one new test with java retention added.
More accurate tests for intentions in byte code (visibility controlled).
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
For each non-abstract non-declared (i.e. inherited from supertypes) method in
an interface we generate its static form to the TImpl, which calls the TImpl
method from the corresponding supertype.
The accidental override tests changed because we're now trying to generate the
delegate for the super method, not knowing that it will clash with the declared
method
#KT-2888 Fixed
#KT-5393 Fixed
- move some of boxWithStdlib tests under fullJdk/ directory, where they will be
compiled against the full JDK
- introduce FULL_JDK in-text directive for the reflection test as only 4 tests
out of 654 needed the full JDK
There is a lot of changes about closures calculating and generating.
1. As classes can have more than one constructor each of them should
have closure arguments.
2. Captured variables set is the same for all of them.
3. Within constructors bodies/delegating calls closure parameters
should be accessed through method arguments because fields may be
not initialized yet.
And String.length as well.
This is done for JVM interoperability: java.lang.CharSequence is an open class
and has a function 'length()' which should be implemented in subclasses
somehow.
A minor unexpected effect of this is that String.length() is now a compile-time
constant (it wasn't such as a property because properties are not supported in
compile-time constant evaluation)
#KT-3571 Fixed