Commit Graph

102140 Commits

Author SHA1 Message Date
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00
Svyatoslav Kuzmich 9b3237fff9 [Wasm] Initial K2 support in new test infrastructure (KT-57230)
- Implement FirWasmSessionFactory
- Use new compiler test infra for Wasm K1 and K2
- Delete old Wasm compiler test infra
2023-06-25 10:19:36 +02:00
Svyatoslav Kuzmich 3e564236f9 [Wasm] Fix unsigned types in IR interpreter
Wasm kotlin.Any class has properties,
 additional filtering is required when searching for
 value class property
2023-06-25 10:18:51 +02:00
Svyatoslav Kuzmich b503eafcb2 [Wasm] Allow implementing function interfaces in the new test infra
Make it consistent with CLI and old test infra
2023-06-25 10:18:50 +02:00
Svyatoslav Kuzmich 736519c506 [JS] Rename JsLibraryProvider to LibraryProvider
This class is not JS-specific and can be used in Wasm test services
2023-06-25 10:18:50 +02:00
Artem Daugel-Dauge 7eec1b350f [Tests] Try to make CocoaPods installation more robus once againt 2023-06-23 16:56:44 +00:00
Vladimir Sukharev 4d9f93e4eb [K2/N/MPP] Disable one-stage MPP compilation
^KT-56855

Merge-request: KT-MR-10735
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-23 15:51:59 +00:00
Ivan Kylchik bde6df8ca1 [IR] Correctly transform KCallable.name call to optimize it later
We need to transform call from `KFunction(N).name` to
`KFunction(N+1).name`. This way we keep IR correct and if something
goes wrong during interpretation, we still will have compilable code.

This commit suppose to fix three failing tests on Native aggregate
build:
1. `FirNativePartialLinkageTestGenerated.
testReferencingUnusableDeclarations`
2. `FirNativeCodegenBoxTestGenerated$Box$CallableReference$Bound.
testKCallableNameIntrinsic`
3. `FirNativeCodegenBoxTestNoPLGenerated$Box$CallableReference$Bound
.testKCallableNameIntrinsic`
2023-06-23 14:47:26 +00:00
Mikhail Glukhikh ce4ad0e42a Regenerate LightAnalysisModeTestGenerated test group 2023-06-23 16:44:50 +02:00
Mikhail Glukhikh 0d8f3a6026 K2: generate Java synthetics for Kotlin get/sets w/out type parameters
This commit is a follow-up to d8a20f19 and
provides additional K1 compatibility.
#KT-59550 Fixed
2023-06-23 16:44:50 +02:00
Mikhail Glukhikh 08a355756a K2 (minor): fix modality in tests from d8a20f19 2023-06-23 16:44:49 +02:00
Mikhail Glukhikh fcfee9384a K2: reproduce KT-59550 2023-06-23 16:44:49 +02:00
Jinseong Jeon e0fc0d96e5 AA: handle PsiType conversion for recursive type parameter case
^KT-59598 Fixed
2023-06-23 16:31:47 +02:00
Jinseong Jeon 2d132c6b73 SLC: run enum test w/ FULL_JDK 2023-06-23 16:19:06 +02:00
Jinseong Jeon 7f1424737e LC: rework modality of enum class
It is abstract if it has abstract member.
It is final if it doesn't have enum entries that need subclass.
Otherwise, it is open (i.e., no modifier)

^KT-57567 Fixed
2023-06-23 16:19:06 +02:00
Vladimir Sukharev 7930885131 [Test] Convert IGNORE: NATIVE directives in box tests from M to R
^KT-59057

Merge-request: KT-MR-10757
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-23 14:15:48 +00:00
Vladimir Sukharev d0dc292c30 [Test] Put descriptive comment to kt49316.kt
^KT-59057

Merge-request: KT-MR-10789
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-23 13:54:24 +00:00
Vladimir Sukharev 5c7d321e45 [Test] Convert IGNORE: NATIVE directives in box tests "sealed"
^KT-59057

