Commit Graph

105848 Commits

Author SHA1 Message Date
Ilya Chernikov 65d1c8ce7e K2 Scripting: do not report import resolution errors on implicit imports
since implicit imports are used in the gradle scripts, where it seems
difficult to precisely control list of import to avoid
unresolved names. And we can relatively safely ignore
unresolved imports there

#KT-62404 fixed
2023-11-03 21:54:23 +00:00
Ilya Chernikov 02dc3c4ddb K2 Scripting: add annotation resolving for scripts
#KT-62400 fixed
2023-11-03 21:54:23 +00:00
Ilya Chernikov 31f9e9e7a8 K2 Scripting: implement basic metadata serialization support
#KT-62305 fixed
NB: kotlin reflection do not see script class constructor after
this change, and it's ok, since the fact that the script is compiled
into a class is an implementation detail.
If needed, java reflection could be used to access the constructor.
2023-11-03 21:54:23 +00:00
Ilya Chernikov 122f16fc18 K2 ignore return type on special java funs overrides
#KT-62197 fixed
2023-11-03 18:32:05 +01:00
Alejandro Serrano Mena 312187dbe6 [IR] Improve error messages for constant evaluation error 2023-11-03 14:54:48 +00:00
Brian Norman 1bb5e97b62 [FIR] Improve performance of missing supertype detection
^KT-62619 Fixed
2023-11-03 13:28:02 +00:00
Florian Kistner c55dc2578a Fix missing KonanManglerDesc in kotlin-backend-native-for-ide 2023-11-03 13:16:19 +00:00
Ilya Goncharov c2e2572680 [Gradle, JS] Use only KotlinJsCompilation
^KT-41382 fixed
2023-11-03 12:04:11 +00:00
Nikolay Lunyak b8e2a17de1 [Test] Fix diagnostics arguments rendering when quotes are present
Non-capturing `(?:)` was now needed to avoid
getting an additional group that only
contains the last symbol before the closing `"`.

^KT-62711 Fixed
2023-11-03 08:14:28 +00:00
Sergej Jaskiewicz 54de11cb58 [FIR/IR generator] Generate kDocs for visitor classes 2023-11-02 23:05:18 +00:00
Sergej Jaskiewicz 570422dbd4 [FIR/IR generator] Print visitor method expression bodies on new line
This helps to avoid long lines in visitor classes.
2023-11-02 23:05:18 +00:00
Sergej Jaskiewicz c5f519f7c7 [FIR/IR generator] Commonize visitor printing logic
This is a step towards commonizing the code generator between
FIR and IR: KT-61970

Also, don't use kotlinpoet for generating IR visitors (KT-61703)
2023-11-02 23:05:18 +00:00
Anna Kozlova 205a125c5f [AA] implement KtFirSimpleNameReference.getImportAlias
^ KT-62980 fixed

Merge-request: KT-MR-12786
Merged-by: Anna Kozlova <Anna.Kozlova@jetbrains.com>
2023-11-02 21:23:43 +00:00
Vladimir Sukharev 0fb853a995 [FIR] Fix Disappeared CONTRACT_NOT_ALLOWED
https://youtrack.jetbrains.com/issue/KT-60004/K2-Disappeared-CONTRACTNOTALLOWED

Merge-request: KT-MR-12613
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-11-02 20:47:05 +00:00
Ilya Kirillov 834927a901 [Analysis API Standalone] fix common code analysis against a klib
^KT-63007 fixed
2023-11-02 19:19:39 +00:00
Dmitriy Dolovov a3bfe58415 [KLIB tool] Fix failing test on dumping c-interop signatures 2023-11-02 18:44:14 +00:00
Dmitrii Gridin 38524f6b15 [LL FIR] correctly calculate lazy bodies for delegated properties
We should rebind symbols from generated constructions to the original
ones as we already did for regular bodies like (PsiRawFirBuilder.bindFunctionTarget).
This commit also removed bodies for generated accessors as a bonus

^KT-61491 Fixed
2023-11-02 18:39:04 +00:00
Dmitrii Krasnov 680455b162 [FUS Tests] Changed expected hash in module changes
It changed in b9090e12 commit without updating it into the test

