Commit Graph

36268 Commits

Author SHA1 Message Date
Ilya Gorbunov b2a4c27709 Provide extension unsafeCast for dynamic.
#KT-15310
2016-12-23 20:16:21 +03:00
Ilya Gorbunov c43e4f6682 Uncomment some assertions for overflow behavior that now can pass in JS 2016-12-23 18:14:32 +03:00
Ilya Gorbunov 6b509892cb Remove manual overflow for JS arithmetic operations 2016-12-23 18:14:32 +03:00
Ilya Gorbunov d3c82a2741 Minor: optimize imports. 2016-12-23 18:14:32 +03:00
Mikhail Glukhikh 194ff4ee76 Check possible smart cast to enum in when subject #KT-14705 Fixed 2016-12-23 15:10:56 +03:00
Mikhail Glukhikh 0e70e3f80e USELESS_ELVIS_RIGHT_IS_NULL is no more reported for flexible left argument #KT-13593 Fixed 2016-12-23 15:10:49 +03:00
Dmitry Petrov 8d16bd1215 Method can be hidden if it is annotated with kotlin.internal.PlatformDependent,
or is a Java method from a Kotlin built-in class (transitively).

https://github.com/Kotlin/KEEP/blob/master/proposals/jdk-dependent-built-ins.md#backward-compatibility-of-overrides
2016-12-23 13:51:08 +03:00
Dmitry Petrov d9271b54fb Fix IR generation: temporary variable in 'hashCode()' for data class should be 'var' 2016-12-23 10:44:14 +03:00
Dmitry Jemerov 514fc02938 Propagate 'implement' dependencies from Gradle to IDEA project model 2016-12-22 20:57:24 +03:00
Alexey Andreev 9b4b7960d3 JS: prevent compiler from importing module more than once if not necessary. See KT-15260 2016-12-22 17:19:25 +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
Alexey Andreev 8ef284daf4 JS: improve temporary variable elimination in some cases. Apply redundant statement elimination when statement in not synthetic, but its expression is 2016-12-22 17:19:23 +03:00
Alexey Andreev 35ab41e900 JS: when removing unused temporary variable, process its RHS value. Fix KT-15325 2016-12-22 17:19:22 +03:00
Nikolay Krasko 49d57124c1 Take new name when layout rename started from reference 2016-12-22 16:20:29 +03:00
Nikolay Krasko da5f2a0784 Always return identifier from handleElementRename() (KT-14358)
Returning reference will lead to replacing identifier with reference, that result bad psi, bad stubs, and failure at some point.

 #KT-14358 Fixed
2016-12-22 16:20:29 +03:00
Nikolay Krasko 8a49a017ff Use JavaRegExpHost for Kotlin RegExp injection (KT-15329)
#KT-15329 Fixed
2016-12-22 16:20:29 +03:00
Mikhail Glukhikh a78694e9be Test fix: spring test for gutter 2016-12-22 15:03:09 +03:00
Mikhail Glukhikh 4a1e6d3ef9 Inspection to convert two comparisons to range check #KT-5045 Fixed 2016-12-22 15:02:49 +03:00
Mikhail Glukhikh 67788e39d3 Fold initializer & if to elvis: search for variable usage inside if first #KT-14889 Fixed 2016-12-22 14:56:38 +03:00
Mikhail Glukhikh ee1b741e84 More accurate handling of Elvis in areParenthesesNecessary #KT-15227 Fixed 2016-12-22 14:56:32 +03:00
shiraji 6d6a16f399 KT-5045: intention to convert between two comparisons and range check and vice versa 2016-12-22 14:56:10 +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 fa77dd62c4 InlineResult convertion to Kotlin 2016-12-22 09:44:25 +01:00
Mikhael Bogdanov 7688237973 InlineResult.java->kt 2016-12-22 09:44:25 +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 ce333b0a58 Minor. Remove exception handling part from CoroutineMethodTransformer
There is no handleException operator anymore
2016-12-22 11:19:08 +03: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
Denis Zharkov 90c8e35331 Minor. Drop unused parts 2016-12-22 11:08:42 +03:00
Ilya Chernikov a9e9f36e1c Put native-platform-uberjar.jar into compiler embeddable and remove dependency from the compiler runner 2016-12-22 05:37:13 +03:00
Alexey Sedunov 12f2c04a0b Misc: Fix argument copying 2016-12-22 02:47:34 +03:00
Alexey Andreev f42a15bc4f Fix test data for light analysis test 2016-12-21 17:31:29 +03:00
Nikolay Krasko 2500dc9bb1 "Go to Type Declaration" is broken for stdlib types (KT-13001)
#KT-13001Fixed
2016-12-21 13:13:10 +03:00
Nikolay Krasko 6ca5ba3615 Don't call getClassDescriptor for local declarations (KT-15259)
#KT-15259 Open
2016-12-21 13:13:10 +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
Ilya Chernikov c5d03578a3 Update changelog with 1.1-M04 2016-12-20 18:31:20 +01:00
Alexey Tsvetkov 2ba28618ec Remove reference to removed dependency from pom.xml 2016-12-20 20:24:46 +03:00
Ilya Gorbunov 6ee8a23ddd JS: Drop native map get/set intrinsics altogether.
MutableMap.set extension operator is now common among stdlib and stdlib-js.
#KT-2323
2016-12-20 18:00:19 +03:00
Alexander Udalov e8c9e81235 Minor, move and rename test data directory 2016-12-20 17:29:30 +03:00
Alexander Udalov ca886ecb8d Do not report "delegation member hides override" when hidden member is final
This situation is erroneous because OVERRIDING_FINAL_MEMBER_BY_DELEGATION is
already reported, no need to report another error
2016-12-20 17:29:17 +03:00
Alexander Udalov 482b43631c Refactor DelegationChecker and related code
- move getDelegates from CodegenUtil to DelegationResolver, reuse it in
  DelegationChecker
- use getAllOverriddenDescriptors + filterOutOverridden instead of a manual DFS
2016-12-20 17:28:50 +03:00
Denis Zharkov 2dd7d89048 Fix built-ins overridability issue
See the comment for clarification

 #KT-15097 Fixed
2016-12-20 16:35:26 +03:00
Alexey Andreev e02d281ed4 JS: don't use strict comparison (===) for enums when both left-hand side and right-hand side are nullable. See KT-12598 2016-12-20 15:47:39 +03:00
Alexey Andreev c285e5ba3b JS: add tests too prove that operator conventions are correctly inlined. Support inlining of invoke operator. See KT-7588 2016-12-20 15:47:39 +03:00
Alexey Andreev d3d406356c JS: use optimized emulation of int32 multiplication. Add test for emulated int32 multiplication 2016-12-20 15:47:39 +03:00
Alexey Andreev 7d8df5c81c JS: optimize integer overflow emulation when possible 2016-12-20 15:47:38 +03:00
Alexey Andreev eb5c79c70d JS: support int overflow behaviour in augmented assignment 2016-12-20 15:47:38 +03:00