Commit Graph

37144 Commits

Author SHA1 Message Date
Ilya Gorbunov 970490e097 Revert "Update rendered public API". This reverts commit a10c6f00f9.
Revert "Update stdlib reference and binary compatibility test data". This reverts commit 2d02e5106f.
2017-02-07 14:41:31 +03:00
Mikhail Zarechenskiy d7093db5c5 Allow to use emptyArray in annotation as argument
#KT-14236 Fixed
2017-02-07 14:07:20 +03:00
Mikhail Zarechenskiy 9f0403f72c Fix exception at accidentally wrong annotation argument type
#KT-13740 Fixed
2017-02-07 14:07:13 +03:00
Mikhail Zarechenskiy 655cf82534 Copy compileTimeInitializer for const property descriptor
#KT-15802 Fixed
2017-02-07 14:07:06 +03:00
Denis Zharkov 81c3edfc00 Refine cc7f0e2d83
getDispatchReceiver/getExtensionReceiver always return not-null value,
but in the absence of receiver this value is equal StackValue.none(), i.e.
has a size 1

The tests were passing because of the problems with the test framework:
4b9e20ab8c
2017-02-07 13:12:02 +03:00
Denis Zharkov 4b9e20ab8c Rethrow boxError in case of test failure 2017-02-07 12:48:06 +03:00
Denis Zharkov cc7f0e2d83 Fix codegen problem with safe-call on suspension point with two receivers
#KT-16145 Fixed
2017-02-07 11:56:37 +03:00
Denis Zharkov a10c6f00f9 Update rendered public API 2017-02-07 11:32:10 +03:00
Denis Zharkov 9697196473 Put startCoroutineUninterceptedOrReturn header to common stdlib 2017-02-07 11:08:27 +03:00
Denis Zharkov 4f6a77cf38 Introduce createCoroutineUnchecked intrinsic
Also use it for buildSequence implenentation

 #KT-16155 Fixed
2017-02-07 11:08:27 +03:00
Roman Elizarov 9a71a20ad6 Docs for startCoroutineUninterceptedOrReturn 2017-02-07 11:07:04 +03:00
Denis Zharkov 230564fb4a Minor. Get rid of code duplications for resume call wrapping in stdlib
Use processBareContinuationResume instead
2017-02-07 11:07:04 +03:00
Denis Zharkov 6dde567be4 Optimize startCoroutine impls, move them to common stdlib
Do not wrap initial continuation for startCoroutine in SafeContinuation

This changes leaves only internal declarations and intrinsics as platform
dependent parts of the coroutine library, the rest parts (public API)
is implemented through them in common module
2017-02-07 11:07:04 +03:00
Denis Zharkov a65d86293b Improve coroutines library layout
- Split CoroutinesLibrary into common and JVM parts
- Get rid of startCoroutine duplications
- Make suspendCoroutine implementation to be platform independent
2017-02-07 11:07:04 +03:00
Denis Zharkov 258ee0db75 Introduce startCoroutineUninterceptedOrReturn coroutine intrinsic
#KT-15716 Fixed
2017-02-07 11:07:04 +03:00
Denis Zharkov 29b0b30031 Make createCoroutine return a safe continuation
#KT-15718 Fixed
2017-02-07 11:06:50 +03:00
Alexander Udalov b780e6d374 Do not import "kotlin.comparisons" by default for language version 1.0
#KT-16199 Fixed
2017-02-07 10:15:57 +03:00
Alexander Udalov 8014000bd1 Update light analysis test data 2017-02-06 19:41:32 +03:00
Alexander Udalov 85e55810a7 Merge light-analysis tests into black box codegen tests
#KT-15382 Fixed
2017-02-06 19:41:29 +03:00
Alexander Udalov 5bd1a35eb1 Refactor bytecode listing & light analysis tests
Simplify AbstractLightAnalysisModeCodegenTest so that its logic can be merged
with black box codegen tests
2017-02-06 19:41:20 +03:00
Alexander Udalov 2d02e5106f Update stdlib reference and binary compatibility test data
After 0db60bf and 5cffb38
2017-02-06 19:39:15 +03:00
Alexander Udalov e58baa51ae Rename DoubleColonLHS.Expression.isObject -> isObjectQualifier 2017-02-06 19:39:15 +03:00
Alexander Udalov 478352b7e7 Fix callable reference to constructor of nested class in object
#KT-15951 Fixed
2017-02-06 19:39:15 +03:00
Alexander Udalov ca1ed850b8 Improve error on runtime of version different than API version
Include the actual runtime version in the error message
2017-02-06 19:39:15 +03:00
Alexander Udalov 57f8ef372f Report different runtime versions earlier than incompatibility with API version
Previously if you had kotlin-reflect 1.0 and kotlin-runtime 1.1 in the
classpath, checkCompatibleWithApiVersion was invoked first, and an error was
reported that suggested to pass "-api-version" to the compiler. However, no
correct "-api-version" can be passed in this case, because
checkMatchingVersions would then report that the two libraries have different
versions anyway. So, now we first ensure that all libraries have the same
version, and only then do check if the version is correct
2017-02-06 19:39:15 +03:00
Alexander Udalov 3a7eec8635 Check API version instead of language in JVM runtime versions checker
It should be a valid case to invoke the 1.1 compiler with the 1.0 runtime in
the classpath and "-api-version 1.0". However, previously it was an error and
the message suggested to specify "-language-version 1.0". Language version 1.0
implies API version 1.0, so this effectively made the "-api-version" option
useless
2017-02-06 19:39:15 +03:00
Dmitry Petrov e0cea468fa KT-15862 Inline generic functions can unexpectedly box primitives
Previous version of the boxing/unboxing analysis treated merging boxed and non-boxed values as a hazard.
If such merged values are not used (e.g., early return + local variables reused in inlined calls),
corresponding boxing/unboxing operations still can be optimized out.

