Commit Graph

32 Commits

Author SHA1 Message Date
Andrey Zinovyev b706e776ad [FIR] Add VARIABLE_WITH_NO_TYPE_NO_INITIALIZER diagnostic 2021-07-28 16:56:53 +03:00
Mikhail Glukhikh bf40c07cc3 FIR: drop questionable DiagnosticKind.NotRootCause 2021-07-06 18:43:16 +03:00
Tianyu Geng 768ddea18f FIR checker: ILLEGAL_DECLARATION_IN_WHEN_SUBJECT 2021-07-06 18:27:47 +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 cd890d5833 [Test] Disable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:29 +03:00
Dmitriy Novozhilov 85949b387e [Test] Explicitly enable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:28 +03:00
Jinseong Jeon f1fa290d49 FIR checker: report val reassignment 2021-03-03 12:27:11 +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 8dd9d98129 [FIR] Implement checker for exhaustive when's in expression position 2021-02-09 16:04:40 +03:00
Mikhail Glukhikh 7d4eaefd36 FIR: report UNSAFE_CALL on dot when possible 2021-01-29 16:55:26 +03:00
Jinseong Jeon e72ddbcbfe FIR checker: differentiate UNSAFE_CALL from INAPPLICABLE_CANDIDATE
To do so, inside the root cause of inapplicable candidate errors,
we will record expected/actual type of receiver, if any.
That will help identifying inapplicable calls on nullable receiver.
2021-01-29 16:54:23 +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 26458875d5 [FIR] Add checker for uninitialized properties 2020-06-19 15:53:09 +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
Mikhael Bogdanov 32bcab2867 Switch rest of test to new scheme with configuration kind processing 2020-03-04 14:51:21 +01:00
Dmitriy Novozhilov 6735cc8937 [FIR] Implement new bound smartcast algorithm
#KT-36055 Fixed
2020-02-12 10:17:45 +03:00
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Dmitriy Novozhilov 14d6f8009d [NI] Update diagnostic messages in testdata 2019-08-01 14:37:54 +03:00
victor.petukhov 46bd5ba107 Add alphabetical sorting diagnostics with same ranges 2019-02-14 12:31:42 +03:00
Dmitriy Novozhilov 42b333f6fd Update some testdata according to new inference behaviour 2019-01-24 10:53:58 +03:00
Dmitry Petrov b4dc3dc91b Fix exhaustiveness check for when with subject variable 2018-06-20 14:06:34 +03:00
Dmitry Petrov 67247ee490 'val' in 'when' subject can't have modifiers (annotations are ok) 2018-06-20 14:06:34 +03:00
Dmitry Savvinov 148d03e365 Add some data flow analysis tests on when 2018-06-20 14:06:34 +03:00
Dmitry Petrov ae929d0f08 Handle nested when with subject properly
Hack: callee expression for when with subject variable is the subject
variable declaration. This solves the problem that all sub-calls in the
expression are implicitly considered to have a single common lexical
scope (and 'when (val x = ...)' introduces a new lexical scope, which
contains 'x').
2018-06-20 14:06:34 +03:00
Dmitry Petrov 758548603e Extra tests for when with val in subject 2018-06-20 14:06:34 +03:00
Dmitry Petrov 091b935c2d Introduce separate callee expression for when with subject variable
'Subject.Error' is redundant.
'Subject.None' can be an object.
'Subject#dataFlowValue' can be a lateinit property.

TODO: fix
- parsing local extension properties in 'when' subject
- parsing destructuring declarations in 'when' subject
- non-completed calls in nested 'when' with subject variable
- non-completed calls for subject variable in 'in' pattern
2018-06-20 14:06:34 +03:00
Dmitry Petrov 5f0c9490bb Add test for smart cast on a value bound to when subject variable
E.g.:
  when (val y = x?.foo()) {
    null -> ...
    else -> ... // 'x' is also non-null here
  }
2018-06-20 14:06:34 +03:00
Dmitry Petrov 0a0bc67e8a Add test for UNUSED_VALUE on when subject variable 2018-06-20 14:06:34 +03:00
Dmitry Petrov c20c1abb68 Add test for VAL_REASSIGNMENT on when subject variable 2018-06-20 14:06:34 +03:00
Dmitry Petrov 7bc89b8871 Report error on illegal variable declaration in when subject 2018-06-20 14:06:34 +03:00
Dmitry Petrov 098d3eb235 Make smart casts work with variable declared in when subject 2018-06-20 14:06:34 +03:00
Dmitry Petrov 1eeafc2d0e Resolve variable declaration in 'when' subject 2018-06-20 14:06:34 +03:00