Commit Graph

183 Commits

Author SHA1 Message Date
Dmitriy Novozhilov b19116d3af [FIR] Provide implementation of ExpectActualMatchingContext for FIR
^KT-58578
2023-05-19 10:19:17 +00:00
Dmitriy Novozhilov 6544220b3e [FIR] Check only for visibility modifiers for NON_PRIVATE_OR_PROTECTED_CONSTRUCTOR_IN_SEALED error
^KT-58033 Fixed
2023-04-19 14:53:42 +00:00
Roman Efremov c718c77c43 [FE] Check visibilities of expected and actual property setters are compatible
^KT-30905 Fixed
2023-04-06 13:10:30 +00:00
Roman Efremov 456d3e0f42 [FE] Prohibit expect fun interface to have non-fun actual counterpart
In K1 .isFun is always false for Java classes, so extra check
is added for that. This is not needed for K2, because .isFun is
true for all Java classes. Here it is not necessary to check
that interface has only one method, because such check will be
done in the place where interface implementation is created.

^KT-39362 Fixed
2023-04-05 07:31:58 +00:00
Roman Efremov bcf4528763 [MPP] Forbid actual member in expect class
Such member descriptor will be actual and expect at the same time,
so we should run both checks.

^KT-40903 Fixed
2023-04-04 12:28:00 +00:00
Kirill Rakhman 3b0c36da3f [FIR] Fix ClassCastException when rendering ACTUAL_WITHOUT_EXPECT
#KT-57320
2023-03-29 10:19:47 +00:00
Kirill Rakhman 60b227c519 [FIR] Sort HMPP dependencies topologically for symbol providers
This fixes an issue where an actual class from an intermediate module
has more supertypes than its expect declaration which leads to a
false-positive resolution error because a type reference resolves to the
expect class. The fix is to sort the dependencies topologically from
"most actual" to "most expect" when creating the list of symbol
providers.

#KT-57369 Fixed
2023-03-27 07:41:05 +00:00
Dmitrii Gridin 9a4a3d1f49 [LL FIR] introduce test with reversed resolve order
^KT-56543

Merge-request: KT-MR-9299
Merged-by: Dmitrii Gridin <dmitry.gridin@jetbrains.com>
2023-03-22 17:34:07 +00:00
Ivan Kochurkin cd07eba25c [K2, MPP] Fix reporting of MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED 2023-03-22 01:28:19 +00:00
Ivan Kochurkin 60edf1def3 [K2, MPP] Support actualization of enums and annotations that have primary constructor with arguments
^KT-57241 Fixed
2023-03-22 01:28:18 +00:00
Ivan Kochurkin 44807b7bd4 [K2, MPP] Support actualization of actual function with dynamic arguments
^KT-57210 Fixed
2023-03-22 01:28:18 +00:00
Ivan Kochurkin ec34b9fa7b [K2, MPP] Restore ir functions actualization by argument types instead of full signatures
Refactor IrActualizer
2023-03-22 01:28:17 +00:00
Ivan Kochurkin d99b4c78d2 [K2, MPP] Correct actualization of nested objects
^KT-57182 Fixed
2023-03-22 01:28:17 +00:00
Ilya Chernikov 59b88f33b2 [K2, MPP] implement IR errors reporting and test infrastructure
Fix test data

^KT-56344 Fixed
2023-03-22 01:28:16 +00:00
Nikita Bobko 62d2327ca3 Don't issue a warning about expect/actual in the same module for incompatible expect/actual pairs
^KT-57067 Fixed
Review: https://jetbrains.team/p/kt/reviews/9123
2023-03-09 09:30:29 +00:00
Nikolay Lunyak bcfafc601e Add EnumEntries to minimal-stdlib-for-tests
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-03-02 10:23:38 +00:00
Ivan Kochurkin 9d0e02658f [FIR] Support of ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION diagnostic 2023-03-01 22:10:09 +00:00
Ivan Kochurkin 3e33258f36 [FIR] Support of ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE diagnostic 2023-03-01 22:10:08 +00:00
Ivan Kochurkin cf1bd9837a [FIR] Support of ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE diagnostic 2023-03-01 22:10:08 +00:00
Ivan Kochurkin 8bf9d6c92f [FIR] Support of ACTUAL_TYPE_ALIAS_NOT_TO_CLASS diagnostic
^KT-56514 Fixed
2023-03-01 22:10:08 +00:00
Ivan Kochurkin c418a7a7bf [FIR] Support of ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS diagnostic
^KT-56522 Fixed
2023-03-01 22:10:07 +00:00
Ivan Kochurkin d87619e06e [FIR & IR] Support of default values for arguments in expect functions
Add FirActualDeclarationChecker that checks expect/actual return types

