FIR checker: warn unnecessary safe calls

This commit is contained in:
Jinseong Jeon
2021-04-01 11:55:05 -07:00
committed by Mikhail Glukhikh
parent 2ecb6733ed
commit 5a0b75bd89
65 changed files with 232 additions and 349 deletions
@@ -53,7 +53,7 @@ fun case_3(x: Class?) {
* ISSUES: KT-30376
*/
fun case_4(x: Class?) {
if (x!!?.prop_8?.prop_8?.prop_8?.prop_8 == null == true) else {
if (x!!<!UNNECESSARY_SAFE_CALL!>?.<!>prop_8?.prop_8?.prop_8?.prop_8 == null == true) else {
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8
@@ -68,7 +68,7 @@ fun case_4(x: Class?) {
* ISSUES: KT-30376
*/
fun case_5(x: Class?) {
if (x?.prop_8!!?.prop_8?.prop_8?.prop_8 == null == true) else {
if (x?.prop_8!!<!UNNECESSARY_SAFE_CALL!>?.<!>prop_8?.prop_8?.prop_8 == null == true) else {
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8
@@ -83,7 +83,7 @@ fun case_5(x: Class?) {
* ISSUES: KT-30376
*/
fun case_6(x: Class?) {
if (x?.prop_8?.prop_8?.prop_8!!?.prop_8 == null == true) else {
if (x?.prop_8?.prop_8?.prop_8!!<!UNNECESSARY_SAFE_CALL!>?.<!>prop_8 == null == true) else {
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8