Commit Graph

26828 Commits

Author SHA1 Message Date
Ivan Kochurkin 7c6326856b [FIR] Use toFirRegularClassSymbol instead of toFirRegular in checkers 2021-09-10 00:49:11 +03:00
Ivan Kochurkin ee37768808 [FIR] Rename getClassLikeSymbolFqName to getClassLikeSymbolByClassId 2021-09-10 00:49:10 +03:00
Ivan Kochurkin 69a13a3269 [FIR] Use getAnnotationByClassId instead of getAnnotationByFqName in JVM checkers 2021-09-10 00:49:09 +03:00
Ivan Kochurkin 55f33999f1 [FIR] Add REPEATED_ANNOTATION, REPEATED_ANNOTATION_WARNING 2021-09-10 00:49:07 +03:00
Ivan Kochurkin fa12e72551 [FIR] Add REPEATABLE_CONTAINER_* diagnostics
REPEATABLE_CONTAINER_MUST_HAVE_VALUE_ARRAY
REPEATABLE_CONTAINER_HAS_NON_DEFAULT_PARAMETER
REPEATABLE_CONTAINER_HAS_SHORTER_RETENTION
REPEATABLE_CONTAINER_TARGET_SET_NOT_A_SUBSET
REPEATABLE_ANNOTATION_HAS_NESTED_CLASS_NAMED_CONTAINER
2021-09-10 00:49:07 +03:00
Ivan Kochurkin f414a91c66 [FIR] Implement FirInterfaceDefaultMethodCallChecker
Add diagnostics: INTERFACE_STATIC_METHOD_CALL_FROM_JAVA6_TARGET,
INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER,
DEFAULT_METHOD_CALL_FROM_JAVA6_TARGET
2021-09-10 00:49:04 +03:00
Ivan Kochurkin 97bc079634 [FIR] Add REPEATED_ANNOTATION_WITH_CONTAINER, NON_SOURCE_REPEATED_ANNOTATION
REPEATED_ANNOTATION_TARGET6
2021-09-10 00:49:03 +03:00
Ivan Kochurkin 2baed77598 [FIR] Add JVM_SYNTHETIC_ON_DELEGATE diagnostic
Extract JVM names to common JvmNames
2021-09-10 00:49:03 +03:00
Ivan Kochurkin 3725c58794 [FIR] Add INAPPLICABLE_JVM_FIELD, INAPPLICABLE_JVM_FIELD_WARNING 2021-09-10 00:49:02 +03:00
Ivan Kochurkin 816e8f487c [FIR] Add JVM diagnostics about external declaration 2021-09-10 00:49:00 +03:00
Ivan Kochurkin cfd2835254 [FIR] Add JVM Default diagnostics 2021-09-10 00:48:59 +03:00
Nikolay Lunyak 108df38255 [FIR] Regenerate code 2021-09-09 20:23:08 +03:00
Nikolay Lunyak 4f2eb8b955 [FIR] Make toAnnotationLookupTag() return null for generic annotations 2021-09-09 20:18:50 +03:00
Nikolay Lunyak 2a2c92d8b3 [FIR] Add support for JVM_STATIC_ON_EXTERNAL_IN_INTERFACE diagnostic 2021-09-09 20:18:49 +03:00
Nikolay Lunyak 7006426304 [FIR] Add support for JVM_STATIC_ON_CONST_OR_JVM_FIELD diagnostic 2021-09-09 20:18:49 +03:00
Nikolay Lunyak f3d61c199b [FIR] Add support for JVM_STATIC_ON_NON_PUBLIC_MEMBER diagnostic 2021-09-09 20:18:49 +03:00
Nikolay Lunyak c2e5583780 [FIR] Add support for JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION diagnostic 2021-09-09 20:18:49 +03:00
Nikolay Lunyak 276bfd9305 [FIR] Add support for OVERRIDE_CANNOT_BE_STATIC diagnostic 2021-09-09 20:00:38 +03:00
Nikolay Lunyak 5607be3920 [FIR] Add support for INAPPLICABLE_JVM_NAME diagnostic 2021-09-09 20:00:36 +03:00
Nikolay Lunyak 5ebad97cd5 [FIR] Add support for ILLEGAL_JVM_NAME diagnostic 2021-09-09 19:58:16 +03:00
Dmitriy Novozhilov 405670e111 Merge :compiler:fir:jvm module into :compiler:fir:java 2021-09-09 17:20:14 +03:00
Jinseong Jeon 6342e6ecad FIR/LC: fix modality of enum class
enum class, which is extended by enum entries, should not be final.
(Those enum entries should be, instead.)

