Commit Graph

100202 Commits

Author SHA1 Message Date
Igor Yakovlev 09ea0ef757 [Wasm] Update jsShell to 2023-04-11-21-59-06 2023-04-12 13:24:02 +00:00
Igor Yakovlev edf4e80165 [Wasm] Fix for ReturnableBlockLowering invalid ir type for converted inlined blocks 2023-04-12 13:24:02 +00:00
Igor Yakovlev 08273623e6 [JS/Wasm] Remove redundant code
returnableBlockMap is never mutated, so the code that uses it seems to be dead
2023-04-12 13:24:00 +00:00
Nikita Bobko 9ca7ee3b97 Don't forget to configure JdkHome for CompilerConfiguration
Review: https://jetbrains.team/p/kt/reviews/9562

This commit fixes IdeaJsr223Test in kotlin plugin. The test failure was
caused by b50a803b6f commit where we
dropped `put(JVMConfigurationKeys.JDK_HOME, ...)` from
`configureJdkClasspathRoots`. Ilya Chernikov says that it's incorrect to
set JDK_HOME in `configureJdkClasspathRoots`.

To reproduce the test failure:
1. Update `.idea/libraries/kotlinc_kotlin_dist.xml` and
   `.idea/libraries/kotlinc_kotlin_jps_plugin_classpath.xml` with new
   Kotlin (in other words: bump bundled JPS)
2. Run the test

Test failure stacktrace:
```
javax.script.ScriptException: error: cannot access 'java.io.Serializable' which is a supertype of 'kotlin.Int'. Check your module classpath for missing or conflicting dependencies
y.first() + 2
          ^
  at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.asJsr223EvalResult(KotlinJsr223JvmScriptEngineBase.kt:104)
  at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compileAndEval(KotlinJsr223JvmScriptEngineBase.kt:63)
  at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.eval(KotlinJsr223JvmScriptEngineBase.kt:31)
  at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:262)
  at org.jetbrains.kotlin.idea.repl.IdeaJsr223Test.testJsr223Engine(IdeaJsr223Test.kt:31)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.base/java.lang.reflect.Method.invoke(Method.java:568)
  at junit.framework.TestCase.runTest(TestCase.java:177)
  at com.intellij.testFramework.UsefulTestCase.lambda$runBare$11(UsefulTestCase.java:479)
  at com.intellij.testFramework.UsefulTestCase.lambda$wrapTestRunnable$13(UsefulTestCase.java:500)
```
2023-04-12 13:16:10 +00:00
Kirill Rakhman aab1959cc4 [FIR2IR] Fix codegen for lambda with dynamic receiver
#KT-57835 Fixed
2023-04-12 13:10:43 +00:00
Bogdan Mukvich 1c96a87dca Update dokka to 1.8.10 from dev version 2023-04-12 12:12:08 +00:00
Denis.Zharkov 39639e08f9 K2: Fix incorrect inference of delegated property type
It was working incorrectly, because we've been trying to fix
P1 variable to intersectTypes(String?, StubForP2) that should result
to String? because we've got stubEqualsToAnything enabled there,
but nullability was being chosen incorrectly because
`StubForP2.isNullableType()` returned false

NB: The code inside `is ConeTypeVariable` case wasn't working properly
because it always `lookupTag.toSymbol(session)` always returned null,
thus there was effectively five dead lines of code there.

^KT-57814 Fixed
^KT-57921 Related
2023-04-12 11:31:43 +00:00
Dmitriy Novozhilov e079d9d405 Advance bootstrap to 1.9.0-dev-5560 2023-04-12 11:08:22 +00:00
Nataliya.Valtman 2c2a01113e KT-57371: Add versions for FUS statistic bean 2023-04-12 11:04:35 +00:00
Nikolay Lunyak caa7bee917 [FIR] KT-57835: Prevent the compiler crash
^KT-57835 Fixed
2023-04-12 10:20:44 +00:00
Abduqodiri Qurbonzoda e1c91ee50f [K/N] Move kotlin.native.internal.GC into kotlin.native.runtime
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 13:07:50 +03:00
Abduqodiri Qurbonzoda 7a2e2f5f9f [K/N] Move GCInfo, MemoryUsage, RootSetStatistics into kotlin.native.runtime
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 13:07:49 +03:00
Abduqodiri Qurbonzoda bb8498b0c5 [K/N] Move kotlin.native.internal.Debugging into kotlin.native.runtime
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 13:07:49 +03:00
Abduqodiri Qurbonzoda f90b846f86 Loosen @NativeRuntimeApi opt-in requirement level to WARNING 2023-04-12 13:07:48 +03:00
Abduqodiri Qurbonzoda ab78b44d2e [K/N] Introduce NativeRuntimeApi annotation
Marks the Kotlin/Native stdlib API that is related to runtime behavior.
Such API is unstable and won't become stable in the future.

