Commit Graph

90860 Commits

Author SHA1 Message Date
Dmitriy Dolovov 709101a56b [Native][tests] Refactoring: Extract configuration properties from NativeTestSupport 2022-01-28 16:23:35 +03:00
Dmitriy Dolovov bfc7e3d825 [Native][tests] Use new Gradle property for cache mode 2022-01-28 16:23:35 +03:00
Dmitriy Dolovov 18cd07ea5f [Test] Fix proper use of annotation parameter names in generated classes
When an annotation parameter has a different name than "value" or there is more than one annotation parameter we need to specify annotation parameter names explicitly in generated Java source code.

Fix using classes as annotation parameters in generated classes
2022-01-28 16:23:35 +03:00
Dmitriy Novozhilov 938baa5cfe [FIR] Support reading optIn annotations from module dump in MT and FP tests 2022-01-28 16:12:13 +03:00
Dmitriy Novozhilov 1265dda880 [FIR] Render diagnostic names in full pipeline tests 2022-01-28 16:12:12 +03:00
Dmitriy Novozhilov aab66bd623 [FIR] Support rendering diagnostic names in CLI FIR compiler 2022-01-28 16:12:12 +03:00
Dmitriy Novozhilov 5055e1eaf1 Add kotlinx_cli_jvm_* idea artifact to .gitignore 2022-01-28 16:12:11 +03:00
Alexander Shabalin 4c97b55adf [K/N] Simplify SingleThreadExecutor
Merge-request: KT-MR-5591
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-28 12:11:44 +00:00
Svyatoslav Scherbina 4cd60090e0 ObjCExport: fix replacing Kotlin class methods by Swift extensions
^KT-49937 Fixed
2022-01-28 11:15:39 +00:00
Dmitriy Novozhilov 199edd59f8 [FE] Delay StopPropagatingDeprecationThroughOverrides till 1.9
^KT-47902
2022-01-28 13:59:21 +03:00
Sergej Jaskiewicz 8149189585 [JS IR] Optimize away upcasts
#KT-50212 Fixed
2022-01-28 10:03:53 +00:00
Sergej Jaskiewicz 400a5a0f34 [JS] Add CHECK_TERNARY_OPERATOR_COUNT and CHECK_BINOP_COUNT directives 2022-01-28 10:03:52 +00:00
Pavel Kirpichenkov a220624769 [Commonizer] move commonizer setting keys to the commonizer-cli module
Get rid of `OptionAlias` as unnecessary; keys will be used directly
2022-01-28 12:22:50 +03:00
Pavel Kirpichenkov b17737d7de [Commonizer] minor: rename type commonizer options
Call it `context` to make more distinguishable from the global settings
2022-01-28 12:22:50 +03:00
Pavel Kirpichenkov 2609175d58 [Commonizer] Introduce commonizer settings
Add settings for a more fine-grained control over commonizer features
that will be added in the future

Add setting and KGP flag for optimistic number commonization

KT-51011
2022-01-28 12:22:50 +03:00
Igor Chevdar 1aea2d0437 [K/N][IR] Respect -Xlazy-ir-for-caches on caches building 2022-01-28 13:14:37 +05:00
Igor Chevdar 0cc48440e1 [K/N][IR] Properly handle enums when building caches
Helps to fix https://youtrack.jetbrains.com/issue/KT-50977 but not entirely
2022-01-28 12:35:50 +05:00
nataliya.valtman 5e721122e9 Add human readable timestamp in statistic 2022-01-28 09:58:00 +03:00
Pavel Kunyavskiy 1bc8061667 [K/N] Refactor suspension to reduce generated code size 2022-01-28 06:44:47 +00:00
Ilya Matveev 41c45b97e7 [K/N][Runtime] Switch thread state when triggering CMS GC 2022-01-28 12:25:03 +07:00
Ilya Matveev 1e78036a1b [K/N] Enable CMS GC by default for the new MM
Issue #KT-50713 Fixed
2022-01-28 12:24:57 +07:00
Artem Kobzar f835433221 test: add optional argument d.ts generation. 2022-01-27 19:45:00 +00:00
Artem Kobzar 0cf1ebd686 fix(d.ts for Default Argument Value): add question mark to exported funcitons with default parameter. 2022-01-27 19:44:59 +00:00
Simon Ogorodnik 4c5eb9ac32 KT-50889: Fix caching of module descriptors in K2MetadataKlibSerializer
Previously, in case of repeated analysis, descriptors cached in
CommonDependenciesContainer was initialized multiple times

 #KT-50889 Fixed
2022-01-27 17:32:18 +00:00
Dmitriy Novozhilov 794297eea3 Advance bootstrap to 1.7.0-dev-1132 2022-01-27 17:54:03 +03:00
Mikhail Glukhikh fd3d86eddf FE 1.0: introduce deprecation for Enum.declaringClass (KT-49653) 2022-01-27 17:27:40 +03:00
Mikhail Glukhikh 983fa4c8c7 FIR: add temporary access to Enum.getDeclaringClass (see KT-49653) 2022-01-27 17:27:39 +03:00
Mikhail Glukhikh c2ab09fa84 Add test for KT-49653 2022-01-27 17:27:38 +03:00
Roman Golyshev 9ff46004e4 FIR IDE: Remove typesCache from KtSymbolByFirBuilder
This cache wasn't working too well, because ConeTypes have
equals/hashCode implementations which do not account for types'
attributes (like annotations, for example).

