Commit Graph

295 Commits

Author SHA1 Message Date
Alexander Udalov 8dae1b62dd Add CharSequence.subSequence
This is done primarily for JVM interoperability, otherwise it's impossible to
inherit from CharSequence there. On JS subSequence at the moment just invokes
substring.

 #KT-5956 Fixed
2014-11-27 20:38:19 +03:00
Alexander Udalov a7b88e9485 Make CharSequence.length a function instead of property
And String.length as well.

This is done for JVM interoperability: java.lang.CharSequence is an open class
and has a function 'length()' which should be implemented in subclasses
somehow.

A minor unexpected effect of this is that String.length() is now a compile-time
constant (it wasn't such as a property because properties are not supported in
compile-time constant evaluation)

 #KT-3571 Fixed
2014-11-27 20:38:17 +03:00
Alexander Udalov a6d759ff96 Minor, add test for obsolete issue
#KT-3587 Obsolete
2014-11-25 23:16:56 +03:00
Michael Bogdanov 8fc3a37989 Fix for KT-6312: Compiler crashes accessing inherited property of class object
#KT-6312 Fixed
2014-11-24 13:10:59 +03:00
Andrey Breslav 0eee83b6ec Lazy logs removed 2014-11-21 18:59:45 +03:00
Svetlana Isakova b71260f54e Moved tests
that are used both for codegen & diagnostics to codegen/box/diagnostics
2014-11-21 14:02:45 +03:00
Svetlana Isakova 2a83053355 Updated lazy log tests 2014-11-21 14:02:45 +03:00
Svetlana Isakova 8ad017c071 Extracted 'deparenthesizeArgument', used it where necessary
#KT-6176 Fixed
2014-11-21 14:02:41 +03:00
Michael Bogdanov 5412a67d29 Generate static backing fields for properties in object
#KT-4973 Fixed
2014-11-20 10:20:31 +03:00
Michael Bogdanov af998101b3 Fix for KT-4206: NoSuchFieldError with class objects
#KT-4206 Fixed
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
Stanislav Erokhin b7c473f59e Update lazy.log files 2014-11-17 17:45:01 +03:00
Stanislav Erokhin 2033042d33 Make candidates lazy in ResolutionTask & ResolutionTaskHolder 2014-11-17 17:38:52 +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
Pavel V. Talanov d2cfcfa659 Fix test data after changes to renderer and descriptors 2014-11-14 17:09:05 +03:00
Alexander Udalov 4f0d83a7fe Update lazy logs after field rename 2014-11-11 18:35:39 +03:00
Andrey Breslav 4892369cf4 Diagnostic tests are logging their lazy activity 2014-11-10 17:24:04 +02:00
Michael Bogdanov ad6afee53f Fix for KT-6196: ClassCastException on unit property initializer
#KT-6196 Fixed
2014-11-05 18:25:36 +03:00
Valentin Kipyatkov 0806de6782 Highlighting ranges should never include comments before/after element 2014-10-31 21:08:52 +03:00
Valentin Kipyatkov c93b78c6dc Fixed diagnostics tests 2014-10-31 21:07:50 +03:00
Alexander Udalov 35e956609a Rewrite mutable collection stub method generation
The main problem of the previous approach was that we were only generating
erased method signatures, which was incorrect in case a class also had a member
from another supertype with the same signature as the substituted one from the
collection. Javac issues compilation errors when compiling Java code against
such classes.

Also all the needed method stub signatures were hardcoded in
generateBuiltInMethodStubs() and the case of MutableListIterator was missing
2014-10-27 17:17:31 +03:00
Alexander Udalov fb5806f5fb Fix inheritance from mutable Java collections
Don't use CodegenUtil#getDeclaredFunctionByRawSignature because it's incorrect
in case of platform types. Instead use JetTypeMapper to find JVM signatures of
methods which are callable on the current class

 #KT-6042 Fixed
