Commit Graph

103633 Commits

Author SHA1 Message Date
Alexander Shabalin 83a70ddf8b [K/N] Decouple ObjectFactory from concrete ObjectData ^KT-60928
* Use type_layout to declaratively express heap object headers in both
  custom allocator and ObjectFactory.
* Invoke constructor (w/o invoking Kotin constructors) for created
  objects and arrays from both custom allocator and ObjectFactory.
  Previously:
  - custom allocator only checked body for nullability (now this is
    performed in body constructor)
  - ObjectFactory only constructed ObjectData
* In each GC have a AllocatorImpl.hpp and ObjectData.hpp headers
  the first encapsulating allocator-specific types, the second
  containing specific ObjectData implementation.
* In each GC have a separate ObjectFactoryTraits that does not
  actually depend on the specific GC anymore.
* Each GC now expose ObjectData (as undefined type) and its descriptor,
  the latter being used by the custom allocator and ObjectFactory.
* Descriptors for ObjectBody and ArrayBody now live in Memory.h and the
  code calculating size is now shared. Their constructors check that the
  memory is zeroed (Kotlin constructors will expect this).
2023-08-10 07:58:27 +00:00
Alexander Shabalin d956a5504d [K/N] Add a helper for objects with custom layout ^KT-60928 2023-08-10 07:58:27 +00:00
Nikolay Lunyak 70e98c9c2b [FIR] Report inherited java members referencing FunctionN
^KT-60000 Fixed
2023-08-10 05:14:08 +00:00
Ilya Chernikov 0c35e97a8d Tests: fix testLightTreeReadLineEndings
- it is now depends on the propery configured environment
2023-08-09 23:58:51 +00:00
Mikhail Glukhikh 0abf17201f K2: fix implementation of EXTENSION_PROPERTY_MUST_HAVE_ACCESSORS_OR_BE_ABSTRACT
This commit fixes
`FirCompileKotlinAgainstCustomBinariesTest.testUnreachableExtensionVarPropertyDeclaration`.
2023-08-09 23:58:51 +00:00
Alexander Udalov 54c7466074 Tests: add CompileKotlinAgainstCustomBinariesTest for K2
This is needed because after changing default language version to 2.0,
we still need to test many scenarios from this test in K1.

Move K1-specific tests to OldCompileKotlinAgainstCustomBinariesTest, and
K2-specific tests to FirCompileKotlinAgainstCustomBinariesTest.

Mute failing K2 tests via `muteForK2`. It will throw exception if the
muted test will suddenly start passing.
2023-08-09 23:58:51 +00:00
Alexander Udalov 21c7325dbe Tests: remove actualTypealiasToCompiledInlineClass test
This test uses multiple features which are obsolete and will be
discontinued soon:
- Language version 1.4
- Expect/actual declarations in the same module
- Declaring inline classes via "inline class"
2023-08-09 23:58:51 +00:00
Alexander Udalov bad7fa597b Tests: move some tests to diagnostics 2023-08-09 23:58:51 +00:00
Alexander Udalov b3b9ffaea9 Tests: remove obsolete txt dumps in CompileKotlin...Test
Check that the client code compiles against the "broken" classpath
instead. Descriptor text dump is a part of the obsolete test
infrastructure and should not be used anymore.
2023-08-09 23:58:50 +00:00
Alexander Udalov 19abb66886 Tests: minor cleanup in CompileKotlinAgainstCustomBinariesTest
Fix inspections, formatting
2023-08-09 23:58:50 +00:00
Alexander.Likhachev 2675531624 [Build] allow empty build cache url to disable it
4af1970b28 allows it only for the included build
2023-08-09 22:10:43 +00:00
Nikolay Lunyak a871fa9a64 [FIR] Don't ignore too many diagnostics
`DelegatingConstructorCall` -
because in this case there is
either `UNRESOLVED_REFERENCE` or
`SYNTAX` already.

`ErrorTypeRef` - because in this
case there is `SYNTAX` already.
Note that there is only 1 test
that shows this behavior, and
it's LT-specific. It's
`FirLightTreeOldFrontendDiagnosticsTestGenerated.testKt847`, and
in this test the string template
is parsed and processed
differently in LT and PSI:

- in LT there are 6 nodes: "",
"$this", " must be", "$as", "$t",
"".
- in PSI there 4 notes: "$this",
" must be", "$as", "$t".
2023-08-09 21:00:06 +00:00
Alexander Korepanov 7a31167e0b [Common IR] Do not add internal methods to overrides
[JS IR] Use a module name in JsFunctionSignature for internal methods