^KT-56331 Fixed, ^KT-56334 Fixed
2023-03-01 22:10:07 +00:00
Kirill Rakhman 9dda5e4fcd [Test] Remove redundant FIR_DISABLE_LAZY_RESOLVE_CHECKS directives
KT-56177
2023-02-28 10:19:18 +00:00
Nikita Bobko 9a865e4c55 [FE 1.0] Issue a warning if expect and actual are declared in the same module
The commit is based on b09561c3c3
Co-authored-by: Dmitriy Novozhilov <dmitriy.novozhilov@jetbrains.com>

^KT-40904 Fixed
^KT-55177 Fixed
Review: https://jetbrains.team/p/kt/reviews/8731

True negative test already exist:
`compiler/testData/diagnostics/tests/multiplatform/hmpp/multiplatformCompositeAnalysis/intermediateWithActualAndExpect.kt`
2023-02-21 14:45:46 +01:00
Nikita Bobko 456605542c Make it possible to run hmpp tests with ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE
In scope of KT-40904 KT-55177
Review: https://jetbrains.team/p/kt/reviews/8731

In order to make it possible to run hmpp tests with
`ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE`, a dependency manager
must be implemented. This commit implements some basic dependency
manager. I'm not sure in its correctness because
`CommonDependenciesContainer` is an awkward API, but this dependency
manager works for my cases.

Why: I need hmpp + `ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE`
infrastructure to cover `ExpectActualInTheSameModuleChecker` (I will add
the checker in the next commit) with tests. The checker couldn't be
covered with regular hmpp tests because regular hmpp tests and
`K2MetadataCompiler` run the compiler in a different way.
Contrary, `ENABLE_MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE` runs the compiler in a
way `K2MetadataCompiler` does it.

I moved some tests from hmpp to `hmpp/multiplatformCompositeAnalysis`
because otherwise the tests would fail after I implement
`ExpectActualInTheSameModuleChecker` in the next commit.

Also the descriptor dumps were changed
(intermediateWithActualAndExpect.txt and
sealedInheritorsInComplexModuleStructure.txt). It happened because now
common source sets are no longer "squashed" into a single source set but
rather correct dependencies between source sets are established. And
each source set is analyzed separately (exactly like in
K2MetadataCompiler)
2023-02-21 14:45:45 +01:00
Marco Pennekamp d6cb75ca91 [LL FIR] KT-55329 Support transitive dependsOn dependencies in LL FIR
- In contrast to other kinds of dependencies, `dependsOn` dependencies
  must be followed transitively.
- Add `transitiveDependsOnDependencies` to `KtModule`. These
  dependencies are calculated lazily with a topological sort. They are
  added to the dependency provider when it's built in
  `LLFirSessionFactory`.

^KT-55329 fixed
2023-01-30 17:17:58 +00:00
Marco Pennekamp 1803bd36cc [FIR] Fix IncDecOperatorsInExpectClass for FIR, add multi-module test
- `IncDecOperatorsInExpectClass.kt` should produce an
  `ACTUAL_WITHOUT_EXPECT` in K2 (see KT-55177). This went unnoticed
  because of KT-55570.
- A similar multi-module test for K1 and K2 has been added, called:
  `multiplatform/incDecOperatorsInExpectClass.kt`.
2023-01-30 17:17:57 +00:00
Marco Pennekamp 2faa247075 [FIR] KT-55570 Fix ACTUAL_WITHOUT_EXPECT reporting for empty classes
- FirExpectActualMatcherTransformer: Instead of returning,
  `transformMemberDeclaration` must assign an empty map to
  `expectForActualData` so that `FirExpectActualDeclarationChecker`
  doesn't assume that the member declaration needs no expect-actual
  checking.

