Commit Graph

151 Commits

Author SHA1 Message Date
Dmitriy Novozhilov da581f38e1 [Test] Require specifying parser for FIR test. Unify names for FIR tests
Now all tests with `Fir` in name are named accordingly to parser which
  is used in them -- `FirPsi` or `FirLightTree`. This is needed to keep
  consistency between different types of tests, because there is no
  single default in parser mode between different scenarios of using FIR
2023-02-24 11:15:26 +00:00
Dmitriy Novozhilov 41192b022d [FIR] Pass context to all relevant methods of FirDeclarationGenerationExtension
^KT-53470 Fixed
2023-02-10 12:30:14 +00:00
Dmitriy Novozhilov 89c42e20c9 [FIR] Consistently use _function_ instead of _functional_ in names of classes and functions 2023-02-02 08:24:52 +00:00
Dmitriy Novozhilov c86495dcae [FIR] Introduce ConeFunctionalTypeKind as a replacement of FunctionClassKind
This is needed to provide an ability to extend different kinds of
  functional types

Also, cleanup and rename utilities related to functional types to avoid
  possible confusions
2023-02-02 08:24:49 +00:00
Dmitriy Novozhilov 125b773205 [FIR] Introduce utility for creating ConeClassLikeLookupTagImpl from ClassId
`classId.toLookupTag()` looks much cleaner than `ConeClassLikeLookupTagImpl(classId)`
2023-02-02 08:24:48 +00:00
Dmitriy Novozhilov 36bb418049 [Parcelize] Add test for KT-47074 2023-01-31 07:53:08 +00:00
Ivan Kochurkin c103da98dd [FIR] Add missing dependencies to :compiler:fir:checkers:checkers.native 2023-01-24 15:27:12 +00:00
Sergej Jaskiewicz 1f76d39e66 [IR] Make IrTypeArgument a sealed interface 2023-01-20 10:58:28 +00:00
Nikolay Lunyak 23301e3369 [FIR] Remove annotations.any from FirParcelizeAnnotationChecker 2023-01-17 06:26:39 +00:00
Nikolay Lunyak cf73d59e29 [FIR] Remove FirAnnotation.classId from FirParcelize
The same reasoning as with the serialization. If we
decide to support it, we wouldn't need to think
about unexpanded types.
2023-01-17 06:26:35 +00:00
Ilya Kirillov a55b4a977b [FIR] refactoring: extract registration of lazy declaration resolve contract checking to a separate function in tests 2023-01-13 15:57:05 +00:00
Ilya Kirillov 747ab5fdb3 [FIR] get rid of FirFrontendFacadeForDiagnosticTests 2023-01-13 15:57:05 +00:00
Ivan Kochurkin 041f9c4700 [Testing] Simplify test functions 2023-01-13 12:55:56 +00:00
Dmitriy Novozhilov 5fedb2f72d [Parcelize] Use new DSL for generating declarations 2023-01-12 17:45:41 +00:00
Dmitriy Novozhilov 4f3add8f7a [FIR] Fix resolution of plugin annotations if only meta annotations are registered 2023-01-04 11:02:01 +00:00
Mikhail Glukhikh 0d50f71fb8 K2: expand type aliases in annotation position #KT-55615 Fixed 2023-01-04 10:06:39 +00:00
Alexander Udalov 3c4b5529af Update year to 2023 in COPYRIGHT_HEADER.txt
This commit is the result of changing the year to 2023 in
COPYRIGHT_HEADER.txt and running all `generate*` tasks in
`generators/build.gradle.kts`.
2023-01-02 22:52:15 +01:00
Ilya Kirillov 644d1bf0d0 [FIR] ignore tests which fail because of resolve contracts violation 2022-12-12 16:21:07 +00:00
Ilya Kirillov 7bac119f20 [FIR] add lazy resolution contract checks in resolve 2022-12-12 16:21:06 +00:00
Alexander Udalov 0d8d91f803 Remove unsafe cast function usages from compiler plugins 2022-12-06 19:44:56 +00:00
Dmitriy Novozhilov 246dc985a6 [FIR] Rework predicates system
Now predicates are split into LookupPredicate and DeclarationPredicate
  hierarchies. First one allows to perform global search for declarations
  and second one allows to check if some declaration matches the predicate.