^KT-60635 Fixed
2023-08-09 16:35:59 +00:00
Anna Kozlova 788fa5d545 [psi] skip absent parameter names in function type presentation
KTIJ-26566
2023-08-09 16:29:37 +00:00
Svyatoslav Scherbina 05d38c8297 Native: don't build tests/samples/echoServer on Windows
Because of KT-50547, this test doesn't work on Windows with HMPP
enabled.

Previously, because of that HMPP was disabled for all samples.
But now disabling HMPP is no longer possible, so ce9a45b enables HMPP
for samples.

Disable echoServer sample on Windows to workaround ^KT-50547
2023-08-09 16:22:14 +00:00
Dmitrii Gridin bdd8cce69c [LL FIR] LowLevelFirApiFacadeForResolveOnAir: drop unused function 2023-08-09 15:22:57 +00:00
Dmitrii Gridin 3947ba57da [LL FIR] support on-air resolve for scripts
We should reanalyze only statements and leave declarations as they are

^KT-61013 Fixed
2023-08-09 15:22:57 +00:00
Dmitrii Gridin 4c8399ae8c [LL FIR] KtToFirMapping: encapsulate recorder
We need this to avoid wrong recorders in on-air resolve

^KT-61013
2023-08-09 15:22:57 +00:00
Dmitrii Gridin d19a23aae5 [LL FIR] implement tests on dependent copy session analyze
^KT-60987
2023-08-09 15:22:57 +00:00
Dmitrii Krasnov 682cb991b8 Test for PartialLinkageMode resolving fix
#KT-60839 Fixed
2023-08-09 15:13:24 +00:00
Dmitrii Krasnov 1f61a195a9 Bump Kotlin/Native version in KGP to 1.9.20-dev-9320 2023-08-09 15:13:24 +00:00
Aleksei.Cherepanov c8c3565a24 Fix JPS import
Exclude kotlin-stdlib-js project for JPS build. Related to KT-56106

#KT-61059 Fixed


Merge-request: KT-MR-11527
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-08-09 14:37:21 +00:00
Margarita Bobova affe0754bf Add ChangeLog for 1.9.0 and move ChangeLog for 1.8.X to a separate file 2023-08-09 12:26:03 +00:00
Dmitriy Dolovov da2e6d93ff [Native][tests] Don't use trove4j in K/N new test infra 2023-08-09 12:15:39 +00:00
Svyatoslav Scherbina ce9a45bf92 Native: enable HMPP in tests/samples
Remove `kotlin.mpp.hierarchicalStructureSupport=false`.
Disabling HMPP is not supported anymore.

^KT-59304
2023-08-09 12:14:13 +00:00
Ilya Goncharov 949e4be658 [Gradle, JS] Add test with cross modules with compose dependency 2023-08-09 11:45:58 +00:00
Simon Ogorodnik d6e760b477 [K2/K1 FP] Fix context-receivers flag passing in full-pipeline test
We should copy `-Xcontext-receivers` flag from the original arguments
during the setup of compiler arguments in the FP test

Otherwise, UNSUPPORTED_CONTEXTUAL_DECLARATION_CALL diagnostic gets
triggered where it shouldn't be present
2023-08-09 10:25:12 +00:00
Leonid Startsev f450122d63 Refactor MetadataExtensions.kt to remove extension visitors
This helps to completely get rid of Visitors API during reading and writing
of the JVM metadata.

Note: Klib writers still use .accept and left for future refactorings.

See also #KT-59442
2023-08-09 10:16:27 +00:00
Leonid Startsev b8e4b44b04 Promote DeprecationLevel on Visitors API to ERROR
Rewrite Readers.kt and Writers.kt to avoid using
Visitors API

Align KotlinCommonMetadata/KotlinModuleMetadata API with
KotlinClassMetadata one (it is necessary for restructured reading/writing)

#KT-59442 In Progress
2023-08-09 10:16:27 +00:00
Dmitriy Novozhilov 4e3dbcada3 [FIR2IR] Always look for already generated fake overrides before creating them
This change covers the case where some f/o was generated in common module
  and it is referenced in platform code. But signature of this f/o may be
  different in different modules because of e.g. actualization of value
  parameters with actual typealias

