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).
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.
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.
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
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>
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
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
`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
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
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
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