Introduct "Redundant 'with' call" inspection #KT-6633 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-07-12 17:19:48 +09:00
committed by Natalia Selezneva
parent 58becffb1f
commit 4c34ced1fa
40 changed files with 493 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
fun test() {
with(foo()) {
println("test")
}
}
fun foo(): String {
println("foo")
return ""
}
@@ -0,0 +1,9 @@
<problems>
<problem>
<file>callReceiver.kt</file>
<line>2</line>
<entry_point TYPE="file" FQNAME="temp:///src/callReceiver.kt" />
<problem_class severity="WEAK WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant 'with' call</problem_class>
<description>Redundant 'with' call</description>
</problem>
</problems>
@@ -0,0 +1,2 @@
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.RedundantWithInspection
// WITH_RUNTIME