Because of that, `String` and `@Annotated String` were considered the
same type, and the cache was remembering whichever came first.
2022-01-27 16:23:44 +03:00
Pavel Punegov 10ac98b029 [Gradle][test] Fix Cocoapods integration tests
The change 782b4f64be added plugin
management to settings that require at least 2 properties to be set.
2022-01-27 12:42:03 +00:00
Alexander Shabalin 4c8bb93560 [K/N] Helpers for saturating arithmetics in runtime
Merge-request: KT-MR-5496
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-27 12:32:40 +00:00
Victor Petukhov 1a23cd8c45 [FE 1.0] Don't try to report specialized resolution ambiguity error for builder inference if the corresponding substitutor is empty
^KT-50989 Fixed
2022-01-27 15:30:16 +03:00
Mikhail Glukhikh eeadd8588d Drop CommonCompilerArguments.optInDeprecated
On the way to KT-22956
2022-01-27 11:48:22 +00:00
Mikhail Glukhikh 5798320e9e Drop usages of CompilerArguments::useExperimental 2022-01-27 11:48:21 +00:00
Mikhail Glukhikh c255da815f Change some names in source code from useExperimental to optIn 2022-01-27 11:48:21 +00:00
Mikhail Glukhikh 3e00f41a99 Replace useExperimentalAnnotation with optIn in scripts 2022-01-27 11:48:20 +00:00
Sergej Jaskiewicz 4a724611d8 [JS IR] Extract varargs in bridges generated for external methods
The issue this commit fixes occurs when we have an external interface
implemented by a Kotlin class, if that interface has methods with
varargs.

Kotlin functions expect varargs passed as arrays, but JavaScript code
may be unaware of this convention.

So, when generating a bridge for external interface method
implementaion, we insert some additional logic for extracting varargs
using the JavaScript `arguments` object.

A simplified example:

```kotlin
external interface Adder {
    fun sum(vararg numbers: Int): Int
}

class AdderImpl: Adder {
    override fun sum(vararg numbers: Int) = numbers.sum()
}
```

For `AdderImpl` we generate the following JS code:
```js
AdderImpl.prototype.sum_69wd7h_k$ = function (numbers) {
  return sum(numbers);
};
AdderImpl.prototype.sum = function () {
  var numbers = new Int32Array([].slice.call(arguments));
  return this.sum_69wd7h_k$(numbers);
};
```

#KT-15223 Fixed
2022-01-27 11:06:17 +00:00
Sergej Jaskiewicz d5e46e0607 [JS IR] Introduce intrinsics for slicing array-like objects 2022-01-27 11:06:16 +00:00
Sergej Jaskiewicz 08e6116ecb [JS IR] Introduce jsArguments() intrinsic function
`jsArguments()` is lowered into a reference of the `arguments` object.

This is useful for extracting varargs, when calling Kotlin code from
JavaScript. For a concrete example, see KT-15223.
2022-01-27 11:06:16 +00:00
Sergej Jaskiewicz d8838f4e7b [JS IR] Fix binary operator lookup in JsIrBackendContext
Previously, if multiple operators with the same name were defined in
a single class, we could look up neither of them (for example, the `Int`
class defines multiple `plus` operators, one for each primitive type
referenced on the RHS).

Now we can distinguish operator functions by their RHS type when
performing operator lookup in the backend.
2022-01-27 11:06:15 +00:00
Artem Kobzar 9547b0cae1 fix(Generic Constraints d.ts): add to d.ts generic type parameters constraints. 2022-01-27 10:37:10 +00:00
Sergey Igushkin 62c351874f KT-49089 Fix using @OptionalExpectation annotations from dependencies
Fix the behavior of the common (metadata KLIB) compiler with
hierarchical project structures support as
it analyses usages of annotations from dependencies that are marked
with `@OptionalExpectations`.

The fix on the Kotlin Gradle plugin side is to add the
-Xcommon-sources=... compiler argument to those the invocations of the
compiler, just as it is done with the other compilers.

Issue #KT-49089 Verification Pending
2022-01-27 06:32:08 +00:00
Hung Nguyen 9e1a771d57 KT-44741: Update test data to use companion object with custom name
Test: Existing IncrementalJvmCompilerRunnerTestGenerated.PureKotlin#testCompanionConstantChanged
    and similar *.PureKotlin#testCompanionConstantChanged tests
2022-01-27 02:34:42 +03:00
Ilya Muradyan 070f537ee9 REPL: Extract IDE-specific tests to a separate test set 2022-01-27 02:23:28 +03:00
Ilya Muradyan 9637b6b848 REPL: Fix REPL scripts metadata to be correctly recognized by class file decompiler 2022-01-27 02:23:27 +03:00
Georgy Bronnikov d2418a1329 IR: never attach return type to signatures of fake overrides
Cases that necessitate the return type hack (see KT-46042) always
involve exactly two methods, exactly one of which is a fake override. It
is sufficient to mark one of them.
2022-01-27 01:02:25 +03:00
Georgy Bronnikov d2738c02cc Add test for IR serialization 2022-01-27 01:02:24 +03:00
Georgy Bronnikov f0fb0cbefe IR: remove IdSignatureBuilder.isKotlinPackage() 2022-01-27 01:02:23 +03:00
Georgy Bronnikov 6a3a375372 IR: pass DescriptorByIdSignatureFinder as parameter to DeclarationStubGeneratorimpl
This breaks dependency between serialization.common and psi2ir modules.
2022-01-27 01:02:23 +03:00
Georgy Bronnikov 3f91674090 IR: inline and remove ...FromLinker methods from SymbolTable 2022-01-27 01:02:22 +03:00