Commit Graph

43531 Commits

Author SHA1 Message Date
Mikhail Glukhikh 08c22c388c K2: change logic of result type search in ILT case
Related to KT-57487, KT-57703
2023-04-27 12:19:38 +00:00
Mikhail Glukhikh 27c4a7b7ef FE: add new tests around unresolved integer literals
Related to KT-57487, KT-57703
2023-04-27 12:19:38 +00:00
Mikhail Glukhikh 70c5978add K2: Approximate ILT in vararg expressions properly #KT-57487 Fixed 2023-04-27 12:19:38 +00:00
Anna Kozlova a41f7dc25d [cls] save parameter name for functional types in stub
to make it available for deserialized Fir
2023-04-27 11:37:28 +00:00
Anna Kozlova d59d66e876 [AA, LL] use stubs to build deserialized Fir elements in IDE
^KTIJ-24638

Notice on `DebugSymbolRenderer`:
stub based deserializer sets source directly,
but it's available in IDE mode only.
Thus, standalone and IDE tests have different results.
In order to avoid this, sources for compiled code are explicitly ignored

Notice on distinct callables:
for a file which belong to multiple libraries, decompiled code would be build per library.
In order to avoid ambiguity errors for members in that file,
we need to distinct provided elements by origins
failed test from IJ repo:
 FirReferenceResolveWithCrossLibTestGenerated#testSetWithTypeParameters
2023-04-27 11:37:28 +00:00
Anna Kozlova d491fd2f70 [LL] don't include kotlin classes in combined java provider
do not resolve annotations when short name doesn't match
2023-04-27 11:37:27 +00:00
Anna Kozlova 6ba4e37696 [psi] don't load ast for compiled code
deserialized parameters do not contain real default values anyway
2023-04-27 11:37:26 +00:00
Anna Kozlova 1f4e4f94a7 [FIR] varargs: do not leak source of value parameter to the call site
when source for compiled fir elements is set, it leaks e.g. to diagnostics,
which is then filtered

see `TestsWithStdLib.Experimental.testImplicitUsages`
2023-04-27 11:37:26 +00:00
Anna Kozlova e94946d8df [FIR] extract data class copy function generation 2023-04-27 11:37:25 +00:00
Anna Kozlova 3f6432cdc9 [FIR] setup origin for generated enum functions 2023-04-27 11:37:25 +00:00
Alexander Udalov 68b94b07b8 Fir2Ir: more precise calculation of enum class modality
Use the same condition as in the already existing `createIrEnumEntry`
function (and as in psi2ir): enum class should be final unless there's
an enum entry with any declaration other than its constructor.

 #KT-57216
2023-04-27 11:02:22 +00:00
Kirill Rakhman 6d3b911dfc [K2/Native] Configure metadata compilation mode
This fixes access to internal declarations in common source sets from
intermediate source sets that are compiled to metadata.

