Commit Graph

113 Commits

Author SHA1 Message Date
Dmitriy Novozhilov c70c8f927e [FIR] Remove FirDeclarationsForMetadataProviderExtension extension
`IrGeneratedDeclarationsRegistrar` should be now used instead to register
  IR declarations in resulting metadata
2023-12-05 10:21:40 +02:00
Dmitriy Novozhilov 159bc1b435 [IR] Introduce API to register generated IR declaration to be present in metatada
KT-63881
2023-12-05 10:21:38 +02:00
Dmitriy Novozhilov 1cdc8361d6 [IR] Rename IrAnnotationsFromPluginRegistrar to IrGeneratedDeclarationsRegistrar
In further commits, this service will be used not only for registering
  annotations, but newly generated IR declarations too
2023-12-05 10:21:27 +02:00
Roman Golyshev 776926518d KT-59732 [FIR] Add testdata to check incorrect imports with test compiler plugins 2023-12-04 16:51:46 +00:00
Dmitriy Novozhilov ffe5b4c40d [Test] Update some IR dumps after previous changes
Now IR dump handlers receiver actualized IR with removed expected
  declarations, so corresponding tests should be updated accordingly
2023-11-27 10:17:54 +00:00
Nikolay Lunyak 44d6d10233 [FIR] Only check conflicting callables that may clash with declared ones
This change improves performance, as
checking callables via scopes in
`4e587157` turns out to be quite
slow, and it also prevents some redundant
diagnostics.
2023-11-15 07:56:32 +00:00
Roman Golyshev 500dd20277 KT-63096 [LL] Add test for using annotation from other module for compiler plugin 2023-11-09 23:39:32 +00:00
Dmitriy Novozhilov fb8bf19091 [IR] Rename IrSymbolInternals to UnsafeDuringIrConstructionAPI
The new name more precisely describes the meaning of this opt-int
2023-10-25 11:32:46 +00:00
Ivan Kochurkin bb937a8a21 [FIR] Initialize annotations in FirErrorTypeRef
^KT-62447 Fixed
^KT-62628 Fixed
2023-10-24 10:53:33 +00:00
Mikhail Glukhikh 90eaf5f70f K2: introduce val ConeAttribute.keepInInferredDeclarationType 2023-10-20 12:38:19 +00:00
Svyatoslav Kuzmich a10042f909 [Wasm] Add K2 checkers.wasm module (KT-56849)
Add first K2 checker ExternalInheritanceChecker to test the infra
2023-10-12 13:26:58 +00:00
Nikolay Lunyak 2e7dcd6096 [FIR] Require overrides to have matching isSuspend flag value
^KT-57100 Fixed
2023-10-09 06:55:43 +00:00
Nikolay Lunyak ec9cb8beb6 [FIR] Rename JvmNames -> JvmStandardClassIds
This is more consistent with the code of
the common compiler checkers.

It would be nice to refactor the contents
of this object further, but it's out
of scope of the current branch.

^KT-54596
2023-09-19 22:14:09 +00:00
Dmitriy Novozhilov 6d00dcf972 [FIR] Strip comments in Fir2IrAnnotationsFromPluginRegistrar
Fir2IrAnnotationsFromPluginRegistrar stores elements using start and end
  offsets from IR elements, which strip comments from the start offset.
  So it's also needed to strip it from FIR source to keep the consistency

^KT-61872 Fixed
2023-09-12 13:21:05 +00:00
Dmitriy Novozhilov 1f49266c4b [Test] Reproduce KT-61872 2023-09-12 13:21:05 +00:00
Dmitriy Novozhilov 49071374b4 [FIR] Look for annotations generated by backend based on declaration-site session
Test dump for klib does not correlate to real case (CLI compilation of
  JS or Native), because for some reason KLib facade in MPP scenario
  uses session/module of each specific file, instand of session for
  leaf platform module
In CLI scenario only one session is used, so annotations are generated
  properly

^KT-61833 Fixed
2023-09-12 13:21:05 +00:00
Alexander.Likhachev 6eaccc997f [Build] Fix the typo junit jupyter -> jupiter 2023-09-06 22:47:34 +00:00
Alexander.Likhachev 6f96be0b76 [Build] Get rid of the testApiJUnit5 method
#KTI-1349 In Progress
2023-09-06 22:47:34 +00:00
Alexander.Likhachev 53fde520d5 [Build] Add jUnit dependencies in testApiJUnit5 to the implementation configuration
Adding these dependencies to the `api` configuration pollutes classpath for each dependant modules even if it doesn't need them. Instead, the dependencies should be declared more granularly if they're required
#KTI-1349 In Progress
2023-09-06 22:47:34 +00:00
Mikhail Glukhikh c695d2759a K2: add test plugin visitor checking source elements presence
Related to KT-60555, KT-61330
2023-09-06 13:14:16 +00:00
Kirill Rakhman c30ce4aabe [FIR] Print operator keyword and token to unresolved diagnostic message
#KT-55672 Fixed
2023-08-28 08:12:25 +00:00
Kirill Rakhman 7fde5af7f8 [FIR] Rename FirExpression.coneType to resolvedType 2023-08-24 07:54:57 +00:00
Kirill Rakhman 8d7c5b375e [FIR] Replace usages of FirExpression.typeRef with coneTypeOrNull
#KT-59855 Fixed
2023-08-24 07:54:57 +00:00
Kirill Rakhman 9ec814b7ad [FIR] Replace FirExpression.typeRef.coneType (and variants) with FirExpression.coneType
#KT-59855
2023-08-24 07:54:56 +00:00
Nikolay Lunyak f9c6af4d2a [FIR] Properly assign <local> packages to symbols
This prevents `FirConflictsExpressionChecker.kt`
from missing conflicting local functions. It used
to due to inconsistencies in assigning `<local>`,
and this commit makes it a bit more
straightforward.

