Commit Graph

137 Commits

Author SHA1 Message Date
Tianyu Geng 10d4dfef04 FIR: check subclass of sealed class 2021-08-25 14:37:24 +03:00
Ivan Kochurkin cd6384eb20 [FIR] Fix handling of WRONG_MODIFIER_TARGET
Implement DEPRECATED_MODIFIER, DEPRECATED_MODIFIER_FOR_TARGET, REDUNDANT_MODIFIER_FOR_TARGET
2021-08-13 18:32:27 +03:00
Ivan Kochurkin fd92b851a2 [FIR] Implement PACKAGE_OR_CLASSIFIER_REDECLARATION
Fix REDECLARATION positioning
2021-08-10 15:09:25 +00:00
Andrey Zinovyev 015c2d1875 [FIR] Add NOTHING_TO_INLINE diagnostic 2021-08-04 17:33:08 +03:00
Stanislav Erokhin 748a2d2e7c [MPP] Performance optimization in expect/actual checker
Previously, the checker executed for every declaration i.e. every
declaration was considered as expect declaration. Because of that in
some cases this checker could eat 6% of compilation time.
After this commit only declarations marked with expect or actual
are checked. To achieve that, logic, that do reporting about missing
actual modifier was moved to the Actual part.

Please note, that in cases where there is no expect/actual modifier at
all other errors (like redeclaration and missing body on "actual"
declaration) would be reported.

Useful nodes:
- In this checker reportOn is always the same as
descriptor.sourceElement.ktElement. This is because the only case when
it isn't true is PropertyAccessors and they are filtered
- Annotation constructor descriptor isActual == true all the time
- previously for weak incompatible members ACTUAL_MISSING
was not reported
- the logic here is super complicated and crazy, but I don't think that
there is sense to refactor it in the old FE
2021-08-04 15:19:34 +03:00
Ivan Kochurkin d4e1cded59 [FIR] Implement RESOLUTION_TO_CLASSIFIER 2021-07-28 23:18:38 +03:00
Dmitriy Novozhilov 9b3b386f0a [FIR IDE] Ignore HMMP compiler test 2021-07-20 10:33:54 +03:00
Dmitriy Novozhilov c3060e861f [FIR] Add expect actual checker 2021-07-20 10:33:49 +03:00
Denis.Zharkov ddbdfafa79 Remove OI/NI attributes from test data 2021-05-25 13:28:27 +03:00
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00
Dmitriy Novozhilov e08df2c530 [Test] Add diagnostics and codegen tests with hmpp module structure 2021-05-19 00:52:31 +03:00
Dmitriy Novozhilov 06b2efe65f [Test] Introduce new syntax for dependsOn dependencies 2021-05-19 00:52:27 +03:00
zadorotskas 334d0a8b5a FIR: introduce three diagnostics for const val 2021-04-13 21:36:46 +03:00
Dmitriy Novozhilov 803d47daaa Distinguish classes from different sourcesets in SealedInheritorInSameModuleChecker
#KT-45848 Fixed
#KT-46031
2021-04-13 11:21:58 +03:00
Dmitriy Novozhilov a107e3d160 Support actualization of expect sealed class with typealias in CliSealedClassInheritorsProvider 2021-04-06 11:40:40 +03:00
Dmitriy Novozhilov 1633190478 Refine expect classes in CliSealedClassInheritorsProvider
KT-45796 Fixed
2021-04-06 11:40:36 +03:00
Tianyu Geng 761a0a7d0d FIR checkers: report specific errors instead of INAPPLICABLE_CANDIDATE
Specifically, the report the following 4 errors.

* NON_VARARG_SPREAD
* ARGUMENT_PASSED_TWICE
* TOO_MANY_ARGUMENTS
* NO_VALUE_FOR_PARAMETER

Also added/updated the following position strategies.
* NAME_OF_NAMED_ARGUMENT
* VALUE_ARGUMENTS
2021-04-02 14:36:14 +03:00
Dmitriy Novozhilov cd890d5833 [Test] Disable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:29 +03:00
Tianyu Geng 56bec6997c FIR checker: report SUPERTYPE_NOT_INITIALIZED
Combined this and the checker of
SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR together.

