Commit Graph

91 Commits

Author SHA1 Message Date
Nikita Bobko 8c0cf7d0bc [FIR] Fix disappeared ACTUAL_MISSING
^KT-59887 Fixed

Review: https://jetbrains.team/p/kt/reviews/13244
2023-12-04 13:08:23 +00:00
Anton Lakotka 58b0d6ffa8 [Gradle] Update MppHighlightingTestDataWithGradleIT for K2
^KT-61106 Verification Pending
2023-09-19 15:46:29 +00:00
Nikita Bobko 39fa2b0baf Delete Kotlin IntelliJ IDEA plugin sources
Kotlin plugin sources were migrated to intellij-community:
https://github.com/JetBrains/intellij-community/tree/master/plugins/kotlin

Preserve `jps-plugin/testData/incremental`
because it's used in `compiler/incremental-compilation-impl/test`

Preserve `idea/testData/multiModuleHighlighting/multiplatform`
because it's used in `MppHighlightingTestDataWithGradleIT`
2021-07-21 11:23:43 +02:00
Mikhail Glukhikh 0a670bf055 Report EXPERIMENTAL_API diagnostics on various implicit usages
#KT-32443 Fixed
#KT-22852 Fixed
2021-06-08 11:37:28 +03:00
Alexander Dudinsky a51c65ed60 Update test data for MultiModuleHighlightingTest.testLanguageVersionsViaFacets
Add `Resolved to error element` markers
2021-06-03 16:42:24 +03:00
Pavel Kirpichenkov 71365d2452 [IDE] Move library dependency filtering to dependencies cache
The primary client of LibraryDependenciesCache is LibraryInfo,
but it is also used for maintaining modification trackers of
source-dependent libraries. Moving dependency filtering to
cache allows keeping all client in sync.

^KT-45908 In Progress
2021-04-27 10:14:13 +03:00
Dmitriy Novozhilov af94bcebea [IDE] Propagate KotlinFacetSettings version and completely drop isReleaseCoroutines flag
Also this commit removes number of tests related to support
  experimental coroutines
2021-01-12 16:47:55 +03:00
Nikolay Krasko 866666f3ff Update test data for MultiModuleHighlightingTest.testLanguageVersionsViaFacets
Remove `Reference is not resolved to anything` markers
2020-08-27 14:08:48 +03:00
Sergey Igushkin 2c63a15af2 Add a test for KT-38338
^KT-38338
2020-04-28 02:39:32 +03:00
Dmitry Savvinov 8fcd98639d Minor: merge HierarchicalExpectActualMatchingTests into MultiplatformHighlightingTests 2020-03-05 17:27:19 +03:00
Ilya Chernikov 6356807997 Reapply "Only create descriptors for candidates with lambda args"
#KT-36247 fixed
A lot of testdata changed because significanly less (error) descriptors
are created for unresolved types, so diagnostics became different.
2020-02-14 11:41:30 +01:00
Pavel Kirpichenkov 572dee6835 Revert "Only create descriptors for candidates with lambda args"
This reverts commits:
349d07ad43
2249c223fe

Revert due to differences in test data with NI enabled
^KT-36247 Open
2020-02-12 20:52:30 +03:00
Ilya Chernikov 2249c223fe Only create descriptors for candidates with lambda args
#KT-36247 fixed
2020-02-10 14:21:02 +01:00
Alexander Udalov 9187a85aaf Rename UseExperimental->OptIn, Experimental->RequiresOptIn in quickfix and IDE tests 2020-01-14 21:04:43 +01:00
Dmitry Savvinov 3abfe59d75 Deduplicate incompatible actual descriptors
Otherwise, we might get false positive AMBIGUOUS_ACTUALS due to one and
the same descriptor appearing multiple times in a list
2019-10-29 14:28:41 +03:00
Dmitry Savvinov 9198b7a039 Add test on weakly incompatible actual in intermediate source-set 2019-10-29 14:28:41 +03:00
Dmitry Savvinov 3989f351ff Use modules instead of files for MPP diagnostic
Using files turned to be a bad idea, because people often
use the same name for files with expects and with corresponding actuals.

This commits disambiguiates ambiguous message for
AMBIGUOUS_ACTUALS/AMBGIUOUS_EXPECTS diagnostics by using modules instead
of files

^KT-32582 Fixed
2019-10-02 16:52:40 +03:00
Dmitry Savvinov 1fe8e4ba15 Use CompositeResolve in HierarchicalExpectActual tests 2019-07-30 12:41:41 +03:00
Denis Zharkov 33a31fb688 [Tesdata fix] Fix test data for multiplatform highlighting test
Once refinement is introduced the behavior becomes correct
2019-07-30 12:41:39 +03:00
Denis Zharkov d744192e6f [Invariant fix] Fix false positive internal visibility diagnostic
Effectively, this commit allows for common module
to see internal content of all expect-modules

