Commit Graph

400 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 877b53201b [FIR] Prohibit access to members of companion of enum from enum entry initializer
^KT-49110
2021-10-29 18:45:23 +03:00
Tianyu Geng b48870c11f FIR checker: pass expected array type in ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION
This is needed by the IDE quickfix to generate the correct `arrayOf` (or
`intArrayOf`, etc`) wrapper call.
2021-10-28 16:36:02 +03:00
Dmitriy Novozhilov 4490f64666 [FIR] Get rid of FirAnnotatedDeclaration
Now all fir declarations have annotations

^KT-49260 Fixed
2021-10-28 15:01:18 +03:00
Ilya Chernikov da2d3f29da Add multiple renderer sources support to new diagnostics infrastructure 2021-10-27 22:17:41 +02:00
Ilya Chernikov d3f3aa4b29 Move specific diagnostics infrastructure to frontend.common-psi 2021-10-27 22:17:40 +02:00
Ilya Chernikov e9f59e8d1d Move common diagnostics infrastructure to frontend.common 2021-10-27 22:17:39 +02:00
Ilya Chernikov a65beb2dc5 Move Fir*SourceElement to frontend.common, rename to Kt* (complete) 2021-10-27 21:44:11 +02:00
Mikhail Glukhikh 8bd0b237b7 Convert EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR into deprecation error
#KT-28078 Fixed
2021-10-27 19:43:01 +03:00
Tianyu Geng a969e5af50 FIR: fix API mode checker for local functions 2021-10-27 19:42:52 +03:00
Dmitriy Novozhilov f26059a7d3 [FE] Add clear warning about future changes about nullability of safe call with non nullable receiver
^KT-46860
2021-10-27 16:28:37 +03:00
Tianyu Geng 363b25504d FIR checker: report REDUNDANT_LABEL_WARNING
Since many labels are not present in the FIR tree, this checker is
implemented as a syntax checker. Comparing with FE1.0, this change
reports some REDUNDANT_LABEL_WARNING that FE1.0 has missed, especially
LHS of assignments.
2021-10-25 13:51:01 +03:00
Dmitriy Novozhilov 06a26a5a74 [FE 1.0/FIR] Fix message of SEALED_SUPERTYPE_IN_LOCAL_CLASS diagnostic
^KT-46285 Fixed
2021-10-21 19:39:49 +03:00
Dmitriy Novozhilov 94664694df [FIR] Prohibit confusing syntax inside when branches
^KT-48385
2021-10-21 19:39:46 +03:00
Mikhail Glukhikh 7962acd3e2 FIR: temporarily downgrade NO_EXPLICIT_VISIBILITY_IN_API_MODE to warning
This commit is intended to fix broken bootstrap build
2021-10-21 11:44:44 +03:00
Tianyu Geng c262f17d75 FIR checker: report violations related to API mode 2021-10-21 00:01:14 +03:00
Tianyu Geng 52b247937e FIR checker: fix positioning of CONFLICTING_IMPORT
FE1.0 puts it on the alias when applicable.
2021-10-21 00:00:29 +03:00
Tianyu Geng bdc71a3281 FIR IDE: pass candidate super types for AMBIGUOUS_SUPER
This way the IDE quickfix do not need to do resolution again to figure
out what super type to offer in the quickfix.
2021-10-20 19:16:48 +02:00
Nikolay Lunyak dbfe3524ce [FIR] Add FirDelegateUsesExtensionPropertyTypeParameterChecker 2021-10-20 16:49:51 +03:00
Nikolay Lunyak f97e666608 [FIR] Add property delegate positioning strategy 2021-10-20 16:49:48 +03:00
Roman Golyshev d3e2f9a3f6 [FIR IDE] Fix bug in diagnostics' combining during code generation 2021-10-12 19:21:11 +00:00
Ivan Kochurkin 6c7c1a7a0d [FIR] Convert REDUNDANT_MODIFIER, DEPRECATED_MODIFIER_PAIR to warnings ^KT-49073 Fixed 2021-10-08 18:52:18 +03:00
Denis.Zharkov 1c16f2f8c9 Fix ClassCastException at FirUninitializedEnumChecker 2021-10-07 17:26:29 +03:00
Tianyu Geng 826ea122a9 FIR checker: DSL_SCOPE_VIOLATION 2021-10-05 15:30:37 +03:00
Ivan Kochurkin 75b40e4b75 [FIR] Add INVISIBLE_SETTER 2021-10-03 17:10:06 +03:00
Tianyu Geng 5c716ea979 FIR checker: report NOT_A_FUNCTION_LABEL 2021-10-01 17:21:39 +03:00
Victor Petukhov 01e853fb9b Introduce error for SUPER_CALL_FROM_PUBLIC_INLINE
^KT-45378 Fixed
2021-09-30 20:08:36 +03:00
Mikhail Glukhikh ac3b738d9b FIR: report OPT_IN_OVERRIDE(_ERROR) diagnostics 2021-09-29 19:39:25 +03:00
Mikhail Glukhikh 4052befe88 Make OPT_IN_USAGE_ERROR an error in FIR 2021-09-29 19:39:24 +03:00
Mikhail Glukhikh 3045a5e920 FIR: implement OPT_IN_MARKER_ON_WRONG_TARGET 2021-09-29 19:39:20 +03:00
Tianyu Geng 5252effb10 FIR checker: report tailrec problems on the keyword
FE1.0 reports it on the declaration signature. This is not ideal so we
move it to the `tailrec` keyword in FIR.
2021-09-28 22:30:09 +03:00
Tianyu Geng 951812f130 FIR checker: record whether type mismatch is due to nullability
This is useful for downstream quickfixes.
2021-09-17 01:59:01 +03:00
Tianyu Geng 76e192fc8a FIR Checker: check AMBIGUOUS_ANONYMOUS_TYPE_INFERRED
Also change
org.jetbrains.kotlin.fir.types.TypeUtilsKt#hideLocalTypeIfNeeded to skip
approximating anonymous objects if there are multiple super type refs so
that resolution behaves the same (for uncompilable code).

Note that this change does not implement check for
ApproximateAnonymousReturnTypesInPrivateInlineFunctions as the check is
already turned on in 1.5 and will likely not needed when FIR becomes
stable.
2021-09-16 22:38:06 +03:00
Tianyu Geng dfc36ec614 FIR checker: ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_(ANNOTATION|FUNCTION) 2021-09-15 12:11:41 +03:00
Tianyu Geng 8525b4932b FIR Checker: check tailrec
Difference from FE1.0
* KT-4285: calls to virtual method with default argument should be
  reported as not tailrec. FE1.0 is missing such cases.
* KT-48600: calls inside lambda should be reported as not tailrec. FE1.0
  also misses such cases.
2021-09-14 23:48:50 +03:00
Ivan Kochurkin a816bd9a33 [FIR] Add JVM_INLINE_WITHOUT_VALUE_CLASS, VALUE_CLASS_WITHOUT_JVM_INLINE_ANNOTATION 2021-09-13 20:49:00 +03:00
Ivan Kochurkin 7e7066d75e [FIR] Add FUNCTION_DELEGATE_MEMBER_NAME_CLASH 2021-09-13 20:48:59 +03:00
Ivan Kochurkin a5caa14255 [FIR] Add SPREAD_ON_SIGNATURE_POLYMORPHIC_CALL 2021-09-13 20:48:59 +03:00
Ivan Kochurkin 5760a94ab4 [FIR] Add CONCURRENT_HASH_MAP_CONTAINS_OPERATOR 2021-09-13 20:48:58 +03:00
Ivan Kochurkin 0ffd6ccb34 [FIR] Add SUSPENSION_POINT_INSIDE_CRITICAL_SECTION 2021-09-13 20:48:57 +03:00
Ivan Kochurkin e97933a9e5 [FIR] Add POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION 2021-09-13 20:48:55 +03:00
Ivan Kochurkin dd46c36b24 [FIR] Add SUBCLASS_CANT_CALL_COMPANION_PROTECTED_NON_STATIC 2021-09-13 20:48:54 +03:00
Dmitriy Novozhilov 5769d42248 [FIR] Fix all usages of annotations due to new FirAnnotation hierarchy 2021-09-13 13:53:12 +03:00
Dmitriy Novozhilov 4b662a42a1 [FIR] Rename FirAnnotationCall to FirAnnotation 2021-09-13 13:53:09 +03:00
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 66beecfb18 [FIR] Improve backing field diagnostics positioning 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