Commit Graph

855 Commits

Author SHA1 Message Date
Alexander Udalov 49de52e7ef Fix kotlinFunction for inline reified methods in reflection
Inline functions with reified type parameters are generated as private (see
AsmUtil.specialCaseVisibility), so we should treat them as "declared" in
reflection to look them up via getDeclaredMethod, not getMethod

 #KT-14721 Fixed
2016-12-16 13:12:41 +03:00
Stanislav Erokhin d7566d84d0 Fixed testdata. 2016-12-16 02:01:12 +03:00
Stanislav Erokhin b527a4d158 Global rename in test data for coroutines
(cherry picked from commit 132f97b)
2016-12-15 23:58:26 +03:00
Alexey Andreev e2d969d8b0 JS: implement new coroutine convention 2016-12-15 23:58:20 +03:00
Dmitry Petrov 9fd1ac72a9 Purge remaining traces of @AllowSuspendExtensions. 2016-12-15 23:58:19 +03:00
Denis Zharkov 8387d04425 Revert "Add special tests for interceptRun support"
This reverts commit 01c21e218a.
2016-12-15 23:57:59 +03:00
Stanislav Erokhin e014fb7181 Added coroutine import to back-end test. 2016-12-15 23:57:52 +03:00
Stanislav Erokhin 7d1b883171 Replace @Suspend to suspend in box tests. 2016-12-15 23:57:50 +03:00
Denis Zharkov 6649f64e9f Support new coroutine convention in JVM backend 2016-12-15 23:57:40 +03:00
Alexey Andreev 1bcb225afa JS: fix translation of invoke convention call when it is declared as extension member inside class. See KT-15073 2016-12-15 19:53:37 +03:00
Alexey Andreev c82f8213b0 JS: extract outer class reference as dispatchReceiver from ResolvedCall, to include it into UsageTracker mechanism. This allows to capture outer class of super class in local classes. See KT-13166 2016-12-15 19:05:34 +03:00
Alexey Andreev 87f4e53544 JS: when translating nested classes of local classes, capture closure variables via outermost local class. See KT-12566 2016-12-15 19:05:34 +03:00
Alexey Andreev b50bfaf071 JS: add test to prove that KT-14419 is not more reproducible. Add test to prove that extension delegate with extension getValue is translated correctly. 2016-12-15 19:05:33 +03:00
Alexey Andreev b21f906856 JS: add tests to prove that compiler does not optimize RTTI and safe calls based on type information. Remove corresponding optimization for !! operation. See KT-14033 2016-12-15 19:05:33 +03:00
Anton Bannykh 1957ac347a JS: make enum valueOf() throw if not found. 2016-12-15 17:58:40 +03:00
Mikhail Zarechenskiy 5a829809d9 Add operator 'rem' as extension to BigInteger
#KT-14650 Fixed

 Note that after this change behaviour of '%' on BigInteger is changed,
now it works like a proper remainder
2016-12-14 15:29:00 +03:00
Alexey Andreev d9cf15a665 JS: deparenthesize LHS of assignment before choosing appropriate AccessTranslator. Fix KT-15169 2016-12-13 14:05:25 +03:00
Stanislav Erokhin 9dc9fb578f Rename toDelegateFor to provideDelegate. 2016-12-12 23:14:07 +03:00
Alexey Andreev a01fac9d10 JS: support toDelegateFor in JS backend (see KT-15163) 2016-12-12 23:14:05 +03:00
Mikhael Bogdanov 937a933150 Support local 'toDelegatedFor' properties 2016-12-12 23:14:02 +03:00
Mikhael Bogdanov c5e14a2059 Some new tests for 'toDelegateFor' 2016-12-12 23:14:01 +03:00
Dmitry Petrov 97d5bbf1c2 toDelegateFor: JVM BE implementation 2016-12-12 23:13:59 +03:00
Dmitry Petrov 5ddf8e60e6 Use delegate initializer expression resolution scope for 'toDelegateFor' resolution. 2016-12-12 23:13:57 +03:00
Alexey Andreev 1db4765801 JS: unmute shared box test that now passes 2016-12-12 14:30:43 +03:00
Mikhail Zarechenskiy 97ca51381a Gradual migration of operator 'mod' to 'rem'
- Introduce new 'rem' operator convention
 - Prefer 'rem()' to 'mod()' when both are available, even if mod() is a
   member, and rem() -- an extension
 - Place operator 'rem' under the language feature
