Commit Graph

25534 Commits

Author SHA1 Message Date
Ilya Kirillov f19a9af7b3 Unify WhenMissingCase from FIR and FE1.0 2021-02-24 20:13:43 +01:00
Ilya Kirillov f4371c670e Move WhenMissingCase from fir module to compiler.common to use in IDE 2021-02-24 20:13:42 +01:00
Ilya Kirillov 83f8650e80 Move CallableId from fir module to compiler.common to use in IDE 2021-02-24 20:13:41 +01:00
Alexander Udalov 2e2caae05c Extract control flow analysis to separate module
Extract a service interface out of ControlFlowInformationProviderImpl
and register its implementation in two "leaf" modules: 'cli',
'idea-core'.

This improves parallel build, since a lot of modules depend on
'frontend' but only these two modules reference the implementation and
thus depend on the full CFA implementation now.
2021-02-24 17:17:04 +01:00
Alexander Udalov c744515832 Minor, pass CliSealedClassInheritorsProvider explicitly in some places
Do not use default parameter value for functions with only 1 or 2 call
sites, since it doesn't add much value but provides a dangerous
possibility to forget to pass the real implementation.
2021-02-24 17:17:03 +01:00
Alexander Udalov ca5a35b4b3 Move CompilerEnvironment from 'frontend' to 'cli'
This is needed in order to have a single convenient place where to
register frontend services implemented _outside_ of the 'frontend'
module, such as the control flow analysis, extracted to a separate
module in a subsequent commit.
2021-02-24 17:17:03 +01:00
Alexander Udalov 5ad0033d42 Extract some cfg utilities into separate files
These utilties are used not only within CFG, but from the frontend and
idea as well. Therefore upon extraction of CFG into another module,
these two new files will remain in 'frontend'.
2021-02-24 17:17:03 +01:00
Tianyu Geng aec498a4ea Add quickfixes for NON_FINAL_MEMBER_IN_FINAL_CLASS 2021-02-24 15:56:35 +01:00
Tianyu Geng 5bdea9652b FIR: fix position and reporting of PRIVATE_SETTER_*
Previously `FirPropertyAccessor.source` references the `KtProperty` if
the user code contains a setter or getter that doesn't contain a body.
For example, with the following

```
val i: Int = 1
  private set
```

The `FirPropertyAccessor` would reference the `KtProperty` as the
source.

This change makes `FirPropertyAccessor` reference `KtPropertyAccessor`
as the source if possible, regardless of whether the body is present or
not.
2021-02-24 13:50:46 +03:00
Tianyu Geng bdeecfc188 FIR: check multiple vararg param and forbidden vararg type 2021-02-24 13:50:46 +03:00
Yaroslav Chernyshev c571c5c441 Refactor and apply optimization to KaptModelBuilderService logic 2021-02-24 11:38:13 +03:00
Andrey Uskov 7ef136d142 Improve performance of import of pure kotlin project: do not force all tasks creation
#KT-34401 Fixed
2021-02-24 11:38:12 +03: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
Denis.Zharkov 45018ea468 FIR: Rework loading overrides of special built-in methods from Java
Some of the changed data is correct, but some diagnostics are incorrect
Corner cases like having both contains(Object) and contains(String)
within implementation of Collection<String> is not supported
2021-02-20 10:59:21 +03:00
Denis.Zharkov 3e420ca4e3 FIR: Introduce FirDeclarationOrigin.BuiltIns 2021-02-20 10:59:21 +03:00
Ilya Kirillov ca4ec997ee FIR IDE: split KtAnalysisSession into mixins 2021-02-19 19:52:46 +01:00
Ilya Kirillov 141b6b0e55 FIR IDE: use different .after testdata for AbstractHLIntentionTest.kt 2021-02-19 16:44:50 +01:00
Ilya Kirillov 42103b7363 FIR IDE: use correct denotable type approximator 2021-02-19 16:44:48 +01:00
Mikhail Glukhikh 3571074da4 Update FIR-IDE diagnostic components 2021-02-19 18:24:49 +03:00
Mikhail Glukhikh 588b1354f6 FIR IDE: fix reference shortening regarding new qualified sources 2021-02-19 18:24:47 +03: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
Ilya Kirillov b08eb6cf4c FIR IDE: specify behaviour of HL API getOverriddenSymbols
- Split it into two functions getAllOverriddenSymbols and getDirectlyOverriddenSymbols
- Implement tests for getOverriddenSymbols
- temporary mute inheritance.kt light classes test
2021-02-19 11:49:57 +01:00
Ilya Kirillov 804df1aec2 FIR IDE: introduce base class for multifile tests 2021-02-19 11:49:56 +01:00
Tianyu Geng 6b453d9b23 FIR: implement checker for open members
Specifically,

