Commit Graph

21 Commits

Author SHA1 Message Date
Mark Punzalan d2b8204fdc FIR/FIR IDE: Use entire FirVariableAssignment when reporting UNSAFE_CALL
(e.g., `nullable.a = b`), and use positioning strategies to locate the
dot in the LHS expression.

Without it, only the callee reference is reported on, which makes the
highlighting of the error and application of quickfixes incorrect in the
IDE.

Also fixed issue with annotated and/or labeled expressions on LHS of
assignment (e.g., `(@Ann label@ i) = 34`).
2021-05-20 20:32:58 +02: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
Ilya Chernikov 6356807997 Reapply "Only create descriptors for candidates with lambda args"
#KT-36247 fixed
A lot of testdata changed because significanly less (error) descriptors
are created for unresolved types, so diagnostics became different.
2020-02-14 11:41:30 +01:00
Dmitry Petrov df6d4f358a KT-22274 report warning on labels that can't be referenced
Labels are meaningful only if they can be referenced by 'break',
'continue', or 'return' expressions.
2018-07-25 12:08:20 +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 Neverov cd24adac32 Detect redundant 'is' check
#KT-14187 Fixed
2017-05-15 11:24:35 +03:00
Ilya Ryzhenkov a717afd9db Fix NPE in checkLValue when selector is absent. Add test for incomplete syntax. 2015-08-12 17:08:16 +03:00
Alexey Sedunov df07a61a08 Control-Flow: Generate instruction for left-hand side of invalid assignments
#KT-8390 Fixed
2015-07-10 19:27:53 +03:00
Valentin Kipyatkov 7edff172a2 KT-1273 Unused assignment - should highlight assignment instead of expression
#KT-1273 Fixed
2015-05-19 23:45:59 +03:00
Dmitry Jemerov f374eec8f1 deprecating types after colon 2015-04-29 16:33:24 +02:00
Denis Zharkov 44a55e5bf6 Adjust testData to new labels syntax 2015-04-29 14:03:11 +03:00
Ilya Ryzhenkov 2f02024c24 checkLValue for array indexing expression should resolve set method #KT-7218 Fixed 2015-04-01 21:02:05 +03:00
Evgeny Gerashchenko a3fdce8131 Highlighting "as Foo" for useless casts in gray.
#KT-6070 fixed
2014-12-08 17:30:47 +03:00
Zalim Bashorov c767ffc3e7 Unit.VALUE -> Unit in testData 2014-07-25 17:16:40 +04:00
Svetlana Isakova 6e622f2301 Highlight all text ranges for diagnostics in tests 2014-06-21 12:26:32 +04:00
Svetlana Isakova e0f37bbef0 Generate parse error on label without name '@' 2014-05-20 15:07:03 +04:00
Andrey Breslav 1e2eb6dfa1 Special instructions added for calls and other constructs 2013-12-05 13:00:44 +04:00
Evgeny Gerashchenko b9e5704057 Updated test data and stdlib sources. 2013-02-13 18:08:37 +04:00
Alexander Udalov 43c37398af Labeled this & super to nested class' outer is an error
#KT-1174 In Progress
2013-01-16 23:11:42 +04:00
Andrey Breslav 5eaa5b396b Removing usages of tuples from test data
(KT-2358 Drop tuples)
 #KT-2358 In progress
2012-09-18 20:27:09 +04:00
Andrey Breslav 3d8d92c7d3 JetDiagnosticsTest migrated to TestGenerator
- test data files renamed from *.jet to *.kt
2012-07-10 14:48:11 +04:00