enum class itself wouldn't be instantiated, and thus it's technically
abstract, but having a private ctor() would be an option.
For the latter case, we can simply put no modality modifier.
2021-09-09 16:07:09 +02:00
Jinseong Jeon 5446a8ad10 FIR IDE: null out for erroneous PsiType conversion 2021-09-09 16:07:09 +02:00
Jinseong Jeon 8e242655f9 FIR IDE: resolve call to property accessors 2021-09-09 16:07:09 +02:00
Roman Golyshev 43156dc726 [FIR IDE] Handle FirImplicitInvokeCalls in KtFirImportOptimizer
Hacks with PSI to detect implicit invoke calls are no more needed
2021-09-09 14:57:15 +03:00
Mikhail Glukhikh 19a75b31f9 FIR: avoid resolve loop between accessor and other members
#KT-48634 Fixed
2021-09-08 14:47:51 +03:00
Roman Golyshev 19d11f9149 [FIR IDE] Do not create KtPsiBasedSymbolPointer for generated members
For example, if a class has default constructor (`class Foo`),
both KtClassSymbol and KtConstructorSymbol will be pointing to the same
PSI - thus creating effectively the same `KtSymbolPointer`. Later
it will be impossible to deduce which symbol we had in mind

Currently, `Show Parameters Info` works incorrectly for
such generated declarations  because of that - it throws CCE while
trying to cast class symbol to function (constructor) symbol
2021-09-07 13:36:11 +00:00
Roman Golyshev 90c88273c3 [FIR IDE] Refactor functions for qualifiers traversing in KtFirReferenceShortener
The code is more coherent when `qualifiedTypesWithSelf` and
`qualifiedExpressionsWithSelf` both do not contain unqualified psi
elements
2021-09-06 14:58:24 +03:00
Roman Golyshev 7a37a7b2a0 [FIR IDE] Refactor KtFirReferenceShortener::findClassifierElementsToShorten
Instead of filtering lambda, pass only qualified elements to the
function (because non-qualified elements cannot possibly be shortened)
2021-09-06 14:42:04 +03:00
pyos 090b90f62e FIR: load type qualifiers from module, package, and parent classes 2021-09-06 13:11:13 +03:00
pyos ba1fc81b96 FIR: remove extra layers of caching above JavaSymbolProvider
There needs to be exactly one postcompute-aware cache in order to avoid
breaking recursive calls to getClassLikeSymbolByFqName.
2021-09-06 13:11:10 +03:00
Tianyu Geng 14b66872b5 FIR IDE: hoist up API to get Java getter/setter name of a property...
and expose API to get the getter and setter symbols for synthetic Java
properties.
2021-09-05 11:18:58 +03:00
Roman Golyshev bb3f55dec2 [FIR IDE] Improve handling aliased types in KtFirImportOptimizer 2021-09-03 22:40:37 +03:00
Mikhail Glukhikh ed035d99ab Migrate -Xopt-in to -opt-in in Gradle Kotlin scripts 2021-09-03 15:40:47 +03:00
Roman Golyshev cc3ad73436 [FIR IDE] Handle callable references better in KtFirImportOptimizer 2021-09-02 18:10:16 +00:00
Roman Golyshev 911bfcf150 [FIR IDE] Add basic compiler-side Import Optimizer tests
These tests are not complete, but it is intentional - it is just a basic
setup, so when the need arise, the tests can be added right away
2021-09-02 18:10:16 +00:00
Roman Golyshev d284ed1c79 [FIR IDE] Commonize FirCallableSymbol.computeImportableName function 2021-09-02 18:10:16 +00:00
Roman Golyshev 0dfddb8bf2 [FIR IDE] Refactor KtFirReferenceShortener 2021-09-02 18:10:15 +00:00
Roman Golyshev 52e012712d [FIR IDE] Add a little KDoc to KtImportOptimizerMixIn::analyzeImports 2021-09-02 18:10:15 +00:00
Roman Golyshev 03f29de5ef [FIR IDE] Add token validity assertion to KtFirImportOptimizer 2021-09-02 18:10:14 +00:00
Roman Golyshev 81768bdaef [FIR IDE] Mark imports from the same package as unused 2021-09-02 18:10:14 +00:00
Roman Golyshev 824acc2c4f [FIR IDE] Improve imports analysis for import aliases
Also make it work more correctly with invoke operator functions
2021-09-02 18:10:14 +00:00
Roman Golyshev 989cd487a6 [FIR IDE] Improve imports analysis for complex type qualifiers 2021-09-02 18:10:13 +00:00
Roman Golyshev 43e266273c [FIR IDE] Implement basic algorithm for KtFirImportOptimizer 2021-09-02 18:10:13 +00:00
Roman Golyshev cc88d92d05 [FIR IDE] Add KtImportOptimizer mixin and FIR implementation
Does nothing for now
2021-09-02 18:10:12 +00:00
Dmitriy Novozhilov d46e2dd749 Fix OVERRIDE_DEPRECATION warnings in project code 2021-09-02 15:04:07 +03:00
Dmitriy Novozhilov 69c3831865 Rename Deprecation to DeprecationInfo 2021-09-02 15:04:07 +03:00
Dmitriy Novozhilov 5d31f0f032 [FIR-IDE] Avoid clashes between diagnostic and it's parameter with same short names 2021-09-02 15:04:07 +03:00
Dmitriy Novozhilov 88913aa2a3 [FIR] Report warning on non-deprecated overrides of deprecated members
^KT-47902
2021-09-02 15:04:07 +03:00
Dmitriy Novozhilov ef9ad5af51 [FE 1.0] Report warning on non-deprecated overrides of deprecated members
Also don't propagate deprecation status to overrides after 1.7

^KT-47902 Fixed
2021-09-02 15:04:07 +03:00