Also fixed SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR incorrectly
repoted as warning instead of error.
2021-03-24 17:48:39 +03:00
Mikhail Glukhikh 9ce8420491 FIR: introduce not implemented checker 2021-03-24 16:07:25 +03:00
Mikhail Glukhikh a26a195c35 Add FIR_IDENTICAL to some tests 2021-03-24 16:02:09 +03:00
Ilmir Usmanov 3bcc2fe476 Minor. Add IDE MPP test 2021-03-22 11:13:14 +00:00
Ilmir Usmanov 164e9034d1 IC MPP: Allow expect value classes without @JvmInline
#KT-45525 Fixed
2021-03-22 11:13:13 +00:00
Tianyu Geng be0dd84a06 FIR: check NAMED_ARGUMENTS_NOT_ALLOWED
The check has already been partially implemented in
org.jetbrains.kotlin.fir.resolve.calls.FirCallArgumentsProcessor. This
change completes the missing piece that determines if a `FirFunction`
has stable parameter names.
2021-03-11 22:57:57 +03:00
Jinseong Jeon d2da15e039 FIR checker: report (expected|unnecessary) lateinit 2021-03-11 13:25:51 +03:00
eugenpolytechnic f6e564ffa6 FIR: introduce inline classes checks 2021-03-06 09:22:34 +03:00
Jinseong Jeon e009b71f88 FIR checker: report uninitialized member/extension properties 2021-03-04 17:56:29 +03:00
Ilmir Usmanov 62123d72e2 IC: Add inline class -> @JvmInline value class warning 2021-02-25 16:06:47 +01:00
Dmitriy Novozhilov 4222bb9af2 [FE] Make whens on expect sealed classes and enums not exhaustive 2021-02-25 14:56:08 +03:00
Mikhail Glukhikh 239a44b30c FIR: forbid reporting inapplicable-likes on implicit constructors 2021-02-19 18:24:46 +03:00
Dmitriy Novozhilov f3a8fcaea6 [FE] Make constructors of sealed classes protected instead of internal 2021-02-12 13:36:38 +03:00
Dmitriy Novozhilov f14bd87ecc [Test] Update testdata of diagnostic tests during to change language to 1.5
Mostly this commit contains changes of descriptor dump of sealed classes
  tests according to changed visibility of sealed class constructor
2021-01-28 13:19:24 +03:00
Jinseong Jeon 97241599bf FIR checker: add support diagnostic: EXPECTED_PRIVATE_DECLARATION 2021-01-27 19:46:06 +03:00
Jinseong Jeon 57c8dd86a0 FIR checker: introduce top-level property checkers
Also, refactor property initializer checking so that those
newly added property checkers as well as member property checker
can share the same logic
2021-01-27 19:46:06 +03:00
Jinseong Jeon f9378a3ab7 FIR checker: add diagnostic EXPECTED_DECLARATION_WITH_BODY 2021-01-27 19:46:06 +03:00
Jinseong Jeon 9341ca3004 FIR checker: introduce top-level function checker 2021-01-27 19:46:05 +03:00
Jinseong Jeon f1d8a6e5d1 FIR checker: introduce DECLARATION_SIGNATURE_OR_DEFAULT positioning strategy
and fix CONFLICTING_OVERLOADS to use it
2021-01-21 16:06:09 +03:00
Jinseong Jeon 39df3e2b0a FIR checker: introduce member function checker 2021-01-15 14:38:35 +03:00
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00
Jinseong Jeon 5167d69b7c FIR checker: introduce member property checker 2020-12-04 16:58:30 +03:00
sebastian.sellmair 06cb64bb51 Allow open callable members in expect interfaces
#KT-42094 fixed
2020-11-11 17:41:59 +00:00
Nick 4669e019d1 [FIR] Add diagnostic CONFLICTING_OVERLOADS & REDECLARATION 2020-08-10 10:09:37 +03:00
Nick f74eb07203 [FIR] Fix incorrect diagnostic behaviour + several enum diagnostics 2020-08-04 22:28:49 +03:00
Nick 0f213e58db [FIR] Add diagnostic for primary constructor not called 2020-08-04 22:28:48 +03:00
Nick bb0e1b7390 [FIR] Add diagnostic for constructor delegation cycles 2020-08-04 22:28:48 +03:00
Dmitriy Novozhilov f283f2db43 [FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible
Also introduce few new diagnostics:
- NONE_APPLICABLE more many inapplicable candidates
- HIDDEN for visible candidates
2020-07-28 20:46:56 +03:00
Nick c4b7ac994b [FIR] Support diagnostic ABSTRACT_SUPER_CALL 2020-04-20 18:33:40 +03:00
Dmitriy Novozhilov 7f02d57d88 [FIR] Correctly detect super type in delegated constructor call 2020-04-17 12:37:29 +03:00
FenstonSingel b7d8e879a6 [FIR] Support 4 diagnostics for pairs of modifiers
In particular, this commit includes:
* Attempt to abstract access to FirSourceElement via FirModifier
* Add more visit functions to DeclarationCheckersDiagnosticComponent
* Add messages+factories for 4 modifier-related errors and warnings
* Introduce FirModifierChecker
2020-03-27 12:34:29 +03:00
Mikhail Glukhikh 8884cbe415 Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed 2020-03-05 09:39:40 +03:00