Private-in-file declarations conflict with public overload-equivalent declarations
in other files in the same package.
Move functions for grouping possible redeclarations to OverloadResolver
(since they are used only there).
Refactor redeclarations / conflicting overloads reporting.
Unless the compatibility option "-Xsingle-module" is passed, the compiler will
create two modules instead of one now (see TopDownAnalyzerFacadeForJVM): the
main module contains Kotlin and Java sources and binaries from the previous
compilation of the given module chunk, the dependency module contains all other
Kotlin and Java binaries. This fixes some issues where the compiler couldn't
detect that the used symbol was from another module, and did not forbid some
usages which are only possible inside the module (see KT-10001).
The ideal way to deal with modules here would be to exactly recreate the
project structure, for example as it's done in JvmAnalyzerFacade and usages.
This is postponed until later
#KT-10001 Fixed
#KT-11840 In Progress
This is a radical but likely temporary measure to forbid the current compiler
from compiling code against binaries compiled by newer compilers
Cherry picked from commit 149a4eddff0106bbe91c9a6b51a26c12c242d14f and commit
285b20e3ff387eb3d2ee33ceaa376ed8eba90857
Introduce LanguageFeatureSettings, instance of which should be injected by the
container and be accessible everywhere during the compilation (front-end and
back-end).
Parameters of LanguageFeatureSettings are unused in this commit, will be used
later
Skip declarations without sources in reporting, not when determining redeclaration groups:
this allows emitting informative diagnostics for incremental compilation.
Provide containing declaration with "kind", e.g., "package '<root>'", "class A", and so on.
When checking for overloads in package, consider functions and top-level class constructors as possibly conflicting between each other. NB OverloadUtil uses containing package scope from module descriptor.
Change diagnostic message for CONFLICTING_OVERLOAD: it's misleading in case of fun vs constructor conflict.
Add custom multifile test for diagnostics in IDE (probably not the best; should preprocess file content if it's required to check highlighting in multiple files, not only in the first file).
Add test for KT-10765 Incremental compilation misses overload conflict between constructor and function ...