Commit Graph

103075 Commits

Author SHA1 Message Date
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
Alexander Udalov 994d61a360 JVM IR: do not copy call in ResolveInlineCalls
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 c8862f3aa8 JVM IR: do not copy call in UpdateFunctionCallSites
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 943dde0cbb JVM IR: do not copy call in ReplaceKFunctionInvokeWithFunctionInvoke
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 755d140e16 Parcelize: do not copy call in ParcelizeIrTransformer
This is just a refactoring/optimization that makes use of the fact that
IrCall.symbol and IrFunctionReference.symbol are now mutable.
2023-06-22 17:19:00 +00:00
Alexander Udalov b75aa9af4e IR: do not copy call in CrossFileCallAdjuster
This is just a refactoring/optimization that makes use of the fact that
IrCall.symbol is now mutable.
2023-06-22 17:18:59 +00:00
Alexander Udalov 42057b7fe0 IR: do not copy call in ForLoopsLowering
This is just a refactoring/optimization that makes use of the fact that
IrCall.symbol is now mutable.
2023-06-22 17:18:59 +00:00
Alexander Udalov bb4d25dfc9 IR: do not copy calls/references in ExpectSymbolTransformer
This is just a refactoring/optimization that makes use of the fact that
IrCall.symbol and other similar fields are now mutable.
2023-06-22 17:18:59 +00:00
Alexander Udalov 978553c513 IR: make call symbols mutable
This will help in some lowerings which need to change the callee of a
call. Instead of creating a new call and copying everything (type
arguments, value arguments, receivers, annotations, attributes, ...),
it's easier to modify the `symbol`. In a way, this is a continuation of
22b4b29292.
2023-06-22 17:18:59 +00:00
Alexander Udalov 3744192806 IR: minor, remove redundant override IrSetValue.symbol 2023-06-22 17:18:59 +00:00
Aleksei.Cherepanov a3583ea79b Add the possibility to omit explicitly specifying a version in annotationProcessorPaths
Resolve the version of the annotation processor path (specified in annotationProcessorPaths) in kapt plugin if it is already specified in dependencies of this module or parent module. Plugin management is also supported.

#KT-59521 In Fixed

Merge-request: KT-MR-10761
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-06-22 17:13:24 +00:00
Alexander Udalov e4d1e6246e CLI: increase default value of Xms option
According to the preloader's "-measure" option, just the raw class files
occupy ~50 Mb during compilation of hello world (~55 Mb for K2). So 32M
is a very outdated value for Xms. This change sets it to something more
reasonable to hopefully avoid unnecessary GCs and thus help with
performance and potentially with OOMs (KT-58690).

 #KT-58690
2023-06-22 17:10:11 +00:00
Sergej Jaskiewicz 0ae95b39c3 [IR] Reorder parameters in IrFactory#createConstructor
This is to prepare for IrFactory auto-generation (KT-59308).
2023-06-22 16:31:17 +00:00
Pavel Kunyavskiy f486fc942b [K/N] Fix special backend checks tests 2023-06-22 16:22:59 +00:00
Sergej Jaskiewicz 0b7db067e6 [IR] Reorder parameters in IrFactory#createField
This is to prepare for IrFactory auto-generation (KT-59308).
2023-06-22 15:55:02 +00:00
Ilya Goncharov 90f6c53bf8 [Gradle, Js] Use dynamic import to catch exceptions during wasm compilation 2023-06-22 15:46:31 +00:00