The problem is that when computing the member scope for A (see the test)
we're building a special member scope for CommonAbstract viewed from JVM
and it's effectively has a fake override of actual member from Jvm/ExpectBase.

OverridingUtil checks if it's visible in CommonAbstract and finds that it's not
thus creating a fake_invisible fake override

The latter results in A::foo override being marked as INVISIBLE_MEMBER_OVERRIDE

Probably, the fix might be smarter
(passing a requested module to OverridingUtil::createAndBindFakeOverride)
but allowing using internal member seems to be safe & simple
because it's reasonable to assume there's no cyclic dependencies
between expected/actual modules
2019-07-30 12:41:39 +03:00
Denis Zharkov 2bf6bd3724 Do not consider descriptors equality as a reason not to refine type
Otherwise, it results in skipping refinement for JobNode when requested
from JVM module while it's necessary because CompletionHandlerBase's content
depends on the module
2019-07-30 12:41:37 +03:00
Denis Zharkov b7e011a29b [API Usage] Use type refinements in overrides-related facilities 2019-07-30 12:41:37 +03:00
Denis Zharkov 8d1b063d62 [Misc] Add test on typealiased SAM 2019-07-30 12:41:35 +03:00
Dmitry Savvinov 8df759b05c [Expect/Actual] Adjust IdeaModuleStructureOracle to old IDE Resolve
The main issue is that we have CombinedModuleInfo in old IDE Resolve,
which essentially merges platfor-modules together with its
dependsOn-parents. It conceals real module structure, which is fine for
practically all clients except for ExpectedActualDeclarationChecker.

In particular, it is nearly impossible to check expect/actual via
ModuleDescriptors, because you'll always get one and the same
'merged'-module descriptor.

So, this commit rewrites IdeaModuleStructureOracle in the following way:
- use ModuleInfos instead of ModuleDescriptor, as they allow more
fine-grained way to work with modules
- use 'unwrapModuleSourceInfo' in seemingly random places in order to
get real, non-merged moduleInfos
- carefully convert them back to ModuleDescriptors, because EADC work
with descriptors

This is still not an ideal solution. In particular, last step is flawed:
conversion back to ModuleDescriptors will always return merged
moduleDescriptor for platform-modules. There's no easy way to fix that
except for removing CombinedModuleInfo altogether, so we leave it as
known issue.

Also, there are some weird changes in testdata (again, because sometimes
we see several modules merged together), but they are mostly confusing
rather than plain incorrect.
2019-06-10 13:34:28 +03:00
Dmitry Savvinov 54b8f9da28 [Expect/Actual] Add testdata on hierarchical expect/actual matching 2019-06-10 13:34:27 +03:00
Dmitry Savvinov cac326bf4a [Expect/Actual] Adjust old testdata after changes in expect/actual
matching

This commit makes several changes in testdata:

- compiler multiplatform tests now contain newly introduced diagnostics
about AMBIGIOUTS_ACTUALS
- MultiModuleHighlighitng tests now contain proper reports about
ACTUAL_MISSING:
  - ACTUAL_MISSING should be indeed reported in them, because those
  tests don't contain dependsOn edges, only usual intermodule
  dependencies
  - This error wasn't reported here because expect/actual diagnostics in
  common module used to be reported by PlatformExpectedAnnotator, which
  had a bit flawed logic for deremining common-modules: it checked for
  presence of implementing modules. In those tests, common module has no
  implementing modules, so Annotator was returning silently
  Note that such configurations (common module without implementing
  modules) are almost impossible in real-life projects
  - After removal of PlatformExpectedAnnotator, we use
  ExpectedActualDeclarationChecker in common modules, which launches all
  checks properly
- some QuickFixMultuModuleTests now contain proper reports about
ACTUAL_MISSING. This change is also connected with
PlatformExpectedAnnotator, but now for different reason:
  - QuickFixMultiModuleTest used to check for errors in file by running
  'analyzeWithAllCompilerChecks' and inspecting returned BindingTrace.
  For common modules, there were no diagnostics about expect/actuals in
  that trace, because there were no ExpectedActualDeclarationChecker
  (and PlatformExpectedAnnotator was reporting diagnostics in ad hoc
  trace).
  - Again, now we inject EADC in common modules properly, so we see
  those errors in trace and report them in test
2019-06-10 13:34:27 +03:00
Denis Zharkov 956f8ad5e9 Support deserialized contracts in common code
#KT-26687 Fixed
2018-09-17 12:48:42 +03:00
Mikhail Glukhikh 5f2c7d3c84 Do not report OPTIONAL_DECLARATION_USAGE_... in IDE for platform modules
#KT-26585 Fixed
Also fixes MultiPlatformHighlightingTestGenerated.testMultifileFacade
2018-09-06 11:07:21 +03:00
Mikhail Glukhikh 56d89266d4 Add tests for KT-26141 (yet without changes) 2018-09-05 13:10:03 +03:00
Pavel V. Talanov 3a8499b10e Fix a bug where kotlin common classes were seen as missing dependencies
When kotlin referred to them through java signatures
Java resolver ignores expect classes

 #KT-24185 Fixed
