Commit Graph

66 Commits

Author SHA1 Message Date
Victor Petukhov d9c50f0fda Report NON_VARARG_SPREAD on missed cases
^KT-48162 Fixed
2021-09-30 20:08:56 +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 e95de0a778 FIR checker: report type mismatch for named vararg arguement
ProhibitAssigningSingleElementsToVarargsInNamedForm is enabled from 1.3
so there is no need to make FIR accepting single element passed through
named arguments.

In addition, we may want to report only
ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION and not arg
type mismatch. But FE1.0 is reporting both so I am following it. If we
want to remove the redundant report, we will probably want to remove
FirNamedVarargChecker and report during resolution as a cone diagnostic.
2021-09-15 12:11:36 +03:00
Tianyu Geng 3708290ca3 FIR checker: fix NON_VARARG_SPREAD 2021-09-15 12:11:35 +03:00
Mark Punzalan 34e6459014 FIR: Ensure that the array set argument (on RHS of =) is always mapped
to the last parameter of the set operator function, even if there are
missing or too many index arguments.
2021-08-31 14:52:28 +03:00
Andrey Zinovyev 1cd321a90f [FIR] Add INAPPLICABLE_OPERATOR_MODIFIER diagnostic 2021-08-18 16:03:01 +03:00
Andrey Zinovyev 1cdbbad367 [FIR] ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION diag 2021-08-17 16:05:42 +03:00
Denis.Zharkov dac9d7b17a FIR: Mark a pack of tests (53) as FIR_IDENTICAL 2021-05-25 13:28:29 +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
Mikhail Glukhikh 3663884db2 FIR: support CONDITION_TYPE_MISMATCH diagnostic
We report CONDITION_TYPE_MISMATCH on
- loop conditions
- when branch conditions
- binary logic arguments
2021-05-20 12:22:20 +03:00
Ivan Kochurkin 525cc6df97 [FIR] Implement MANY_LAMBDA_EXPRESSION_ARGUMENTS diagnostics, fix tests 2021-04-28 16:21:48 +03:00
Ivan Kochurkin ad9b962536 [FIR] Fix tests (ARGUMENT_TYPE_MISMATCH instead of INCOMPATIBLE_CANDIDATE) 2021-04-12 23:49:55 +03:00
Denis.Zharkov 0637748f10 FIR: Introduce NAMED_PARAMETER_NOT_FOUND diagnostic 2021-04-05 12:58:07 +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 e1c80ac75c FIR checker: introduce NO_(GET|SET)_METHOD
Besides introducing new diagnostics, this commit unifies source usages
for array accesses in PSI & LT.
2021-03-24 16:25:01 +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
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
Mark Punzalan f6ce2d893c [FIR] Handle varargs in overloaded indexed access operator. 2020-10-02 12:08:01 +03:00
Victor Petukhov d02432cf93 Introduce warning for the changing arguments execution order for named varargs (KT-17691) 2020-10-01 12:15:13 +03:00
Victor Petukhov bcd33da6f8 Don't check an argument type during passing it to vararg in the named form to avoid false positives if the argument type is type variable yet
^KT-41144 Fixed
2020-09-10 19:38:26 +03:00
Jinseong Jeon 49679f3145 FIR: map arguments for overloading indexed access operator 2020-09-10 11:25:36 +03:00
Ivan Kylchik 0a28e5e031 Add argument unwrapping for case when argument is named 2020-08-04 08:59:15 +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
Dmitriy Novozhilov e696d1d06a [FIR] Improve mapping arguments to parameters 2020-02-14 17:53:28 +03:00
Dmitriy Novozhilov 389dcff125 [FIR] Discard argument with spread in place of non-vararg parameter 2020-02-14 09:18:54 +03:00
Mikhail Zarechenskiy 6b07ef42dd [NI] Update testdata for NI after switching language versions 2020-01-23 18:56:01 +03:00
Mikhail Zarechenskiy 8871c8b4fd Migrate diagnostic tests to 1.4 2019-12-26 15:08:51 +03:00
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Mikhail Zarechenskiy bcc8802014 [NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
2019-04-17 12:55:12 +03:00
victor.petukhov 46bd5ba107 Add alphabetical sorting diagnostics with same ranges 2019-02-14 12:31:42 +03:00
Dmitriy Novozhilov b9c5b63d69 Fix #KT-28993 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov c60bce88c2 Add test for #KT-28993 2019-02-07 12:12:34 +03:00
Mikhail Glukhikh f3555daa60 Report UNUSED_PARAMETER on main parameter in 1.3+ #KT-26999 Fixed 2018-10-25 19:10:39 +03:00
Mikhail Zarechenskiy 513b27f65f Make tests about varargs compatible with 1.2 and 1.3 versions 2018-07-06 15:23:33 +03:00
Mikhail Zarechenskiy 8757298994 Add diagnostics to test data from NI 2017-11-29 02:54:26 +03:00
Mikhail Zarechenskiy a71238bf94 Place !WITH_NEW_INFERENCE directive to diagnostics test data 2017-11-29 02:53:49 +03:00
Dmitry Savvinov f5d40a1c98 Fix testdata in varargs tests
Testdata have been changed since 1.2. due to KT-20171.
2017-10-11 14:06:54 +03:00
Alexander Udalov 8fe964f269 Resolve array access RHS always as the last argument of the call
Also do not attempt to match any of the arguments in the brackets with the last
parameter of the 'set' method

 #KT-10633 Fixed
2016-01-21 00:36:35 +03:00
Dmitry Jemerov e97e82d119 use terms "lambda expression" and "anonymous function" instead of "function literal" and "function expression" 2015-12-09 13:55:40 +01:00
Michael Nedzelsky bc5c9065d2 fix tests in org.jetbrains.kotlin.checkers 2015-09-08 02:04:32 +03:00
Stanislav Erokhin 5ded315cbb Improved error reporting for candidates with wrong parameter count 2015-09-01 23:37:42 +03:00
Svetlana Isakova 722a49767a Rename: TypeConstructorMismatch -> ParameterConstraintError 2015-07-10 15:05:12 +03:00
Dmitry Jemerov f374eec8f1 deprecating types after colon 2015-04-29 16:33:24 +02:00
Dmitry Jemerov 98b8784ab0 drop deprecated syntax for anonymous initializer blocks 2015-04-29 14:07:04 +02:00
Svetlana Isakova 7a5124215a Updated test data for Array<out T> vararg type 2014-12-12 23:08:28 +03:00
Andrey Breslav 0eee83b6ec Lazy logs removed 2014-11-21 18:59:45 +03:00
Svetlana Isakova 2a83053355 Updated lazy log tests 2014-11-21 14:02:45 +03:00
Stanislav Erokhin b7c473f59e Update lazy.log files 2014-11-17 17:45:01 +03:00