Commit Graph

889 Commits

Author SHA1 Message Date
Alexander Udalov 2ea9a2cfc9 Generate annotations on enum entry constants in bytecode
#KT-5665 Fixed
2014-08-25 17:50:08 +04:00
Denis Mekhanikov 1533c0e9f3 Support more than 32 default arguments
#KT-4675 Fixed
2014-08-20 20:47:34 +04:00
Alexander Udalov 99d4f97aef Fix access to top level delegated property from another property
#KT-5612 Fixed
2014-08-14 10:43:50 +04:00
Alexander Udalov 226bfe65f0 Don't make traits and annotations inherit from KObject
#KT-5609 Fixed
2014-08-13 17:19:56 +04:00
Alexander Udalov 47d5f83d04 Report unmet trait requirements
#KT-3006 Fixed
2014-08-13 17:19:55 +04:00
Alexander Udalov 415fe7a5e6 Initial support for classes in scripts and REPL 2014-08-13 15:13:22 +04:00
Alexander Udalov 9ae95c1e5c Generate codegen tests on scripts 2014-08-13 15:13:17 +04:00
Denis Zharkov e0ced7cbcf Boxing values merge fix. #KT-5588 Fixed
When merging Boxed value and something else just return MIXED_VALUE
2014-08-05 13:54:42 +04:00
Svetlana Isakova fb4c256d08 Added tests for choosing 'most specific' resolution candidate
Fixed test (while resolve with library on android): 'run' resolves to library function
2014-07-30 17:07:10 +04:00
Evgeny Gerashchenko 90b065e82b += tests fix 2014-07-29 12:06:36 +04:00
Denis Zharkov b86affaa3a Assignment operations test fix:
x is a byte, x += 2 translated to x = x+2, but type of (x+2) currently
is Int, so it's not compiled because Int can't be stored in Byte.

Maybe we need to think about what should be a result of sum of to
Bytes, but currently it's still Int
2014-07-28 22:00:15 +04:00
Denis Zharkov c4746bc90f Assignment operations test fix:
these methods used in expressions like a = a + b, so they need to return
NotNull when receiver is NotNull
2014-07-28 22:00:15 +04:00
Alexander Udalov c24c799819 Fix NoSuchMethodError on private components of data classes
A follow-up to
https://github.com/JetBrains/kotlin/commit/d5681540ec47ee5c9a548ba56df8b4e20097549d
2014-07-26 01:31:11 +04:00
Alexander Udalov 98ffdb3e32 Minor, delete Object from some test data 2014-07-25 21:19:39 +04:00
Alexander Udalov fb958897a9 Introduce kotlin.Cloneable
- Cloneable is a trait with a single protected member 'clone', which is mapped
  to java.lang.Cloneable on JVM
- 'clone' is non-abstract to be able to call 'super.clone()' in the
  implementations. Also if you need your class to be Cloneable, most of the
  time inheriting from Cloneable and calling 'super.clone()' will work
- hack 'super.clone()' in JVM intrinsics and TImpl delegation generation
- make arrays Cloneable, handle 'clone()' calls in the intrinsic

 #KT-4890 Fixed
2014-07-25 21:19:39 +04:00
Alexander Udalov a79398fa00 Don't load Object as a supertype for Java classes
#KT-4890 In Progress
 #KT-5002 Fixed
2014-07-25 21:19:37 +04:00
Alexander Udalov 485f63e1cd Rename object$ -> OBJECT$, instance$ -> INSTANCE$
According to Java code conventions, public static final constants should be
named with all capital letters
2014-07-25 21:15:13 +04:00
Zalim Bashorov c767ffc3e7 Unit.VALUE -> Unit in testData 2014-07-25 17:16:40 +04:00
Denis Zharkov 18cb479ef3 When2Switch: tests for non-literal expression in when by integral 2014-07-21 17:13:57 +04:00
Denis Zharkov 8d8c3d2b9e When2Switch: generate ifnonnull check for nullable values before *switch-opcode 2014-07-21 17:13:56 +04:00
Denis Zharkov d4cb822ee8 When by String constants:
Generate TABLESWITCH/LOOKUPSWITCH bytecode operation for when operator by String constants
2014-07-21 17:13:56 +04:00
Denis Zharkov 5a1c995b5c When by enum:
Generate TABLESWITCH/LOOKUPSWITCH bytecode command in case of "when" by enum entries
2014-07-21 17:13:55 +04:00
Alexander Udalov d5681540ec Fix NoSuchMethodError for data classes with private parameters
Introduced in a07909bb52
2014-07-19 02:13:26 +04:00
Alexander Udalov 65c21561a4 Fix super constructor calls of anonymous objects and local classes
If a class inherits from another class which captures something (outer class
instance, receiver parameter, local variables, etc.), the constructor of the
former class should contain all the parameters of the super constructor as its
own parameters, so that it could make a proper super call. All such parameters
are now replicated in the derived constructor with kind = SUPER_CALL_PARAM,
except an instance of the outer class (kind = OUTER), which can be taken from
the derived's own OUTER when it has one, to prevent multiple passing of the
same argument.