#KT-58219 Fixed
2023-04-27 10:49:53 +00:00
Mikhail Glukhikh abb58f1380 K2: unmute the test related to KT-48675 2023-04-27 09:16:44 +00:00
Ilya Chernikov a045a0a81c FIR: use default getter in serializer if fir contains none
since we generate the default getter in this case in
Fir2IrDeclarationStorage.createIrProperty, so the serialized metadata
should follow the same behavior.
#KT-57373 fixed
2023-04-27 09:14:20 +00:00
Dmitriy Novozhilov 913b55174d [FIR] Correctly determine primary constructor parameters scope for class initialization section
^KT-58135 Fixed
2023-04-27 09:11:31 +00:00
Anna Kozlova 7ee648a4f5 [cls] include annotation arguments in cls stubs
^ KTIJ-24666
this would allow to build fir based on stubs,
do not keep ProtoBuf in memory and
search in decompiled code by stubs
2023-04-26 21:43:15 +02:00
Anna Kozlova f0af7c4228 [cls] include property constant initializer in stubs
^KTIJ-24667
this would allow building FirElements from stubs
2023-04-26 21:43:15 +02:00
Anna Kozlova 70ef87354f [psi] KtValueArgumentName: use stub when possible 2023-04-26 21:43:15 +02:00
Anna Kozlova 171e9db1f8 [psi] don't search for property initializer in decompiled code
it's not included in decompiled text, so can't be found anyway
2023-04-26 21:43:14 +02:00
Anna Kozlova 7021c079c6 [cls] include property accessors in cls stubs 2023-04-26 21:43:14 +02:00
Mikhail Glukhikh 41e551e321 K1: add deprecation warning for property/field pair with different types
#KT-57905 Fixed
2023-04-26 11:47:16 +00:00
Ilya Gorbunov f260b55810 Raise deprecation of js synchronized {} to error 2023-04-26 10:44:52 +00:00
Abduqodiri Qurbonzoda 63a5a74613 Introduce HexFormat for formatting and parsing hexadecimals #KT-57762
Merge-request: KT-MR-9460
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-04-26 09:54:25 +00:00
Sergey Bogolepov fce878d63a [K/N] KT-56464: implementation of HiddenFromObjC for classes in backend 2023-04-26 09:36:10 +00:00
Denis.Zharkov 6651e6ed8c K2: Avoid inappropriate approximation of captured type to Nothing?
There's a heuristic for approximation of a captured type that once
it has non-trivial lower bound (other than Nothing), it's worth
approximating it to sub-type even while the containing
top-level type is being approximated to super-type.

And that sounds reasonable in case the lower bound is indeed non-trivial,
but that's not the case because nullability here comes from
the nullability of captured type position.

So, the fix is basically not to treat such approximations as non-trivial.
And while that seems to be a bit of a change in the language semantics,
it still looks reasonable (see other changes in test data and KT-58087)

^KT-57958 Fixed
^KT-58087 Fixed
2023-04-26 09:21:19 +00:00
Denis.Zharkov 0a631ed8fc K2: Fix undesirable NEW_INFERENCE_ERROR for case of return + buildList
While plainly repeating K1 behavior might be a dumb solution,
but inventing another one might be quite complicated
because we need to stop fixing variables into Nothing in many cases,
but probably not in all of them (see KT-58232).

^KT-58149 Fixed
^KT-58232 Related
2023-04-26 09:20:02 +00:00
Zalim Bashorov 4e36f5b391 [Wasm, JS] Add a warning that dumping reachability and size infos to file is supported only for Kotlin/Wasm 2023-04-25 19:44:03 +02:00
Zalim Bashorov 0a1116376c [CLI, JS, Wasm] Regenerate K2JSCompilerArgumentsCopyGenerated.kt 2023-04-25 19:44:03 +02:00
Zalim Bashorov ef28bf27ae [CLI tests] Update testdata 2023-04-25 19:44:03 +02:00
Zalim Bashorov bd852e87ab [Wasm] Add an option to dump declaration IR sizes to file 2023-04-25 19:44:03 +02:00
Zalim Bashorov 3c343e3074 [Wasm, JS] Minor: make description non-nullable 2023-04-25 19:44:02 +02:00
Zalim Bashorov 62b21ac078 [Wasm] Add an option to dump reachability info to file 2023-04-25 19:44:02 +02:00
mvicsokolova 75b4469757 [K/N] Stabilization of Atomics API
`AtomicInt`, `AtomicLong`, `AtomicReference` and `AtomicNativePtr` classes were moved to `kotlin.concurrent` package. The corresponding classes from `kotlin.native.concurrent` were deprecated with warning since Kotlin 1.9.

In order to prepare for further commonization of Atomics API the following changes were made:
* `kotlin.concurrent.AtomicInt`: 
    * `increment(): Unit` and `decrement(): Unit` methods were deprecated with error
    * New methods were added: `incrementAndGet(): Int` , `decrementAndGet(): Int`, `getAndIncrement(): Int`, `getAndDecrement(): Int`, `getAndSet(newValue: Int): Int` 
