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
Alexander Udalov
32c3bb8c7f
Extract module 'deserialization' out of 'serialization'
...
'deserialization' stays in core because it's needed both in compiler and
reflection, but 'serialization' is used only in the compiler
2015-03-30 19:44:17 +03:00
Alexander Udalov
085bc2197b
Merge module 'serialization.jvm' into 'descriptor.loader.java'
...
It was very small and there proved to be no point in separation of loading Java
classes and deserializing Kotlin classes
2015-03-30 17:22:06 +03:00
Alexander Udalov
fd48b4dd04
Minor, drop unneeded code in findClassInJava
...
JavaClassFinderImpl already checks that it never finds light classes and
ReflectJavaClassFinder can't ever find them
2015-03-26 21:34:53 +03:00
Pavel V. Talanov
ed218c473a
Get rid of 'class object' usages in code and builtins
...
Replace some comments and library usages as well
2015-03-25 18:28:00 +03:00
Alexander Udalov
9a041136f2
Make ClassId's relative class name FqName instead of FqNameUnsafe
...
It was FqNameUnsafe in times when there were classes without identifier names,
specifically class objects with names like '<class-object-for-...>'
2015-03-23 16:30:25 +03:00
Pavel V. Talanov
94937a39be
Increase ABI and stub versions
2015-03-17 15:52:41 +03:00
Pavel V. Talanov
06916d98c6
default -> companion: replace all mentions of default and default object
2015-03-17 15:47:39 +03:00
Pavel V. Talanov
2a6facaef6
default -> companion: default object -> class object in project code, builtins and libs code
2015-03-17 15:46:48 +03:00
Alexander Udalov
094fa2f92b
Report error on using reflection without kotlin-reflect.jar in classpath
...
Should be a warning because strictly speaking, the codegen doesn't need it
during the compilation. It's an error at the moment only to let all clients of
Kotlin reflection know that they must include kotlin-reflect.jar in the
classpath
2015-03-16 20:40:49 +03:00
Alexander Udalov
8af6ca5279
Delete kotlin.jvm.internal.KObject
...
It was supposed to be used in reflection but the benefits do not outweigh the
cost of KT-6951
#KT-3223 Fixed
#KT-6951 Fixed
2015-03-12 23:15:38 +03:00
Andrey Breslav
36bbd2c0e3
ErrorReporter is now Java-independent
2015-03-11 19:38:15 +03:00
Andrey Breslav
61989ba245
KT-6815 Representing raw types when used as supertypes for Java classes
...
#KT-6815 Fixed
2015-03-11 18:27:37 +03:00
Andrey Breslav
7c62d8ed83
Minor. Unused declarations removed
2015-03-11 18:27:37 +03:00
Denis Zharkov
4022982760
Add synthetic argument to default constructors
...
It's need to add synthetic argument (of type that user can't use)
to constructors with default arguments to avoid clashing with
real user's constructor having the same set of parameters
and additional int's arguments.
2015-03-11 17:45:28 +03:00