Originally it was an application-level component, which caused non-trivial
logic and cognitive load to carefully handle those extensions to avoid
memory leaks.
6740a596 introduced a way to easily register `DiagnosticSuppressor` to
project, and this commit continues this work, making it a proper
project-level extension
A lot of changes caused by the fact, that this extension is needed to be
obtained from `BindingContext` (see `BindingContextSuppressCache` and
its usages), so almost all changes are introducing `Project` to
`BindingContext`
^KT-66449 Fixed
Even ones inside inline functions. This was a backwards compatibility
hack for Kotlin 1.4, where the inliner would crash if it attempted to
regenerate an anonymous object with no SMAP; that has been fixed in 1.5,
and ever since then trivial SMAPs could be inferred from line number
markers in methods.
There are three kinds of changes to tests in this commit:
* Some SMAPs are gone entirely - self-explanatory.
* Some SMAPs have narrower line ranges - that's because the old SMAP
had the range for the entire file, while the new one only maps up to
the last line number used in the class. There should be no
difference in behavior.
* Some "source file name" markers are removed in continuation objects
- continuations don't have any line numbers, so there's no debugging
information anyway. The actual source information is in the
containing class.
The parameter, unlike other ones, should span the whole method, since
throughout the whole method it has some value and thus should be
visible.
This effectively rolls bb5a99ec back
#KT-64309 Fixed
- remove ENABLE/COMPATIBILITY because they can no longer be used
- remove forAllMethodsWithBody because its behavior is now equivalent to
isEnabled
- inline isCompatibility
- inline DEFAULT
- rename ALL_INCOMPATIBLE -> ALL
We could get several files from the IDE to analyze. For example, some
code fragment and a file with context information. This additional
file, in fact, can be a file where a code fragment is defined, and we
can accidentally analyze a single file twice that leads to errors.
See the comment in the code for more info.
No proper test added because the compiler test infrastructure lacks the
ability to run old compiler versions, however I've verified manually
that the change fixes the issue.
#KT-62531 Fixed
This is just a refactoring commit. All fast analyzers are doing the
same thing in `mergeControlFlowEdge`, so we extract it in common
`FastAnalyzer`. The only exception is `FastStackAnalyzer`.
There was no `isMergeNode` check, but this is an optimization
that allows us to reuse a frame and not copy it.
There is no class that overrides this method.
Also replaced `newValue` call with `newExceptionValue`. Under the hood,
`newExceptionValue` still calls `newValue` if the interpreter doesn't
redefine it. And it kind of makes sense to call `newExceptionValue`
here because we are handling try-catch block.
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