* `kotlin.concurrent.AtomicLong`:
    * `increment(): Unit` and `decrement(): Unit` methods were deprecated with error
    * New methods were added: `incrementAndGet(): Long`, `decrementAndGet(): Long`, `getAndIncrement(): Long`, `getAndDecrement(): Long`, `getAndSet(newValue: Long): Long`
    * Deprecated `AtomicLong()` constructor with default parameter value
* For all atomic classes `compareAndSwap` method was renamed to `compareAndExchange`

See KT-58074 for more details.

Merge-request: KT-MR-9272
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-04-25 16:55:42 +00:00
Mikhail Glukhikh 1c56a71b14 FirClassSubstitutionScope: don't recreate constructor type parameters w/out need
#KT-58008 Fixed
2023-04-25 16:42:59 +00:00
Mikhail Glukhikh 5daafd5ed5 FirNestedClassifierScope: don't give empty map substitutor to a processor
Optimization related to KT-58008 (hides the issue in some cases)
2023-04-25 16:42:59 +00:00
Mikhail Glukhikh 4172ce1018 K2: reproduce KT-58008 2023-04-25 16:42:59 +00:00
Artem Kobzar 27b103e2ca [K/JS] Eliminate duplication of init block inside exported ES-classes ^KT-58246 Fixed 2023-04-25 16:21:08 +00:00
Alexander Korepanov 81b591ed21 [JS IR IC] Interface default implementations affect IC hash
Adding or removing a method or property with
a default implementation to an interface should
invalidate all children: we must regenerate JS code for them

^KT-56237 Fixed
2023-04-25 15:34:22 +00:00
Alexander Udalov a0790047f7 JvmDefault: remove -Xjvm-default modes "enable" and "compatibility"
#KT-54746
2023-04-25 14:33:00 +00:00
Alexander Udalov e0b5ae7781 JvmDefault: remove diagnostics related to @JvmDefault
#KT-54746
2023-04-25 14:33:00 +00:00
Alexander Udalov 3120a35a88 JvmDefault: remove most tests on @JvmDefault
The tests are removed because JvmDefault is going to be deprecated with
error in KT-54746 and removed later in KT-57696.

Many of the removed tests already had existing counterparts with the new
modes `all` and `all-compatibility`. In this change, I've added such
tests where they were missing, and removed tests which were testing
behavior specific to the JvmDefault annotation, such as some
diagnostics.

 #KT-54746
2023-04-25 14:33:00 +00:00
Jinseong Jeon 5298abf2d6 AA/LC: introduce an API to find script files 2023-04-25 14:49:03 +02:00
Jinseong Jeon f9086daf4d SLC: add support for .kts
^KTIJ-21108
^KT-50241
^KT-55626 Fixed
2023-04-25 14:49:03 +02:00
Artem Kobzar 4327c6645a [K/JS] Save order for modulesWithReachableTopLevels and deserializersForModules to make partial linkage work again 2023-04-25 12:20:14 +00:00
Mikhail Glukhikh 4589463e92 FirBasedSymbol: call lazyResolveToPhase directly on a backing field 2023-04-25 12:18:27 +00:00
Mikhail Glukhikh 1f05ce2e01 AA/LC: Support annotation property->backing field move
#KT-57462 Fixed
2023-04-25 12:18:27 +00:00
Mikhail Glukhikh f6bf7560a6 K2: fix field annotation handling around serialization
#KT-57135 Fixed
2023-04-25 12:18:27 +00:00
Mikhail Glukhikh dc38ce24f7 K2: fix field annotation splitting and frontend checks
Related to KT-57135
2023-04-25 12:18:26 +00:00
Pavel Mikhailovskii 37ed7beda0 KT-57135 Take into account annotations' allowed targets
- Check allowed targets
- Attach field annotations to the backing field
2023-04-25 12:18:26 +00:00
Nikolay Lunyak e3d313dd02 [FIR] Introduce the proper Fir2IrResultsConverter
Sometimes when running MPP tests we may
observe js-specific modules running with
the jvm-specific fir2ir converter
(probably because the name didn't contain
the JVM affix).
2023-04-25 11:29:34 +00:00