The change in KtClassTypeQualifierRenderer
prevents `FirOverrideImplementTest.testLocalClass`
from failing in `intellij`. It didn't fail for
callables, because `KtCallableSignatureRenderer`
doesn't try to render packages.

^KT-59186 Fixed
2023-08-18 13:31:04 +00:00
Ilya Kirillov bdfc68468f [FIR] optimize direct allocation of empty ConeTypeProjection arrays
On the snapshot from KTIJ-26260 empty ConeTypeProjection arrays take about 10mb
2023-08-18 11:36:42 +00:00
Nikolay Lunyak 4958196c51 [FIR] Forbid mixing supertypes with different functional kinds
^KT-61277 Fixed
2023-08-17 21:45:42 +00:00
Dmitriy Novozhilov 697d0d5638 [IR] Mark IrSymbol.owner with OptIn annotation
^KT-60923 Fixed
2023-08-16 17:47:29 +00:00
Mikhail Glukhikh 66bbb9582c K1/K2: split incremental compilation tests properly (relates to KT-59171) 2023-07-19 09:34:58 +00:00
Dmitrii Gridin 7620289f6f [FIR] fix contract violation from meta annotations
^KT-60448 Fixed
2023-07-18 16:50:25 +00:00
Dmitriy Novozhilov 8e73d5a54a [FIR] Run irGenerationExtensions after IR actualization
^KT-56173 Fixed
2023-07-07 11:26:15 +00:00
Dmitriy Novozhilov 81da96fed3 [FIR Plugin] Reproduce KT-56173 2023-07-07 11:26:15 +00:00
Dmitriy Novozhilov 037572ee9f [FIR] Create FirExtensionSyntheticFunctionInterfaceProvider only once for all sessions
This is needed to avoid duplication of symbols for the same classIds

^KT-58539 Fixed
2023-07-06 11:00:38 +00:00
Dmitriy Novozhilov d46f697cf8 [Test] Reproduce KT-58539 2023-07-06 11:00:38 +00:00
Dmitriy Novozhilov 1212128f04 [FIR plugin] Replace composable functions with regular kotlin functions 2023-07-06 11:00:38 +00:00
Sergej Jaskiewicz 6281faa063 [IR] Move IrFactory#createBlockBody overloads to extension methods
This is to prepare for IrFactory auto-generation (KT-59308).
2023-07-04 15:19:28 +00:00
Mads Ager 607d38f96f [K2 plugin] Support simple arguments in annotation metadata extension.
^KT-58968
^KT-60051 Fixed
2023-07-04 14:11:26 +00:00
Alexander Udalov c66bc36382 Build: fix some warnings in buildSrc and build.gradle.kts 2023-06-26 15:42:21 +00:00
Dmitriy Novozhilov 5717b59f52 [FIR/IR] Introduce an ability to propagate generated IR annotation to metadata
^KT-58638 Fixed
2023-06-21 06:56:59 +00:00
Dmitriy Novozhilov 24e07fdfe0 [FIR plugin] Add test for plugin which generates annotations on IR
^KT-58638
2023-06-21 06:56:59 +00:00
Dmitriy Novozhilov fd670d33cb [FIR plugin] Compile annotations in plugin sandbox to jvm and js
This is needed for further testing of plugins with JS backend
2023-06-21 06:56:59 +00:00
Dmitriy Novozhilov 2290a096d1 [Test] Add JVM platform to name of ..FirLoadCompiledKotlin.. tests
This is needed for further distinguishing them with similar JS tests
2023-06-07 10:58:01 +00:00
Sergej Jaskiewicz f2031ae642 [IR] Don't print multifile/synthetic facade class names in irText tests
This only applies to JVM and fq-names in declaration references
in IR dumps.

This enables us to run more irText tests on platforms other than JVM
(see KT-58605).
2023-06-05 10:40:17 +00:00
Sergej Jaskiewicz fd76a34277 [IR] Don't print flags in declaration references in irText tests
This doesn't reduce the quality of tests, because the flags are still
printed for declarations themselves. We only omit them in references.

However, this makes the tests more compatible with non-JVM backends
(see KT-58605), because flags of referenced stdlib declarations may
differ among target platforms.
2023-05-30 17:26:30 +00:00
Sergej Jaskiewicz 56f977f70c [IR] Don't render facade classes in JVM fq-names in irText tests
This makes the tests more compatible with non-JVM backends
(see KT-58605)
2023-05-17 12:43:35 +00:00
Mads Ager 6117f76a8c Discourage the use of LANGUAGE_VERSION directive.
Pinning the language version is rarely the right thing to do.
This changes makes it harder to do so by requiring an additional
directive with a name that indicates to developers that they are
likely doing something dangerous.
2023-05-15 14:29:48 +00:00
Mads Ager 089928ba2b [K2] Support legacy serialization for custom function type extensions.
For Compose libraries, it is important that libraries built with
K2 in version 2.0 can be read and used by a version 1.9 K1
compiler. That is not possible if custom function types are
in the metadata.

^KT-58456 Fixed
2023-05-12 10:49:43 +00:00
Roman Golyshev ac388010b1 [213] Add missing test runtime dependencies
KTI-1114
2023-04-21 13:19:04 +00:00
Roman Golyshev d4cffb8a5a [213] Switch to 213 platform
KTI-1114
2023-04-21 13:19:04 +00:00
Sebastian Sellmair 5d0bf2de24 [CLI] Restore K2JVMCompilerArguments.classpath and javaModulePath
to support IDEs < 2023.2

Reverts:
- 9dcd40d7b7
- fb66764c4d

KTIJ-25227
2023-04-18 09:18:10 +00:00