^KT-60850 Fixed
2023-08-09 09:40:23 +00:00
Yahor Berdnikau 380062c511 [repo] Update the shadow version to 8.1.1 release
https://github.com/johnrengelman/shadow/releases/tag/8.1.1
2023-08-09 08:36:46 +00:00
Yahor Berdnikau c701677e45 [repo] Remove the shadow version from version.properties 2023-08-09 08:36:45 +00:00
Anton Lakotka c58eef8330 [stdlib-mpp] Update kotlin-stdlib.pom
It has now unnecessary duplicated dependencies on kotlin-stdlib-common.
They should be removed in followup changes.

^KT-61053 Verification Pending
2023-08-09 07:52:35 +00:00
Anton Lakotka 7c5dd7c451 [stdlib-mpp] Add dependency constraint on kotlin-stdlib-common for...
...other variants where it can be expected. Such as:

* commonMainMetadataElements (legacy metadata)
* metadataElements (klib metadata)
* nativeApiElements

This would prevent from leaking kotlin-stdlib-common dependencies of
older Kotlin versions. So every KGP configuration where
stdlib dependencies is configured automatically will enforce dependency
constraints on kotlin-stdlib-common.

^KT-61053 Verification Pending
2023-08-09 07:52:35 +00:00
Anna Kozlova b725cd3e6c [light classes] match property with getter or setter only
^ KTIJ-26536
2023-08-09 07:09:35 +00:00
Dmitrii Gridin b39286e6cb [LL FIR] fix script testdata
Conflict with 887dc18719
2023-08-09 06:58:41 +00:00
Roman Golyshev 71a4f36faf KTIJ-26576 [Analysis API] Add where clause to classHeaderParts in FirTowerDataContextAllElementsCollector
In `where` clause there are type constraints, and there are no
supertypes scopes at those positions

^KTIJ-26576 Fixed
2023-08-09 06:49:48 +00:00
Alexander Udalov 5b0c075c8d Rework list of dependencies of kotlin-annotation-processing 2023-08-09 01:17:21 +00:00
Pavel Mikhailovskii 2002542ad2 Stub generation infrastructure (except for metadata generation) for KAPT+K2
This commit includes the basic Java stubs generation infrastructure and
the corresponding tests. The main entry point is called
Kapt4StubGenerator. Calls to it from production code will be added in a
separate commit.

 #KT-51982
2023-08-09 01:17:21 +00:00
marat.akhin ae4fab8483 [KMP] Allow matching expect ctorless final classes to objects
both directly and via typealias.

This is a possible fix to KT-59747
2023-08-08 23:18:35 +00:00
marat.akhin 6df9ce23f7 [FIR2IR] Configure Unit built-in to have kotlin.Any as a supertype
Without this change, the Unit type does not have Any members declared
in its scope which breaks the expect/actual mapping
(aka we cannot find actual `toString` for expect one).
2023-08-08 23:18:35 +00:00
Alexander Udalov e87bccd5c7 K2: fix reporting of NO_REFLECTION_IN_CLASS_PATH on implicit invoke
#KT-61054 Fixed
2023-08-08 20:19:11 +00:00
Igor Yakovlev 87ab88957d [Wasm] Fix wasm-target compiler key in gradle plugin 2023-08-08 18:35:31 +00:00
Ilya Goncharov a3aa1f6121 [Gradle, Wasm] Add wasm wasi stdlib by default 2023-08-08 18:35:31 +00:00
Dmitrii Krasnov b1a611e2b2 Fixed PartialLinkageMode resolving
#KT-60839
2023-08-08 18:28:32 +00:00
Yan Zhulanow 6fac185f14 [LL API] Add backend-computed code fragment mappings 2023-08-08 17:26:39 +00:00
Yan Zhulanow 5a67b0d7dc [LL API] Correct used IR symbols in code fragments
As 'FirCodeFragments' are converted to IR independently of its context,
in some cases duplicate (and not quite correct) symbols for local
classes and functions are created.

Until properly fixed in fir2ir, here we replace such duplicates with
original symbols.
2023-08-08 17:26:39 +00:00
Yan Zhulanow ee7e6b0fce [LL API] Ignore local functions in 'CodeFragmentDeclarationCollector'
In the old JVM backend, local functions were compiled as JVM classes,
so there were an instance to pass around. Today, they are compiled to
static functions in the containing class/facade, and calls to them
compile natively.
2023-08-08 17:26:38 +00:00
Nikolay Lunyak 921db9f8d4 [FIR] Report UNSUPPORTED_SUSPEND_TEST
^KT-60002 Fixed
2023-08-08 16:48:02 +00:00
Igor Yakovlev 223e590dcd [Wasm] Temporary task to provide wasm stdlib tests 2023-08-08 18:10:20 +02:00