Merge-request: KT-MR-10763
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-23 13:53:29 +00:00
Sergej Jaskiewicz f46761a241 [IR] Reorder parameters in IrFactory#createClass
This is to prepare for IrFactory auto-generation (KT-59308).
2023-06-23 13:25:34 +00:00
Alexander.Likhachev bfb314adcb [BT] Mark the Build Tools API as experimental 2023-06-23 12:34:23 +00:00
Alexander.Likhachev 5993e4bce4 [BT] Introduce JVM compilation API 2023-06-23 12:34:23 +00:00
Alexander.Likhachev 2412693ef0 [BT] Move KotlinLogger to the bt-api module
#KT-57398 In Progress
2023-06-23 12:34:23 +00:00
Alexander.Likhachev 1005d0244a [BT] Move KotlinLogger to the bt-api package
#KT-57398 In Progress
2023-06-23 12:34:23 +00:00
Alexander.Likhachev 6e07d432b3 Embed kotlin-build-tools-api into kotlin-compiler
#KT-57398 In Progress
2023-06-23 12:34:23 +00:00
Anna Kozlova 93887e1d7a [LL] store builtin session as cached value
to invalidate builtins on stdlib update.
It is required after making builtins use stubs of stdlib.
2023-06-23 12:23:30 +00:00
Anna Kozlova 137f8b7c70 [decompiler] ensure names starting with numbers are escaped
^ KTIJ-25985
2023-06-23 11:17:46 +00:00
Denis.Zharkov 60f09f6512 K2: Adjust renaming on import for current package with K1 rules
Namely, once a file in a package `foo` has import `foo.bar as baz`,
auto imported `bar` from the package name becomes inivisible in the file

^KT-54854 Fixed
2023-06-23 10:58:08 +00:00
Jinseong Jeon 5d7ac18778 SLC: drop the assertion that class context shouldn't be null
...because it can be null if an anonymous object is returned as a value
of reified inline function, which isn't materialized as LC element.

^KT-59537 Fixed
2023-06-23 10:33:58 +00:00
Marco Pennekamp f318cd8a79 [SLC/ULC] KTIJ-25335 Add tests for fields with missing names 2023-06-23 09:26:58 +00:00
Marco Pennekamp c00eb050ce [SLC/ULC] KTIJ-25335 Avoid generating fields with special names
- Due to the fixes for KTIJ-23584, when calling the UAST conversion
  `convertDeclarationOrElement` from `BaseKotlinConverter` (intellij
  project) for an SLC/ULC property, `convertDeclaration` failed because
  the declaration is "special". This caused `convertPsiElement` to be
  tried instead, which also returned `null`, causing the "failed to
  convert element" exception described in KTIJ-25335.
- In parallel to the solution for KTIJ-23584, which fixed the special
  names issue for functions, this commit skips UAST field generation for
  properties with special names.

^KTIJ-25335 fixed
^KTIJ-24121 fixed
2023-06-23 09:26:57 +00:00
Vladimir Sukharev a036e41809 [Test] Convert IGNORE: NATIVE directives in box tests from D to I
^KT-59057

Merge-request: KT-MR-10748
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-23 09:11:17 +00:00
Kirill Rakhman 919d6401f7 [Tests] Convert line endings of test files to LF
This fixes a problem on Windows where CRs would end up in the code
leading to parsing problems.
2023-06-23 09:03:28 +00:00
Vladimir Sukharev 503cd6196c [Test] Convert IGNORE: NATIVE directives in box tests specialBuiltins
^KT-59057

