"if-then to safe access": treat transformation to 'let' as intention

Related to KT-7675
This commit is contained in:
Mikhail Glukhikh
2018-08-15 12:32:51 +03:00
parent f5cfec4a91
commit 5b77def0e0
10 changed files with 20 additions and 41 deletions
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// HIGHLIGHT: INFORMATION
fun convert(x: String, y: String) = ""
fun foo(a: String?, b: String) {
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// HIGHLIGHT: INFORMATION
fun convert(x: String, y: String) = ""
fun foo(a: String?, b: String) {
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// HIGHLIGHT: INFORMATION
fun convert(x: String, y: String) = ""
fun foo(a: Any?, b: String) {
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// HIGHLIGHT: INFORMATION
fun convert(x: String, y: String) = ""
fun foo(a: Any?, b: String) {
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// HIGHLIGHT: INFORMATION
fun convert(x: String, y: Int) = ""
fun foo(a: String?, it: Int) {
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// HIGHLIGHT: INFORMATION
fun convert(x: String, y: Int) = ""
fun foo(a: String?, it: Int) {
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// HIGHLIGHT: INFORMATION
fun maybeFoo(): String? {
return "foo"
}
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// HIGHLIGHT: INFORMATION
fun maybeFoo(): String? {
return "foo"
}
@@ -167,40 +167,4 @@
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
<description>Foldable if-then</description>
</problem>
<problem>
<file>call4.kt</file>
<line>10</line>
<module>light_idea_test_case</module>
<package>&lt;default&gt;</package>
<entry_point TYPE="file" FQNAME="temp:///src/call4.kt" />
<problem_class severity="INFO" attribute_key="INFO_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
<description>Foldable if-then</description>
</problem>
<problem>
<file>call3.kt</file>
<line>5</line>
<module>light_idea_test_case</module>
<package>&lt;default&gt;</package>
<entry_point TYPE="file" FQNAME="temp:///src/call3.kt" />
<problem_class severity="INFO" attribute_key="INFO_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
<description>Foldable if-then</description>
</problem>
<problem>
<file>call2.kt</file>
<line>5</line>
<module>light_idea_test_case</module>
<package>&lt;default&gt;</package>
<entry_point TYPE="file" FQNAME="temp:///src/call2.kt" />
<problem_class severity="INFO" attribute_key="INFO_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
<description>Foldable if-then</description>
</problem>
<problem>
<file>call.kt</file>
<line>5</line>
<module>light_idea_test_case</module>
<package>&lt;default&gt;</package>
<entry_point TYPE="file" FQNAME="temp:///src/call.kt" />
<problem_class severity="INFO" attribute_key="INFO_ATTRIBUTES">If-Then foldable to '?.'</problem_class>
<description>Foldable if-then</description>
</problem>
</problems>