Predicates with meta annotations are excluded from LookupPredicates,
  because it's impossible to create index of annotations with meta-annotations,
  because they can be located inside binary dependencies (so to achieve
  this we need to scan the whole classpath).
Also only one predicate with meta-annotations is left in DeclarationPredicate
  hierarchy (AnnotatedWithMeta)

^KT-53874 Fixed
^KT-53590 Fixed
2022-12-01 07:29:37 +00:00
Ilya Kirillov 7781ad67d4 [FIR] introduce FirValueParameter.containingFunctionSymbol
^KT-55034 fixed
2022-11-22 18:25:30 +01:00
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00
pyos b23de16b06 FIR Parcelize: register the error message factory 2022-10-27 10:19:21 +03:00
pyos 72e671c8f1 FIR Parcelize: allow anonymous local objects if they're enum entries 2022-09-28 15:14:25 +03:00
Vladimir Sukharev c8864369fd Use main class as test generator name
Merge-request: KT-MR-7031
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-09-09 12:51:18 +00:00
Alexander Udalov 7dad47cd76 Add -X argument to disable generation of @SourceDebugExtension
This will be used in tests in the subsequent commit.
2022-09-09 14:32:35 +02:00
Nikita Bobko 8f79e833a8 Drop all redundant kotlin-reflect, kotlin-reflect-api dependencies
Review: https://jetbrains.team/p/kt/reviews/6753

All redundant I managed to find, of course.

Why: I'm going to process all reflect dependencies in the next commits.
Cleanup reflect dependency before processing.

They are redundant because:
1. if `compileOnly` then compilation didn't break after dropping the
   dependency
2. if `test*` then tests didn't break after dropping the dependency.
3. `analysis/analysis-api-fir/analysis-api-fir-generator/build.gradle.kts`
   `compiler/fir/checkers/checkers-component-generator/build.gradle.kts`
   Drop `implementation(project(":kotlin-reflect-api"))` because the
   module already depends on
   `implementation(project(":kotlin-reflect"))`
4. `compiler/daemon/daemon-client/build.gradle.kts`. Drop `runtimeOnly`
   because after dropping `compileOnly` compilation didn't break (so
   `runtimeOnly` looks suspicious). Less safe than 1-3
2022-08-22 15:42:57 +02:00
Dmitry Gridin 4ceb170917 regenerate tests 2022-08-05 14:12:41 +02:00
Steven Schäfer 58e51919bd Parcelize: Add missing FIR diagnostics 2022-07-26 09:34:10 +00:00
Steven Schäfer d4aa303acb Parcelize: Avoid KotlinTypeMapper in ParcelizeDeclarationChecker 2022-07-26 09:34:10 +00:00
Mikhail Glukhikh eba0e94429 K2: get rid of manual diagnostic suppression in checkers 2022-07-22 11:35:28 +00:00
Nikolay Krasko 5b8a4ccd56 Use cache-redirector for downloading in parcelize tests
There's a flaky failures when
~/.m2/repository/org/robolectric/android-all/5.0.2_r3-robolectric-r0/android-all-5.0.2_r3-robolectric-r0.jar
is partially downloaded during tests execution.
This led to Parcelize tests failure with:

Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
 at java.util.zip.ZipFile.read(Native Method)
 at java.util.zip.ZipFile.access$1400(ZipFile.java:60)
 at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734)
 at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434)
 at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
 at java.io.FilterInputStream.read(FilterInputStream.java:133)
 at java.io.FilterInputStream.read(FilterInputStream.java:107)
 at org.robolectric.util.Util.copy(Util.java:21)
 at org.robolectric.util.Util.readBytes(Util.java:38)
 at org.robolectric.internal.bytecode.SandboxClassLoader.getByteCode(SandboxClassLoader.java:166)
