Fix typechecker when initializer of destructuring declaration is unresolved or missing

This commit is contained in:
Pavel V. Talanov
2016-02-03 18:10:42 +03:00
parent a4e3dd7030
commit 7c84225cc4
7 changed files with 77 additions and 15 deletions
@@ -0,0 +1,11 @@
fun useDeclaredVariables() {
val (a, b) = <!UNRESOLVED_REFERENCE!>unresolved<!>
<!UNUSED_EXPRESSION, DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a<!>
<!UNUSED_EXPRESSION, DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>b<!>
}
fun checkersShouldRun() {
val (@A <!UNUSED_VARIABLE!>a<!>, <!UNDERSCORE_IS_RESERVED, UNUSED_VARIABLE!>_<!>) = <!UNRESOLVED_REFERENCE!>unresolved<!>
}
annotation class A
@@ -0,0 +1,11 @@
package
public fun checkersShouldRun(): kotlin.Unit
public fun useDeclaredVariables(): kotlin.Unit
public final annotation class A : kotlin.Annotation {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -0,0 +1,11 @@
fun useDeclaredVariables() {
<!INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION!>val (a, b)<!>
<!UNUSED_EXPRESSION, DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a<!>
<!UNUSED_EXPRESSION, DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>b<!>
}
fun checkersShouldRun() {
<!INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION!>val (@A <!UNUSED_VARIABLE!>a<!>, <!UNDERSCORE_IS_RESERVED, UNUSED_VARIABLE!>_<!>)<!>
}
annotation class A
@@ -0,0 +1,11 @@
package
public fun checkersShouldRun(): kotlin.Unit
public fun useDeclaredVariables(): kotlin.Unit
public final annotation class A : kotlin.Annotation {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}