Commit Graph

127 Commits

Author SHA1 Message Date
Alexander Udalov 4d95bcfc7e Rename CharSequence.get to charAt
This is done for JVM interoperability. There's still a member function
String.get() and an extension function "get" on CharSequence

 #KT-1730 Fixed
 #KT-5389 Fixed
2014-11-27 20:38:18 +03:00
Denis Zharkov 3b2d0b88f3 Supported nested reified parameter declarations
Also switched to using type names as identifiers instead of their
indices
2014-11-27 15:15:04 +04:00
Denis Zharkov 080610c208 Wrap parentCodegen before generating from inline 2014-11-27 14:58:04 +04:00
Michael Bogdanov e2826a47e1 Remove "operation" method from StackValue.kt;
Compilation fix: remove static import to kotlin from AsmUtil
2014-11-21 13:59:44 +03:00
Michael Bogdanov 3a70992d27 Lazy intrinsic generation
#KT-6241 Fixed
2014-11-21 13:59:43 +03:00
Michael Bogdanov ec649e83c3 Don't skip receiver with side effects on static calls
#KT-6278 Fixed
2014-11-20 10:20:33 +03:00
Michael Bogdanov 5a8944085a Fix default property setter generation 2014-11-20 10:20:32 +03:00
Michael Bogdanov 2cc9d8e29b Support platformStatic for properties
#KT-5766 Fixed
2014-11-20 10:20:31 +03:00
Michael Bogdanov 855bf772ca Prefix inc refactoring 2014-11-20 10:20:12 +03:00
Michael Bogdanov c7b1c0fe52 Store refactoring
#KT-1213 Fixed
2014-11-20 10:20:11 +03:00
Stanislav Erokhin 65c9ea2465 Fix variance problems. 2014-11-17 17:45:05 +03:00
Alexander Udalov 93696ff9bd Make Array.indices extension property, move to stdlib
This is not something that needs to be intrinsified. Note that compiler
optimizations are still possible and the fact whether 'indices' is a member or
an extension is irrelevant to the optimizer
2014-11-17 15:20:44 +03:00
Alexander Udalov 128c938965 Make Array.size() a function instead of a property
Also add a deprecated extension property to help migration. This is done to
unify getting size of arrays and collections
2014-11-17 15:02:38 +03:00
Denis Zharkov a8ca39754c Supported creating varargs of reified type parameter 2014-11-13 20:56:10 +03:00
Denis Zharkov 21699e1753 Supported reification for anonymous objects and lambdas 2014-11-13 20:56:08 +03:00
Denis Zharkov fc1d8dd9ce javaClass<T> is supported for reified T 2014-11-13 20:56:06 +03:00
Denis Zharkov f3c49c605f Typecheck instructions are supported for reified T 2014-11-13 20:56:06 +03:00
Denis Zharkov 4a66ab3627 Support generic array creation for reified inlined 2014-11-13 20:56:06 +03:00
Michael Bogdanov 25d7c9f20a Enabled disabled non-local returns in stdlib 2014-10-28 19:14:14 +03:00
Nikolay Krasko ea69f5a9a6 Fix for KT-6106: Using platformStatic crashes intellisense (but not Compiler)
#KT-6106 Fixed
2014-10-24 10:04:43 +04:00
Alexander Udalov c50ca3ab86 Fix empty stack trace in assertion for platform typed expression 2014-10-23 18:32:47 +04:00
Michael Bogdanov 6eaa6201f0 Test for obsolete KT-6020: Type inference failed on property reference of generic class
#KT-6020 Can't Reproduce
2014-10-21 09:47:17 +04:00
Alexander Udalov fe59dc27b3 Make 'when' on nullable enums exhaustive if 'null' entry is present
#KT-2902 Fixed
2014-10-21 00:16:06 +04:00
Alexander Udalov 624e507ec2 Make enum classes comparable
#KT-3727 Fixed
2014-10-17 21:27:23 +04:00
Alexander Udalov 1edaf43051 Fix Double and Float equality/hashCode in data classes
#KT-5818 Fixed
2014-10-17 21:27:22 +04:00
Denis Zharkov ec63394121 Check that boxing instruction is simple call
like T.valueOf(unboxType(T))

 #KT-6047 fixed
2014-10-17 01:22:25 +04:00
Michael Bogdanov 212d3da950 Fix for KT-5937: Receiver of javaClass-property hasn't been generated
#KT-5937 Fixed
2014-10-07 17:21:10 +04:00
Michael Bogdanov 989cae9f1f Fix for KT-4357: Compiler error with infix call to Array.get
#KT-4357 Fixed
2014-10-07 10:13:53 +04:00
Denis Zharkov f1d9d11590 Store stack values before inlines. #KT-5634 Fixed
Inlining code violates JIT assumptions for OSR in Java 8 in case of
starting with non-empty and containing cycles.

Fix is to mark each inlined block with markers and then store/restore
stack state before and after inlined body.
2014-09-29 17:16:58 +04:00
Alexander Udalov cd0551078c Support static method references
#KT-5123 Fixed
2014-09-26 18:48:43 +04:00
Denis Zharkov 35cda83c8f Refined merging logic #KT-5844 Fixed
If merging primitives of different integral types (e.g. I and Z) return
INT.
Else return UNINITIALIZED_VALUE
2014-09-26 12:37:04 +04:00
Alexander Udalov c30aa7db84 Include package part name to top level closure names
#KT-4234 Fixed
 #KT-4496 Fixed
2014-09-26 10:22:25 +04:00
Alexander Udalov c57441b51b Use '$' instead of '-' in package part class names
Otherwise some tools break (e.g. CheckMethodAdapter in ASM, used in generic
signature writer) because they expect class names to be Java identifiers.

Some tests fixed, some will be fixed in future commits
2014-09-26 10:22:20 +04:00
Natalia Ukhorskaya 655682ac97 Move regression tests from stdlib to compiler
#KT-5770 FIxed
2014-09-17 13:59:52 +04:00
Michael Bogdanov 08e02f4176 Moving platformStatic annotation to kotlin.platform package 2014-09-10 17:35:59 +04:00
Michael Bogdanov e26d635633 Initial implementation of platformStatic 2014-09-09 16:28:28 +04:00
Svetlana Isakova 9d366cb896 Prohibit local objects and enum classes
#KT-5402 Fixed
  #KT-4838 Fixed

Resolve type of object inside local object as special, not supertype('Any').
Changed visibility of constructor of anonymous object to 'internal' to be able to resolve the following:
fun box(): String {
    var foo = object {
        val bar = object {
            val baz = "ok"
        }
    }
    return foo.bar.baz
}
The containing declaration of property initializers is constructor, so 'baz' was invisible inside private constructor.
2014-09-01 12:32:52 +04:00
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 226bfe65f0 Don't make traits and annotations inherit from KObject
#KT-5609 Fixed
2014-08-13 17:19:56 +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
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
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 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
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