There was a refactoring of AbstractDiagnosticsTest in 9052ef06 which
contains bug that `setupEnvironment` for AbstractDiagnosticsTestUsingJavac
was not called, so for last year tests `UsingJavac` had no difference
with usual diagnostics tests which causes some contradictions in test data
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
- DeprecatedSinceKotlin annotation should only be applicable when
there's `@Deprecated` annotation on the same declaration
- Deprecation level shouldn't be specified in the relevant
`@Deprecated` annotation
- Check that warningSince <= errorSince <= hiddenSince
This annotation will be used in the standard library to prevent the new
compiler from reporting deprecation diagnostics in case an older API
version is used (where the declaration was not deprecated yet).
#KT-23575 Fixed
Here we introduce ONLY_IMPLICIT_RECEIVER tower level
to support extension lambda calls on local variables,
and soften extension receiver checks to make such extensions visible & applicable.
Also here we try to map arguments twice for functional types
If property accessor rendering is disabled in a test, render annotations
on accessors as use-site-targeted, as was done with
`@setparam:`-annotations. Otherwise they were lost
Add PropertyDescriptor.backingField/delegateField to store annotations
on the field directly in an otherwise almost empty descriptor instance,
instead of storing them with use-sites in the corresponding property
descriptor. Instead of AnnotationWithTarget, create AnnotationDescriptor
instances in AnnotationSplitter. Change DescriptorRenderer to render
annotations on "related" declarations when needed, with the explicit
use-site target if applicable.
Most changes in diagnostic test data are related to the fact that
annotations which are known to have an incompatible use-site to the
declaration they're applied at (such as `@param:`-annotation on a
function), are now not loaded at all. It's fine because the code is
erroneous, so it doesn't really matter how do we load annotations with
invalid targets (some of this logic is also changed freely in subsequent
commits). Some changes are also explained by the fact that for example
an annotation on the property which is only applicable to FIELD is now
rendered with an explicit use-site target `@field:`, regardless of
whether it did have that use-site target syntactically or not.
Basically, after this change there's no point in calling
Annotations.getUseSiteTargetedAnnotations/getAllAnnotations anymore
because it's easier and more intuitive to just use Annotations of the
corresponding descriptor -- the backing / delegate field (introduced in
this commit) or the extension receiver / setter parameter (related
behavior was fixed in previous commits). Usages of
use-site-target-related methods will be refactored out in subsequent
commits
1. Determine source element for descriptors with NO_SOURCE recursively.
2. Always provide type abbreviation for type alias constructor
return type.
#KT-15495 Fixed
Classifiers annotated with `@Deprecated(level = HIDDEN)` now have smaller
priority in imports, similarly to private classes. For example, if two
classifiers named Foo are imported with a star import and one of them is
deprecated-hidden, the name Foo in the source code is resolved to the other
one.
Also a minor change in multi-module diagnostic tests: do not append newlines
after the last module in the test
#KT-13926 Fixed
Since functions usually are hidden from resolution when they are
deprecated-hidden, the problem can only be reproduced for properties with
deprecated-hidden accessors, where DeprecatedCallChecker reported warnings
instead of errors
Invoking checkers right after resolution of qualified expressions is too early:
DeprecatedClassifierUsageChecker tries to load the annotations of a referenced
classifier to report deprecation, and that may result in building light classes
for not yet analyzed declarations
#KT-13954 Fixed
Fake overrides are still created for java static with non-empty overriddenDescriptors
Add tests for inheriting visibility for java static members
Add test: check that java static declarations that shadow deprecated declarations should not be deprecated
Add test for corner case where "overriding" java static constant led to incorrect type in inheritor
Fix test data for existing tests
Property accessor is considered deprecated when the property is
Provide IDE inspection to strikeout members overriding deprecated members (like in java)
Look into QUALIFIER for left-most "unrolled" qualified expression
in CallExpressionResolver#getQualifiedExpressionTypeInfo.
Drop some unused functions.