Commit Graph

1381 Commits

Author SHA1 Message Date
Michael Bogdanov 67c2f7105b Fix for KT-6863: Internal compiler error folding functions
#KT-6863 Fixed
2015-04-10 08:59:27 +03:00
Alexander Udalov 6182b3ff5c Prohibit Array::class, require type arguments for reified parameters 2015-04-09 19:46:47 +03:00
Alexander Udalov 4956b24810 Merge two DescriptorRenderer parameters about parameter name rendering
Also disable parameter name rendering completely in
AbstractJvmRuntimeDescriptorLoaderTest because they can't be obtained anyway in
reflection
2015-04-07 20:25:08 +03:00
Alexander Udalov 87ef4ff7c5 Fix KClassImpl#toString to render Kotlin FQ name, not JVM one 2015-04-07 20:25:06 +03:00
Alexander Udalov 9c1e7f93d2 Reflection: refactor property construction and fix memory leak
Properties obtained by KClass.properties were having strong references to
descriptors (captured by closures, which are strongly retained by
DescriptorBasedProperty). Support initial value in lazy soft properties
2015-04-07 20:22:52 +03:00
Alexander Udalov 715641fb0d Call getMethod/getDeclaredMethod depending on visibility 2015-04-07 20:20:40 +03:00
Alexander Udalov 0202217135 Fix JVM signatures involving multi-dimensional array types
Apparently ASM's Type#getElementType returns the type of the array even if it's
multi-dimensional, so the loop was incorrect
2015-04-07 20:06:23 +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
Nikolay Krasko 2946c1d6a8 KT-7271 Accessing an extension property of Char.Companion leads to ClassNotFoundException in runtime
#KT-7271 Fixed
2015-04-07 15:59:05 +03:00
Stanislav Erokhin b703f59e04 Migrate kotlin sources, maven projects and stdlib to new lambda syntax 2015-04-07 13:08:53 +03:00
Stanislav Erokhin 6ab83c9b8c Added init keyword to builtins, maven projects and stdlib 2015-04-07 13:08:50 +03:00
Michael Nedzelsky 54df359134 JS: add default package name to DescriptorUtils.getPackageNames 2015-04-03 05:35:53 +03:00
Alexander Udalov 0b252505d9 Minor, add clarifying comment & inline useless property 2015-04-02 03:22:58 +03:00
Alexander Udalov 57be11a7e6 Minor, move common logic to ReflectJavaModifierListOwner 2015-04-02 03:22:22 +03:00
Valentin Kipyatkov 7a414336c1 Do not run partial body resolve if full body resolve already cached 2015-04-01 23:21:21 +03:00
Pavel V. Talanov 5fe8bb4a92 Drop ClassifierDescriptor#getClassObjectType()
Introduce utility for ClassDescriptor to use where necessary
2015-04-01 20:09:32 +03:00
Svetlana Isakova 61d0bcdf76 KT-7068 None of the following functions can be called with two functions with extention function parameter
#KT-7068 Fixed
2015-04-01 11:57:15 +03:00
Denis Zharkov a4018d9eae Run "Add 'init' keyword in whole project" quickfix 2015-03-31 20:20:23 +03:00
Denis Zharkov 8e69c06e5a Adjust stub-builder, decompiler and renderer to new PSI structure
of primary ctor
2015-03-31 20:20:22 +03:00
Mikhail Glukhikh 9c1551bca9 Implementation of smart casts for public / protected immutable properties that are not open and used in the same module.
DataFlowValueFactory and its environment refactoring: containing declaration is added into factory functions
as an argument and used to determine identifier stability. A few minor fixes. #KT-5907 Fixed. #KT-4450 Fixed. #KT-4409 Fixed.

