Commit Graph

75 Commits

Author SHA1 Message Date
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
Dmitriy Novozhilov 839026b6fe [FIR2IR] Generate IR declarations in classes in strict order
Order is following:
- declared declarations in declaration (in source) order
- generated declarations in sorted order
2023-04-11 13:43:38 +00:00
Sebastian Sellmair 9dcd40d7b7 [CLI] K2JVMCompilerArguments: Model classpath as Array<String>
to allow interning individual file-path arguments on the IDE

KTIJ-24976
2023-04-06 16:03:03 +00:00
Dmitriy Novozhilov c957a0b43b [IR] Properly serialize IrDeclarationOrigin.GeneratedByPlugin to klibs
^KT-56911 Fixed
2023-03-30 07:52:56 +00:00
Dmitriy Novozhilov 62ad784b73 [FIR] Fix matching annotated predicate for java and binary declarations
^KT-57400 Fixed
2023-03-27 10:54:27 +00:00
Dmitriy Novozhilov 336b6ba9f0 [FIR] Extract extension functional type from an annotated functional type during deserialization
^KT-57140 Fixed
2023-03-27 10:44:51 +00:00
Dmitriy Novozhilov 8ca7b32577 [FIR] Register type related extensions in libraries sessions
^KT-57140
2023-03-27 10:44:50 +00:00
Dmitriy Novozhilov 01fc84ee3a [FIR] Add tests for plugins compatibility
^KT-57140
2023-03-27 10:44:50 +00:00
Dmitrii Gridin 706ff6b61f [FIR] pre-resolve some scope callables before creating a scope
In a lot of cases, when we want to process the
declaration in scope, it should be resolved to at least TYPES phase.

To avoid doing it manually in all our variety of scopes, we do it when the scope it created.
It was implicitly working manually before as lazy resolve did a lot of extra work
on resolving a declaration it was not supposed to resolve.
Now it's not the case, and we have to explicitly resolve all the declarations we need.

^KT-56543

Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com>
2023-03-24 09:57:46 +00:00
Kirill Rakhman 59c61cdd07 [FIR Plugin prototype] Fix AllPropertiesConstructor test
^KT-56861 Fixed
2023-02-28 10:19:19 +00:00
Kirill Rakhman 9dda5e4fcd [Test] Remove redundant FIR_DISABLE_LAZY_RESOLVE_CHECKS directives
KT-56177
2023-02-28 10:19:18 +00:00
Ilya Kirillov ce3305300b [FIR] temporary mute blackbox test which fails on runtime
It was failing before, but it was hidden as the actual test was not run due to the bug in the test pipeline.

In the case of any WrappedException.FromHandler were thrown, no blackbox tests were run.

Tracking issue: ^KT-56861
2023-02-24 16:11:45 +01:00
Ilya Kirillov 69c024a5ce [FIR] optimize deprecation calculation for symbols
All symbols except member callables can be deprecated if they have non-empty annotation list

^KT-56800 fixed
2023-02-24 16:10:57 +01:00
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 a197d1aadc [FIR Plugin prototype] Add simple implementation of FirDeclarationsForMetadataProviderExtension
^KT-55885
2023-02-08 08:44:51 +00:00
Dmitriy Novozhilov 791a7b1c31 [FIR] Extract function type kind for lambda in argument position
^KT-56381 Fixed
2023-02-06 10:08:37 +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 f268ab8858 [FIR plugin prototype] Implement Composable-like extension 2023-02-02 08:24:52 +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
Ivan Kochurkin c103da98dd [FIR] Add missing dependencies to :compiler:fir:checkers:checkers.native 2023-01-24 15:27:12 +00:00
Dmitriy Novozhilov 4363b0815c [FIR] Add ability to specify if meta annotation itself should match metaAnnotated predicate
^KT-55843 Fixed
2023-01-17 14:51:28 +00:00
Ilya Kirillov bba8064413 [FIR] mute lazy resolving contract check in a test where it was recently enabled 2023-01-13 15:57:06 +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
Dmitriy Novozhilov 3744878b6d [FIR Plugin prototype] Use new DSL for generating declarations 2023-01-12 17:45:40 +00:00
Dmitriy Novozhilov 6783621eb0 [FIR] Change API for generating nested classes from plugins
`FirDeclarationGenerationExtension.generateClassLikeDeclaration` was split
  into two functions: one for generating top level classes, and one for
  nested classes. Such change reduces verbosity and error-proness of
  this extension and also allows to smoothly run plugins on local classes

^KT-55248 Fixed
2023-01-12 17:45:39 +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
Dmitriy Novozhilov b174bb8844 [FIR] Update testdata after introducing FirResolvedErrorReference 2022-12-15 12:12:19 +00:00
Steven Schäfer 6af616d3c3 FIR: make declarations marked with 'override' implicitly open
#KT-52236 Fixed
2022-12-14 21:46:41 +00: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
Dmitriy Novozhilov 6864433581 [FIR] Support resolution of meta-annotations before supertypes
Now annotations are resolved with following algorithm:
1. On COMPILER_REQUIRED_ANNOTATIONS we resolve all annotations
     and store results if this is compiler annotation, plugin annotation,
     or annotation with meta-annotation (meta annotations are checked
     recursively with designated resolution if needed)
2. On TYPES stage we resolve all those annotations once again and if
     some annotation changes resolution then we keep type from p.1 and
     report error on this annotation, so user should disambiguate it

Ambiguity may occur because of nested annotations with same name as
  plugin annotations:

```
annotation class SomeAnnotation // (1) plugin annotation

open class Base {
    annotation class SomeAnnotation // (2)
}

class Derived : Base() {
    @SomeAnnotation // <-----------------
    class Inner
}
```
At COMPILER_REQUIRED_ANNOTATIONS annotation call will be resolved to (1)
  because at this stage supertypes are not resolved yet, and we consider
  only importing scopes. At the TYPES stage we will find correct
  annotation from supertype
2022-12-01 07:29:39 +00:00
Dmitriy Novozhilov 0b4216c096 [FIR] Fix test configuration of FIR plugin prototype 2022-12-01 07:29:38 +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
Nikolay Lunyak e34dd49872 [FIR] Get rid of the argumentMapping function.
It's just a duplicate of `resolvedArgumentMapping`. Plus there is a
member with the same name inside `FirAnnotationCall`.
2022-11-14 22:40:41 +02:00
Dmitriy Novozhilov 7ce3934cf7 [FIR] Add type resolution service into SerializationFirSupertypesExtension
This service allows resolve custom user types from plugins, which allows
  to support specifying type arguments of generated supertypes basing
  on arguments passed to annotations
2022-09-26 10:09:09 +00:00