Commit Graph

26791 Commits

Author SHA1 Message Date
Nikolay Lunyak 4e56ba2fa4 [FIR] Forbid backing fields for delegated properties 2021-09-11 22:05:43 +03:00
Nikolay Lunyak 6b532ccd0d [FIR] Allow lateinit FirBackingField's 2021-09-11 22:05:41 +03:00
Nikolay Lunyak 3a3ef161d1 [FIR] Add a REDUNDANT_EXPLICIT_BACKING_FIELD warning 2021-09-11 22:05:40 +03:00
Nikolay Lunyak 2aafe84eef [FIR] Forbid explicit backing fields in extension properties 2021-09-11 22:05:39 +03:00
Nikolay Lunyak 56b2a984ce [FIR] Quick fix FirModifierChecker 2021-09-11 22:05:35 +03:00
Nikolay Lunyak 25124cca3d [FIR] Add an interface/abstract checker for the backing field 2021-09-11 22:05:35 +03:00
Nikolay Lunyak aefd6c30ad [FIR] Merge FirPropertyFieldDeclarationSymbol into FirBackingFieldSymbol 2021-09-11 22:05:34 +03:00
Nikolay Lunyak 47abdf2de1 [FIR] Add a modifiers diagnostic for the backing field 2021-09-11 22:05:33 +03:00
Nikolay Lunyak d4d43b9907 [FIR] Add type-related diagnostics for the backing field 2021-09-11 22:05:32 +03:00
Roman Golyshev e34b64d6f2 [FIR IDE] Make KtFirImportOptimizer more robust to reference errors 2021-09-11 14:57:01 +03:00
Mikhail Glukhikh 3febabe977 Use OPT_IN instead of EXPERIMENTAL in diagnostic names 2021-09-10 16:29:13 +03:00
Tianyu Geng 05fbed68e2 FIR checker: report PROPERTY_AS_OPERATOR 2021-09-10 07:07:43 +03:00
Tianyu Geng 4915d8dda3 FIR checker: support DUPLICATE_LABEL_IN_WHEN
Changes from FE1.0:
1. As discussed previously, no expression evaluation happens during this
check.
2. FE1.0 doesn't check redundant object comparisons.
2021-09-10 07:07:42 +03:00
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