Commit Graph

86272 Commits

Author SHA1 Message Date
Tianyu Geng f35680f0a4 FIR checker: resolve property with protected getter and public setter
Assuming Java class `Super` has a protected `getName` method and a
public `setName` method.

Then, in a subclass of `Super`, FE1.0 allows calls to `setName` via the
property syntax if the property is protected and invisible due to
dispatch receiver is not `this` or `super`.
2021-09-29 19:39:12 +03:00
Alexander Likhachev f27f91b03a [Build] Make JVM target settings logic less imperative
Previously actual value was dependent on the order of calls to `updateJvmTarget` and `configureJava9Compilation` in build script that may lead to inconsistencies
2021-09-29 16:34:11 +00:00
Alexander Likhachev 2f230833ac [Build] Create configuration in :kotlin-reflect-api to patch Java module
`compileOnly` configuration is unresolvable, and it's more preferable to create new configuration that extends from it rather than making it resolvable
2021-09-29 16:34:10 +00:00
Alexander Likhachev c6e1e4fd8e [Gradle] Make compileOnly/compile/runtime configurations not resolvable
#KT-48245 Fixed
2021-09-29 16:34:10 +00:00
Dmitry Petrov 86b3ea09c2 JVM_IR handle @EnhancedNullability types in null check simplification 2021-09-29 19:14:38 +03:00
Dmitry Petrov cc885f9b24 JVM don't remove NOP starting a try-catch block 2021-09-29 19:14:37 +03:00
Dmitry Petrov 9325660f06 JVM_IR fold safe calls and elvises 2021-09-29 19:14:36 +03:00
Dmitry Petrov 7370d096ee JVM_IR recognize safe calls and elvises in arbitrary IR 2021-09-29 19:14:34 +03:00
Dmitry Petrov ca7ee75f88 JVM replace redundant GOTOs with NOPs to preserve debugging behavior 2021-09-29 19:14:33 +03:00
Dmitry Petrov 0a67ab54fe JVM_IR more compact safe call chains (almost as old BE) 2021-09-29 19:14:32 +03:00
Leonid Startsev f4eaf611c8 Do not access serializable property IrField if it is unbound
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1698
2021-09-29 15:21:12 +00:00
Svyatoslav Scherbina 9672b6b30d kotlin-native/NEW_MM.md: update to 1.6.0-M1 and remove kotlin/temporary repo 2021-09-29 15:16:53 +00:00
pyos be53fc3467 IR: remove the use of lazy from LocalDeclarationsLowering 2021-09-29 16:25:43 +02:00
pyos 255e94e961 JVM_IR: add IrInstanceInitializerCall to suspend lambda constructors 2021-09-29 16:25:43 +02:00
pyos e1520c61da IR: use parameters for captures in field/instance initializers
val y = 1
    object { val x = y }
  ->
    class XKt$1(`$y`: Int) { val x: Int = `$y` }

Note that `$y` is not stored in a field because it's not used outside
the primary constructor.

One exception is captured inline parameters on the JVM backend, as the
bytecode inliner uses field assignment instructions (setfield) to locate
them; removing the field is thus not possible.
2021-09-29 16:25:43 +02:00
pyos 85c53bc24e IR: do not create unused capture fields
^KT-48784 Fixed
2021-09-29 16:25:43 +02:00
Leonid Startsev e7f1cef3a1 Correctly rearrange arguments for annotation constructors copied from another module
It won't fix KT-48181 completely, but it will allow to create such annotations
if all value arguments are specified.

For the full fix, we need to read default annotation values from classfiles in jar.

#KT-48181 In progress
2021-09-29 13:45:45 +00:00
Yahor Berdnikau 60cbfbf107 Change KotlinGradleSubplugin deprecation level to ERROR.
^KT-48830 Fixed
2021-09-29 12:13:02 +00:00
Pavel Kunyavskiy e15cfe8f70 [K/N] Use gradle-level conditional compilation for core symbolication 2021-09-29 07:00:07 +00:00
Pavel Kunyavskiy 9f2035c43d [K/N] Don't assume all apple target support CoreSymbolication 2021-09-29 07:00:07 +00:00
Ilya Gorbunov 193effc7c4 Fix Random.nextLong returning value out of range KT-47304
Correctly zero-extend the lower Int part of the Long being produced
2021-09-29 06:50:41 +00:00
Alexander Shabalin 43f64bc7b4 [K/N] Fix timer tests 2021-09-28 22:50:52 +00:00
Steven Schäfer 00134fddf9 Parcelize: Allow Parcelize annotation on sealed classes
See https://issuetracker.google.com/177856520
2021-09-28 22:16:33 +02:00
Denis.Zharkov 9ac29e0714 Fix enhancement when mixing TYPE_USE and non-TYPE_USE annotations 2021-09-28 22:59:18 +03:00
Tianyu Geng a5435c0efc Make FE1.0 report tailrec diagnostics on the keyword 2021-09-28 22:30:20 +03:00
Tianyu Geng 5252effb10 FIR checker: report tailrec problems on the keyword
FE1.0 reports it on the declaration signature. This is not ideal so we
move it to the `tailrec` keyword in FIR.
2021-09-28 22:30:09 +03:00
Ivan Kochurkin 922ae607f6 [FIR] Implement REPEATED_ANNOTATION for types refs ^KT-48652 Fixed 2021-09-28 21:33:06 +03:00
Ivan Kochurkin 3dc0935da4 [FIR] Pass bounds from original type to fully expanded ^KT-40203 Fixed 2021-09-28 21:32:54 +03:00
Sergej Jaskiewicz f0f60907e2 [JS IR] Fix generating property accessors
TL;DR, before we were emitting this JS code:
  Object.defineProperty(Base.prototype, 'bar', {
    configurable: true,
    get: Base.prototype._get_bar__0_k$,
    set: Base.prototype._set_bar__a4enbm_k$
  });

