UNUSED_VARIABLE is now reported only for last entry of destructuring declaration (if applicable) #KT-14221 Fixed
This commit is contained in:
compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/DoubleDeclForLoop.kt
Vendored
+1
-1
@@ -8,7 +8,7 @@ class C {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
for ((x, y) in C()) {
|
||||
for ((x, <!UNUSED_VARIABLE!>y<!>) in C()) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ class C {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
for ((x: Double, y: Int) in <!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH, COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>C()<!>) {
|
||||
for ((x: Double, <!UNUSED_VARIABLE!>y<!>: Int) in <!COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH, COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH!>C()<!>) {
|
||||
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -9,7 +9,7 @@ class C {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
for ((x, y) in <!COMPONENT_FUNCTION_AMBIGUITY!>C()<!>) {
|
||||
for ((x, <!UNUSED_VARIABLE!>y<!>) in <!COMPONENT_FUNCTION_AMBIGUITY!>C()<!>) {
|
||||
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@ class C {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
for ((x, y) in <!COMPONENT_FUNCTION_MISSING!>C()<!>) {
|
||||
for ((x, <!UNUSED_VARIABLE!>y<!>) in <!COMPONENT_FUNCTION_MISSING!>C()<!>) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ fun useDeclaredVariables() {
|
||||
}
|
||||
|
||||
fun checkersShouldRun() {
|
||||
for ((@A a, <!UNDERSCORE_IS_RESERVED!>_<!>)<!SYNTAX!><!>) {
|
||||
for ((@A a, <!UNDERSCORE_IS_RESERVED, UNUSED_VARIABLE!>_<!>)<!SYNTAX!><!>) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ class C {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
for ((x, y) in C()) {
|
||||
for ((x, <!UNUSED_VARIABLE!>y<!>) in C()) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ class C {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
for ((x: Int, y: Double) in C()) {
|
||||
for ((x: Int, <!UNUSED_VARIABLE!>y<!>: Double) in C()) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ class C {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
for ((<!REDECLARATION!>x<!>, <!NAME_SHADOWING, REDECLARATION!>x<!>) in C()) {
|
||||
for ((<!REDECLARATION!>x<!>, <!NAME_SHADOWING, REDECLARATION, UNUSED_VARIABLE!>x<!>) in C()) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ fun useDeclaredVariables() {
|
||||
}
|
||||
|
||||
fun checkersShouldRun() {
|
||||
val (@A <!UNUSED_VARIABLE!>a<!>, <!UNDERSCORE_IS_RESERVED, UNUSED_VARIABLE!>_<!>) = <!UNRESOLVED_REFERENCE!>unresolved<!>
|
||||
val (@A a, <!UNDERSCORE_IS_RESERVED, UNUSED_VARIABLE!>_<!>) = <!UNRESOLVED_REFERENCE!>unresolved<!>
|
||||
}
|
||||
|
||||
annotation class A
|
||||
+1
-1
@@ -5,7 +5,7 @@ fun useDeclaredVariables() {
|
||||
}
|
||||
|
||||
fun checkersShouldRun() {
|
||||
<!INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION!>val (@A <!UNUSED_VARIABLE!>a<!>, <!UNDERSCORE_IS_RESERVED, UNUSED_VARIABLE!>_<!>)<!>
|
||||
<!INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION!>val (@A a, <!UNDERSCORE_IS_RESERVED, UNUSED_VARIABLE!>_<!>)<!>
|
||||
}
|
||||
|
||||
annotation class A
|
||||
Reference in New Issue
Block a user