Mikhail Zarechenskiy
3afd4a2f4a
[NI] Record all diagnostics from subcalls resolution results
2018-02-14 14:58:04 +03:00
Dmitry Savvinov
ea72c76a37
[NI] Testdata changes after fixes in error types
2017-12-07 12:49:56 +03:00
Mikhail Zarechenskiy
328c67b9e8
Add separate diagnostic renderer results for tests with NI
2017-11-29 02:54:30 +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
Denis Zharkov
1f9d56439a
Fix KNPE caused by optimizations in control-flow analysis
...
The problem is that when performing full analysis we do it in
a backward order while result for trivial vals is filled
in a forward one.
It turns out that reversedInstuctions might return a superset of
forward traversed instructions, e.g. in case of dead code in lambda.
At the same time result for trivial vals is constant
for any instruction, thus we can just return its constant value
and use it in the full analysis
#KT-20895 Fixed
2017-11-14 16:38:28 +03:00
Denis Zharkov
a51078fda6
Turn off optimizations in case of do-while presence
2017-10-02 10:04:16 +03:00
Denis Zharkov
c31b5beb9e
Remove redundant check for a variable being initialized after write
...
It's anyway is obvious for write instruction, while effectively
after optimizations we treat val with syntactic initializer
uninitialized until their immediate initiazer
2017-10-02 10:04:16 +03:00
Denis Zharkov
527daced46
Optimize CFG for cases of simple variables
...
Parameters/vals with an immediate initializer (which we assume is a
rather common situation) do not require any kind of complicated CFA
- Unused vals can be simply determined by linear traversal of
the pseudocode
- Definite assignment is a bit more complicated: a read-instruction of val
can be considered as a safe if it's located *after* the first write in
the pseudocode. It works almost always beside the case with do/while
(see the test changed). This case will be fixed in the further commits
The test for kt897.kt will also be fixed further, all other changes
might be considered as minor as they mostly change diagnostics for
already red code
2017-10-02 10:04:16 +03:00
Dmitry Petrov
2b27e64fc8
Improve diagnostics for "not yet supported in inline"
...
- Tell user what exactly is not supported (e.g., local inline function)
- Reduce diagnostics range to a keyword or an identifier
where appropriate
#KT-16223 Fixed Target versions 1.1.50
2017-09-06 09:46:33 +03:00
Mikhail Zarechenskiy
2d3ce89afc
Use only completed arguments of special call
2017-07-13 12:26:03 +03:00
Dmitry Neverov
cd24adac32
Detect redundant 'is' check
...
#KT-14187 Fixed
2017-05-15 11:24:35 +03:00
Mikhail Zarechenskiy
7530a9426f
Warn about val reassignment via backing field
...
#KT-16681 In Progress
2017-05-05 21:30:37 +03:00
Mikhail Glukhikh
14886827a2
Introduce warning REDUNDANT_ELSE_IN_WHEN #KT-17497 Fixed
2017-05-04 14:17:41 +03:00
Mikhail Glukhikh
b5d0de7c3f
Add test for KT-17479 looks like #KT-17479 Fixed
...
(after CAPTURED_MEMBER_VAL_INITIALIZATION introduction)
2017-05-02 19:59:43 +03:00
Mikhail Glukhikh
28283bad3e
Introduce special CAPTURED_VAL_INITIALIZATION for members
2017-05-02 19:59:37 +03:00
Mikhail Glukhikh
56e633e345
CFA: detect captured writes more precisely
...
So #KT-14381 Fixed
So #KT-13597 Fixed
Also refactors captured writes detection inside DFA
2017-05-02 19:59:23 +03:00
Mikhail Glukhikh
8fa739ed0f
Test for KT-14381 and KT-13597
2017-05-02 19:02:01 +03:00
Mikhail Glukhikh
14e798a1fc
Take imported from object descriptor into account in pseudocode
...
So #KT-15566 Fixed
2017-04-27 15:27:41 +03:00
Mikhail Glukhikh
7a53b2f4c8
Introduce UNUSED_ANONYMOUS_PARAMETER for anonymous functions
...
It is not reported for 1.0 language version because
renaming to _ is not possible. It has weak warning severity
So #KT-8813 Fixed
So #KT-16875 Fixed
2017-04-04 14:23:30 +03:00
Mikhail Glukhikh
b81268cca1
Control-flow analysis: do-while scope is ended after condition but before jump #KT-15334 Fixed
2017-01-10 17:57:43 +03:00
Mikhail Zarechenskiy
e67543e08e
Revert "Update test data as operator 'mod' became deprecated"
...
This reverts commit 040f4e90ce .
2016-12-14 15:29:00 +03:00
Mikhail Zarechenskiy
040f4e90ce
Update test data as operator 'mod' became deprecated
...
Revert this commit after changing 'mod' to 'rem' in stdlib
2016-12-09 16:59:25 +03:00
Mikhail Glukhikh
a19d178867
Initialization analysis : more accurate handling of non-local variables while merging data #KT-14304 Fixed
2016-10-20 19:52:44 +03:00
Valentin Kipyatkov
41ee06ec96
Use parameter names in DescriptorRenderer
2016-10-11 23:38:49 +03:00
Mikhail Glukhikh
436b0ec873
CFA merge for definition / initialization : more accurate handling of unknown variables #KT-13969 Fixed
...
(cherry picked from commit 4a96589)
2016-09-29 15:56:47 +03:00
Mikhail Glukhikh
025d063b27
UNNECESSARY_LATEINIT: do not report if property is not initialized at use-site #KT-13806 Fixed
...
(cherry picked from commit 09c0865)
2016-09-27 18:49:02 +03:00
Mikhail Glukhikh
4da9a101cf
UNNECESSARY_LATEINIT warning introduced #KT-13295 Fixed
...
(cherry picked from commit 88f9938)
2016-09-27 18:48:50 +03:00
Alexander Udalov
090d157f86
Update test data for data classes
2016-09-15 16:45:48 +03:00
Mikhail Glukhikh
f8039249c6
CFA: additional jumps to catch / finally generated in the end of try / before exits from try #KT-5469 Fixed
...
Also #KT-13612 Fixed
(cherry picked from commit 7c188b3)
2016-08-31 19:28:09 +03:00
Mikhail Glukhikh
6a9d058db4
UNUSED_VALUE is now reported on expression only if this expression is unused in all (e.g. finally) branches #KT-9825 Fixed
...
(cherry picked from commit aac8e94)
2016-08-31 19:28:00 +03:00
Mikhail Glukhikh
25eefdb6ec
Pseudocode label now cannot be bound to a non-owning pseudocode #KT-13555 Fixed
...
Also EA-77641 Fixed
(cherry picked from commit 07643ce)
2016-08-25 10:32:04 +03:00
Mikhail Glukhikh
d08d8af407
USELESS_ELVIS_RIGHT_IS_NULL : build fix (add to different files in DiagnosticsTestGenerated), do not report if USELESS_ELVIS already exists
...
(cherry picked from commit c71b656)
2016-08-23 16:26:54 +03:00
Mikhail Glukhikh
1c5c6506ce
Report of UNINITIALIZED_ENUM_COMPANION also for implicit receivers #KT-11769 Fixed
2016-08-12 15:06:43 +03:00
Mikhail Glukhikh
04f71bccf2
KT-11769 case with companion function call: error is now detected if companion receiver is stated explicitly
2016-08-12 15:06:38 +03:00
Mikhail Glukhikh
30fd22499b
Test data fix (after cherry-pick from 1.0.4)
2016-08-09 10:32:15 +03:00
Mikhail Glukhikh
b668206aa7
Minor: test comment, relevant to KT-13322
...
(cherry picked from commit 7606b1d)
2016-08-09 10:28:49 +03:00
Mikhail Glukhikh
13e64c18d9
Correct CFA order for enums: first own members, then entries, and at last companion object members #KT-6054 Fixed
...
(cherry picked from commit 94d3b4c)
2016-08-09 10:28:27 +03:00
Alexander Udalov
1bc7b4e363
Fix test data
2016-08-08 21:48:10 +03:00
Mikhail Glukhikh
0c98231f53
Report UNINITIALIZED_VARIABLE also for qualified object property #KT-12809 Fixed
...
(cherry picked from commit 7b2857f)
2016-08-08 17:48:08 +03:00
Mikhail Glukhikh
35446037bb
UNINITIALIZED_ENUM_ENTRY compiler warning introduced #KT-2349 Fixed
...
(cherry picked from commit 76ac6d1)
2016-08-08 17:47:56 +03:00
Nikolay Krasko
300e0acd27
Report RETURN_NOT_ALLOWED and RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY only on the return with label (KT-13340)
...
#KT-13340 Fixed
2016-08-05 13:16:05 +03:00
Stanislav Erokhin
7389d412a5
Fixed visibility check on a property with private setter of the subclass
...
#KT-3689 Fixed
2016-06-22 19:42:08 +03:00
Mikhail Glukhikh
5ccbf47531
Elvis / if / when now infer error type in case of ErrorType + Nothing #KT-6665 Fixed
...
(cherry picked from commit 9a50a0b)
2016-06-17 16:43:24 +03:00
Mikhail Glukhikh
be40cf8138
KT-12152 : constructor consistency: distinguish properties with and w/o backing fields, with default / custom accessors
2016-06-03 09:45:49 +03:00
Denis Zharkov
d0acb3674a
Fix rendered testData
...
New members in enum member scope
2016-05-16 15:38:13 +03:00
Mikhail Glukhikh
d24528f6bb
Control flow analysis: nested finally blocks now appear in correct order in CFG #KT-4764 Fixed
2016-04-22 15:16:57 +03:00
Mikhail Glukhikh
b7e8f71367
Fix of getCorrespondingLoop for complex loop / try-finally trees #KT-8246 Fixed
2016-03-30 18:49:23 +03:00
Mikhail Glukhikh
32e7f9e58f
Correct handling of local class / anonymous object cases for KT-10445 / KT-10042
2016-03-23 15:04:09 +03:00
Mikhail Glukhikh
b975b7d26e
More accurate CFG for local class constructors (now they are not considered unconditionally executed) #KT-10042 Fixed
2016-03-23 15:04:05 +03:00