Previously it worked only when inheriting from inner classes via a special hack
(ConstructorFrameMap).

Also reuse recently introduced ArgumentGenerator to automatically take care of
default and vararg arguments of super constructor

 #KT-3581 Fixed
 #KT-5342 Fixed
 #KT-5343 Fixed
2014-07-18 16:26:46 +04:00
Alexander Udalov a07909bb52 Don't generate unnecessary accessors for private class properties 2014-07-17 19:18:05 +04:00
Alexander Udalov 4bdf7e3426 Use direct field access to trivial class properties
#KT-3845 Fixed
2014-07-17 19:18:05 +04:00
Denis Zharkov 0b2b8ba816 Fixed KT-5493: NPE fix 2014-07-17 18:43:44 +04:00
Denis Zharkov 0f5e29df9b tests added 2014-07-15 21:26:53 +04:00
Evgeny Gerashchenko 708816f09c Fixed generating method calls from same module when inlining. 2014-07-11 14:54:12 +04:00
Michael Bogdanov 6ddeb85c00 Added checking for ONLY_LOCAL_RETURN in actual parameter of inline function 2014-07-09 09:46:28 +04:00
Michael Bogdanov 6b34035455 Avoid exceptions in test setUp cause tearDown would not be invoked 2014-07-07 10:51:47 +04:00
Michael Bogdanov ce71c5abde Test update for new ONLY_LOCAL_RETURN diagnostic 2014-07-07 10:51:46 +04:00
Michael Bogdanov 8092717da4 Support non local return generation, support non local return inlining 2014-07-07 10:51:46 +04:00
Mikhael Bogdanov 02c6bdeaa3 Inline test data structure changed 2014-07-07 10:51:46 +04:00
Andrey Breslav 6422bafb7a More tests for synchronized() {} 2014-07-03 18:39:57 +04:00
Andrey Breslav 90690e0711 KT-4825 Implement "synchronized" properly via monitorenter/monitorexit
#KT-4825 Fixed
2014-07-02 22:05:45 +04:00
Alexander Udalov 36f7cc742f Introduce NoSuchPropertyException and IllegalAccessException
No new tests added because it's difficult to model a situation where a
::-access is allowed but the code throws these exceptions at runtime
2014-07-02 01:58:22 +04:00
Alexander Udalov bc8bce7ca1 Provide "toString" for reflection objects 2014-07-02 01:55:55 +04:00
Alexander Udalov c5d92cc03e Provide "equals" and "hashCode" for reflection objects 2014-07-02 01:55:55 +04:00
Alexander Udalov 704de8992e Support mapping between Java and Kotlin reflection objects 2014-07-02 01:55:55 +04:00
Alexander Udalov a38a396a43 Remove default import "kotlin.reflect"
Basic reflection is usable without any imports (with :: literals)

This reverts commit 9503056dd5.
2014-07-02 01:55:53 +04:00
Alexander Udalov 1ad037f621 Fix KClassOrigin for non-Kotlin classes
Check against presence of KotlinClass annotation
2014-07-02 01:55:21 +04:00
Alexander Udalov a86cfdc5de Add some simple tests on HashPMap 2014-07-02 01:26:23 +04:00
Alexander Udalov 89d6f25fb6 Fix initialization order of KClass field and class object fields 2014-07-02 01:26:21 +04:00
Alexander Udalov e7f19c531a Support 'accessible' for reflected properties on JVM
Calls Java reflection's isAccessible/setAccessible
2014-07-02 01:26:20 +04:00
Alexander Udalov 1275c84f92 Fail with IllegalAccessException on :: reference to private property
Instead of mysterious NoSuchMethodException
2014-07-02 01:26:20 +04:00
Alexander Udalov a8e1de48b8 Support :: references to Java instance fields in codegen
#KT-1183 In Progress
2014-07-02 01:26:19 +04:00
Alexander Udalov 5ab83aad8a Support references to extension properties in JVM codegen
#KT-1183 In Progress
2014-07-02 01:26:19 +04:00
Alexander Udalov 461cce103b Support references to top level and member properties in JVM codegen
#KT-1183 In Progress
2014-07-02 01:26:19 +04:00
Alexander Udalov 59777e7df6 Generate "$kotlinClass"/"$kotlinPackage" reflection fields to every class
Some seemingly irrelevant tests were changed because now there's <clinit> in
almost every class and class initialization begins with executing it
2014-07-02 01:26:18 +04:00