New tests for KT-4409, KT-4450, KT-5907 (public and protected value properties used from the same module or not,
open properties, variable properties, delegated properties, properties with non-default getter).
Public val test and KT-362 test changed accordingly.
2015-03-31 16:19:03 +03:00
Alexander Udalov d2ef040bcb Fix occasional reflection test failure
The cache in moduleByClassLoader.kt contains weak references to instances of
RuntimeModuleData. However, prior to this change no one else had any _strong_
reference to the corresponding RuntimeModuleData: KClassImpl depends on the
ModuleDescriptor almost directly. Therefore the weak references were sometimes
garbage collected and a new module was constructed for a new reflection object,
which resulted in broken equality between two reflection objects.

No test added because it was rather hard to come up with (and, more
importantly, to support) a test case.
2015-03-30 19:44:19 +03:00
Alexander Udalov d59e1ad7ac Minor, add toString() to WeakClassLoaderBox for debug 2015-03-30 19:44:18 +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 d09e0e73fa Rename NameSerializationUtil, move serialization-related code there 2015-03-30 17:22:07 +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 b57e15f3a4 Move utilities from NameSerializationUtil to meaningful places 2015-03-30 17:22:06 +03:00
Denis Zharkov 418034add3 Prohibit instance access before super call
- Before this change members just left unresolved as they were absent in the
  specific scope named scopeForSecondaryConstructorHeaderResolution that
  created just to prohibit such accesses.
- Now they are resolved the same way as other members, but diagnostic is
  repored by in-place injected CallChecker
- Drop obsolete type of class scope

 #KT-6995 Fixed
2015-03-27 20:15:00 +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
Michael Nedzelsky 842eaa86a4 merge serialization.js module into js.serializer 2015-03-24 15:13:45 +03:00
Alexander Udalov 0fe0235525 Improve built-in initialization error message 2015-03-23 17:15:06 +03:00
Alexander Udalov 7e69a5ac9a Don't create KProperty instance for synthetic field
#KT-5759 Fixed
2015-03-23 16:30:26 +03:00
Alexander Udalov a5a60b6917 Move code from file named util.kt to meaningful place 2015-03-23 16:30:25 +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
Alexander Udalov 31554b9fa3 Introduce ClassId.getShortClassName() for convenience 2015-03-23 16:30:24 +03:00
Alexander Udalov 9cf0720925 Fix KClass.simpleName for local classes 2015-03-23 16:30:24 +03:00
Alexander Udalov 06537c5b14 Clarify 'class_fq_name` field in jvm_descriptors.proto
Regenerate protobuf files with protoc 2.5.0
2015-03-23 12:21:38 +03:00
Alexander Udalov 5d0af36432 Minor, pull equals/hashCode/toString up to DescriptorBasedProperty 2015-03-23 12:21:24 +03:00
Alexander Udalov e60c299def Fix warnings in module 'reflection.jvm', clarify some code 2015-03-23 12:21:17 +03:00
Dmitry Jemerov 50c4a88661 suppress documentation for HashPMap 2015-03-19 10:41:58 +01:00
Dmitry Jemerov e9ffd589fc @suppress for APIs in kotlin.reflect.jvm.internal 2015-03-19 10:33:31 +01:00
Dmitry Jemerov cffb80c86a Suppress documentation for the kotlin.internal package 2015-03-19 09:58:38 +01:00
Pavel V. Talanov bb2f08635c default -> companion: Minor: fix comment 2015-03-18 14:35:54 +03:00
Michael Nedzelsky af4afaba4a DescriptorUtils: add getPackagesFqNames 2015-03-18 09:38:49 +03:00
Michael Nedzelsky e0c0012a20 add serialization.js module 2015-03-18 09:38:47 +03:00
Michael Nedzelsky 9be62de964 add FlexibleTypeCapabilitiesDeserializer.Dynamic object 2015-03-18 09:38:45 +03:00
Michael Nedzelsky a7ba93c1d1 add flexibleTypeCapabilitiesDeserializer field to BuiltinsPackageFragment 2015-03-18 09:38:42 +03:00
Michael Nedzelsky c927b69103 DescriptorSerializer: add skip argument to packageProto method 2015-03-18 09:38:33 +03:00
Michael Nedzelsky 930ecb9cf9 move BuiltInsSerializerExtension from builtins-serializer to serialization module 2015-03-18 09:38:25 +03:00