Commit Graph

6615 Commits

Author SHA1 Message Date
Alexey Andreev 175d37fdc8 JS: add test to prove that KT-13523 is no more reproducible 2016-12-29 16:00:54 +03:00
Alexey Andreev 27c2a4f6a8 JS: disable mangling for PublishedApi. Export declarations marked with PublishedApi. See KT-15442 2016-12-29 16:00:51 +03:00
Alexey Andreev 1af01d0ecb JS: make call to suspend lambda to resume it immediately. See KT-15379 2016-12-29 16:00:35 +03:00
Alexey Andreev 84f094c770 JS: prohibit to implement functional interfaces. See KT-15136 2016-12-29 16:00:29 +03:00
Ilya Gorbunov 0a840d0174 Migrate 1.1 reflection API usages in tests. 2016-12-29 06:51:01 +03:00
Yan Zhulanow 5844f3cf1b Kapt3: Write stub class files with metadata (needed for incremental compilation) 2016-12-28 22:28:30 +03:00
Alexander Udalov 73845bfc27 Fix light-analysis test data 2016-12-27 18:19:49 +03:00
Alexander Udalov b4051c4577 Do not generate unnecessary super-call checks for functions with defaults
Such check should only be generated for a function in an open class

 #KT-11962 Fixed
2016-12-27 16:22:12 +03:00
Alexander Udalov 3d9c264d63 Do not generate CHECKCAST after 'null' literal
#KT-15411 Fixed
2016-12-27 16:22:12 +03:00
Mikhael Bogdanov 4c9bac084c Fix for KT-15437: VerifyError: Bad local variable type on simplest provideDelegate
#KT-15437 Fixed
2016-12-27 14:07:37 +01:00
Mikhael Bogdanov f1c1fcf0fc Fix for KT-11969: ProGuard issue with private interface methods
#KT-11969 Fixed
2016-12-27 14:07:37 +01:00
Alexander Udalov f8a88bdffb Fix "Rewrite at slice LEXICAL_SCOPE" for callable references
For special calls (when-expressions, if-expressions, etc.), do not attempt to
get type of the argument expression, which is the block with the callable
reference, instead get type of the callable reference itself. The difference
matters because for block expressions, a new lexical scope is created for each
getTypeInfo (see ExpressionTypingServices.getBlockReturnedType), and we do not
support rewrites of this value in the binding trace

 #KT-12044 Fixed
2016-12-27 10:45:46 +03:00
Mikhail Zarechenskiy 38a2518498 Fix computation of erased receiver for intersection types
#KT-9630 Fixed
2016-12-26 22:34:40 +03:00
Ilya Gorbunov 85232ffa07 Drop deprecated pre-1.0 API. Remove remaining usages in tests. 2016-12-26 19:07:20 +03:00
Alexey Andreev 11ce184d8e JS: add suspendCoroutine function 2016-12-26 12:45:14 +03:00
Alexander Udalov cf2839a088 Fix light-analysis test data 2016-12-24 14:37:24 +03:00
Alexander Udalov 5402d50ea3 Light analysis tests: do not render empty lines between classes and in the beginning 2016-12-23 22:30:48 +03:00
Alexey Andreev 1ecd957981 JS: fix translation of delegated constructor call from secondary constructor when argument is a complex expression which translates to multiple statements. See KT-15357 2016-12-22 17:19:24 +03:00
Alexey Andreev 1ab78dffe5 JS: fix translation of for statement when either next or hasNext method translates to multiple statements. Fix KT-15367 2016-12-22 17:19:24 +03:00
Alexey Andreev cef32b3327 JS: initialize fields of coroutine state machine with undefined value so that they match local variable semantics. Fix KT-15366 2016-12-22 17:19:23 +03:00
Mikhael Bogdanov 1040c97196 Fix for: KT-14011 Compiler crash when inlining: lateinit property allRecapturedParameters has not been initialized
#KT-14011 Fixed
2016-12-22 09:44:26 +01:00
Mikhael Bogdanov ef825a7559 Fix for KT-14868: CCE in runtime while converting Number to Char
#KT-14868 Fixed
2016-12-22 09:44:24 +01:00
Denis Zharkov 8475869fb3 Support common calls on suspend function typed values
Also support multiple value parameters in suspend function type

 #KT-15379 Fixed
 #KT-15380 Fixed
