Commit Graph

642 Commits

Author SHA1 Message Date
Alexander Udalov b474fa9278 Refactor fictitious function class kinds, reuse in J<->K map 2015-06-04 23:08:21 +03:00
Alexander Udalov d1df234cfe Support annotations as annotation arguments in reflection, add test
A follow-up to 281acb8 where this was supported in the compiler
2015-06-02 17:31:19 +03:00
Alexander Udalov dff3e17d88 Minor, swap order of parameters for clarity 2015-05-28 22:09:24 +03:00
Alexander Udalov d14e5b8a72 Restore and deprecate Function{n}/ExtensionFunction{n} classes for easier migration
Users' Java code will not break in common cases (when passing functions to
Kotlin), and deprecation warnings will be reported.

Provide an inspection with a quick fix which allows to replace deprecated
function class usages to the new classes. Include this fix to the "code
cleanup" action
2015-05-28 01:20:05 +03:00
Valentin Kipyatkov 281acb860e Loading of annotation class arguments from compiled classes 2015-05-27 16:15:50 +03:00
Alexander Udalov 48b18f18d3 Restore explicit imports of Kotlin function types in Java
This is a follow-up to 738a84e259 and
d4965a4f3e. Optimize imports in all files
affected in those commits, drop temporary _.kt
2015-05-26 18:46:27 +03:00
Alexander Udalov 34c6af0039 Advance stub and JVM ABI versions due to function type reform 2015-05-26 15:04:58 +03:00
Alexander Udalov 4141e0a8df Introduce fictitious numbered Function class descriptors 2015-05-26 15:04:54 +03:00
Alexander Udalov 738a84e259 Temporary hack to migrate functions to package kotlin.jvm.functions
Add a file in package 'kotlin.jvm.functions' to the project and replace
explicit imports of functions 'kotlin.Function{n}' to two imports 'kotlin.*'
and 'kotlin.jvm.functions.*', so that the codebase can be compiled both by the
old and by the new compiler
2015-05-26 15:04:34 +03:00
Michael Nedzelsky 6b64dcc4ee JvmProtoBuf: reuse one instance of ExtensionRegistryLite 2015-05-21 02:30:35 +03:00
Michael Nedzelsky ea8234adb9 convert JvmProtoBufUtil.java to kotlin, step 2: convert content 2015-05-21 02:30:32 +03:00
Michael Nedzelsky 2a6cd3dd96 convert JvmProtoBufUtil.java to kotlin, step 1: rename extentsion 2015-05-21 02:30:27 +03:00
Nikolay Krasko edeea5e399 Refactoring: move JavaDescriptorResolver extensions to idea-analysis module 2015-05-19 13:04:55 +03:00
Mikhail Glukhikh fdf0ea5546 Enum warnings fixed: deprecated delimiters, short super constructors, both in project and in libraries 2015-05-18 16:08:16 +03:00
Denis Zharkov 02659ca22d Adjust project code to new labels syntax 2015-04-30 10:16:42 +03:00
Dmitry Jemerov cce1be3892 rename JetClass.isTrait() to isInterface(); rename ClassKind.TRAIT to INTERACE 2015-04-29 16:50:19 +02:00
Alexander Udalov 890d18e7be Support external annotations in IDE when approximating flexible types 2015-04-29 01:09:36 +03:00
Alexander Udalov 2271ca1e81 Further simplify Java annotation resolution
Filter annotations by FQ name, get rid of unneeded properties, lazy values,
static import some stuff
2015-04-29 01:09:36 +03:00
Alexander Udalov d7c810a4d0 Copy only nullability/mutability annotations to types
Also don't render copied annotations
2015-04-29 01:09:35 +03:00
Alexander Udalov 3369da94e4 Rename annotationUtils.kt -> LazyJavaAnnotations.kt 2015-04-29 01:03:57 +03:00
Alexander Udalov 24bad39e76 Don't use external annotations in compiler
External annotations will be re-enabled in the IDE later.

This fixes LazyJavaAnnotations which was breaking the contract of Annotations:
findAnnotation(FqName) was looking for external annotations, while iterator()
did not. This resulted in some inconsistencies in the compiler and IDE tests.

The other way, i.e. making iterator() look up external annotations, would have
been too costly for the compiler and with no clear benefit at the moment.
2015-04-29 01:03:57 +03:00
Alexander Udalov fe602d34ce Support type annotations in cls stub builder
Also add test on decompiler
2015-04-29 01:03:56 +03:00
Alexander Udalov 0732b78853 Serialize/deserialize annotations on types 2015-04-29 01:03:55 +03:00
Pavel V. Talanov ac2cb9af74 Remove some usages of KotlinBuiltIns.getInstance()
Introduce DeclarationDescriptor.builtIns extension to get builtins where descriptors are available
Introduce various utilities in KotlinBuiltIns to check for primitive types and get fq names of builtins
2015-04-28 12:49:34 +03:00
Alexander Udalov d1f94e8468 Get rid of confusing javaToKotlinCovariant map 2015-04-24 02:09:34 +03:00
Alexander Udalov d2cd7b00bb Map intrinsic companion objects in JavaToKotlinClassMap
Get rid of multiple usages of IntrinsicObjects where JavaToKotlinClassMap was
already used, simplify code, and support loading of *CompanionObject as Kotlin
built-in companions from Java code.

