Commit Graph

60 Commits

Author SHA1 Message Date
Alexander Udalov
c811c1bea5 Reflection: add KAnnotatedElement.findAnnotation
#KT-12250 Fixed
2016-12-07 21:45:24 +03:00
Denis Zharkov
1f98accad2 Support new suspend convention in JVM backend partially
Stack-unwinding does not work yet

 #KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Dmitry Petrov
3d2696c81b KT-13440 Bound callable references in reflection 2016-11-25 16:11:18 +03:00
Ilya Gorbunov
0899a0fdda Make some tests JVM only 2016-11-21 18:20:33 +03:00
Alexey Andreev
b5358122e2 JS: unmute shared box tests 2016-11-16 19:50:10 +03:00
Alexander Udalov
eedad9194e Drop KParameter.isNoinline, KParameter.isCrossinline
There seems to be no valuable use cases for them at the moment
2016-11-15 11:01:17 +03:00
Alexander Udalov
7e82d139cf Drop KFunction.isTailrec
The fate of this modifier seems unclear, and there doesn't seem to be any
valuable use cases for it in reflection
2016-11-15 11:01:16 +03:00
Zalim Bashorov
596f3364c6 Automatically mute failed tests 2016-11-09 21:41:12 +03:00
Alexander Udalov
035d6156a7 Drop Cloneable in JS, synthesize it at compile-time on JVM
Use the same approach that is used for creating function type classes
(Function{0,1,...}) + add Cloneable to supertypes of Array and primitive arrays

 #KT-5537 Fixed
2016-10-25 15:42:33 +03:00
Alexander Udalov
621c6691d0 Support equals, hashCode, toString for annotations instantiated with reflection
#KT-13106 Fixed
2016-09-20 21:36:30 +03:00
Alexander Udalov
525937252d Support Java annotation constructors in reflection
#KT-13106 In Progress
2016-09-20 21:36:30 +03:00
Alexander Udalov
aeba124bdb Support Kotlin annotation constructors in reflection
#KT-13106 In Progress
2016-09-20 21:36:29 +03:00
Alexander Udalov
fb18e4bf4c Sort parameters of Java annotation constructors by name for stability 2016-09-20 21:36:29 +03:00
Alexander Udalov
a10cf8a931 Support 'is/as FunctionN<...>' and 'invoke' for KFunction instances 2016-09-13 14:12:31 +03:00
Alexander Udalov
fc043c6e66 Drop KPropertyNFromReferenceImpl classes
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
2016-09-13 14:12:29 +03:00
Alexander Udalov
90eafe0d71 Fix reflective access on overridden generic property reference
Generation of callable reference's signature in codegen should use the same
mechanism for obtaining the signature as the runtime in RuntimeTypeMapper,
namely DescriptorUtils.unwrapFakeOverride(...).original

 #KT-13700 Fixed
2016-09-12 10:39:21 +03:00
Alexander Udalov
5b1ee13db8 Make KClasses for primitives equal to KClasses for wrapper types
Both primitive int and wrapper type java.lang.Integer are represented by the
single type kotlin.Int in Kotlin, so inequality between the corresponding
KClasses was confusing here. To keep the old behavior, one may call 'k1.java ==
k2.java' instead of `k1 == k2`

 #KT-13462 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov
3efa738bc0 Fix NPE on .companionObjectInstance for built-in classes
#KT-13370 Fixed
2016-08-15 19:41:47 +03:00
Alexander Udalov
7f142253bf Reflection: simplify KTypeProjection 2016-08-08 17:54:11 +03:00
Alexander Udalov
a7f4037206 Reflection: change order of arguments of inner generic type
As in KClassifier.createType and everywhere in the compiler, specify arguments
for the innermost type first. This is more convenient to use because generally
the construction/introspection of such type starts from the innermost class
anyway (i.e. something like generateSequence can be used, without the need to
call .reverse() in the end)
2016-08-08 17:54:11 +03:00
Alexander Udalov
89d69bc7eb Reflection: add KClass.createInstance 2016-08-08 17:54:11 +03:00
Alexander Udalov
0525b1e6c1 Reflection: add KClass.declaredMembers 2016-08-08 17:54:11 +03:00
Alexander Udalov
30b7334e48 Reflection: add utilities to filter parameters by kind and name 2016-08-08 17:54:11 +03:00
Alexander Udalov
d78988a12a Reflection: add KVisibility, KClass.visibility, KCallable.visibility 2016-08-08 17:54:11 +03:00
Alexander Udalov
7e317f7a7c Reflection: add API for declaration modifiers
#KT-10447 Fixed
2016-08-08 17:54:11 +03:00
Alexander Udalov
ada81923dc Reflection: add KClass.isInstance, KClass.cast, KClass.safeCast
#KT-11284 Fixed
2016-08-08 17:54:11 +03:00
Alexander Udalov
3702f4a7a7 Reflection: add KClass.{isSubclassOf,isSuperclassOf}, KType.{isSubtypeOf,isSupertypeOf}
The behavior in primitives.kt is likely to be reconsidered

 #KT-8998 Fixed