All information related to boxed value usage by instructions is moved to 'BoxedValueDescriptor'.
Introduce "tainted" (and "clean") boxed values, with the following rules:

  merge(B, B) = B, if unboxed types are compatible,
                T, otherwise

  merge(B, X) = T

  merge(T, X) = T

  where
    X is a non-boxed value,
    B is a "clean" boxed value,
    T is a "tainted" boxed value.

Postpone decision about value merge hazards until a "tainted" value is used.
2017-02-06 16:22:26 +03:00
Simon Ogorodnik 98269c10d8 KT-15744 Intention to import sleep wrongly suggests Thread.sleep
#KT-15744 fixed
2017-02-06 14:56:18 +03:00
Alexander Udalov 389ddf26b3 Do not use LanguageVersionSettings.languageVersion directly 2017-02-03 19:35:17 +03:00
Alexander Udalov b784680fe2 Fix NPE on equals/hashCode for callable references without kotlin-reflect
#KT-11316 Fixed
 #KT-15847 Fixed
2017-02-03 19:35:16 +03:00
Alexander Udalov 0db60bf6cb Do not always generate synthetic "$annotations" as private
Since annotations are a part of the declaration, they must have the same
visibility as the declaration in the bytecode. Otherwise obfuscators like
Proguard might strip the "$annotations" method and no annotations would be
found via Kotlin reflection

 #KT-15993 Fixed
2017-02-03 19:35:15 +03:00
Mikhail Glukhikh 81e083a133 Join declaration and assignment: extra descriptor check for assignment of the same property 2017-02-03 19:26:51 +03:00
Mikhail Glukhikh 153bc79c08 Join declaration & assignment: do not suggest for non-first line of init / constructor #KT-15545 Fixed 2017-02-03 19:26:49 +03:00
Mikhail Glukhikh ea6e3c828d Join declaration & assignment: treat assignment with this. correctly #KT-16000 Fixed 2017-02-03 19:26:48 +03:00
Ilya Gorbunov 84f324e04f Add deprecated parseInt overload without radix parameter to provide better replacement. 2017-02-03 18:39:24 +03:00
Mikhail Glukhikh 6db698f5aa Correct order added for 'suspend' modifier #KT-16104 Fixed 2017-02-03 18:24:47 +03:00
Vyacheslav Gerasimov 1452129b60 Fixed InvalidMirrorException in uast while getting annotation argument location 2017-02-03 18:06:05 +03:00
Vyacheslav Gerasimov bad15249e7 Fixed exception in android lint 2017-02-03 18:06:05 +03:00
Vyacheslav Gerasimov 1ea2e8c1d1 Fixed KotlinLintTestGenerated.testJavaPerformance 2017-02-03 18:06:05 +03:00
Vyacheslav Gerasimov 6699b03c0b Fixed error reporting in AnnotationDetector
#KT-14920 Fixed

(cherry picked from commit 3647d53)
2017-02-03 18:06:05 +03:00
Vyacheslav Gerasimov 10517c16ee Uast 1.0.9 2017-02-03 18:06:04 +03:00
Denis Zharkov 5888c75d41 Minor. Refine implicit receiver for destructuring scope
Actually it should not be very important, but for sake of consistency
we should use null receiver even if we have one in an outer scope

This is a post-review fix
2017-02-03 17:58:52 +03:00
Ilya Gorbunov da81fb32a6 Add LowPriority annotation to deprecated functions to allow star-importing their replacements from kotlin.reflect.full. 2017-02-03 17:53:16 +03:00
Ilya Gorbunov af443ac046 Search java version in java.specification.version, prepare to that starting from java 9 it will contain only a single component. 2017-02-03 17:52:13 +03:00
Alexey Tsvetkov 62e42d6f45 Fix kapt1 with stubs test to main internal references 2017-02-03 17:16:08 +03:00
Alexey Tsvetkov de24e68adc Revert "Avoid having -d and -module set at the same time"
This reverts commit ac241e267648e9344d718c3a44446c6e13d8d2e4.
2017-02-03 17:16:08 +03:00
Denis Zharkov 2d88419c38 Fix annotation deserialization on suspend functions
Use proper initial/frontend version of suspend descriptor
when writing METHOD_FOR_FUNCTION, because serializer uses this version

Also this commit contains adjustments of neighboring code to the describe
change

 #KT-16093 Fixed
2017-02-03 16:44:22 +03:00
Sergey Igushkin 2516583ecf Fixed empty -libraries passed from Gradle plugin in CLI. 2017-02-03 13:20:53 +03:00
Anton Bannykh f0e3c87b84 JPS: fixed duplicate meta.js in case of multiple source roots in the same module. 2017-02-03 13:03:12 +03:00
Anton Bannykh 289a7a9cc3 JS: fixed support for test source roots (KT-6627) 2017-02-03 13:03:12 +03:00