1. NON_FINAL_MEMBER_IN_FINAL_CLASS
2. NON_FINAL_MEMBER_IN_OBJECT
2021-02-19 10:17:18 +03:00
Jinseong Jeon 9aaa952b39 FIR: regard implicit type for value parameter after body resolve as an error type 2021-02-19 10:17:16 +03: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
Tianyu Geng 51da54ce66 FIR IDE: Simplify registerPsiQuickFixes
This change makes it possible to register multiple fixes for a
diagnostic. Also, the previous registerPsiQuickFix that relies compiler
to infer the KtFirDiagnostic type parameter is dangerous since it
can silently register fixes on interface `KtDiagnosticWithPsi` if caller
doesn't specify it explicitly.
2021-02-18 19:37:37 +01:00
Alexander Udalov 1d6b198915 Build: suppress version and JVM target warnings
To further reduce the output on each build.
2021-02-18 12:17:17 +01:00
Alexander Dudinsky a3fa6c6d13 Publish artifacts needed for the kotlin-gradle-plugin in kotlin-ide repository 2021-02-18 11:51:32 +03:00
Mikhael Bogdanov 61fce74b76 Support new targets in KotlinBytecodeToolWindow
#KT-30222 Fixed
2021-02-17 18:43:23 +01:00
Tianyu Geng 652207dcac FIR IDE: add AddModifierFix 2021-02-17 18:19:27 +01:00
Tianyu Geng 5793f77ece FIR IDE: AddModifierFix -> AddModifierFixMpp 2021-02-17 18:19:27 +01:00
Tianyu Geng 66f00a2eb5 FIR IDE: move AddFunctionBodyFix to fe-independent 2021-02-17 18:14:10 +01:00
Ilya Kirillov 3e22011626 Fix compilation of HLRedundantVisibilityModifierInspection 2021-02-16 15:47:08 +01:00
Ilya Kirillov e8f3ebdd19 FIR IDE: introduce HLRedundantVisibilityModifierInspection by extended checker 2021-02-16 15:23:18 +01:00
Ilya Kirillov 6d97841f38 FIR IDE: introduce HLLocalInspectionTest 2021-02-16 15:23:18 +01:00
Ilya Kirillov 7fb6c22889 FIR IDE: allow creating inspections by extended checkers 2021-02-16 15:23:17 +01:00
Ilya Kirillov b9a4613e44 FIR IDE: remove getMessage from HLPresentation as it duplicates HLApplicator.getActionName 2021-02-16 15:23:17 +01:00
Ilya Kirillov ca4a07f73f Unify message bundles used in IDEA FIR into KotlinBundle 2021-02-16 15:23:17 +01:00
Vladimir Dolzhenko 6352814d45 Fix NPE
#KTIJ-898 Fixed

Original commit: 12d8e88b846f29598ca3904b49996bd6a9891ccd
2021-02-16 14:21:40 +00:00
Vladimir Dolzhenko 98ba379e07 Fixed NPE on StandaloneScriptRootsCache instantiation
Relates to ^EA-218043
#KTIJ-1137 Fixed

Original commit: 1d63a1b48d480b958ff44676c42b698a8ca5f64a
2021-02-16 14:21:39 +00:00
Ilya Kirillov 91581d6c1a Move KotlinBundle to frontend-independent module
to use from IDEA FIR
2021-02-16 12:16:17 +01:00
Ilya Kirillov 0a72e16451 FIR: transform DiagnosticBuilder DSL to an object
To make diagnostics visible in symbol search in IJ
2021-02-15 22:28:13 +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
Simon Ogorodnik 3909e3c54c Decouple TypeCheckerContext and TypeSystemContext 2021-02-15 18:28:58 +03: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
Andrei Klunnyi eb0c73fd5e KT-44839 [Sealed interfaces]: ability to specify compiler options in tests 2021-02-15 15:28:00 +00:00
Andrei Klunnyi c63a9afa56 KT-44839 [Sealed interfaces]: move refactoring for language level < 1.5
This commit restores sealed-check-logic for language level < 1.5
mistakenly removed in 690fb47c.

^KT-44839 fixed
2021-02-15 15:27:59 +00:00
Victor Petukhov 0d40022d6d Add reporting of the warnings based on Java annotations for expanded type aliases
Before that, such warnings weren't reported as the corresponding errors were reported during type inference (only original types took part there)
2021-02-15 12:13:55 +03:00