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
@@ -0,0 +1,12 @@
// WITH_RUNTIME
// PROBLEM: none
package kotlinx.coroutines
suspend fun barAsync(): Deferred<String>? {
return null
}
suspend fun foo() {
" ".let <caret>{ barAsync() }
}
@@ -1,3 +1,4 @@
// PROBLEM: none
package kotlin
fun test() {
@@ -1,5 +0,0 @@
package kotlin
fun test() {
val x = fun() = Result("123").getOrThrow()
}
@@ -1,3 +1,4 @@
// PROBLEM: none
package kotlin
fun test() {
@@ -1,5 +0,0 @@
package kotlin
fun test() {
val x = { Result(true).getOrThrow() }
}
@@ -1,3 +1,4 @@
// PROBLEM: none
package kotlin
fun test(arg: Boolean) {
@@ -1,11 +0,0 @@
package kotlin
fun test(arg: Boolean) {
val x = foo@{
(if (!arg) {
return@foo Result(true).getOrThrow()
} else {
Result(false)
}).getOrThrow()
}
}
@@ -1,3 +1,4 @@
// PROBLEM: none
package kotlin
fun test() {
@@ -1,5 +0,0 @@
package kotlin
fun test() {
val x = foo@<caret>{ return@foo Result(true).getOrThrow() }
}