Now we emit this code instead:
  Object.defineProperty(Base.prototype, 'bar', {
    configurable: true,
    get: function () {
      return this._get_bar__0_k$();
    },
    set: function (value) {
      this._set_bar__a4enbm_k$(value);
    }
  });

This fixes the issue where if we had a @JsExport'ed base class with a
public property overridden in a non-exported derived class, we couldn't
access that property from JS if we were given an instance of
the derived class.

#KT-41912 Fixed
2021-09-28 20:04:38 +03:00
Svyatoslav Kuzmich 841f5a583e [Wasm] Support wasm target in multiplatform plugin 2021-09-28 18:26:07 +03:00
Roman Artemev 070c64f9b5 [JS IR] Add descriptive error message for js("...") call
Report a message instead of NPE if `js("...")`` code couldn't be emitted
2021-09-28 18:15:57 +03:00
Roman Artemev 920daac0a2 [JS IR] Fix string literal folder in codegen for js("...") function
Support `val v = "S"` and plus (`v1 + v2`) cases

Fix KT-48941, KT-47360 and probably KT-42681
2021-09-28 18:15:55 +03:00
Roman Artemev f05c8ad953 [JS IR] Fix js("...") call checker in frontend.
Call mather relies on that BuiltIn package fragment implement specific
interface `BuiltInsPackageFragment` which was missed. Make sure that
BuiltIn module's package fragments implement that interface.

Fix progression optimizer symbols resolve in JS & WASM IR BE
2021-09-28 18:15:51 +03:00
Roman Artemev 18950feeff [JS IR] Add tests for KT-48941 2021-09-28 18:15:48 +03:00
Ilya Kirillov 7d4d035287 Analysis API: add validity assertions to diagnostics 2021-09-28 15:55:24 +03:00
Ilya Kirillov 9fd988d727 Analysis API: regenerate diagnostic classes 2021-09-28 15:55:22 +03:00
Ilya Kirillov 6c97393927 Analysis API: get rid of weak refs scheme for working with FIR internals for diagnostics 2021-09-28 15:55:19 +03:00
Ilya Kirillov d723916d67 Analysis API: get rid of weak refs scheme for working with FIR internals for KtScope 2021-09-28 15:55:18 +03:00
Ilya Kirillov d348c48e4f Analysis API: get rid of weak refs scheme for working with FIR internals for KtSymbol and KtType 2021-09-28 15:55:17 +03:00
Ilya Kirillov 2de4a6f924 Analysis API: fix reference resolving for implicit invoke calls 2021-09-28 15:55:16 +03:00
Ilya Kirillov 7045e3ee45 Unmute passing FIR LC test 2021-09-28 14:19:15 +02:00
sebastian.sellmair 4eaabe54ee [Gradle] Finalize naming of 'runProjectConfigurationHealthCheckWhenEvaluated' API
^KT-48823
2021-09-28 12:11:10 +00:00
sebastian.sellmair 5430b19262 [Gradle] Add 'gradleKotlinDsl' dependency to 'functionalTestImplementation'
^KT-48823
2021-09-28 12:11:10 +00:00
sebastian.sellmair 29fb74d27d [Gradle] Don't run post-evaluation-checks on projects that failed to configure
When in 'lenient' or 'classpath' mode, Gradle will catch exceptions
during project evaluation and collect them into the
'ClassPathModeExceptionCollector'.

Running checks on the project after evaluation should only happen
if the project is properly configured (aka no such exceptions collected)
to prevent false positive error reports (that will then fail
the Gradle process and swallow the real cause)

^KT-48823 Verification Pending
2021-09-28 12:11:09 +00:00
Yahor Berdnikau e4827efb4a Remove WorkersIT test.
Now all compilations are using workers and issues should be covered
by other tests.

^KT-46406 Fixed
2021-09-28 11:41:09 +00:00
Yahor Berdnikau 3dc69495f9 Restore tasks outputs to pre-execution state in worker.
Workers usually execute later than task action and does not raise
exception to the task. Such behaviour skips task outputs restoration to
the pre-execution state.

Kotlin compiler on incremental compilation error leaves 'dirty*' files
in the build output, forcing Gradle to run non-incrementally on the
next build. Fixed it by moving task outputs reset logic into worker as
well.

^KT-46406 In Progress
2021-09-28 11:41:09 +00:00
Yahor Berdnikau 904f9c72f2 Remove 'kotlin.parallel.tasks.in.project' property.
^KT-46406 In Progress
2021-09-28 11:41:08 +00:00
Yahor Berdnikau 24454ba726 Split toolchain and jvm target validation tests.
Should slightly improve test suite execution time.
2021-09-28 13:38:06 +02:00
Sergej Jaskiewicz b3c681ee42 [JS IR] Tests for TS declarations of sealed classes
Also make sure we generate proper declarations for abstract and data
classes.

#KT-39364 Fixed
#KT-47376 Fixed
2021-09-28 13:54:48 +03:00
Vyacheslav Karpukhin 5530080a7d KMA-271 Android dependencies are not imported with AGP 7 2021-09-28 10:51:28 +00:00