Commit Graph
100 Commits
Author SHA1 Message Date
Dmitry Savvinov 77ebe1085d [klib tool] Return unbound symbols for dump-ir mode
This is more convenient behaviour for debugging with klib-tool than
just failing.

Note that enabling Partial Linkage globally in klib-tool is undesirable,
as it can auto-tweak IR (e.g. when overrides do not match), thus
distorting the rendered IR

^KT-61143 Fixed
2024-01-22 17:11:56 +00:00
Dmitry Savvinov 8236fc245b [gradle, mpp] Clean-up dead code around metadata klib manifest handling
See the added source comment for details. This commit shouldn't change
any behavior of KGP

^KT-64525
2024-01-16 10:53:37 +00:00
Dmitry Savvinov 0d98995a8e [build] Fix regex in verification-metadata.xml for kotlin-native
Regex OR ('|') has weird precedence rules and previous version of regex
were essentially checking two alternatives:
- kotlin-native-prebuilt-.*-1\.9\.3[0-9](-.+)?
- 2\.0\.0(-.+)?

This is obviously incorrect, but it won't manifest on machines that
already downloaded that artifact to `.konan` via the build without
verification-metadata.xml
2023-10-04 10:04:07 +00:00
Dmitry Savvinov 23dbe5ed3e [mpp, tests] Minor: fix incorrect testdata
It was missed on rr/CI because those tests run only on macs, and
currrently CI has some troubles with that
2023-10-03 15:55:37 +00:00
Dmitry Savvinov 0db4f464bb [gradle, kmp] Minor: add more info to deprecation message
Buildscripts that used `ios`-shortcut certainly used
`val iosMain by getting` as well, which will lead to Gradle exception
after migration. Mention in the diagnostic message that one should
replace `by getting` with static accessors

^KT-60734
2023-09-20 13:33:06 +00:00
Dmitry Savvinov 5736201e3a [K1, MPP] Implement hack for KTIJ-24195
Force-refine typealiases if their expansion isn't visible in the
refiner's module

^KTIJ-24195
2023-09-08 15:31:22 +00:00
Dmitry Savvinov c359f684cd [Gradle] Don't print stacktraces in IDEA sync
IDEA sync is always launched with equivalent of `--stacktrace`, so
checking startParameter.showStacktrace is unreliable.

This commit instead mutes printing of stacktraces in sync unless the
internal property is specified. If users want stacktraces, they're
expected to launch Gradle task with `--stacktrace`.

In the extremely rare cases where the stacktrace is needed
*specifically* during IDE sync,
`kotlin.internal.diagnostics.showStacktrace=true` can be used

^KT-61172
2023-08-15 10:11:45 +00:00
Dmitry Savvinov e8289181e6 [mpp] Minor: diagnostic messages clean-up
- Mention link to docs about templates in warning messages
^KT-60491 Fixed

- Make sure that each warning mentions some way to solve the problem
  aside from disabling default template

- Fix small syntactical bug in code sample

- fix incorrect indentation in trimMargin after joinToString

- Use kotl.in in Kotlin12XMppDeprecation
2023-08-11 08:26:14 +00:00
Dmitry Savvinov edbaed0da9 [Gradle] Minor: restore link to page about JVM toolchains in warning text
The link has been accidentally lost during migration of diagnostics to
the new infrastructure
2023-08-11 08:26:14 +00:00
Dmitry Savvinov 027fdb86a5 [Gradle] Print diagnostics stacktrace only under --stacktrace or higher
Most of the changes in commit are test-related, as our tests launched
with '-full-stacktrace' by defayult + asserting full stacktrace is
flaky and unreliable

^KT-59774 Fixed
2023-08-03 10:02:25 +00:00
Dmitry Savvinov e334523fd8 [Gradle] Minor: rename verboseDiagnostics -> useParsableDiagnosticsFormat
^KT-59615 Fixed
2023-08-03 10:02:25 +00:00
Dmitry Savvinov a65953a7fb [Gradle] Minor, rename task
EnsureNoKotlinGradlePluginErrors ->
CheckKotlinGradlePluginConfigurationErrors
2023-08-01 13:03:29 +00:00
Dmitry Savvinov 7cc72f096a [Gradle] Don't use PropertiesProvider.propertiesWithPrefix in checker
It causes weird failures in functional tests, see KT-60712.