2018-08-30 19:37:02 +02:00
Pavel V. Talanov 7087a1b3f5 MPP: test different jvm implementations for single common module
Add test infrastructure to support same platform implementations
2018-08-30 19:37:02 +02:00
Denis Zharkov 944b0d058a Allow calling some pieces of the experimental coroutine API
- Calling suspend functions is allowed
- Presence of suspend function type still makes declaration
unusable unless it belongs to a value parameter as a top-level type
containing less then three parameters

Still, warning should be emitted because they will become unsupported in 1.4

 #KT-25683 In Progress
2018-08-21 13:44:02 +03:00
Ilmir Usmanov 4b03db771a Minor. Fix test. 2018-07-30 18:59:44 +03:00
Denis Zharkov f72aa78eec Fix libraries analysis for case of isReleaseCoroutines feature enabled
#KT-25466 In Progress
2018-07-19 16:19:04 +03:00
Pavel V. Talanov a8a490ea5a Test multifile facades in mpp projects 2018-06-06 21:04:00 +02:00
Pavel V. Talanov 8185b1bf02 Test accessing file facades from java in mpp project 2018-06-06 21:03:57 +02:00
Pavel V. Talanov dae8b12872 Mpp: fix production internals not visible from tests in platform modules
Caused by change in mpp resolve
Happened in platform modules that have expectedBy dependencies

#KT-24729 Fixed
2018-06-01 14:15:04 +02:00
Mikhail Glukhikh f8f3b1c6f1 Provide language version settings correctly for platform modules
So #KT-24546 Fixed
2018-05-24 16:40:52 +03:00
Alexander Udalov 712a796637 Fix MultiModuleHighlightingTestGenerated.testUseCorrectBuiltInsForCommonModule
Add dependency from a_jvm8 on stdlib. Otherwise, `getEmptyList` from
a_common was resolved to have an error return type
2018-05-02 16:56:54 +02:00
Nikolay Krasko 5216dfcc59 Add internal errors to test data in multi module tests
Tests started to fail after 82a21b3955.
2018-04-28 22:24:39 +03:00
Pavel V. Talanov 521357a22d Add tests for KT-20824, KT-23745, KT-23124, KT-20605, KT-23760
#KT-20824 Fixed
 #KT-23745 Fixed
 #KT-23124 Fixed
 #KT-20605 Fixed
 #KT-23760 Fixed
2018-04-20 20:00:12 +02:00
Pavel V. Talanov 94fe170b7b MPP: analyze platform sources with expectedBy common sources
This allows to emulate current compiler behaviour

Introduce CombinedModuleInfo which is a combination of several other modules intended to be analyzed together
2018-04-20 20:00:11 +02:00
Pavel V. Talanov 3949fc70c9 Adjust test data for previously ignored tests 2018-04-20 20:00:05 +02:00
Pavel V. Talanov 5ddb7c71d1 Mpp resolve: fix actual/expect declaration lookup
Previously we would look fo expect declaration in common dependencies
    as opposed to looking inside the module exclusively
2018-04-20 20:00:04 +02:00
Pavel V. Talanov cdb49511e6 Mpp highlighting test: make generated, adjust test data
Note: this spawns new test cases which were ignored previously
2018-04-20 20:00:02 +02:00
Alexander Udalov 0439abba46 Check that kotlin.stdlib is explicitly required in module-info
Writing a Jigsaw-modular Kotlin program which doesn't require
kotlin.stdlib doesn't make sense because it most likely will fail at
runtime, on access to anything from the standard library. Previously, we
checked that kotlin.stdlib was in the module graph, but that's not
enough, we should also check that the source module requires it.
'-Xallow-kotlin-package' can be used to disable the error.

Add a test checking that an indirect (transitive) dependency is also OK
2018-04-03 21:50:25 +02:00
Mikhail Glukhikh 442a89bc6c ModuleDescriptor now sees internals of its expected by #KT-15739 Fixed 2018-03-07 13:58:31 +03:00
Mikhail Glukhikh 3f500a1655 Add "expectedBy" to module descriptor and use it in checker
Now ExpectActualDeclarationChecker in IDE context
uses common module descriptors for relevant checks.
Compiler still uses own module instead (see comment in checker)
So #KT-21771 Fixed
2018-02-14 15:09:14 +03:00
Alexander Udalov 21e2a3c0b4 Load module annotations in IDE
#KT-22759 Fixed
2018-02-08 17:08:33 +01:00
Mikhail Glukhikh 8a3fed15f8 Report NO_ACTUAL_FOR_EXPECT etc. on relevant declaration
So #KT-20398 Fixed
2017-10-06 10:48:34 +03:00