2016-12-22 11:15:52 +03:00
Denis Zharkov d0ba048342 Refine coroutine/suspend functions ABI
- `invoke` method must always start a suspend functions
- For creation of coroutine that has not been started yet, there are
two special internal interfaces `SuspendFunction0`/`SuspendFunction1`
2016-12-22 11:08:42 +03:00
Denis Zharkov 75174b4fba Fix issue on dumping override of suspend function
The meaning of `setDropOriginalInContainingParts()` call is that
it makes copyBuilder forget the original parts, in particular
the valueParameter.original.containingDeclaration does not reference
original descriptor no more

Otherwise the following exception is happening:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
	at java.util.ArrayList.get(ArrayList.java:322)
	at org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl.getOverriddenDescriptors(ValueParameterDescriptorImpl.kt:119)
	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
	at java.util.ArrayList.get(ArrayList.java:322)
	at org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl.getOverriddenDescriptors(ValueParameterDescriptorImpl.kt:119)
	at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt$hasDefaultValue$1.getNeighbors(DescriptorUtils.kt:192)
	at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt$hasDefaultValue$1.getNeighbors(DescriptorUtils.kt)
	at org.jetbrains.kotlin.utils.DFS.doDfs(DFS.java:98)
	at org.jetbrains.kotlin.utils.DFS.doDfs(DFS.java:99)
	at org.jetbrains.kotlin.utils.DFS.dfs(DFS.java:27)
	at org.jetbrains.kotlin.utils.DFS.dfs(DFS.java:37)
	at org.jetbrains.kotlin.utils.DFS.ifAny(DFS.java:47)
	at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.hasDefaultValue(DescriptorUtils.kt:189)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.renderValueParameter(DescriptorRendererImpl.kt:803)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.renderValueParameters(DescriptorRendererImpl.kt:767)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.renderFunction(DescriptorRendererImpl.kt:683)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.access$renderFunction(DescriptorRendererImpl.kt:42)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl$RenderDeclarationDescriptorVisitor.visitFunctionDescriptor(DescriptorRendererImpl.kt:1039)
	at org.jetbrains.kotlin.renderer.DescriptorRendererImpl$RenderDeclarationDescriptorVisitor.visitFunctionDescriptor(DescriptorRendererImpl.kt:1002)
	at org.jetbrains.kotlin.descriptors.impl.FunctionDescriptorImpl.accept(FunctionDescriptorImpl.java:760)
2016-12-22 11:08:42 +03:00
Alexey Andreev f42a15bc4f Fix test data for light analysis test 2016-12-21 17:31:29 +03:00
Dmitry Petrov 8fe9de1d35 Generate toArray methods defined in classes inherited from collections as public even if they are declared with different visibility in Kotlin. 2016-12-21 10:50:17 +03:00
Alexey Andreev eb5c79c70d JS: support int overflow behaviour in augmented assignment 2016-12-20 15:47:38 +03:00
Alexey Andreev c411a8febe JS: update tests 2016-12-20 15:47:37 +03:00
Ilya Gorbunov 10f8e70322 Rename ClosedComparableRange to ClosedFloatingPointRange 2016-12-19 18:36:52 +03:00
Denis Zharkov a1ac77d382 Support async iterator case with coroutines
Not all the `hasNext` operators return types is exactly Z,
suspend operators return boxed versions.

So the fix is just coercing result value after invoked function to Z
2016-12-19 11:07:33 +03:00
Denis Zharkov 5dbc04abbb Refine returns codegen for suspend functions
This change should make the logic a bit more simple.
For all suspend functions/coroutines treat them in expression codegen
like they return boxed version of the original type.

Everything works fine then, except Unit type functions:
their bodies must be generated just like they're VOID and then load
Unit on stack manually.
2016-12-19 11:07:32 +03:00
Denis Zharkov 01ff975cc0 Minor. Update tests on coroutines 2016-12-16 13:27:11 +03:00
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 845e116aa9 Update bytecodeText and bytecodeListing tests on coroutines 2016-12-15 23:58:00 +03:00
Denis Zharkov 8387d04425 Revert "Add special tests for interceptRun support"
This reverts commit 01c21e218a.
2016-12-15 23:57:59 +03:00
Denis Zharkov 7ffefb515f Update test data for LightAnalysis/Coroutines 2016-12-15 23:57:58 +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