Commit Graph

62796 Commits

Author SHA1 Message Date
Leonid Startsev e495c35ad7 Use upper bound as a type for polymorphic serializer
when it is used in sealed class case

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/753
2020-03-11 17:09:05 +03:00
Leonid Startsev 15fa6ea757 Do not insert @SerializableWith marker annotation if already present
Such situation may happen if generic class is customized by user
with object-kind serializer. In such case, both arguments from
generateSerializerGetter and generateSerializerFactory are objects.
See linked issue for details:

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/749
2020-03-11 17:07:17 +03:00
Leonid Startsev e20354926b Do not check 'no ctor parameters' for serializable enums
fixes https://github.com/Kotlin/kotlinx.serialization/issues/742

Do not use serializableIrClass if it is not bound (this may happen
in case we're generating external serializer for library class)

fixes https://github.com/Kotlin/kotlinx.serialization/issues/744
2020-03-11 17:07:16 +03:00
Mark Punzalan 79fef09bf5 [JVM IR] Add tests for KT-15971. 2020-03-11 14:33:31 +01:00
Mark Punzalan 2239b5ceab [JVM IR] Maintain KT-36188 bug compatibility between non-IR and IR
backends.
2020-03-11 14:33:31 +01:00
Sergey Igushkin 435e74b74b Redirect warning output to error log when allWarningsAsErrors is enabled
Issue #KT-35447 Fixed
2020-03-11 16:03:55 +03:00
Mikhail Glukhikh 47ebd38534 FIR2IR: fix origin of object literal constructor call 2020-03-11 16:01:58 +03:00
Mikhail Glukhikh 8231377f6b FIR2IR: convert qualifiers inside getClass properly 2020-03-11 16:01:57 +03:00
Mikhail Glukhikh 1812b490a1 FIR: set anonymous object constructor return type properly 2020-03-11 16:01:57 +03:00
Nicolay Mitropolsky d1739289c6 Uast: UastFakeLightMethod hashcode fix (KT-37200) 2020-03-11 15:54:01 +03:00
Alexander Podkhalyuzin 5bb74d9840 Fixed generated text from jvm classfile, when quotes is required
#KT-34759 Fixed
2020-03-11 15:41:41 +03:00
Dmitriy Novozhilov 36ec0a2e2e [FIR-TEST] Move FIR ide tests to separate module 2020-03-11 15:12:04 +03:00
Dmitriy Novozhilov 78f910e321 Regenerate tests 2020-03-11 15:12:04 +03:00
Alexander Udalov 4d2ee279c0 Remove unneeded workaround for IBM JDK and older intellij-core
The underlying problem (IDEA-206446) was fixed a long time ago and the
compiler is no longer affected by it.

 #KT-37286 Fixed
2020-03-11 12:49:38 +01:00
Svyatoslav Kuzmich f113c22450 [JS IR BE] Fix enum entry initialization
Keep helper fields uninitialized. This way thier initialization
would not depend on field initialization order.
2020-03-11 14:28:20 +03:00
Pavel Kirpichenkov 04f9a03796 [NI] Fix isNullableType for definitely not null type parameter
Consider type parameter with nullable bound not null
if it is inside of a definitely not null type.
2020-03-11 13:55:25 +03:00
Pavel Kirpichenkov 88ae9bc7d5 minor: rename test 2020-03-11 13:55:24 +03:00
Vladimir Dolzhenko 8af5e2bb04 Make copy-paste resolve task modal to avoid invalid psi elements
Due to background formatting pasted PSI elements become invalid quite soon and it is not possible to make resolve

#KT-37414 Fixed
2020-03-11 11:53:03 +01:00
Roman Golyshev 90750483ee KT-36860 Collect extensions from object on first completion
- This should not affect the performance of the completion, since all
object extensions are collected on the last step, when all main variants
are already collected
- Add more tests
- Also, disable completion of extensions from objects as callable
references (^KT-37395 Fixed)
- ^KT-36860 Fixed
2020-03-11 13:31:56 +03:00
Zalim Bashorov 7dc9a2fc64 [JS IR BE] Add intrinsic for hashCode on Boolean 2020-03-11 12:54:43 +03:00
Zalim Bashorov 2103c0e0f8 [JS IR BE] Add intrinsic for hashCode on String 2020-03-11 12:54:43 +03:00
Zalim Bashorov c8efe8c4ec Add tests for equals, hashCode, toString in String and Number 2020-03-11 12:54:42 +03:00
Zalim Bashorov 8e788e2169 [stdlib-js-ir] Copy Boolean and String sources and add equals, hashCode, toString 2020-03-11 12:54:42 +03:00
Zalim Bashorov 9e59d93ad5 [JS IR BE] Add intrinsics for hashCode on primitive number types 2020-03-11 12:54:42 +03:00
Zalim Bashorov adfb296e45 [stdlib-js-ir] Add equals, hashCode, toString to some builtins
Namely:
* Throwable;
* primitive numbers except Long (which implemented in Kotlin).
2020-03-11 12:54:42 +03:00
Zalim Bashorov 97e86fb2ce [stdlib-js-ir] Char shouldn't be a data class 2020-03-11 12:54:41 +03:00
Zalim Bashorov 7c874ccf0c [stdlib-js-ir] Hack: mark Char.toString by JsName to force keeping it 2020-03-11 12:54:41 +03:00
Zalim Bashorov 9e7f72382f [stdlib-js-ir] Remove BitUtils object and make all members toplevel
It works slightly better with IR DCE --
we get about 6% less code on box tests.
2020-03-11 12:54:41 +03:00
Zalim Bashorov 62014e6711 [JS IR BE] Add better error message when some function not found during init JsIrBackendContext 2020-03-11 12:54:41 +03:00
Zalim Bashorov 43171f67a8 [stdlib-js-ir] Cleanup exceptions 2020-03-11 12:54:41 +03:00
Zalim Bashorov d22e4495de [JS IR DCE] Improve handling overrides
Introduce the notion of contagious for overridable declarations.
So, now overriding uncontagious declaration will not lead to becoming a declaration reachable.
By default, all declarations treated as contagious, it's not the most efficient, but it's safest.
In case when we access a declaration through a fake-override declaration,
the original (real) one will not be marked as contagious, so, later,
other overrides will not be processed unconditionally only because
it overrides a reachable declaration.
2020-03-11 12:54:40 +03:00
Zalim Bashorov f60d0b2c7c [JS IR CLI] Change K2JsIrCompiler#executableScriptFileName's body to TODO() and provide a proper fix later 2020-03-11 12:54:39 +03:00
Zalim Bashorov 2a7e32d3ae [JS IR DCE] Add CLI option to print reachability info 2020-03-11 12:54:39 +03:00
Zalim Bashorov 16cd3f0cef [JS IR DCE] Print reachability info 2020-03-11 12:54:39 +03:00
Zalim Bashorov e6657b016f [JS IR DCE] Move withNested fun to get better diff in the next commit 2020-03-11 12:54:39 +03:00
Zalim Bashorov 95d248189f [JS IR BE] JsClassGenerator: don't use descriptor for error message 2020-03-11 12:54:39 +03:00
Leonid Startsev 01108d595c Fix broken test data from 5d73550b 2020-03-11 12:25:13 +03:00
Anton Bannykh 63a909dee6 JS: fix KT-37386
Anonymous object constructor parameters should not reuse JsName's
of the super class. Otherwise the temporary name renamer gets
confused.
2020-03-11 12:15:23 +03:00
Dmitriy Dolovov 182c1cee05 [Commonizer] Don't regenerate commonized KLIBs for *-SNAPSHOT versions 2020-03-11 15:18:35 +07:00
Georgy Bronnikov d032f9b9cc JVM_IR: handle common klibs when compiled via cli 2020-03-11 11:03:58 +03:00
Georgy Bronnikov 6af099c11a Typo fix 2020-03-11 11:03:58 +03:00
Ilya Gorbunov afab52c3bc Remove workarounds that called primary constructor manually 2020-03-11 02:09:32 +03:00
Vyacheslav Gerasimov 338dae7a83 Build: Apply checkCacheability.gradle.kts to buildSrc 2020-03-10 20:34:05 +03:00
Vyacheslav Gerasimov 35dc57d674 Build: Sort idea files in ivy repository to stabilize order
Sort by lowercase name, otherwise order may be different on win
2020-03-10 20:34:04 +03:00
Vyacheslav Gerasimov da0eeb0c28 Build: Exclude plugin.xml from runtime classpath normalization
Version is written to the plugin.xml in every build so we exclude it to
improve caching.
Add test for kotlin plugin version to checkArtifacts.gradle.kts
2020-03-10 20:32:22 +03:00
Vyacheslav Gerasimov a0b82c4dec Build: Compile against tollsJarApi in idea-jvm & jvm-debugger-coroutine 2020-03-10 17:24:21 +03:00
Vyacheslav Gerasimov f735396ffb Build: Make toolsJarApi() helper for JPS build 2020-03-10 17:24:21 +03:00
Vyacheslav Gerasimov c75ad13b66 Build: Remove all code from tools-jar-api leaving only declarations
Since method bodies are not required for compilation
strip them out to remove noise between different versions.
2020-03-10 17:24:21 +03:00
Vyacheslav Gerasimov ef169aa12b Build: Use preprocessed tools.jar for compilation
tools.jar from JDK has different public api on different platforms which
makes impossible to reuse caches for tasks which depend on it. Since we
can't compile against those classes & stay cross-platform anyway, we
may just exclude them from compile classpath. This should make tools.jar
compatible at least within one build of JDK for different platforms
2020-03-10 17:24:21 +03:00
Mikhail Zarechenskiy 8fbd22ff73 Add test to check consistency of pre_release flag in the compiler
It's important to have consistent pre_release flag values in the
 current and bootstrap compiler. Otherwise, it's possible to publish
 release compiler with pre_release artifacts (stdlib, for example) and
 vice versa.

 Once this test fails, the next step is to advance bootstrap compiler
2020-03-10 17:22:26 +03:00