Commit Graph

109927 Commits

Author SHA1 Message Date
Sonya Valchuk 0005ba47f8 JVM: extract some helpers for SMAP inlining 2024-03-13 21:31:19 +00:00
Mikhail Glukhikh 95fa065361 Temporary: don't check log in Maven test (KT-66551) 2024-03-13 20:38:45 +00:00
Mikhail Glukhikh f2ec6d7495 Temporary: comment the last check in JavaUsageTest (KT-66551) 2024-03-13 20:38:45 +00:00
Mikhail Glukhikh 0757247233 Temporary: mute pre-release warnings in Gradle tests (KT-66551) 2024-03-13 20:38:44 +00:00
Mikhail Glukhikh 92cf3e3343 Temporary: make "Pre-release classes were found in dependencies" warning
See KT-66551
2024-03-13 20:38:44 +00:00
Mikhail Glukhikh 893e5cac94 Temporary: mute PRE_RELEASE_CLASS in some tests (KT-66551) 2024-03-13 20:38:44 +00:00
Mikhail Glukhikh a0cb713d19 Temporary: make PRE_RELEASE_CLASS a warning in both K1/K2 (KT-66551) 2024-03-13 20:38:44 +00:00
Mikhail Glukhikh 93a796b635 Temporarily unmute passing test around IS_PRE_RELEASE (related to KT-62063)
This test (probably) should be muted again after bootstrapping
2024-03-13 20:38:44 +00:00
Mikhail Glukhikh f37347ddb7 Temporarily mute failing test around IS_PRE_RELEASE (related to KT-62063)
This test should be fixed by bootstrapping or in KT-66551
2024-03-13 20:38:44 +00:00
Mikhail Glukhikh dc879a3875 K2: drop poisoning flag due to upcoming 2.0.0-RC
#KT-62063 Fixed
2024-03-13 20:38:44 +00:00
Kirill Rakhman b74dcb77e3 [FIR] Add opt-in to replaceIsTrailingLambda
#KT-66553
2024-03-13 17:05:48 +00:00
Kirill Rakhman 1876c8a9ee [AA] Fix getKtExpressionType for augmented array assignment
This previously worked on accident because the get call in an
augmented array assignment wouldn't have a resolved argument list, and
so `argumentsToSubstitutedValueParameters` would return null.
Now, we additionally verify that we're in a `set` call.

#KT-66124
2024-03-13 17:05:48 +00:00
Kirill Rakhman 0cac6b66d5 [FIR] Remove vararg workaround in FirArgumentsToParametersMapper
Since we save the unresolved argument list, we don't need the workaround
anymore.

#KT-66124
2024-03-13 17:05:48 +00:00
Kirill Rakhman fbb21f2406 [FIR2IR] Remove argument unwrapping for SAM conversion
FirNamedArgumentExpressions don't exist anymore during FIR2IR phase
and so we don't need to unwrap arguments here anymore.

#KT-66124
2024-03-13 17:05:48 +00:00
Kirill Rakhman 015f257031 [FIR2IR] Remove special handling of named arguments for vararg
FirNamedArgumentExpressions don't exist anymore during FIR2IR phase
and so handling FirSpreadArgumentExpression in Fir2IrVisitor is
sufficient.

#KT-66124
2024-03-13 17:05:48 +00:00
Kirill Rakhman d16cc668cd [FIR] Add KDocs for wrapped argument expressions
#KT-66124
2024-03-13 17:05:48 +00:00
Kirill Rakhman 454ef4ae46 [FIR] Build resolved argument list for augmented array assignment get call
This lets us get rid of some fallback code in FIR2IR that handles
unresolved argument lists.
After this, we should have an invariant that all non-empty argument
lists are resolved when FIR2IR runs.

#KT-66124
2024-03-13 17:05:48 +00:00
Kirill Rakhman 8443daf78d [FIR] Remove FirNamedArgumentExpressions during completion
They are mostly necessary for argument mapping during resolution.
To support a couple checkers, we transform named args for varargs
into "fake" spread expressions.

Other than that, named arguments aren't needed for anything and often
lead to bugs where we forget to unwrap them for something, so it's
better to get rid of them.

#KT-66124
2024-03-13 17:05:48 +00:00
Kirill Rakhman 03fc0fd381 [FIR] Remove FirLambdaArgumentExpression
It's not really necessary if the information about if the lambda was a
trailing lambda can be directly saved in FirAnonymousFunctionExpression.

Removing the FIR node uncovered a couple of bugs
(UNINITIALIZED_ENUM_ENTRY, ERROR_IN_CONTRACT_DESCRIPTION) that were
caused by assuming that a lambda is always a trailing lambda.

#KT-66124
2024-03-13 17:05:48 +00:00
Kirill Rakhman 1a5fa8d3f6 [Tests] Add test for suspend SAM conversion with trailing lambda
#KT-65878
#KT-66124
2024-03-13 17:05:48 +00:00
Kirill Rakhman 5a00984607 [FIR] Fix misleading return type 2024-03-13 17:05:48 +00:00
Kirill Rakhman b4d036ce58 [FIR] Remove unused code 2024-03-13 17:05:48 +00:00
Ivan Kylchik 61fabc02ba [K2] Resolve bodies of const properties during IMPLICIT_TYPES_BODY_RESOLVE
This is required to implement constant evaluator on the FIR level.

#KT-64151
2024-03-13 16:53:59 +00:00
Ivan Kylchik 0ebf2862a9 [K2] Add new tests on lazy resolve to check new resolve rules
In the consequent commits, there are some changes in FIR resolve.
These tests will show the difference.