Instead, enumerate all known KGP properties and report only them. Note
that internal properties, unknown to the current version of KGP, won't
be reported. Such cases can appear because of a typo or after migrating
to version of KGP that dropped support for that property. It's not
considered to be a problem at the moment
2023-08-01 13:03:29 +00:00
Dmitry Savvinov 34f4e3cbf6 [mpp, tests] Modernize and simplify new-mpp-lib-with-tests
- Don't use presets (they are deprecated and provoke ERROR, causing
  build to fail)
- Drop two JVM targets (cause issues because ambiguous consumable
  configuration will be created; proper setup needs disambiguation
  attribute, but that's too much for this test)
- Drop jvmWithJava-target (this test case is used in several places
  as "just some MPP project", so specific advanced features like
  jvmWithJava shouldn't be covered here)

Refer to KT-60745 for proper jvmWithJava support
2023-08-01 13:03:29 +00:00
Dmitry Savvinov a9a6441d2d [Gradle] Improve tests on diagnostics rendering, suppression, failures 2023-08-01 13:03:29 +00:00
Dmitry Savvinov a132d37292 [Gradle] Introduce checker of 'kotlin.internal' properties
Those properties are meant for internal use and/or "hacking". Using them
by design provokes big non-suppressible warning
2023-08-01 13:03:29 +00:00
Dmitry Savvinov 6c88b92b88 [Gradle] Fail compileKotlin-tasks if ERROR-diagnostics were reported
KT-60237
2023-08-01 13:03:29 +00:00
Dmitry Savvinov c544d68a64 [Gradle] Do not store suppressed diagnostics 2023-08-01 13:03:28 +00:00
Dmitry Savvinov 71c1abde5c [mpp] Minor: use ToolingDiagnostic for reporting cyclic dependsOn-edges 2023-08-01 13:03:28 +00:00
Dmitry Savvinov 7abb0d9f0c [Gradle] Minor: prettify extraction of Tooling diagnostics from output 2023-08-01 13:03:28 +00:00
Dmitry Savvinov 2ab73f286a [mpp] Add test: pre-hmpp dependencies not reported in test source sets
Test source sets do not participate in the metadata compilations by
default, so the check misses them. This commit just encodes this
behavior into tests, without actually addressing it

KT-60724
2023-07-31 15:36:21 +00:00
Dmitry Savvinov 38cd8ee7e7 [mpp] Don't report kotlin-test as pre-HMPP dependency
- Exclude kotlin-stdlib and kotlin-test from reporting

- kotlin-stdlib wasn't reported, because it doesn't even have Gradle
modular metadata (so no o.j.k.platform.type attribute, and check doesn't
work). This commit explicitly excludes kotlin-stdlib, so that when it
starts publishing Gradle Modular Metadata, nothing would break

- kotlin-test was reported only when it is declared in commonMain,
because we're checking only metadata compilations, and commonTest
isn't compiled to metadata

- Depending on kotlin-test is an odd configuration, but it arises
sometimes (e.g. when people extract some test utilities in a separate
Gradle project)

^KT-58872
2023-07-31 15:36:21 +00:00
Dmitry Savvinov 14b340c61e [mpp, tests] Assert that all dependencies are resolved, fix misconfigurations
- Assert that all dependencies are resolved. Gradle won't fail the build
by default, which might lead to test running in a weird misconfigured
state and producing unreliable results (can be green even though there
are bugs)

- Fix several typos and misconfigurations that were revealed after
adding assertion described above
2023-07-31 15:36:21 +00:00
Dmitry Savvinov c9b7063d96 [mpp] Report commonTest with dependsOn similarly to commonMain
^KT-60556
2023-07-28 09:41:51 +00:00
Dmitry Savvinov a4d40498c7 [mpp] Remove KMM-related diagnostic functional tests
Functional tests do not run on Mac-hosts on CI. Adding a corresponding
integration will be handled as part of more general KGP/MPP tests
rework
2023-06-14 14:36:48 +02:00
Dmitry Savvinov 768e185280 [mpp] Ignore KMM-related diagnostic tests
Currently, CI runs on Linux agents which can not work with iOS targets
2023-06-14 14:36:48 +02:00
Dmitry Savvinov 66411a92f0 [Gradle] Cleanup: remove unused classes
- CompilationFreeArgsValidator got accidentally unused at some point,
and for now we don't see a reason to enable it back. A proper solution
includes exposing K/N linker options more explicitly via DSL, which
would address the initial problem of passing linker options to compiler
accidentally

- With ComplationFreeArgsValidator removal and migration of
DisabledNativeTargetsReporter to diagnostics infra, AggregateReporter
becomes unused so it can be removed as well
2023-06-14 14:36:48 +02:00
Dmitry Savvinov e74e6759ed [Gradle] Cleanup: remove SingleWarningPerBuild API
Instead, newer infrastructure for diagnostics should be used (see
'KotlinToolingDiagnosticsCollector')
2023-06-14 14:36:48 +02:00
Dmitry Savvinov 8a5433734b [Gradle] Migrate K2-usage warning 2023-06-14 14:36:48 +02:00
Dmitry Savvinov b6a90cfe7e [Gradle] Migrate warning about using pre-HMPP dependencies to new infra 2023-06-14 14:36:48 +02:00
Dmitry Savvinov 57b71b8ea6 [Gradle] Migrate warning about not chosen JS-environment 2023-06-14 14:36:48 +02:00
Dmitry Savvinov 76c37f359a [Gradle] Migrate warning about inconsistent JVM target 2023-06-14 14:36:48 +02:00
Dmitry Savvinov 5658991fe3 [Gradle] Migrate reporting of K/N targets disabled on current host 2023-06-14 14:36:48 +02:00
Dmitry Savvinov 5a9aa43aa5 [Gradle] Migrate disabled cinterops commonization warning 2023-06-14 14:36:47 +02:00
Dmitry Savvinov 63f61685c0 [Gradle] Migrate diagnostic about empty Kotlin targets in an MPP project
Also demote it from FATAL to ERROR, as FATAL leads to pretty disruptive
UX in IDE (import fails, and you don't get a broken project, which
makes it hard to fix the root cause and declare a target)
2023-06-14 14:36:47 +02:00
Dmitry Savvinov dcb51e64df [Gradle] Migrate warning about missing Android-target to new infra 2023-06-14 14:36:47 +02:00
Dmitry Savvinov 84fb045d8a [Gradle] Migrate warning about pre-1.3 MPP plugins 2023-06-14 14:36:47 +02:00
Dmitry Savvinov 4f309c0c8f [Gradle] Migrate unrecognized K/N distro warning 2023-06-14 14:36:47 +02:00
Dmitry Savvinov d9b7130f4b [Gradle] Migrate reporting of deprecated properties usage 2023-06-14 14:36:47 +02:00
Dmitry Savvinov 4bef185ccb [Gradle] Migrate checks for non-disambiguated targets 2023-06-14 14:36:47 +02:00
Dmitry Savvinov 1a5cbe1245 [Gradle] Improve diagnostics-related test assertions
- Allow matching substring for 'assertNoDiagnostic' as well
- Better handling of cases when multiple diagnostics with the same ID
are reported (properly look for one 'withSubstring' if provided)
2023-06-14 14:36:47 +02:00
Dmitry Savvinov 1ab1dccea1 [Gradle] Support rendering diagnostics reported in execution phase
- Introduce 'UsesKotlinDiagnostics' marker-interface for tasks that
want to report diagnostics during their execution

- Introduce 'transparent mode' to collector. When all projects are
evaluated, Collector switches to it and will render all received
diagnostics right away. This allows reporting and rendering diagnostics
that are reported not from tasks, but after evaluation phase (e.g.
diagnostics on resolved dependencies)

^KT-58353 Fixed
2023-06-14 14:36:47 +02:00
Dmitry Savvinov 37e791a7d3 [Gradle] Minor: drop deprecated kotlin.build.report.enable property 2023-06-14 14:36:47 +02:00
Dmitry Savvinov dc4bbbc333 [mpp] Minor: drop warning about deprecated K/N test binary access 2023-06-14 14:36:47 +02:00
Dmitry Savvinov 6e8493fa52 [mpp] Minor: drop support for "kotlin.native.restrictedDistribution" 2023-06-14 14:36:47 +02:00
Dmitry Savvinov eeb95f2feb [Gradle] Minor: compare against expected testData in tmpDir
This might become an issue if (when) the editable diff window will
be supported, but for now it doesn't make much difference against
which file we compare the actual output.
2023-06-14 14:36:46 +02:00
Dmitry Savvinov 896292cba1 [Gradle] Minor: remove unused parameter 2023-06-14 14:36:46 +02:00
Dmitry Savvinov 6f584bcbe7 [mpp] Fix reporting of pre-HMPP dependencies from intermediate source sets
It's an unfortunate clash between introduction of KotlinPluginLifecycle
and changes in 'deprecationDiagnostics.kt'. It used 'afterEvaluate',
but with KotlinPluginLifecycle later stages are effectively invoked
in multiple nested afterEvaluate, making them invisible for single
afterEvaluate.

Specifically in this case, configuration of metadata compilations for
intermediate source sets is executed in 'FinaliseCompilations' stage,
which is simply not executed by the time checker runs in its single
afterEvaluate.

The fix is trivial -- wrap diagnostic checks runs into launchInStage

^KT-58470 Fixed
2023-05-08 10:42:11 +00:00
Dmitry Savvinov 8561bbf603 [Gradle] Minor: move diagnostic tests under unitTest package 2023-05-02 14:32:14 +00:00
Dmitry Savvinov c5bda2f63c [Gradle] Support suppressing KGP diagnostics 2023-05-02 14:32:14 +00:00
Dmitry Savvinov f5c4dffc3e [mpp] Hack: Inherit KotlinProjectExtension in KotlinPm20ProjectExtension
Addition of checkers in previous commits lead to CCE when they call
'project.kotlinProjectExtension'. Change in this commit isn't
semantically sound, but allows to repair those tests cheaply
2023-05-02 14:32:13 +00:00
Dmitry Savvinov 97f77c2ecf [Gradle] Add functional tests on the new diagnostics/features infra 2023-05-02 14:32:13 +00:00
Dmitry Savvinov 6452c22430 [mpp] Migrate AGP Compatbility checks to the new infra 2023-05-02 14:32:13 +00:00
Dmitry Savvinov bb3dc145e5 [mpp] Migrate AndroidSourceSetLayout checks to the new infra 2023-05-02 14:32:13 +00:00
Dmitry Savvinov 4e479cb54b [mpp] Migrate UnusedSourceSetsChecker to the new infra 2023-05-02 14:32:13 +00:00
Dmitry Savvinov ee9a952da2 [mpp] Migrate jvmWithJava preset deprecation to the new infra 2023-05-02 14:32:13 +00:00
Dmitry Savvinov 05662eae7a [mpp] Migrate MissingNativeStdlibWarning to the new infra 2023-05-02 14:32:13 +00:00
Dmitry Savvinov 07142a4083 [mpp] Migrate checks of commonMain.dependsOn to the new infra 2023-05-02 14:32:13 +00:00
Dmitry Savvinov 7a5f1d694f [mpp] Migrate checks of deprecated K/N targets to new infra 2023-05-02 14:32:13 +00:00
Dmitry Savvinov a539db932c [mpp] Migrate HMPP-flags deprecations to the new infra 2023-05-02 14:32:13 +00:00
Dmitry Savvinov 29223dbd4a [Gradle] Add integration tests on new diagnostics infrastructure 2023-05-02 14:32:13 +00:00
Dmitry Savvinov 5cd94d1db2 [Gradle] Support testing new diagnostics infrastructure in functionalTests 2023-05-02 14:32:13 +00:00
Dmitry Savvinov 4a88e01a8e [Gradle] Add new infrastructure for diagnostics in KGP 2023-05-02 14:32:13 +00:00
Dmitry Savvinov 5dd52f7d40 [tests] Apply modern plugins instead of legacy ones
KotlinPlatform*Plugins are plugins from pre 1.3 MPP and shouldn't
be used. The intention was to apply usual 'kotlin("jvm")' and
'kotlin("android")'-plugins, for which KotlinPluginWrapper and
KotlinAndroidPlugin stand respectively
2023-05-02 14:32:13 +00:00
Dmitry Savvinov 0a33eef518 [build] Fix weird dependencies management
kotlin-gradle-plugin-integration-tests on runtime uses relocated
compiler jars. A special handling is required to support this.

Looks like 'kotlin-gradle-plugin-test-utils' was meant to help
here somehow, but was accidentally broken at some point. It went
unnoticed because not much classes from transitive dependencies
of 'kotlin-gradle-plugin-test-utils' were used.

The change in this commit still leaves a few questions about this
configuration, but at leats it makes it possible to use compiler
classes (e.g. KotlinTestUtils)
2023-05-02 14:32:12 +00:00
Dmitry Savvinov e22a9b7108 [mpp] Minor: drop obsolete reporting of HMPP flags
Now any usages of HMPP-flags are deprecated and reported in
deprecationDiagnostics.kt, which can sometimes lead to duplicated
reports
2023-05-02 14:32:12 +00:00
Dmitry Savvinov 31eb012b6b [tests] Minor: add support of DevKit in Gradle IT
This should provide some nicities in IDEA like folders for navigating
to testData
2023-05-02 14:32:12 +00:00
Dmitry Savvinov da073c9cc3 [mpp] Warn about using pre-HMPP dependencies
^KT-58086 Fixed
2023-04-20 15:35:05 +00:00
Dmitry Savvinov a3db0f14af [mpp] Minor: fix broken link to docs
^KT-57144 Fixed
2023-04-19 14:02:36 +00:00
Dmitry Savvinov 174252f68f [mpp, tests] Add tests for rendering KpmTestCases 2022-08-12 12:34:14 +02:00
Dmitry Savvinov afa9c2f8b9 [mpp, tests] Use JUnit5 in kotlin-project-model tests 2022-08-12 12:34:14 +02:00
Dmitry Savvinov c1e21f5b8f [mpp, tests] Add infrastructure for *Generated KPM Core tests 2022-08-12 12:34:14 +02:00
Dmitry Savvinov 309b2f569d [mpp, tests] Add few simple KpmCoreCases 2022-08-12 12:34:14 +02:00
Dmitry Savvinov a2c9864adc [mpp, tests] Introduce KpmCoreCases infrastructure 2022-08-12 12:34:14 +02:00
Dmitry Savvinov 3bb70f55d7 Minor: add KpmVariant.nativeTarget extension 2022-08-12 12:34:14 +02:00
Dmitry Savvinov 91d64d992f [MPP] Refine enum entries and Enum-type
Enum-type inherits java.io.Serializable on JVM, so it needs
to be refinement ot avoid TYPE_MISMATCH errors.

Note that for the refinement of Enum-type itself it's necessary
to force refinement of enum-entries, otherwise their supertypes
(and Enum-type specifically) won't be touched

Tests are added on IJ side

^KT-53514
2022-08-12 12:25:28 +02:00
Dmitry Savvinov ea466353fb Dont store type refinement mode in analysis flags
Instead, check the refiner from the DI-container or refiner from
capability of a module descriptor.

The reason is because in the IDE there might be multiple
ResolutionFacades (-> multiple DI-containers -> multiple module
descriptors) for one and the same IDE module, with different refinement
settings.
However, due to how the code is written, it's hard to have
different LanguageVersionSettings for one and the same module.

After this commit the refinement settings are determined by the
moduleDescriptor capabilities, which is much easier to tweak

See usage of that change in Kotlin IDE Plugin (commit is linked to the
YT issue)

^KTIJ-20775
2022-02-14 13:08:50 +03:00
Dmitry Savvinov 46ab972cb1 Exclude common parts of kotlin-test from platform source sets
See details in linked issue. Tests are on the intellij-side

^KT-47570 Fixed
2021-12-17 15:04:51 +03:00
Dmitry Savvinov 50050154d3 [gradle, mpp] Change how outputs of associated compilations are handled 2021-10-06 17:10:17 +03:00
Dmitry Savvinov 699eb47834 Never suggest fake overrides as results of expects-matching
See KT-48291 for example.

The rationale behind the change is that in "findExpectForActual" we want
to find a candidate to be a counterpart for the current (actual)
declaration. Fake overrides can not be a sensible counterpart in that
regard (you can't, nor you should, provide actual for expect which is
FAKE_OVERRIDE)

^KT-48291 Fixed
2021-09-08 16:22:54 +03:00
Dmitry Savvinov d6cb96aa24 Wire proper KotlinTypeRefiner into ClassicTypeSystemCotextForCS
^KT-48589 Fixed
2021-09-06 12:06:26 +03:00
Dmitry Savvinov 45a384bb77 Exclude stdlib-common from non-JVM targets as well
This is a continuation of KT-46936. This commit removes stdlib-common
from platform-specific source sets of JS/Native targets, as well as
Android and 'jvm { withJava() }'

The tests are made on kotlin-ide side, see the KT-46936 for attached
commits.

^KT-46936
^KT-47695 Fixed
^KT-47604 Fixed
2021-07-28 20:02:13 +03:00
Dmitry Savvinov 4f8c854ead Exclude stdlib-common from jvm-specific compilations and source sets
^KT-46936 Fixed

Note that it is the slightly hack-ish fix; the proper one would remove
the dependency from kotlin-stdlib to kotlin-stdlib-common
2021-06-25 15:17:07 +03:00
Dmitry Savvinov fa869c2c2a Add test on KT-46936 2021-06-25 15:17:06 +03:00
Dmitry Savvinov f8fbbc01b6 Don't append 'is a module' suffix to ModuleDescriptor debug text 2021-06-03 17:22:00 +03:00
Dmitry Savvinov 708fead1cc Add debug strings to frontend scopes-related structures
Such as:
- PackageFragmentProviders, and, in particular,
CompositePackageFragmentProviders
- JavaPackageFragments
- Scopes produced by those providers

The rationale is that a lot of frontend-facing bugs (like red code) are
easily recognizeable in resolution. But at that point you just see a
bunch of scopes, without meaningful toStrings, you don't know who has
produced them, and what's exactly wrong.

With this commit it should make debugging slightly easier: now at least
you'll be able to see that "this scope is a scope of package fragment
for foo.bar of module baz" and decide whether the declaration should or
should not have been resolved from such scope.
2021-06-03 17:21:59 +03:00
Dmitry Savvinov 96a4d19365 Minor: inline addDependsOnSourceSets in buildCompilation 2021-03-15 13:35:33 +03:00
Dmitry Savvinov 4927777ffb Minor: rename KotlinCompilation.sourceSets -> allSourceSets 2021-03-15 13:35:32 +03:00
Dmitry Savvinov 1143865e88 Minor: add test on importing platform of commonMain in single-backend project 2021-03-15 13:35:32 +03:00
Dmitry Savvinov c3f5d57d3b Implement precise platforms importing in MPP
- skip metadata target from importing. That lead to metadata
compilations being imported is well -> some source-sets were
participating in metadata compilations as well -> logic for determining
platforms used to consider metadata compilations as well, adding COMMON
platform to set of platforms

Seems like metadata was never needed in import/IDE, and got there purely
by accident

- Use only targets, actually present in the project, as the default
platform. This is needed mostly for corner-cases/miconfigurations, like
orphan source-sets (source-sets which are created but not included into
any configuraion). Still, for those source-sets the tooling is required
to behave properly; presence of non-existing target can lead to various
issues like showing gutters for test runs, which would fail on launch
(because tests for that target actually do not exist)

^KT-37127 Fixed
2021-03-15 13:35:31 +03:00
Dmitry Savvinov 7a5b4ccb9a Refactoring: collect all logic regarding detecting sourceSet platform in one function
Note that previously addSourceSetsToCompilation had logic regarding
platforms. The reason for that is that it was the last place where
default soruce sets of compilations could be distinguished from all
participated source sets.

So, to move that logic, we have to preserve default source sets.
Therefore, this commit introduces 'KotlinCompilation.defaultSourceSets',
and 'ImportingContext.isDefaultSourceSet' method.

The rest is trivial code moving/methods introduction

The resulting code isn't really pretty and likely has non-orthogonal
predicates, this will be cleaned-up in the next commits
2021-03-15 13:35:31 +03:00
Dmitry Savvinov ef04ae041e Minor: swap receiver and parameter for shouldCoerceToCommon
Otherwise, it reads as if KotlinSourceSet coerces ImportingContext,
which is in fact the other way around
2021-03-15 13:35:30 +03:00
Dmitry Savvinov 7ddcdca6bb Dont coerce platforms of source-sets in HMPP to set of available targets in project 2021-03-15 13:35:30 +03:00
Dmitry Savvinov 42345b9c49 Minor: use more clear and specific naming for LazyClassContext.typeChecker (relevant for MPP with type refinement) 2021-02-26 12:37:02 +03:00
Dmitry Savvinov 168c692a27 Use overriding util with proper typechecker for overriding in LazyClassMemberScope
Note that LazyClassMemberScope actually has a separate field for
KotlinTypeRefiner, and it might be actually different from the one in
c.kotlinTypeChecker.

The one in c.kotlinTypeChecker is the refiner of *owner* module, i.e. a
module in which the class has been declared. If we have a class Foo :
Expect in common, then the refiner will be from common, and thus it
won't be able to refine supertypes to their platform-dependent values.

The one passed in constructor is actual refiner of dependant-module.
Say, if we're looking at Foo from the point of view of jvmMain, then
we'll create a (view-dependent) LCMS for that, and it will contain
refiner for jvmMain.

It is important to use proper refiner, otherwise the idea of having
"module-dependent view" breaks, and we might suddenly mismatch some
overrides with expect-classes in their signatures.

^KT-44898 Fixed
2021-02-26 12:37:01 +03:00
Dmitry Savvinov 9616eb94fd Add test on KT-44898 (MPP + type refinement + complex inheritance)
The current behaviour is undesired (ABSTRACT_MEMEBER_NOT_IMPLEMENTED
reported on class Concrete), will be fixed in the next commit
2021-02-26 12:37:01 +03:00
Dmitry Savvinov e3d4c440b5 Minor: rename createMemberScope -> createScopesHolderForClass 2021-02-26 12:37:01 +03:00
Dmitry Savvinov 78b2eb994b Deduplicate logic of computing orphan source sets in MPP Gradle Import
Set of compiled source sets is already available in
MultiplatformModelImportingContext via
'sourceSetsToParticipatedCompilations.keys', no need to recompute it

^KT-37127
2021-01-15 11:12:46 +03:00
Dmitry Savvinov 1d0a696a62 Simplify building of source-sets during MPP Import
Build dependsOn closure straight away by using KotlinSourceSetProto
instead of building first KotlinSourceSetImpls with incorrect
dependsOn-names, and then discarding it

^KT-37127
2021-01-15 11:12:46 +03:00
Dmitry Savvinov 9e58e3c3fd Remove unused KotlinSourceSetImpl.defaultIsTestModule; simplify logic of test modules detection
^KT-37127
2021-01-15 11:12:46 +03:00