2014-10-22 10:51:14 +04:00
Andrey Breslav 7ed7f020d3 Generation of ++ and += fixed for platform types 2014-10-22 00:41:20 +04:00
Alexander Udalov 3a8ad45dec Append newline to EOF for .txt test data files
Reverts and fixes 102f0d3
2014-10-21 03:18:27 +04:00
Svetlana Isakova 4a1a95ea36 Rename: casted -> cast 2014-10-18 11:06:53 +04:00
Alexander Udalov 6ddc063a76 Regenerate test data on enums
Now they have final equals, hashCode and compareTo
2014-10-17 21:27:24 +04:00
Alexander Udalov 6ec71b3fd1 Generate lambdas in enum entry super calls
#KT-4423 Fixed
2014-10-17 21:27:22 +04:00
Alexander Udalov 159878e09d Pass correct outer instance in complex case of inheritance
#KT-5343 Fixed
2014-10-16 16:16:55 +04:00
Alexander Udalov 61674fb3d9 Don't put outer instance twice for anonymous object extending inner
#KT-5343 In Progress
2014-10-16 16:16:54 +04:00
Alexander Udalov 7315146753 Fix and refactor ExpressionCodegen#pushClosureOnStack
- change Closure parameter to ClassDescriptor, load closure in the beginning
- invert and rename boolean parameter, also use it only to prevent pushing
  dispatch receiver (not the extension receiver) onto the stack because the
  only non-trivial usage of it is preceded by manual handling of the dispatch
  (not extension) receiver. This fixes innerOfLocalCaptureExtensionReceiver.kt
2014-10-16 16:16:54 +04:00
Michael Nedzelsky aa3d0fe1d7 minor: rename TargetBackend enum values 2014-10-13 19:24:59 +04:00
Andrey Breslav 1dbfe5483a Fix isNullableType() to always consider flexible types, even if they contain type parameters 2014-10-13 15:38:01 +04:00
Michael Bogdanov a88e9666e4 As designed KT-5930: Wrong execution order in case of extension function
#KT-5930 As Designed
2014-10-13 11:31:15 +04:00
Michael Bogdanov 9d72036ba5 Fix for KT-5995: Labeled val causes an exception from the back-end
#KT-5995 Fixed
2014-10-13 11:30:28 +04:00
Michael Bogdanov 605c9f48b4 Added inline annotation check on local funs 2014-10-11 13:53:43 +04:00
Pavel V. Talanov b2c288b62a Test super calls in enum literals 2014-10-10 18:12:56 +04:00
Pavel V. Talanov 8e6618920d Minor: rename test data file 2014-10-10 18:05:36 +04:00
Pavel V. Talanov bb5998048f Test code generation for enum deriving from a trait 2014-10-10 17:43:33 +04:00
Evgeny Gerashchenko fa70192f75 Added test for EA-49318. 2014-10-10 16:00:27 +04:00
Michael Bogdanov d4307c69d2 Fix for KT-4301: Too many StringBuilders on string concatenations
#KT-4301 Fixed
2014-10-09 12:23:06 +04:00
Michael Bogdanov 4a078c1143 Temporary disable local fun inlining (it's not supported now) 2014-10-09 10:38:14 +04:00
Michael Bogdanov 41c4c3befd Fix test data for KT-3285 2014-10-08 09:34:50 +04:00
Michael Bogdanov 6b336be10c Obsolete KT-1776: Can't resolve members of auto-casted "this" in extension without typing "this" explicitly
#KT-1776 Obsolete
2014-10-07 17:21:11 +04:00
Michael Bogdanov 278e682595 Obsolete KT-3285: "A receiver of type ... is required" when using extension functions
#KT-5467 Obsolete
2014-10-07 17:21:11 +04:00
Michael Bogdanov bb3f1f1fb7 Fix for KT-5467: JVM codegen doesn't support capture of many extension receivers
#KT-5467 Fixed
2014-10-07 17:21:10 +04:00
Michael Bogdanov c3cfe33b64 Fix for KT-5495: Support method implementations in local traits
#KT-5495 Fixed
2014-10-07 17:21:10 +04:00
Michael Bogdanov d0d207f387 Fix for KT-3584: Wrong bytecode generated for local class with default parameters and captured local val
#KT-3584 Fixed
2014-10-07 10:13:53 +04:00
Michael Bogdanov 7be48c7336 Support move on depth 2 2014-10-07 10:13:52 +04:00