Commit Graph

4941 Commits

Author SHA1 Message Date
Yan Zhulanow fc3bf3cca4 Implement lateinit in backend 2015-09-05 00:54:19 +03:00
Alexander Udalov d0a4f82203 Fix NO_KOTLIN_REFLECT directive handling in codegen tests
It was disabling reflection on classpath at compile time, but not at runtime
2015-09-04 20:18:59 +03:00
Mikhail Glukhikh eab288bdd7 annotation() now has no arguments. Syntax migration to Retention / Repeatable / MustBeDocumented combination
Deprecated test for annotation(params) completion deleted. A lot of tests changed.
2015-09-04 19:21:12 +03:00
Denis Zharkov 31244edec9 Deprecate deprecated in favor of Deprecated 2015-09-04 18:19:31 +03:00
Denis Zharkov 952d45dc8b Deprecate JVM platform annotations in favor of capitilized themselves 2015-09-04 18:19:31 +03:00
Denis Zharkov 5471a1d18a Add kotlin.external annotation and deprecate kotlin.jvm.native 2015-09-04 18:19:31 +03:00
Denis Zharkov 26f9bd7b63 Deprecate some of JVM flag annotations in favor of capitilized themselves 2015-09-04 18:19:31 +03:00
Denis Zharkov 9254b1b461 Deprecate tailRecursive in favor of tailrec 2015-09-04 17:23:26 +03:00
Denis Zharkov bbc192fda5 Deprecate suppress annotation in favor of Suppress 2015-09-04 17:23:25 +03:00
Denis Zharkov 11fed1674e Deprecate extension annotation in favor of Extension 2015-09-04 17:23:25 +03:00
Alexander Udalov df935f5bb7 Support reflection on lambdas and function expressions
Write a special annotation containing the bytes for the Callable protobuf
message and deserialize it at runtime properly

 #KT-9005 Fixed
2015-09-03 21:43:58 +03:00
Mikhail Glukhikh fa292ec0e0 Enum entries now can have no initializer if default secondary constructor is available. #KT-8484 Fixed 2015-09-02 18:23:07 +03:00
Yan Zhulanow 2ce9903356 Fix tests 2015-08-31 15:33:13 +03:00
Yan Zhulanow 552211b2f4 Add bytecode listing test for use site targets and default targets (with priorities) 2015-08-31 15:33:12 +03:00
Alexander Udalov a1097f7081 Add val KClass.staticProperties: Collection<KProperty0<*>>
To get static fields from Java classes
2015-08-29 18:37:41 +03:00
Alexander Udalov 593937d302 Support KCallable.callBy with map of parameters to arguments
callBy is able to handle optional parameters.

 #KT-8827 Fixed
2015-08-29 18:37:40 +03:00
Alexander Udalov 0d62680f63 Support KParameter.isOptional
#KT-8825 Fixed
2015-08-29 18:37:39 +03:00
Alexander Udalov fd97383f8a Fix mapping of jvmStatic functions
#KT-8800 Fixed
2015-08-29 18:37:38 +03:00
Alexander Udalov 9a8cf23ed4 Support KClass.companionObject and companionObjectInstance
#KT-7636 Fixed
2015-08-29 18:37:32 +03:00
Alexander Udalov 94d45f35d4 Support KClass.nestedClasses 2015-08-29 17:59:45 +03:00
Alexander Udalov 7c28a2e732 Support KClass.defaultType 2015-08-28 21:22:11 +03:00
Alexander Udalov ea8fe56704 Include property type to KProperty.toString 2015-08-28 21:11:31 +03:00
Alexander Udalov d36ef90dd6 Provide equals/hashCode/toString for KParameter implementation
Two KParameter instances are equal iff their backing descriptors are equal and
their callables are equal
2015-08-28 21:11:30 +03:00
Alexander Udalov d4825cf4f0 Support KParameter.kind: instance, extension receiver, or value 2015-08-28 21:11:22 +03:00
Alexander Udalov a73d02418d Introduce additional API for introspecting functions
memberFunctions, declaredMemberFunctions, staticFunctions, etc.

 #KT-8797 Fixed
