KT-11850 Add nested lambdas with implicit parameters warning (#1664)

* Add `Nested lambda has shadowed implicit parameter` inspection #KT-11850 Fixed

* KT-11850 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-06-20 21:57:03 +09:00
committed by Vyacheslav Gerasimov
parent c0f53f3a4d
commit e41a34af88
20 changed files with 278 additions and 0 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.inspections.NestedLambdaShadowedImplicitParameterInspection
@@ -0,0 +1,10 @@
// PROBLEM: none
fun foo(f: (String) -> Unit) {}
fun test() {
foo {
<caret>foo { s ->
}
}
}
@@ -0,0 +1,10 @@
// PROBLEM: none
fun foo(f: (String) -> Unit) {}
fun test() {
foo { s ->
<caret>foo {
}
}
}
@@ -0,0 +1,8 @@
fun foo(f: (String) -> Unit) {}
fun test() {
foo {
<caret>foo {
}
}
}
@@ -0,0 +1,8 @@
fun foo(f: (String) -> Unit) {}
fun test() {
foo { it ->
foo {
}
}
}
@@ -0,0 +1,11 @@
fun foo(f: (String) -> Unit) {}
fun bar(f: (Int) -> Unit) {}
fun test() {
foo {
val s: String = it
<caret>bar {
val i: Int = it
}
}
}
@@ -0,0 +1,11 @@
fun foo(f: (String) -> Unit) {}
fun bar(f: (Int) -> Unit) {}
fun test() {
foo { it ->
val s: String = it
bar {
val i: Int = it
}
}
}
@@ -0,0 +1,10 @@
fun foo(f: (String) -> Unit) {}
fun test() {
foo {
foo { s ->
<caret>foo {
}
}
}
}
@@ -0,0 +1,10 @@
fun foo(f: (String) -> Unit) {}
fun test() {
foo { it ->
foo { s ->
foo {
}
}
}
}
@@ -0,0 +1,11 @@
// PROBLEM: none
fun foo(f: (String) -> Unit) {}
fun bar(f: String.() -> Unit) {}
fun test() {
foo {
<caret>bar {
}
}
}
@@ -0,0 +1,11 @@
// PROBLEM: none
fun foo(f: (String) -> Unit) {}
fun bar(f: String.() -> Unit) {}
fun test() {
bar {
<caret>foo {
}
}
}