Merge-request: KT-MR-10760
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-23 08:07:13 +00:00
Pavel Mikhailovskii c3746652a4 KT-59293 [SLC] Fix generation of DefaultImpls classes 2023-06-23 08:01:52 +00:00
Kirill Rakhman 896f8853ae [FIR LT] Fix crash in incomplete when condition without type
#KT-58908 Fixed
2023-06-23 07:56:03 +00:00
Kirill Rakhman be232d3e6f [FIR] Enable ForbidInferringTypeVariablesIntoEmptyIntersection in 2.0
#KT-56377
2023-06-23 07:30:45 +00:00
Kirill Rakhman 585d4b3098 [FIR] Report empty intersection on responsible call
When reporting INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION, search
for a call to a declaration with the type parameter that got inferred
into an empty intersection inside the expression.

#KT-56377 Fixed
2023-06-23 07:30:45 +00:00
Ivan Kylchik 3f58782273 [FIR] Drop makeNullable parameter from typeFromSymbol function
We always pass `false` argument to this function.
2023-06-23 07:23:39 +00:00
Ivan Kylchik 8f88f08573 [FIR] Use correct source for implicit this receiver
#KT-57489 Fixed
#KT-56139 Fixed
#KT-56755 Fixed
2023-06-23 07:23:39 +00:00
Vladimir Sukharev ab03cb2357 [Test] Convert IGNORE: NATIVE directives in box tests sam/* and sameFile*/*
^KT-59057

Merge-request: KT-MR-10758
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-23 06:23:53 +00:00
Alexander Udalov 4db2bc28f2 Minor, suppress unchecked cast warning 2023-06-22 18:55:56 +00:00
Alexander Udalov ab195b68a5 Build: remove explicit enabling of RangeUntilOperator
This feature is enabled by default since 1.8. Using the `-XXLanguage`
compiler argument leads to big warnings which are distracting during the
build.
2023-06-22 18:55:56 +00:00
Ivan Kylchik 2115d55e1c [IR] Forbid to interpret expressions that involves unsigned numbers
We want to forbid expressions of type `Unsigned == Unsigned` or
similar. Working with unsigned numbers we can only inline them on the
call site or use in `String.plus` expression.

This commit fixes problem in test `unsignedTypesInAnnotations`. Here
interpreter thinks that expression `ONE_UINT != 1u` can be
evaluated, but fails to do it. This fail prevent us from inlining
`ONE_UINT` and on runtime we get error about missing getter.
Earlier this property would have been inlined by `ConstLowering`,
but we got rid of it.
2023-06-22 18:49:50 +00:00
Ivan Kylchik d1a54a522d [JVM IR] Drop ConstLowering
It basically can be replaced with IR interpreter. The only half-hack
was required in `PropertyReferenceLowering`. Const interpreter is
running before it, so we can't optimize some calls on const
properties that appear after this lowering. Solution is to inline
constants manually during property reference lowering.
2023-06-22 18:49:50 +00:00
Vladimir Sukharev 1bf3bde4f8 [Test] Convert IGNORE: NATIVE directives in box tests from J to J
^KT-59057

Merge-request: KT-MR-10749
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-22 18:39:59 +00:00
Vladimir Sukharev f3fcaa69eb [Test] Convert IGNORE: NATIVE directives in box tests from T to W and boxInline
^KT-59057

Merge-request: KT-MR-10752
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-22 18:33:24 +00:00
Artem Kobzar 64158a8a2f [K/JS] Add file-to-file compilation ^KT-6168 Fixed 2023-06-22 18:23:45 +00:00
Alexander Udalov a44b5e4562 JVM IR: do not copy call in JvmStaticAnnotationLowering
This is just a refactoring/optimization that makes use of the fact that
IrCall.symbol is now mutable.
2023-06-22 17:19:00 +00:00
Alexander Udalov 572892dc8a JVM IR: do not copy call in InterfaceObjectCallsLowering
This is just a refactoring/optimization that makes use of the fact that
IrCall.symbol is now mutable.
2023-06-22 17:19:00 +00:00
Alexander Udalov 7ae195d9eb JVM IR: do not copy call in ReplaceNumberToCharCallSitesLowering
This is just a refactoring/optimization that makes use of the fact that
IrCall.symbol is now mutable.
2023-06-22 17:19:00 +00:00