Commit Graph

8894 Commits

Author SHA1 Message Date
Pavel Kirpichenkov 4bc019736b [MPP] Add KotlinSDK to the set of predefined test SDKs
^KT-45145 Fixed
2021-03-09 20:05:32 +03:00
Ilya Kirillov 0130ecd21d FIR IDE: fix CCE in getKtExpressionType on assignment target 2021-03-07 19:48:08 +01:00
Tianyu Geng 8158a07063 FIR IDE: add quickfix for NESTED_CLASS_NOT_ALLOWED 2021-03-05 13:27:36 +01:00
Jinseong Jeon e009b71f88 FIR checker: report uninitialized member/extension properties 2021-03-04 17:56:29 +03:00
Tianyu Geng 17617ffd3f IDE FIR: fix resolving vararg parameter type
For a vararg parameter type, there corresponding FIR element has a fake
source of kind ArrayTypeFromVarargParameter. As a result,
`getOrBuildFir` returns the whole `FirValueParameter` for the parameter
type reference. Therefore, we need some special handling for this case
in order to resolve the proper `KtSymbol`.
2021-03-02 12:46:55 +01:00
Tianyu Geng bca393bd5c FIR IDE: Add quickfix for PRIVATE_SETTER_FOR_(OPEN|ABSTRACT)_PROPERTY 2021-03-01 19:30:31 +01:00
Roman Golyshev 6ebd4b954c Add new reference resolve tests
The main purpose is to show that old frontend and FIR work differently
in the case of the conflicts of local and top level classes/objects

See the tests that marked with // IGNORE_FIR

Corresponding ticket is ^KT-45192
2021-03-01 10:23:57 +00: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
Ilmir Usmanov 2523ea1ef4 Do not add @JvmInline annotation on JS and Native 2021-02-25 16:07:00 +01:00
Ilmir Usmanov 2df049fc03 Minor. Remove outdated test and update maven test 2021-02-25 16:06:58 +01:00
Ilmir Usmanov 8c31fcb615 Add inline class -> @JvmInline value class intention 2021-02-25 16:06:54 +01:00
Mark Punzalan 1c94372b6c FIR checker/IDE: Add checker and quickfix for VAL_WITH_SETTER. 2021-02-25 13:06:53 +01:00
Dmitriy Novozhilov 4222bb9af2 [FE] Make whens on expect sealed classes and enums not exhaustive 2021-02-25 14:56:08 +03:00
Tianyu Geng aec498a4ea Add quickfixes for NON_FINAL_MEMBER_IN_FINAL_CLASS 2021-02-24 15:56:35 +01:00
Toshiaki Kameyama ee406f1622 Lift assignment out: if last statement is lambda, enclose it in parentheses if necessary
#KT-38155 Fixed
2021-02-22 17:40:06 +01:00
Ilya Kirillov 141b6b0e55 FIR IDE: use different .after testdata for AbstractHLIntentionTest.kt 2021-02-19 16:44:50 +01:00
Tianyu Geng 56854a8b1a FIR IDE: register quickfix for the following
1. NON_ABSTRACT_FUNCTION_WITH_NO_BODY
  2. ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS
  3. ABSTRACT_FUNCTION_IN_NON_ABSTRACT_CLASS
2021-02-19 13:16:42 +01:00
Vladimir Dolzhenko 8783ebc352 Report highlight errors to WolfTheProblemSolver
Relates to #KT-37702
#KTIJ-1246 Fixed

Original commit: bd222a5255c2fd6f4abfce3115f81733ef9a39f3
2021-02-19 05:46:04 +00:00
Ilya Kirillov e8f3ebdd19 FIR IDE: introduce HLRedundantVisibilityModifierInspection by extended checker 2021-02-16 15:23:18 +01:00
Mark Punzalan 706d3e5aa8 FIR IDE: Add quickfix for VAR_ANNOTATION_PARAMETER. 2021-02-15 21:07:32 +01:00
Mark Punzalan 4e44804c77 FIR IDE: Add quickfix for INAPPLICABLE_LATEINIT_MODIFIER.
Also changed FE1.0 checker and all related fix factories to report error
on the declaration instead of the lateinit modifier. This is consistent
with the direction of all checkers in FIR (no reporting on modifiers).
2021-02-15 19:37:14 +01:00
Andrei Klunnyi 53a7dc1126 KT-44839 [Sealed interfaces]: restore move-tests for lang-version < 15
This commit restores tests removed in 690fb47c.
2021-02-15 15:28:00 +00:00
Ilya Kirillov d42cc219bf FIR IDE: fix collecting diagnostics for raanalysable non-toplevel declarations 2021-02-12 15:25:14 +01:00
Roman Golyshev 8020424b93 FIR IDE: Remove fake root prefix even when the element is not shortened 2021-02-12 10:53:17 +00:00
Roman Golyshev ee98a76600 FIR IDE: Implement simple importing of the functions
This is not a complete algorithm, but it already works in many cases