... 36 more

Option used was found at https://github.com/robolectric/robolectric/blob/7697d1217c5eb0dee454004efe60ba219f398255/plugins/maven-dependency-resolver/src/main/java/org/robolectric/MavenRoboSettings.java#L19

^KTI-842 Fixed
2022-07-01 18:44:48 +00:00
Dmitriy Novozhilov 935f5c1180 [Parcelize] Fix registration of IR extension for K2 mode 2022-06-29 12:00:02 +00:00
Dmitriy Novozhilov 1a8496757e [Compiler] Mark all entrypoints to compiler API as experimental 2022-06-29 12:00:01 +00:00
Dmitriy Novozhilov 8b42638afa [Plugins] Introduce new API for registering compiler plugins
Original `ComponentRegistrar` exposes Project to its registration method,
  so plugins should manually register extensions to it. To prepare for
  possible unbound compiler from Project API in future new  `K2ComponentRegistrar`
  introduced which provides registration method without Project at all
2022-06-29 11:59:58 +00:00
Yahor Berdnikau 4d47cf07be Update org.robolectric:android-all to 4.4_r1-robolectric-r2
Possibly could fix flaky parcelize plugin tests on Windows OS.
2022-06-21 11:26:30 +00:00
Mikhael Bogdanov 41d6f0dca4 Remove ir.tree.impl from build 2022-06-20 11:42:52 +00:00
Dmitriy Novozhilov 36a154507e [Parcelize] Remove dependency from backend module to k2 module
This is needed to avoid dependencies on FIR classes inside Parcelize IDE
  plugin
2022-06-08 11:33:37 +00:00
Dmitriy Novozhilov 83d0a3e7a3 [FIR] Extract FirPluginKey into :core:compiler.common and rename it to GeneratedDeclarationKey
This is needed to avoid dependency on :compiler:fir:fir2ir module in
  backend parts of compiler plugins. It will allow to publish those
  parts into jars for IDE, where they are needed for working of debugger
  and bytecode toolwindow
2022-06-07 14:12:25 +00:00
Dmitriy Novozhilov e58e86932c [FIR] Pass declared member scope to methods of declaration generation extension 2022-06-07 14:12:24 +00:00
Dmitriy Novozhilov 23c69f8d17 [FIR] Add to new types of annotation predicates
- `ParentAnnotatedWith` matches declarations, which parent is annotated
- `HasAnnotatedWith` matches declarations, which have at least one
     direct child with annotation

Also, `DeclarationPredicate.Any` is removed, because there is no
  intention to support lookup for all declarations in module

^KT-52486 Fixed
2022-06-07 14:12:22 +00:00
Dmitriy Novozhilov 259862d294 [Parcelize] Reorganize module structure of Parcelize plugin
Also mark parcelize as compatible with K2
2022-06-07 14:12:15 +00:00
Nikolay Lunyak ac1fb07102 [FIR JS] Add checkers.js 2022-06-02 13:47:28 +00:00
Ivan Kylchik f3252334b2 Move most of ir utils from backend.common to ir.tree 2022-05-18 21:20:03 +03:00
Vyacheslav Gerasimov 6bb36bc5e1 Fix flaky android robolectric tests
#KTI-842
2022-05-10 23:42:55 +04:00
Victor Petukhov 8e834fc7bb [FIR] Move subtyping helpers into TypeUtils.kt 2022-04-27 19:50:17 +00:00
Alexander Udalov 45f87bc71a Advance JVM target to 1.8 for kapt, AE, parcelize runtimes 2022-04-19 22:54:40 +02:00
Alexander Likhachev eda759ba31 [Build] Avoid buildscript root capture into task action
#KT-44611 In Progress
2022-04-19 00:39:24 +03:00
Ivan Kochurkin 8c7fad9a5e [FIR] Support of type arguments in annotations ^KT-48444 Fixed 2022-04-18 15:36:19 +00:00