2016-08-08 17:54:11 +03:00
Alexander Udalov
4cd252d9d5 Reflection: add KClass.{supertypes,superclasses,allSupertypes,allSuperclasses}
Some things are not implemented yet for allSupertypes, such as KType->Type
mapping of types and generic substitution of built-in types
2016-08-08 17:54:11 +03:00
Alexander Udalov
486ea62c72 Reflection: add KType.withNullability 2016-08-08 17:54:11 +03:00
Alexander Udalov
f958483e56 Reflection: deprecate KClass.defaultType
Its semantics were unclear and its javaType was implemented incorrectly (it
should have returned ParameterizedType with star projections for generic type)
2016-08-08 17:54:11 +03:00
Alexander Udalov
6b79782951 Reflection: add KClassifier.starProjectedType
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
1edf3c7809 Reflection: add KClassifier.createType
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
153e837a84 Reflection: add KType.jvmErasure
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
e760b5ed53 Reflection: add KTypeParameter.toString
The test covers different type parameters with and without bounds, in case we
decide to also output upper bounds in toString
2016-08-08 17:54:11 +03:00
Alexander Udalov
170ea4dead Reflection: add KVariance, KTypeParameter.{variance,upperBounds,equals,hashCode} 2016-08-08 17:54:11 +03:00
Alexander Udalov
127e7ab5b7 Reflection: add KClass.typeParameters, KCallable.typeParameters
Inheritance from KCallable is removed in kt9078.kt because it was irrelevant to
the test and because it gets in the way of modification of KCallable
2016-08-08 17:54:11 +03:00
Alexander Udalov
f69cc01f8e Reflection: add KTypeProjection and KType.arguments
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
c1dd831e65 Reflection: add KType.classifier
#KT-8998 In Progress
2016-08-08 17:54:11 +03:00
Alexander Udalov
0ea885ce58 Move tests on KClass.java* to box/classLiteral/java
Also replace WITH_REFLECT to WITH_RUNTIME to test that these cases correctly
work without reflection in the classpath
2016-07-26 13:48:19 +03:00
Alexander Udalov
3b349e9be0 Fix reflection on reference to generic property
See a93484b457 for the similar fix to function
references

 #KT-12967 Fixed
2016-07-05 18:18:43 +03:00
Alexander Udalov
c07d0d48d3 Fix KCallable#callBy to JvmStatic companion object members
#KT-12915 Fixed
2016-06-30 19:41:47 +03:00
Alexander Udalov
311301f430 Check return type when locating method in reflection
#KT-11824 Fixed
2016-06-20 21:03:51 +03:00
Mikhael Bogdanov
ee7bbbf530 Fix for KT-12127: Undeclared type variable on delegated property backing field
#KT-12127 Fixed
2016-05-04 17:07:48 +03:00
Dmitry Petrov
e441f0509f KT-11943 Do not use intrinsic 'java' property if receiver type is not acceptable 2016-04-19 10:31:30 +03:00
Dmitry Petrov
583733be8d KT-11645 properly handle private property getter name mangling in reflection 2016-04-14 09:31:29 +03:00
Alexander Udalov
6924d883eb Support reflection calls to multifile class members
#KT-11447 Fixed
2016-03-28 21:11:14 +03:00
Alexander Udalov
f8dfaf4599 Merge boxWithJava testData into box, delete BoxWithJava test 2016-03-09 10:25:38 +03:00
Alexander Udalov
16a0ddd2fb Merge boxMultiFile testData into box, delete BoxMultiFile test 2016-03-09 10:25:38 +03:00
Alexander Udalov
06a67e6602 Merge boxWithStdlib testData into box, delete BoxWithStdlib test 2016-03-09 10:25:38 +03:00
Alexander Udalov
daab3db062 Add WITH_RUNTIME and WITH_REFLECT directives to box tests
Currently all tests in boxWithStdlib/ run with both runtime and reflection
included; eventually they'll be merged into box/ using these directives
2016-03-03 16:11:21 +03:00