Disable some tests that not yet work
2021-02-12 10:53:16 +00:00
Roman Golyshev 51c59e5634 FIR IDE: Check function call before trying to drop the receiver 2021-02-12 10:53:14 +00:00
Roman Golyshev d88fd5bd73 FIR IDE: More strictly navigate to parent KtDotQualifiedExpression 2021-02-12 10:53:14 +00:00
Roman Golyshev e265a78a33 FIR IDE: Implement shortening and import for type qualifiers 2021-02-12 10:53:13 +00:00
Roman Golyshev 0e271b72c7 FIR IDE: Do not try to shorten type without qualifier 2021-02-12 10:53:12 +00:00
Roman Golyshev 534f4a66ad FIR IDE: Add simple shortening for qualified calls and properties 2021-02-12 10:53:12 +00:00
Roman Golyshev f03ca5ea57 FIR IDE: Add import in case when conflicting class comes from * import 2021-02-12 10:53:11 +00:00
Roman Golyshev 0b48416a1e FIR IDE: Unwrap nullable types 2021-02-12 10:53:10 +00:00
Roman Golyshev 08e271411f FIR IDE: Create fake scopes to avoid import duplicates 2021-02-12 10:53:09 +00:00
Roman Golyshev e34370554d FIR IDE: Add simple types importing
Some tests are not passing
2021-02-12 10:53:09 +00:00
Roman Golyshev 8575ce32d4 FIR IDE: Add more tests for type conflicts 2021-02-12 10:53:07 +00:00
Roman Golyshev e744084c15 FIR IDE: Enable types shortening for nested classes and nested types 2021-02-12 10:53:07 +00:00
Roman Golyshev b9d074051f FIR IDE: Add separate tests for FIR reference shortening 2021-02-12 10:53:06 +00:00
Roman Golyshev 108395fcfe FIR: Fix bug with incorrect source element for qualifiers 2021-02-12 10:53:04 +00:00
Dmitriy Novozhilov f3a8fcaea6 [FE] Make constructors of sealed classes protected instead of internal 2021-02-12 13:36:38 +03:00
Mark Punzalan 7962224804 FIR IDE: Add quickfix for VAR_OVERRIDDEN_BY_VAL. 2021-02-11 11:11:00 +01:00
Ilya Kirillov 91e135888d FIR IDE: introduce HLSpecifyExplicitTypeForCallableDeclarationIntention and HLRedundantUnitReturnTypeInspection 2021-02-09 17:15:41 +01:00
Ilya Kirillov e269b1d19d FIR IDE: temporary mute failing tests 2021-02-09 17:15:32 +01:00
Ilya Kirillov d72a2d39da FIR IDE: ignore not passing quickfixes tests 2021-02-09 17:15:31 +01:00
Andrei Klunnyi e3c1aa599d KT-44487 [Sealed Interfaces]: sealed-inheritors-provider for MPP 2021-02-09 12:54:51 +00:00
Igor Yakovlev 04017b00a1 [FIR IDE] Fix TypeRef resolve to error type caused by invalid number of arguments 2021-02-08 11:57:39 +03:00
Pavel Kirpichenkov 9f7d7e55da Consider platform compatibility in library usage index
Logic of module dependencies is enhanced to filter out incompatible
common -> platform dependencies. However the reversed index for getting
all modules that use libraries doesn't take this filtering into
account and returns all modules based exclusively on order entries.
This leads to incorrect library dependency calculation.

^KT-44638 Verification pending
2021-02-05 16:36:59 +03:00
Andrei Klunnyi 690fb47cbb KT-44079 [Sealed Interfaces]: move refactoring update
The idea behind this commit is that Move Refactoring should warn
developers in case their intention potentially breaks sealed
hierarchies (members must share the same module and package).

Provided algorithm has two goals:
- prevent destruction of correct hierarchies
- help in fixing broken ones
2021-02-03 10:04:26 +00:00
Igor Yakovlev 18cebe5131 [FIR IDE] Codereview minor refactoring
https://jetbrains.team/p/kt/review/2069/
https://jetbrains.team/p/kt/review/2070/
2021-02-01 21:21:03 +03:00
Igor Yakovlev 5d4606daaa [FIR IDE] Remove LightClassProvider 2021-02-01 21:21:02 +03:00