MoveLambdaOutsideParentheses: intention -> inspection #KT-21413 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
83573ed517
commit
decf9939fe
@@ -1 +0,0 @@
|
||||
org.jetbrains.kotlin.idea.intentions.MoveLambdaOutsideParenthesesIntention
|
||||
@@ -1,12 +0,0 @@
|
||||
// IS_AVAILABLE: true
|
||||
// ERROR: None of the following functions can be called with the arguments supplied: <br>public fun bar(a: Int = ..., f: (Int) -> Int): Unit defined in root package in file ambigousOverload.kt<br>public fun bar(a: Int, b: Int, f: (Int) -> Int): Unit defined in root package in file ambigousOverload.kt
|
||||
// ERROR: Unresolved reference: it
|
||||
// SKIP_ERRORS_AFTER
|
||||
|
||||
fun foo() {
|
||||
bar(<caret>{ it })
|
||||
}
|
||||
|
||||
fun bar(a: Int = 0, f: (Int) -> Int) { }
|
||||
fun bar(a: Int, b: Int, f: (Int) -> Int) { }
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
// IS_AVAILABLE: true
|
||||
// ERROR: None of the following functions can be called with the arguments supplied: <br>public fun bar(a: Int = ..., f: (Int) -> Int): Unit defined in root package in file ambigousOverload.kt<br>public fun bar(a: Int, b: Int, f: (Int) -> Int): Unit defined in root package in file ambigousOverload.kt
|
||||
// ERROR: Unresolved reference: it
|
||||
// SKIP_ERRORS_AFTER
|
||||
|
||||
fun foo() {
|
||||
bar<caret> { it }
|
||||
}
|
||||
|
||||
fun bar(a: Int = 0, f: (Int) -> Int) { }
|
||||
fun bar(a: Int, b: Int, f: (Int) -> Int) { }
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
fun foo(p: (Int, () -> Int) -> Unit) {
|
||||
p(1, <caret>{ 2 })
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
fun foo(p: (Int, () -> Int) -> Unit) {
|
||||
p(1<caret>) { 2 }
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun foo() {
|
||||
bar() <caret>{ it }
|
||||
}
|
||||
|
||||
fun bar(b: (Int) -> Int) {
|
||||
b(1)
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun <T> doSomething(a: T) {}
|
||||
|
||||
fun foo(x: Int) {
|
||||
if (x == 1) <caret>{
|
||||
doSomething(x)
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun <T> doSomething(a: T) {}
|
||||
|
||||
fun foo(x: Int) {
|
||||
if (x == 1) {
|
||||
doSomething(x)
|
||||
}
|
||||
}
|
||||
|
||||
fun x() <caret>{ doSomething("x") }
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun foo() {
|
||||
bar(<caret>{ it }) {it}
|
||||
}
|
||||
|
||||
fun bar(p1: (Int) -> Int, p2: (Int) -> Int) { }
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun foo() {
|
||||
bar(<caret>{ it })
|
||||
}
|
||||
|
||||
fun bar(b: (Int) -> Int, option: Int = 0) { }
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(2, <caret>l@{ it })
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(2) l@{ it }
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun bar(f: () -> Unit) {}
|
||||
fun foo(a: Int, b: Int) = 2
|
||||
|
||||
fun test() {
|
||||
bar({
|
||||
<caret>val a = foo(1, 2)
|
||||
})
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun bar(f: () -> Unit) {}
|
||||
fun foo(a: Int, b: Int) = 2
|
||||
|
||||
fun test() {
|
||||
bar {
|
||||
val a = foo(1, 2)
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun bar(x: Int, f: () -> Unit) {}
|
||||
fun foo(a: Int, b: Int) = 2
|
||||
|
||||
fun test() {
|
||||
bar(1, {
|
||||
<caret>val a = foo(1, 2)
|
||||
})
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun bar(x: Int, f: () -> Unit) {}
|
||||
fun foo(a: Int, b: Int) = 2
|
||||
|
||||
fun test() {
|
||||
bar(1) {
|
||||
val a = foo(1, 2)
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun bar(a: Int, b: Int, f: () -> Unit) {}
|
||||
fun foo(a: Int, b: Int) = 2
|
||||
|
||||
fun test() {
|
||||
bar(1, 2, /* , , */ {
|
||||
<caret>val a = foo(1, 2)
|
||||
})
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun bar(a: Int, b: Int, f: () -> Unit) {}
|
||||
fun foo(a: Int, b: Int) = 2
|
||||
|
||||
fun test() {
|
||||
bar(1, 2 /* , , */) {
|
||||
val a = foo(1, 2)
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(2, <caret>{ it })
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(2) { it }
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(a = 2, b = {<caret> it })
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(a = 2) { it }
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
// ERROR: Type mismatch: inferred type is () -> ??? but Int was expected
|
||||
// ERROR: No value passed for parameter 'b'
|
||||
// ERROR: Unresolved reference: it
|
||||
// SKIP_ERRORS_AFTER
|
||||
fun foo() {
|
||||
bar({ it <caret>})
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
// ERROR: Type mismatch: inferred type is () -> ??? but Int was expected
|
||||
// ERROR: No value passed for parameter 'b'
|
||||
// ERROR: Unresolved reference: it
|
||||
// SKIP_ERRORS_AFTER
|
||||
fun foo() {
|
||||
bar<caret> { it }
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(2, {
|
||||
val x = 3
|
||||
it * x
|
||||
})<caret>
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(2) {
|
||||
val x = 3
|
||||
it * x
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(a: Int, b: (Int) -> Int) {
|
||||
b(a)
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(name1 = 3, name2 = 2, name3 = 1, <caret>name4 = { it })
|
||||
}
|
||||
|
||||
fun bar(name1: Int, name2: Int, name3: Int, name4: (Int) -> Int) : Int {
|
||||
return name4(name1) + name2 + name3
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(name1 = 3, name2 = 2, name3 = 1) { it }
|
||||
}
|
||||
|
||||
fun bar(name1: Int, name2: Int, name3: Int, name4: (Int) -> Int) : Int {
|
||||
return name4(name1) + name2 + name3
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(3, 2, 1, { it }<caret>)
|
||||
}
|
||||
|
||||
fun bar(name1: Int, name2: Int, name3: Int, name4: (Int) -> Int) : Int {
|
||||
return name4(name1) + name2 + name3
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// IS_APPLICABLE: true
|
||||
fun foo() {
|
||||
bar(3, 2, 1) { it }
|
||||
}
|
||||
|
||||
fun bar(name1: Int, name2: Int, name3: Int, name4: (Int) -> Int) : Int {
|
||||
return name4(name1) + name2 + name3
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
fun bar() {
|
||||
foo { "one" } (<caret>{ "two" })
|
||||
}
|
||||
|
||||
fun foo(a: () -> String): (() -> String) -> Unit {
|
||||
return { }
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
fun bar() {
|
||||
foo { "one" } () { "two" }
|
||||
}
|
||||
|
||||
fun foo(a: () -> String): (() -> String) -> Unit {
|
||||
return { }
|
||||
}
|
||||
Reference in New Issue
Block a user