[inspections] fix false positive "Redundant Unit" inspection in lambda with dynamic return type
^KT-40700 Fixed
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// PROBLEM: none
|
||||
// ERROR: Unsupported [Dynamic types are not supported in this context]
|
||||
|
||||
fun foo() {
|
||||
fun bar(f: () -> dynamic): Unit {}
|
||||
bar {
|
||||
val a = 1
|
||||
Unit<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// PROBLEM: none
|
||||
// ERROR: Unsupported [Dynamic types are not supported in this context]
|
||||
|
||||
fun foo() {
|
||||
fun bar(f: () -> dynamic): Unit {}
|
||||
bar({
|
||||
val a = 1
|
||||
Unit<caret>
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// PROBLEM: none
|
||||
// ERROR: Unsupported [Dynamic types are not supported in this context]
|
||||
// ERROR: Unsupported [Dynamic types are not supported in this context]
|
||||
|
||||
fun foo() {
|
||||
fun bar(c: () -> dynamic, f: () -> dynamic): Unit {}
|
||||
bar({
|
||||
val a = 1
|
||||
Unit
|
||||
}) {
|
||||
val a = 1
|
||||
Unit<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// ERROR: Unsupported [Dynamic types are not supported in this context]
|
||||
|
||||
fun foo() {
|
||||
fun <T> bar(c: () -> dynamic, f: () -> T): Unit {}
|
||||
bar({
|
||||
val a = 1
|
||||
Unit
|
||||
}) {
|
||||
val a = 1
|
||||
Unit<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// ERROR: Unsupported [Dynamic types are not supported in this context]
|
||||
|
||||
fun foo() {
|
||||
fun <T> bar(c: () -> dynamic, f: () -> T): Unit {}
|
||||
bar({
|
||||
val a = 1
|
||||
Unit
|
||||
}) {
|
||||
val a = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// ERROR: Unsupported [Dynamic types are not supported in this context]
|
||||
|
||||
fun foo() {
|
||||
fun <T> bar(c: () -> T, f: () -> dynamic): Unit {}
|
||||
bar({
|
||||
val a = 1
|
||||
Unit<caret>
|
||||
}) {
|
||||
val a = 1
|
||||
Unit
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// ERROR: Unsupported [Dynamic types are not supported in this context]
|
||||
|
||||
fun foo() {
|
||||
fun <T> bar(c: () -> T, f: () -> dynamic): Unit {}
|
||||
bar({
|
||||
val a = 1
|
||||
}) {
|
||||
val a = 1
|
||||
Unit
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// PROBLEM: none
|
||||
// ERROR: Unsupported [Dynamic types are not supported in this context]
|
||||
|
||||
fun foo() {
|
||||
fun bar(f: (Int) -> dynamic): Unit {}
|
||||
bar {
|
||||
val a = 1
|
||||
Unit<caret>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user