#KT-62987 Fixed
2023-11-02 15:25:19 +01:00
Brian Norman 6cf76e1d07 [FIR] Report no return diagnostic on functions returning Nothing
Previously, the NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY diagnostic was not
reported at all on functions which return Nothing. However, in K1, if
the function returns Nothing but the body is empty or doesn't contain a
Nothing expression, this diagnostic would be reported. The checker in K2
has been updated to report this diagnostic on functions which return
Nothing as well.

^KT-55965 Fixed
2023-11-02 13:20:55 +00:00
Sebastian Sellmair 3fb415d966 [Gradle] Replace KotlinTargetWithTestsConfigurator with KotlinTestRunFactory
KT-61634
2023-11-02 13:20:38 +00:00
Sebastian Sellmair 40820e42a6 [Gradle] Implement ConfigureBuildSideEffect (replacing 'configureBuild')
KT-61634
2023-11-02 13:20:38 +00:00
Brian Norman 5676759287 [FIR] Set thisReceiver when generating IrClass for unknown classes
^KT-60942 Fixed
2023-11-02 12:50:23 +00:00
Kirill Rakhman 2d7cadc0ab [FE, Java Resolve] Filter out canonical record constructors
This fixes a false positive overload resolution ambiguity in FIR
when invoking a record constructor when it also defines a canonical
constructor (compact or explicit).

#KT-62151 Fixed
2023-11-02 12:39:45 +00:00
Brian Norman 3327bed5bd [FIR] Report more occurrences of NON_LOCAL_RETURN_NOT_ALLOWED
When an inline lambda is invoked or passed to another inline function,
make sure non-local returns are allowed by all surrounding declarations.
Otherwise, NON_LOCAL_RETURN_NOT_ALLOWED must be reported.

^KT-59884 Fixed
^KT-55319 Fixed
2023-11-02 12:33:56 +00:00
Ilya Chernikov b3d33aee19 HMPP, IC: Implement shared provider for IC class files
#KT-61942 fixed
temporary solution, see comments for details
2023-11-02 11:03:37 +00:00
Ilya Chernikov 76eda0095e HMPP: Fix isCommon calculation for the K2 HMPP case 2023-11-02 11:03:37 +00:00
Alexander Udalov 968dfddbc9 Tests: adjust test data for bytecode listing tests
- remove obsolete `IGNORE_BACKEND: JVM` directives
- move contents of .ir.txt files to the corresponding .txt
2023-11-02 10:59:29 +00:00
Alexander Udalov 1cf04916d6 Tests: remove bytecode listing tests for old JVM backend
These tests are mostly used to check ABI in case you're compiling a
library or library-like code, which is no longer possible (since old JVM
backend is only used in the IDE).
2023-11-02 10:59:29 +00:00
Alexander Udalov 56936e2012 Tests: minor, remove obsolete implicit language directive
These tests were moved in 14c2030595 and an explicit directive was
added.
2023-11-02 10:59:29 +00:00
Alexander Udalov 9ae16fd66e Tests: unmute bytecode listing tests for JVM_IR
Mute them for the old JVM backend instead. JVM IR behavior is fine in
all cases except maybe `destructured.kt`, for which there's now an issue
KT-63075.
2023-11-02 10:59:28 +00:00
Alexander Udalov c1c9549b4f Tests: minor, remove obsolete deprecated AbstractBytecodeListingTest 2023-11-02 10:59:28 +00:00
Pavel Kirpichenkov 237f90d289 [stubs] Move KlibMetaFileType.STUB_VERSION to KotlinStubVersions
Track changes in K/N stubs directly instead of using the hack with
KlibMetaFileType.STUB_VERSION + KotlinStubVersions.BUILTIN_STUB_VERSION.
Changes in built-in stubs might or might not affect .knm stubs and
should be tracked independently.

The used offset constant for migration is the sum of the offsets from
KlibMetaFileType and KotlinStubVersions.BUILTIN_STUB_VERSION.