2016-12-09 16:43:35 +03:00
Alexey Andreev cf25e17209 JS: add tests that emulates promises and wraps them in coroutines, using suspend functions outside of controller 2016-12-09 14:56:21 +03:00
Alexey Andreev 060f08a8dd JS: add support of interceptResume function in coroutine controller 2016-12-09 14:56:20 +03:00
Alexey Andreev 9eff193ea4 JS: support stack unwinding convention in coroutines 2016-12-09 14:56:20 +03:00
Alexey Andreev bf74400776 JS: re-enable coroutine tests for JS backend 2016-12-09 14:56:19 +03:00
Mikhael Bogdanov 18cb734c58 Do not mangle internal @PublishedApi functions 2016-12-09 11:55:16 +01:00
Mikhael Bogdanov 627dd66ed5 New ieee754 arithmetic, Fix for KT-14651: Floating point comparisons shall operate according to IEEE754 2016-12-09 09:48:46 +01:00
Ilya Gorbunov d60fc7d9a8 Introduce ClosedComparableRange interface which inherits ClosedRange to provide special comparison operation for double and float. 2016-12-08 20:50:11 +03:00
Ilya Gorbunov d91f3cba0b Add additional invariant to check in Range.contains optimization tests.
Change expectations for double and float ranges according to #KT-4481
 #KT-5044 #KT-4481

Custom 'rangeTo' might be unoptimized, but still 'in' should not diverge from 'contains'.
2016-12-08 20:47:25 +03:00
Alexey Andreev 68412ae94f JS: replace all usages of @native annotation with external modifier, in tests, stdlib, etc 2016-12-08 15:41:39 +03:00
Alexander Udalov c811c1bea5 Reflection: add KAnnotatedElement.findAnnotation
#KT-12250 Fixed
2016-12-07 21:45:24 +03:00
Mikhail Zarechenskiy 0134b8819b Optimize const vals by inlining them at use sites
#KT-11734 Fixed
 #KT-13570 Fixed
2016-12-05 22:11:33 +03:00
Alexey Andreev 784fe31053 JS: fix translation of calls with aliased labeled lambda arguments. Fix KT-14999 2016-12-05 09:19:06 +03:00
Denis Zharkov b8e1ce7a05 Report error on non-tail suspend-calls
It only concerns calls inside another suspend function

 #KT-14924 In Progress
2016-12-01 10:11:37 +03:00
Denis Zharkov fcd9ee037e Support coroutines stack-unwinding in JVM backend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov 27e4caf046 Temporary disable coroutine tests in JS backend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov 1f98accad2 Support new suspend convention in JVM backend partially
Stack-unwinding does not work yet

 #KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Anton Bannykh 159df7964a JS: bound callable references (KT-13573). 2016-11-28 16:33:58 +03:00
Dmitry Petrov 3d2696c81b KT-13440 Bound callable references in reflection 2016-11-25 16:11:18 +03:00
Dmitry Petrov 5879e201cd Proper equality comparison for bound callable references represented as reflection objects
(including references to property accessors).
2016-11-25 14:49:24 +03:00
Dmitry Petrov 3dd0c9d1c7 Equality comparison for bound callable references takes into account bound receiver.
Fixed KT-14939: use expected receiver type when generating receiver code in get/set methods for bound property references.
Otherwise we have VerifyError for bound receiver 'null' of type 'Nothing?', which is mapped to 'java.lang.Void'.

TODO: proper equality comparison for property accessors ('x::prop.getter', 'x::prop.setter').
2016-11-25 14:49:24 +03:00
Alexey Andreev 66c78be10f JS: don't optimize RTTI when possible, i.e. don't remove is and as when object is known at compile time to have type in RHS of expression. Substitute kotlin.Any with Object. Fix #KT-7665, #KT-7664 2016-11-25 14:08:13 +03:00
Alexey Andreev 23428c9544 JS: fix coroutine test. Fix hanging IDEA tests 2016-11-23 17:01:03 +03:00
Alexey Andreev 40e00a62f5 JS: fix translation of augmented assignment when RHS changes value of LHS 2016-11-23 12:19:03 +03:00
Alexey Andreev dc8e90809c JS: coroutines: fix handling of throw statement inside try/catch block when controller has handleSuspend function 2016-11-23 12:19:02 +03:00
Alexey Andreev e44edf12e0 JS: coroutines: fix inlining of suspend functions 2016-11-23 12:13:54 +03:00