^KT-55570 fixed
2023-01-30 17:17:57 +00:00
Dmitriy Novozhilov 8d728d4f53 Revert "[FE 1.0] Deprecate declaration of expect and actual in the same module"
This reverts commit b09561c3c3.

It was decided to postpone this warning till 1.9
This is needed to provide proper IDE support

^KT-40904 Open
^KT-55177 Open
2023-01-17 18:02:50 +00:00
Dmitriy Novozhilov b09561c3c3 [FE 1.0] Deprecate declaration of expect and actual in the same module
^KT-40904 Fixed
^KT-55177 Fixed
2023-01-17 09:43:14 +00:00
Ivan Kochurkin 8936220876 [IR] Implement IR actualizer and use it for K2 test and CLI scenario
Implement calculateExpectActualMap for Fir2IrComponents

^KT-51753 Fixed
2023-01-13 12:55:58 +00:00
Ivan Kochurkin 5d273ce839 [FIR & FIR2IR] Prepare test and CLI infrastructure to support MPP
- Move out getAnalyzerServices from FirFrontendFacade to TestSetupUtils
- Simplify DependencyListForCliModule. Now it takes BinaryModuleData as input
- FirOutArtifact contains several FirOutputArtifactPart
- Simplify FirFrontendFacade
2023-01-13 12:55:57 +00:00
Ilya Kirillov 644d1bf0d0 [FIR] ignore tests which fail because of resolve contracts violation 2022-12-12 16:21:07 +00:00
Mikhail Glukhikh 82f1535007 K1: fix IIOBE in expect-actual checker with different type parameter number
#KT-54827 Fixed
2022-11-17 22:28:04 +00:00
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00
Ilya Kirillov 556b7894d5 [Low Level FIR] do not search for declarations from kotlin. package in source modules 2022-09-30 12:15:49 +02:00
Pavel Mikhailovskii 85ab8b4ce1 KT-53783 Prohibit "expect data object" syntax 2022-09-07 12:53:24 +00:00
Nikolay Lunyak be9e97d044 [FIR] Introduce ConeDynamicType 2022-06-02 13:47:23 +00:00
Ivan Kylchik 51ccc32a3f Update test data after introducing IntrinsicConstEvaluation annotation 2022-05-18 21:19:57 +03:00
Mikhail Glukhikh d01e6b61a3 FIR: don't report PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED in exp.cl.
#KT-51761 Fixed
2022-04-01 16:15:53 +03:00
Mikhail Glukhikh aaebb7a30e FIR: don't create delegated constructor call in expect
#KT-51756 Fixed
2022-04-01 16:15:53 +03:00
Dmitriy Novozhilov c116565c0e [FIR] Allow named arguments for calls of expect functions 2022-02-18 17:44:41 +03:00
Dmitriy Novozhilov ccb74b6477 [FIR] Fix computing compatibility of expect and actual modality 2022-02-18 17:44:39 +03:00
Dmitriy Novozhilov e1d21d7a37 [Test] Enable MultiPlatformProjects in multiplatform tests by default 2022-02-18 17:44:39 +03:00
Dmitriy Novozhilov 851305f981 [FIR] Allow smartcasts on member properties for classes from dependsOn dependencies 2022-02-18 17:44:37 +03:00
zhelenskiy c1dc1f7e33 Diagnostics renamed
Signed-off-by: zhelenskiy <zhelenskiy2000@yandex.ru>
2021-11-13 12:38:45 +01:00
Tianyu Geng 10d4dfef04 FIR: check subclass of sealed class 2021-08-25 14:37:24 +03:00
Ivan Kochurkin cd6384eb20 [FIR] Fix handling of WRONG_MODIFIER_TARGET
Implement DEPRECATED_MODIFIER, DEPRECATED_MODIFIER_FOR_TARGET, REDUNDANT_MODIFIER_FOR_TARGET
2021-08-13 18:32:27 +03:00
Ivan Kochurkin fd92b851a2 [FIR] Implement PACKAGE_OR_CLASSIFIER_REDECLARATION
Fix REDECLARATION positioning
2021-08-10 15:09:25 +00:00
Andrey Zinovyev 015c2d1875 [FIR] Add NOTHING_TO_INLINE diagnostic 2021-08-04 17:33:08 +03:00