KTIJ-26761
KTIJ-26961
2023-11-02 10:28:37 +00:00
Pavel Kirpichenkov e6b2230d51 [minor] remove duplicated import 2023-11-02 10:28:37 +00:00
Pavel Kirpichenkov 2d10877fda [refactoring] extract base class for annotation loaders
Annotation loaders for descriptors (AnnotationAndConstantLoaderImpl) and
stubs (AnnotationLoaderForStubBuilderImpl) share the loading logic until
mapping ProtoBuf.Annotations to output values. The shared logic has been
extracted to the base class.

KTIJ-26761
KTIJ-26961
2023-11-02 10:28:37 +00:00
Pavel Kirpichenkov 30d45039fb [decompiler] Fix property and receiver annotations loading for stubs
Add annotation loading for property backing field, property delegate and
extension receiver to AnnotationLoaderForStubBuilderImpl. Use logic from
AnnotationAndConstantLoaderImpl.

AnnotationLoaderForStubBuilderImpl is used by KotlinMetadataDecompiler,
K2KlibMetadataDecompiler and KotlinJavaScriptMetaFileDecompiler. Stub
versions for built-ins (affects metadata and K/N decompilers) and JS
are bumped.

KTIJ-26761
KTIJ-26961
2023-11-02 10:28:37 +00:00
Dmitrii Krasnov 0882d5201b [FUS] Fixed ModuleChangesCatchingTest failures
#KT-62987 Fixed
2023-11-02 10:07:34 +00:00
Dmitriy Novozhilov 88bb98e5ad [Build] Update verification-metadata.xml 2023-11-02 10:03:06 +00:00
Dmitriy Novozhilov 2c24bc61cc Advance bootstrap to 2.0.0-dev-6573 2023-11-02 10:03:05 +00:00
Kirill Rakhman 0682a1f76d [FIR] Remove line breaks after context receivers in diagnostic messages
#KT-62944 Fixed
2023-11-02 08:58:28 +00:00
Ilya Gorbunov e18a124cbb [stdlib] Import kotlin-test-common sources as a part of native stdlib 2023-11-02 03:12:56 +00:00
Ilya Gorbunov 1ea0c2aa44 [stdlib] Import native sources in IDE 2023-11-02 03:12:56 +00:00
Pavel Punegov fb66626240 [K/N][test] Remove obsolete test on KlibInstall task
This test relied on the almost obsolete klib installation feature.
General linkage with a libraries already covered by various tests.
2023-11-01 20:58:21 +00:00
Pavel Punegov 9961780fbd [K/N][build] Build platform libraries without zipping/unzipping
With "-nopack" compiler option, it is possible to build unzipped klibs.
This makes it possible to get rid of install tasks that unzip them.
Also, an obsolete test for klib installation was removed.
2023-11-01 20:58:21 +00:00
Yahor Berdnikau 094490acbd [Gradle] Compile against Gradle 8.4 api
^KT-62964 Fixed
2023-11-01 19:26:36 +00:00
Nikita Bobko 173651eb5c Fix misconfigured widerVisibilityInActualClassifier test
^KT-59977 Fixed
Review: https://jetbrains.team/p/kt/reviews/12807/timeline
2023-11-01 19:14:20 +00:00
Dmitriy Novozhilov e473b52da7 [Test] Add additional test for KT-21463 2023-11-01 17:39:33 +00:00
Margarita Bobova 85665d71ca Add changelog for 1.9.20 2023-11-01 14:58:03 +00:00
Ivan Kylchik 32057f6d10 [JVM_IR] Use createSimpleNamedCompilerPhase to create lowerings 2023-11-01 14:01:17 +00:00
Ivan Kylchik f5bb477459 [JVM_IR] Move all stickyPostconditions into single lowering
`stickyPostconditions` are such conditions that are checked
every time after applying when a new lowering finishes its execution.
Right now we are using them only in JVM, and this is a blocker
for adopting Native approach for lowering execution.

In Native we are using
`SimpleNamedCompilerPhase<in Context : LoggingContext, Input, Output>`
as the common super type for all lowerings. Here we have `Input` and
`Output` that can potentially be different and `stickyPostconditions`
don't have much sense in that case.
2023-11-01 14:01:17 +00:00
Ivan Kylchik 6a02a26db8 [Native] Move createSimpleNamedCompilerPhase into common.phaser.PhaseBuilders
This is needed to be able to reuse these functions
for other backends.
2023-11-01 14:01:17 +00:00