Don't suggest "return type is..." inspections for anonymous functions

#KT-29290 Fixed
This commit is contained in:
Mikhail Glukhikh
2019-01-18 10:00:44 +03:00
parent 4f9e844735
commit 04bd5139d5
13 changed files with 34 additions and 63 deletions
@@ -71,24 +71,6 @@
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Function returning Result directly</problem_class>
<description>Function returning Result with a name that does not end with Catching</description>
</problem>
<problem>
<file>test.kt</file>
<line>38</line>
<module>light_idea_test_case</module>
<package>&lt;default&gt;</package>
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Function returning Result directly</problem_class>
<description>Function returning Result with a name that does not end with Catching</description>
</problem>
<problem>
<file>test.kt</file>
<line>40</line>
<module>light_idea_test_case</module>
<package>&lt;default&gt;</package>
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
<problem_class severity="WEAK WARNING" attribute_key="INFO_ATTRIBUTES">Function returning Result directly</problem_class>
<description>Function returning Result with a name that does not end with Catching</description>
</problem>
<problem>
<file>test.kt</file>
<line>60</line>
@@ -34,9 +34,9 @@ class Container {
fun test() {
// YES
fun localGetSuccess() = Result("123")
// YES
// NO (no name)
val anonymous = fun() = Result(45)
// YES
// NO (no name)
val lambda = { Result(true) }
// NO yet (we do not report local *catching functions)
fun localCatching() = Result(2.72)