As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 13:07:47 +03:00
Abduqodiri Qurbonzoda 113d4d8679 [K/N] Internalize KPropertyImpl classes
As a part of efforts to stabilize Native stdlib.
2023-04-12 09:45:59 +00:00
Abduqodiri Qurbonzoda 92c39b0107 [K/N] Remove FixmeReflection annotation class
As a part of efforts to stabilize Native stdlib.
2023-04-12 09:45:58 +00:00
Abduqodiri Qurbonzoda 0bd263b12a [K/N] Mark kotlin.native.ref.Cleaner with @ExperimentalNativeApi
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 09:44:25 +00:00
Abduqodiri Qurbonzoda 16078ae8e8 [K/N] Mark WeakReference with ExperimentalNativeApi
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 09:44:25 +00:00
Abduqodiri Qurbonzoda 6f5504e59b [K/N] Introduce ExperimentalNativeApi annotation
An opt-in annotation to mark the Kotlin/Native-only standard library API
we doubt that eventually will be stabilized.

As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 09:44:24 +00:00
Dmitriy Novozhilov f8ef478647 [FIR] Assume smartacsts on member properties from friend modules as stable
^KT-57893 Fixed
2023-04-12 08:59:03 +00:00
Alexander.Likhachev 0d1500f23f [Gradle] Disable the Kotlin daemon fallback strategy for integration tests
#KT-57782 Fixed
2023-04-12 06:16:36 +00:00
Yahor Berdnikau f7522ec796 Better approach to handle 'moduleName' in project level DSL
Now project level DSL only configures base part of module name, which
latter is enhanced by Kotlin compilation suffix. In this case
'KotlinCompilation.moduleName' is not used.

Additionally,
'KotlinJvmTask.moduleName' usage was deprecated in favor of
'compilerOptions.moduleName'. Though warning is only produced in case
project is using 'org.jetbrains.kotlin.jvm' or
'org.jetbrains.kotlin.android' plugins.

- 'moduleName' is always required to be non-null.

^KT-57688 Fixed
2023-04-12 06:16:36 +00:00
Ivan Kylchik 08ba63df90 Implement proper name interpretation for suspend functions
#KT-57313 Fixed
2023-04-11 21:28:13 +00:00
Vladimir Sukharev 82589f2506 [K2/N] KT-57918: Support typealiases in FirClassSymbol<*>.selfOrAnySuperClass()
Merge-request: KT-MR-9529
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-11 19:48:07 +00:00
Simon Ogorodnik 98aca55a2a KT-57927: Fix deserialization of K2JVMCompilerArguments in FP/MT tests
Due to changes in 9dcd40d7b7
classpath and pluginClasspath arguments become Arrays
Now we need to update arguments representation to properly deserialize
it

^KT-57927
2023-04-11 18:10:36 +00:00
Dmitriy Novozhilov af05646fe3 [FIR] Don't expand typealiases in annotations during type deserialization
During extracting type attributes from annotations we should expand
  typealiases of annotation type to handle cases when user makes a typealias
  on some special annotation, like `kotlin.internal.Exact`. And to exapnd
  typealias we should resolve annotation class id to symbol.
This leads to a cycle during class deserialization, if some nested annotation
  is used as type annotation in some declaration in the same class

```
interface SomeInterface {
    interface NestedInterface : @Ann Some

    interface Some

    @Target(AnnotationTarget.TYPE)
    annotation class Ann
}
```
Attempt to find symbol for SomeInterface.Ann during deserialization of
  SomeInterface.NestedInterface wil lead to second attempt to deserialize
  class SomeInterface, which eventually leads to StackOverFlow. And at the
  same time expanding typealiases for annotations from binaries has not
  much sense, because types in binaries are already expanded

So to fix this issue it's enough to just not expand typealiases on type
  annotations for types of deserialized declarations