Also fix a small bug where Boolean was considered a class with an intrinsic
companion in IntrinsicObjects, although it was not
2015-04-24 02:09:26 +03:00
Alexander Udalov 987206bf95 Merge JavaToKotlinClassMap and JavaToKotlinClassMapBuilder 2015-04-24 02:09:05 +03:00
Alexander Udalov 43c11b2925 Merge CollectionClassMapping into JavaToKotlinClassMap 2015-04-24 02:09:05 +03:00
Alexander Udalov a59fa5015e Merge KotlinToJavaTypesMap into JavaToKotlinClassMap
Also use this new Kotlin->Java mapping in RuntimeTypeMapper instead of
inheriting directly from JavaToKotlinClassMapBuilder
2015-04-24 02:09:05 +03:00
Alexander Udalov b956fb5eb0 Pull Java<->Kotlin primitive type mapping up to JavaToKotlinClassMapBuilder 2015-04-24 02:09:04 +03:00
Alexander Udalov 4b07ec11ea Change Class<?> parameter to ClassId in JavaToKotlinClassMap implementations 2015-04-24 02:09:04 +03:00
Alexander Udalov 0dec1eaaad Refactor RuntimeTypeMapper, extract IntrinsicObjects-related behavior
Make it similar to other JavaToKotlinClassMapBuilder implementations to be able
to get rid of that inheritance
2015-04-24 02:09:04 +03:00
Alexander Udalov 73de54f557 Get rid of unneeded additional map in JavaToKotlinClassMap 2015-04-24 02:09:03 +03:00
Alexander Udalov 23a792aa44 Somewhat simplify mapping of JVM primitive types 2015-04-24 02:09:03 +03:00
Alexander Udalov 0a66c78449 Disperse primitive type mapping in JavaToKotlinClassMap 2015-04-24 02:09:02 +03:00
Alexander Udalov d86b9c8f54 Drop unused primitive wrapper mapping in JavaToKotlinClassMap 2015-04-24 02:08:37 +03:00
Alexander Udalov 6a158c2b16 Remove unused method from PlatformToKotlinClassMap 2015-04-24 02:08:37 +03:00
Alexander Udalov 34fa61675d Replace more eager asserts in project with lazy 2015-04-24 02:08:22 +03:00
Nikolay Krasko f972e12331 Use constant for empty resolve result 2015-04-23 17:38:05 +03:00
Denis Zharkov 93bbd2cbbc Java: load annotations methods as properties 2015-04-23 08:10:31 +03:00
Alexander Udalov 44e35cad29 Make 'sure' an inline function with a lazy parameter
Also replace some other non-lazy stdlib function usages with the new lazy
'sure'
2015-04-16 13:55:06 +03:00
Denis Zharkov 294eb1dceb Load annotation parameter's type for ctr as contravariant
See comment in code
2015-04-16 10:40:20 +03:00
Denis Zharkov 8f0e290dec Create additional constructor for java annotation with Class-parameter
One of them with KClass<*> parameters and other with java.lang.Class<*>.

It's needed just for backward compatibility, and second one is deprecared.
2015-04-16 10:40:20 +03:00
Denis Zharkov f5111180c3 Load Class<?> as KClass<*> for Java annotations parameters 2015-04-16 10:40:20 +03:00
Denis Zharkov 0abc63261d Inject reflectionTypes into LazyJavaResolverContext 2015-04-16 10:40:20 +03:00
Denis Zharkov 07a4e8a405 Minor, move module property to LazyJavaResolverContext
All usages of LazyJavaPackageFragmentProvider.module
got it through LazyJavaResolverContext
2015-04-16 10:40:19 +03:00
Alexander Udalov 7e86d87133 Move built-in companion intrinsics to core to reuse in reflection 2015-04-07 20:06:23 +03:00
Denis Zharkov 9b1443954f Refine loading annotation parameters from java
- Parameter named `value` is always first
- Array parameter represented as vararg iff its name is `value` and all
  other parameters have default values

 #KT-2576 Fixed
 #KT-6641 Fixed
 #KT-6220 Fixed
 #KT-6652 Fixed
2015-04-07 19:31:29 +03:00
Stanislav Erokhin b703f59e04 Migrate kotlin sources, maven projects and stdlib to new lambda syntax 2015-04-07 13:08:53 +03:00
Denis Zharkov a4018d9eae Run "Add 'init' keyword in whole project" quickfix 2015-03-31 20:20:23 +03:00