Commit Graph

611 Commits

Author SHA1 Message Date
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
Alexander Udalov 73e4287aee Initial support of annotation loading at runtime
In order to locate an annotated entity, we need to implement almost the whole
Java element model (which will be used anyway for Java descriptor loading)
2015-03-11 16:42:17 +03:00
Alexander Udalov 356f54b5df Initial support of descriptor loading at runtime 2015-03-11 16:42:15 +03:00
Pavel V. Talanov 9ecf95532e Replace 'class object' with default object in project code 2015-03-10 18:07:46 +03:00
Alexander Udalov ed022f892b Drop JavaTypeParameter#getIndex 2015-03-07 02:32:14 +03:00
Alexander Udalov ca8831097f Resolve annotations on Java constructors
Also add tests on custom annotations on fields and methods
2015-03-07 02:32:14 +03:00
Alexander Udalov e136025ac5 Show "kotlin.Any" in decompiled text for local/anonymous types 2015-03-07 02:30:28 +03:00
Pavel V. Talanov f72f548a93 Add ClassDescriptor#isDefaultObject()
with dummy implementations for now
2015-03-05 13:06:12 +03:00
Pavel V. Talanov 48fbce9582 Refactor: process mentions of class object
Rename usages that refer to "default object" concept now
Test data file names are left as is
2015-03-03 20:57:08 +03:00
Pavel V. Talanov 7f672f8078 Minor: remove redundant class objects from project code 2015-03-03 13:04:30 +03:00
Alexander Udalov b99b1883bc Drop unused parameter in JavaToKotlinClassMap and subclasses 2015-02-25 20:13:46 +03:00
Alexander Udalov fca7a8c4a2 Drop PrimitiveTypesUtil, store desc in JvmPrimitiveType 2015-02-25 20:13:46 +03:00
Alexander Udalov e705ff2517 Write KotlinSyntheticClass annotation on when-by-enum mapping classes 2015-02-16 21:46:22 +03:00
Alexander Udalov 6ce8d6bd2e Serialize descriptors for local/anonymous classes on JVM
Reflection needs this information to work for local classes and anonymous
objects
2015-02-16 21:46:21 +03:00
Alexander Udalov 0d05fca838 Support serialization/deserialization of local classes
Most of these changes are aimed to support and correctly transform ClassId for
local classes, no actual bytes are written or read at the moment (see next
commits). See the comment on ClassId for clarification.

A hack in DescriptorSerializer which erased anonymous types to Any (which had
been breaking the consistency between descriptors resolved from sources and
from serialized information) is now gone
2015-02-16 20:19:54 +03:00
Alexander Udalov add9bb34cb Refactor ReadKotlinClassHeaderAnnotationVisitor
Extract a hierarchy of four nested classes instead of anonymous
2015-02-16 20:19:53 +03:00
Alexander Udalov 5d8ae3ed6a Minor, refactor some constants in JvmAnnotationNames
Declare KotlinClass similarly to KotlinSyntheticClass, this will be used later
2015-02-16 20:19:52 +03:00
Alexander Udalov cd9898fc43 Minor, rename and invert meaning of ClassId.isTopLevelClass
Also use a simpler constructor and simplify ClassDeserializer.ClassKey
2015-02-16 20:19:50 +03:00