#KT-64151
2024-03-13 16:53:59 +00:00
Roman Golyshev 1884a655c5 KT-66498 [AA] Provide KDoc for isSubClassOf and isDirectSubClassOf 2024-03-13 16:31:41 +00:00
Roman Golyshev c6e442c18b KT-66498 [AA] Do not consider a class to be a subclass of itself in K1 impl for isSubClassOf
^KT-66498 Fixed
2024-03-13 16:31:41 +00:00
Roman Golyshev de75297875 KT-66498 [AA] Add more tests for the isSubClassOf/isDirectSubClassOf
Also, reproduce the difference between the K1 and K2 implementation
of `isSubClassOf` for the same class
2024-03-13 16:31:41 +00:00
Mikhail Glukhikh f656a9fdc6 Migrate some KT-65789 & KT-58920 tests on using take<ExpectedType>(arg) 2024-03-13 14:57:34 +00:00
Mikhail Glukhikh 0f53ee64d6 K2: make qualifier & classifier the same tower level
#KT-65789 Fixed
#KT-38031 Fixed
2024-03-13 14:57:34 +00:00
Mikhail Glukhikh d6e67e43f9 K1/K2: add a test for KT-62866 2024-03-13 14:57:34 +00:00
Mikhail Glukhikh 3b9e08d6b8 K1/K2: reproduce KT-65789 2024-03-13 14:57:33 +00:00
Aleksei.Glushko f2501ad424 [K/N] Use already dereferenced weakReferee (KT-66371)
And prevent weak barriers from execution during STW

Merge-request: KT-MR-14797
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2024-03-13 14:43:59 +00:00
Roman Efremov 284d5437e5 [FIR] Don't transform call arguments during TYPES phase
Instead, it should happen during BODY_RESOLVE phase.

This fixes KT-66150. The problem was, that `super<B>.f()` expression
in delegated constructor call was transformed during TYPES phase,
and type transformer has no special logic for allowing bare types in
super qualifiers, like the one in expressions transformer (see
`org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirExpressionsResolveTransformer.transformSuperReceiver`).
As a result, `B` without type argument leads to
WrongNumberOfTypeArgumentsError.
It looks incorrect that expressions in constructor call resolved
during TYPES phase, so skipping transformation of
argument list seems like the best solution here.

^KT-66150 Fixed
2024-03-13 14:31:14 +00:00
Roman Efremov c4f89ab32e [Test] Add test reproducing incorrect error in K2 about super qualifier
...with type arguments.
Also, add lazy resolve test to check the subsequent changes are correct.

^KT-66150
2024-03-13 14:31:14 +00:00
Artem Kobzar a38d317824 [K/JS] Use globalThis isntead of this for UMD modules ^KT-45604 Fixed 2024-03-13 13:36:55 +00:00
Kirill Rakhman 43a08068fc [Tests] Add regression tests for KT-32754
#KT-32754 Fixed
2024-03-13 12:39:54 +00:00
Alexander Shabalin adf5331ff0 [K/N] Remove more ext properties 2024-03-13 12:35:15 +00:00
Alexander Shabalin 23710ac133 [K/N] Keep isolatedClassLoaders in a build service 2024-03-13 12:35:15 +00:00
Alexander Shabalin 3532056e0d [K/N] Remove global execClang extension 2024-03-13 12:35:15 +00:00
Alexander Shabalin aead2c2bff [K/N] Remove unused targetsWithoutZlib 2024-03-13 12:35:15 +00:00
Alexander Shabalin 5a9eea8c45 [K/N] Remove unused gradle ext properties 2024-03-13 12:35:15 +00:00
Alexander Shabalin bb8c8431e8 [K/N][tests] Move gradle stuff for old infra to old infra 2024-03-13 12:35:15 +00:00
Dmitriy Novozhilov c818ce9220 [Test] Add test for KT-66338 2024-03-13 09:17:17 +00:00
Alexander Udalov 55f9f74d5c Tests: do not report backend diagnostics if there's frontend error
In most affected tests, the backend diagnostic such as "conflicting JVM
signature" or "accidental override" is directly caused by some already
existing error reported by frontend, so it doesn't make sense to check
backend diagnostics there.

Tests where that was not the case were moved/copied to
`testsWithJvmBackend`.
2024-03-13 08:38:15 +00:00
Alexander Udalov dca6c21d7f Tests: remove duplicateJvmSignature diagnostic tests
All of these tests were actually copied to `testsWithJvmBackend` in
866f188120, but it's unclear why they were copied instead of moved. The
test runner for `testsWithJvmBackend` correctly runs the compiler
pipeline and obtains errors reported by the backend, as opposed to the
common diagnostic tests which have a very custom code, using parts of
the old JVM backend, to obtain these diagnostics.
2024-03-13 08:38:15 +00:00
Alexander Udalov 6ed06f4dac Tests: minor, move diagnostic test missingNames.kt
Looks like it was placed in the `duplicateJvmSignature` directory by
mistake.
2024-03-13 08:38:14 +00:00
Alexander Udalov 5be1ff1d5f Tests: minor, remove obsolete diagnostic tests
- `require.kt` was added to check JVM accidental override diagnostic
  when using the "traits with required classes" feature, which was
  removed a long time ago.
- `withErrorTypes.kt` was testing conflicting JVM declarations error (a
  backend diagnostic) in presence of error types -- not very useful
  scenario because the backend is not run when there's a frontend error.
2024-03-13 08:38:14 +00:00
eugene.levenetc f7f779df53 [ObjCExport] Add inner classes translation
KT-66339
2024-03-13 08:10:21 +00:00
Vladimir Sukharev 5fee662223 [Tests] Add test for KT-57391
^KT-57391
2024-03-12 18:10:10 +00:00
Artem Kobzar 46dc478c03 [K/Wasm] Reduce debug information for the internal Kotlin functions 2024-03-12 17:37:03 +00:00