^KT-57876 Fixed
2023-04-11 16:02:57 +00:00
Iaroslav Postovalov fb80c0cb0d Override toString function in stdlib delegates
Co-authored-by: ilya-g <ilya.gorbunov@jetbrains.com>
2023-04-11 14:46:29 +00:00
Dmitriy Novozhilov cfa06dbf74 [FIR] Fix incorrect usages of getClassLikeSymbolByClassId with lookup tag
^KT-57839 Fixed
2023-04-11 14:45:36 +00:00
Alexander.Likhachev b750e1e62c [Gradle, K/N] Fix a small typo in a test name 2023-04-11 16:19:15 +02:00
Alexander.Likhachev f439d4d147 [Gradle, K/N] Improve message when a simulator for test is not booted
If a simulator test task is configured to disable standalone mode and the simulator isn't booted, the default error message might sound cryptic, so we can give a more user-friendly error message
#KT-38317 Fixed
2023-04-11 16:16:31 +02:00
Alexander.Likhachev 5486b39d04 [Gradle, K/N] Add a standalone mode toggle for K/N simulator tests
#KT-38317 In Progress
2023-04-11 16:16:31 +02:00
Alexander.Likhachev d6077923c4 [Gradle, K/N] Use default deviceId as a convention 2023-04-11 16:16:30 +02:00
Alexander.Likhachev 282a4ca09d [Gradle] Add a test for KT-38317 2023-04-11 16:16:29 +02:00
Sebastian Sellmair d40a20f90b [Gradle] AbstractCInteropCommonizerTask: Do not use ':' character in fileName
":" is not allowed on Windows. Using _ instead

^KT-57796 Verification Pending
2023-04-11 13:55:05 +00:00
Nikolay Lunyak f826011c9f [FIR] KT-57655: Add the missing branch
^KT-57655 Fixed
2023-04-11 13:49:07 +00:00
Artem Kobzar fa0f9a9201 [K/JS] Change strategy for implicitly exported declarations if there is a cycled reference
^KT-57356 Fixed
2023-04-11 13:48:47 +00:00
Dmitriy Novozhilov 94f77add49 [FIR] Try to load properties in order according to kotlinx.serialization metadata extension
Move metadata extension with property order from kotlinx.serialization to core

After fix of KT-54792 properties will be deserialized in declaration order
  if corresponding class was compiled with modern compiler. But this order
  is needed for kotlinx.serialization for binaries compiled with any
  kotlin compiler >= 1.4. Since we don't plan to add any extension points
  into (de)serialization into FIR, we need to take into account existing
  metadata extension from kotlinx.serialization in compiler itself

^KT-57769 Fixed
2023-04-11 13:43:39 +00:00
Dmitriy Novozhilov 7685284cb7 [FIR] Do not sort declarations in deserialized classes, keep order from metadata
KT-57769
KT-54792
2023-04-11 13:43:38 +00:00
Dmitriy Novozhilov 839026b6fe [FIR2IR] Generate IR declarations in classes in strict order
Order is following:
- declared declarations in declaration (in source) order
- generated declarations in sorted order
2023-04-11 13:43:38 +00:00
Abduqodiri Qurbonzoda c961c15729 Commonize AssertionError(message, cause) constructor 2023-04-11 13:32:54 +00:00
Abduqodiri Qurbonzoda 8e995e6c62 [K/N] Deprecate ArrayIndexOutOfBoundsException
As a part of efforts to stabilize Native stdlib.
2023-04-11 13:32:54 +00:00
Abduqodiri Qurbonzoda be87b6950c [K/N] Hide AssertionError(cause: Throwable?) constructor
To align Native AssertionError behavior with JVM.

As a part of efforts to stabilize Native stdlib.
2023-04-11 13:32:54 +00:00
Abduqodiri Qurbonzoda 0c89224955 [K/N] Deprecate getTime and measureTime functions
As a part of efforts to stabilize Native stdlib.

Merge-request: KT-MR-9533
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-04-11 13:31:12 +00:00
Nikolay Lunyak 077f49f33b [FIR JS] KT-57822: Don't report the diagnostic for non-qualifiers
^KT-57822 Fixed
2023-04-11 13:20:42 +00:00
Alexander Shabalin 375116dcf5 [K/N] Disable testPermanentObjectsFramework w/o GC ^KT-56233
Merge-request: KT-MR-9542
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-04-11 12:43:41 +00:00
Anna Kozlova 1aba9460f2 [LL] fix resolving of compiled type value parameter
KT-57917
occurs when UAST requests e.g. annotations for the target parameter
to check correctness of nullability or Nls
2023-04-11 12:04:50 +00:00
Ivan Kylchik b8b8570a60 Add instruction on how to debug kotlin gradle plugin integration tests 2023-04-11 11:59:12 +00:00
Ilya Goncharov d2c2a86cb7 [Gradle, JS] Existence of node_modules for up-to-date of kotlinNpmInstall
[Gradle, JS] No dev deps in packages_imported

^KT-57920 fixed
2023-04-11 11:52:29 +00:00
Dmitrii Gridin 7d37bb1f78 [LC] FakeFileForLightClass: drop stub access from equals/hashCode
^KT-57857 Fixed
2023-04-11 09:19:39 +00:00