Add inspection for calls of function with lambda expression body
Added "Unused return value of a function with lambda expression body" inspection with quickfix "Remove '=' token from function declaration" #KT-10393 Fixed
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>simple.kt</file>
|
||||
<line>3</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/simple.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Unused return value of a function with lambda expression body</problem_class>
|
||||
<description>Unused return value of a function with lambda expression body</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>simple.kt</file>
|
||||
<line>6</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/simple.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Unused return value of a function with lambda expression body</problem_class>
|
||||
<description>Unused return value of a function with lambda expression body</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+1
@@ -0,0 +1 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.UnusedLambdaExpressionBodyInspection
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
fun foo() {
|
||||
bar()
|
||||
val a = bar()
|
||||
if (bar() != null) {
|
||||
bar()
|
||||
}
|
||||
bar()()
|
||||
}
|
||||
|
||||
fun bar() = {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user