2015-08-28 21:11:21 +03:00
Alexander Udalov ebe4a8ec89 Provide equals/hashCode/toString for KType implementation 2015-08-28 21:11:20 +03:00
Alexander Udalov 9882e86ecb Don't render contents of enum entry classes in .txt tests, regenerate tests
They are irrelevant because cannot be accessed from the outside anyway
2015-08-28 21:11:06 +03:00
Alexander Udalov 89f3cfc704 Support parameter names for Java 8 classes in reflection
Also support specifying additional options to javac in codegen tests, which was
needed to compile Java sources with the "-parameters" option
2015-08-28 21:11:01 +03:00
Denis Zharkov e8f91e596c Adjust test data after fixes about generic nullability 2015-08-28 18:50:26 +03:00
Alexander Udalov 8d9618348d Move .java and .kotlin extension properties to kotlin.jvm
Delete the old ones in package kotlin.reflect.jvm because otherwise the code
using those functions will become red in a lot less meaningful way (overload
resolution ambiguity) than if they're deleted (unresolved import)

Based on the work originally done by @dnpetrov

 #KT-8380 Fixed
2015-08-27 08:19:50 +03:00
Dmitry Jemerov 4743a69d76 rename platformName annotation to jvmName 2015-08-25 15:40:46 +02:00
Alexander Udalov 7dcb690254 Additional tests on reflection calls 2015-08-24 01:29:58 +03:00
Alexander Udalov ccb58d8601 Minor, add some tests on get/set/name/instanceof for properties w/o reflection 2015-08-24 01:29:58 +03:00
Alexander Udalov 9095fa2844 Make PropertyMetadataImpl a data class
To allow property delegates to use property metadata as a key in the hash map,
and to improve debugging experience
2015-08-24 01:29:57 +03:00
Dmitry Jemerov 341f09afd3 rename platformStatic to jvmStatic 2015-08-21 16:59:05 +02:00
Valentin Kipyatkov 468919f5d9 Fixed codegen crash on use of protected synthetic extension property 2015-08-12 18:17:09 +03:00
Dmitry Petrov b59bf6227f unqualified super: should be able to invoke methods of Any without extra hassle
when Any is an implicit immediate superclass
2015-08-12 12:14:14 +03:00
Mikhail Glukhikh b2653ad1e9 Deprecated enum syntax removed: most compiler tests 2015-08-10 16:24:12 +03:00
Alexander Udalov d3e39812cb Support mapping of KType to j.l.reflect.Type 2015-08-07 00:55:35 +03:00
Alexander Udalov 49b689f883 Do not allow to assign null to a non-null property via reflection
This was already working for accessor-based properties because the assertions
were already generated into corresponding accessors, but for fields we must
manually check the value against null
2015-08-07 00:55:33 +03:00
Alexander Udalov 3091f2af3b Report argument number mismatch nicely on wrong 'call()' invocation
The default Java reflection message in such case is not very helpful: "wrong
number of arguments"
2015-08-07 00:55:32 +03:00
Alexander Udalov 9c522b4d49 Refactor property calls in reflection, fix some corner cases
- compute a FunctionCaller instance for getter and setter so that "call" only
  delegates to that FunctionCaller's "call", in the same way it's done in
  KFunctionImpl
- use RuntimeTypeMapper.mapPropertySignature to get the exact origin and
  signature of a property and its accessors. This makes unwrapFakeOverride call
  unnecessary and also fixes some cases like private Java fields
- temporarily drop custom range checks, will be re-added soon
2015-08-07 00:55:30 +03:00
Alexander Udalov a91729e041 Fix isAccessible for property accessors 2015-08-07 00:55:30 +03:00
Mikhail Glukhikh 5b31560808 x?.y is now nullable even if y is Unit + three tests + codegen test fix + source code fix #KT-7936 Fixed #KT-8347 Fixed 2015-08-05 12:26:01 +03:00
Valentin Kipyatkov 9150c53832 Fixed codegen for non-public SAM-adapters 2015-08-04 18:05:57 +03:00
Alexander Udalov 6878453d44 Support KClass.objectInstance for objects and companion objects 2015-08-03 23:33:21 +03:00
Alexander Udalov 2eb5201575 Introduce KAnnotatedElement and val annotations: List<Annotation> 2015-08-03 23:32:23 +03:00
Alexander Udalov d1e67805fc Fix supertypes for reflected Java classes, always include j.l.Object
equals/hashCode/toString had not appeared in Java classes' "members" because of
this
2015-08-03 23:06:15 +03:00
Alexander Udalov af9ae46f9a Minor, fix test on KParameter.index 2015-08-03 23:06:14 +03:00
Mikhail Glukhikh 4bd48c4796 Regular modifier checker implemented (initial version). A set of tests fixed accordingly.
Most of modifier diagnostic is expressed by REDUNDANT_MODIFIER, INCOMPATIBLE_MODIFIERS, REPEATED_MODIFIER, WRONG_MODIFIER_TARGET, WRONG_MODIFIER_PARENT.
A set of modifier diagnostics is not in use now (but not deleted yet).
2015-08-03 19:41:50 +03:00