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
Ivan Kochurkin
e57108d4e8
[FIR] Implement ASSIGNMENT_TYPE_MISMATCH, RESULT_TYPE_MISMATCH diagnostics, fix tests
2021-05-17 22:33:16 +03:00
Andrey Zinovyev
e74141ded6
[FIR] Properly check spread constant argument
2021-05-13 10:13:21 +03:00
Jinseong Jeon
24d792fb49
FIR checker: warn useless elvis
2021-04-22 13:10:54 +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
Mikhail Glukhikh
f0ff9ad5a7
FIR: rename AMBIGUITY to OVERLOAD_RESOLUTION_AMBIGUITY to match FE 1.0
2021-04-02 16:22:01 +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
Jinseong Jeon
bfc7eb7bab
FIR checker: fix REFERENCE_BY_QUALIFIED positioning strategy to consider callable reference
2021-03-26 15:19:10 +03:00
Tianyu Geng
bdeecfc188
FIR: check multiple vararg param and forbidden vararg type
2021-02-24 13:50:46 +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
Mikhail Glukhikh
9b30655d66
[FIR] Load Java annotations named arguments properly (see KT-43584)
2020-11-30 13:05:23 +03:00
Victor Petukhov
90ea64a0e5
Don't report warning about changing execution order for varargs if it's inside an annotation
...
^KT-43110 Fixed
2020-11-05 13:18:00 +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
Dmitriy Novozhilov
7f692be11e
[FIR] Properly detect callable reference type according conversions
2020-09-11 12:13:33 +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
Ivan Kylchik
0a28e5e031
Add argument unwrapping for case when argument is named
2020-08-04 08:59:15 +03:00
Dmitriy Novozhilov
721b9b4d8c
[FIR] Resolve annotations as calls
2020-08-04 08:59:14 +03:00
Jinseong Jeon
0e54f98b79
FIR: support adapted callable reference with vararg
2020-08-03 16:37:36 +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
Victor Petukhov
cca64b8fab
NI: use the inferred type to check of nullable array for vararg
...
^KT-40555 Fixed
2020-07-27 18:24:31 +03:00
simon.ogorodnik
f573719cc1
[FIR] Fix missing receiver type if anonymous function without label
2020-04-08 14:56:17 +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
simon.ogorodnik
f9483b1f4f
[FIR] KT-37027: Add 'out' projection to vararg elements
2020-02-27 19:07:17 +03:00
Dmitriy Novozhilov
e696d1d06a
[FIR] Improve mapping arguments to parameters
2020-02-14 17:53:28 +03:00
simon.ogorodnik
34e6649d31
[FIR] Harden check of argument type properly
...
Before this commit, nullable argument could match not null parameter.
Now we require also correct nullability that breaks some cases
2020-02-03 16:45:18 +03:00
Mikhail Zarechenskiy
8871c8b4fd
Migrate diagnostic tests to 1.4
2019-12-26 15:08:51 +03:00
Dmitriy Novozhilov
7fed7a840b
[NI] Update some testdata broken in NI
2019-12-20 11:17:47 +03:00
Dmitriy Novozhilov
ee36fb903f
Allow use expression of array type as named argument for vararg
2019-12-19 10:22:44 +03:00
Dmitriy Novozhilov
2536fa0cd5
[FIR-TEST] Add new testdata generated after changes in previous commit
2019-12-12 16:11:46 +03:00
Pavel Kirpichenkov
f80a71517f
[NI] Handle vararg parameter in reflection type wrt array types
...
Vararg parameter in reflection type is interpreted as covariant
array type against array in expected functional type and as
vararg element type otherwise. For instance having function
fun foo(vararg args: Int): Unit { /*...*/ }
reference ::foo can be passed against expected
(Int) -> Unit,
(Int, Int) -> Unit, etc.
In none of such cases type for parameter in foo's reflection type
should be changed to array.
However, against expected type (IntArray) -> Unit args' type
must become IntArray.
^KT-25514 Fixed
2019-11-21 20:07:14 +03:00
Mikhail Zarechenskiy
787a8bb9bd
Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
...
This reverts commit 7c4101e21c .
#KT-31866 Fixed
#KT-31868 Fixed
#EA-125401 Fixed
#KT-25290 Open
2019-06-07 12:31:38 +03:00
Dmitriy Novozhilov
7c4101e21c
[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI
2019-05-29 10:35:46 +03:00
Mikhail Zarechenskiy
848640253a
Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
...
This reverts commit f20ec3e0a6 .
2019-05-29 01:31:28 +03:00
Dmitriy Novozhilov
f20ec3e0a6
[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI
...
There is added a new service named `SubstitutingScopeProvider`, that
provides factory that creates captured types and approximator for them.
In OI they are the same as before commit, for NI they are empty, because
that approximation interferes with NI algorithm
That service is injected into function descriptors and property descriptors
and used for creating `SubstitutingScope` with correct services
Also there is changed time when we approximate captured types in NI
(after all call checkers)
#KT-25290 Fixed
2019-05-28 11:18:33 +03:00
Dmitriy Novozhilov
d8cbeb8d15
Add regression test for SPREAD_OF_NULLABLE diagnostic
...
#KT-30808 Fixed
2019-04-05 14:17:34 +03:00
Dmitriy Novozhilov
2ba33c3b8a
Fix testdata broken in 46bd5ba
2019-02-21 12:04:23 +03:00
victor.petukhov
46bd5ba107
Add alphabetical sorting diagnostics with same ranges
2019-02-14 12:31:42 +03:00
Dmitriy Novozhilov
7f48897e21
Add NON_VARARG_SPREAD and SPREAD_OF_NULLABLE diagnostics to new inference
2019-01-24 10:53:58 +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
6dc36055b8
Make diagnostic about redundant spread in @Foo(s = *[A]) more clear
2018-07-06 15:54:23 +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
c032a02373
Prohibit assigning single elements into varargs in named form
...
#KT-20588 Fixed
#KT-20589 Fixed
2018-07-06 15:23:31 +03:00
Mikhail Zarechenskiy
6086cd2cf4
Prohibit non-const expressions through varargs in annotations
...
Fixes #KT-23153 for Kotlin 1.3
The problem was in the type check of expression type against expected type. When feature `AssigningArraysToVarargsInNamedFormInAnnotations` (KT-20171) appeared, expected type could be wrong, which led to failed type check
2018-03-22 04:03:04 +03:00
Dmitry Savvinov
8e50a58408
[NI] New failing test after changes in applicabilities
2017-12-07 12:49:56 +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
Mikhail Zarechenskiy
69e3dd89f6
Split diagnostic factory for the ease of code evolution and tooling
2017-09-26 14:49:42 +03:00