[FIR-TEST] Add new testdata generated after changes in previous commit

This commit is contained in:
Dmitriy Novozhilov
2019-12-11 16:16:22 +03:00
parent e9c02a1cca
commit 2536fa0cd5
4578 changed files with 104067 additions and 1 deletions
@@ -0,0 +1,14 @@
class A {
operator fun component1() = 1
operator fun component2() = 1
}
class C {
operator fun iterator(): Iterator<A> = null!!
}
fun test() {
for ((x, y) in C()) {
}
}
@@ -0,0 +1,15 @@
// !WITH_NEW_INFERENCE
class A {
operator fun component1() = 1
operator fun component2() = 1.0
}
class C {
operator fun iterator(): Iterator<A> = null!!
}
fun test() {
for ((x: Double, y: Int) in C()) {
}
}
@@ -0,0 +1,15 @@
class A {
operator fun component1() = 1
operator fun component1() = 1
operator fun component2() = 1
}
class C {
operator fun iterator(): Iterator<A> = null!!
}
fun test() {
for ((<!AMBIGUITY!>x<!>, y) in C()) {
}
}
@@ -0,0 +1,13 @@
class A {
operator fun component1() = 1
}
class C {
operator fun iterator(): Iterator<A> = null!!
}
fun test() {
for ((x, <!UNRESOLVED_REFERENCE!>y<!>) in C()) {
}
}
@@ -0,0 +1,15 @@
// !WITH_NEW_INFERENCE
fun useDeclaredVariables() {
<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>for ((<!UNRESOLVED_REFERENCE!>a<!>, <!UNRESOLVED_REFERENCE!>b<!>)<!SYNTAX!><!>) {
a
b
}<!>
}
fun checkersShouldRun() {
<!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>for ((<!UNRESOLVED_REFERENCE!>@A a<!>, <!UNRESOLVED_REFERENCE!>_<!>)<!SYNTAX!><!>) {
}<!>
}
annotation class A
@@ -0,0 +1,14 @@
class A {
}
operator fun A.component1() = 1
operator fun A.component2() = 1
class C {
operator fun iterator(): Iterator<A> = null!!
}
fun test() {
for ((x, y) in C()) {
}
}
@@ -0,0 +1,14 @@
class A {
operator fun component1() = 1
operator fun component2() = 1.0
}
class C {
operator fun iterator(): Iterator<A> = null!!
}
fun test() {
for ((x: Int, y: Double) in C()) {
}
}
@@ -0,0 +1,14 @@
class A {
operator fun component1() = 1
operator fun component2() = 1
}
class C {
operator fun iterator(): Iterator<A> = null!!
}
fun test() {
for ((x, x) in C()) {
}
}
@@ -0,0 +1,13 @@
class A {
operator fun component1() = 1
}
class C {
operator fun iterator(): Iterator<A> = null!!
}
fun test() {
for ((x) in C()) {
}
}
@@ -0,0 +1,11 @@
fun useDeclaredVariables() {
val (<!UNRESOLVED_REFERENCE!>a<!>, <!UNRESOLVED_REFERENCE!>b<!>) = <!UNRESOLVED_REFERENCE!>unresolved<!>
a
b
}
fun checkersShouldRun() {
val (<!UNRESOLVED_REFERENCE!>@A a<!>, <!UNRESOLVED_REFERENCE!>_<!>) = <!UNRESOLVED_REFERENCE!>unresolved<!>
}
annotation class A
@@ -0,0 +1,11 @@
fun useDeclaredVariables() {
val (<!UNRESOLVED_REFERENCE!>a<!>, <!UNRESOLVED_REFERENCE!>b<!>)
a
b
}
fun checkersShouldRun() {
val (<!UNRESOLVED_REFERENCE!>@A a<!>, <!UNRESOLVED_REFERENCE!>_<!>)
}
annotation class A
@@ -0,0 +1,16 @@
package test
fun a(s: String) { // <- ERROR
val (x, y) = Pair("", s)
println(x + y)
}
fun b(s: String) {
val x = Pair("", s)
println(x)
}
//from library
data class Pair<A, B>(val a: A, val b: B)
fun println(a: Any?) = a
@@ -0,0 +1,30 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER
fun test(list: A) {
if (true) {
val (c) = list
}
else {}
if (true) {
Unit
val (c) = list
}
else {}
when (1) {
1 -> {
val (c) = list
}
}
fn { it ->
val (a) = it
}
}
class A {
operator fun component1() = 1
}
fun fn(x: (A) -> Unit) {}
@@ -0,0 +1,51 @@
// !WITH_NEW_INFERENCE
class A {
operator fun component1() = 1
operator fun component2() = ""
}
class C {
operator fun iterator(): Iterator<A> = null!!
}
fun test() {
for ((x, _) in C()) {
foo(x, _)
}
for ((_, y) in C()) {
foo(_, y)
}
for ((_, _) in C()) {
<!INAPPLICABLE_CANDIDATE!>foo<!>(_, _)
}
for ((_ : Int, _ : String) in C()) {
<!INAPPLICABLE_CANDIDATE!>foo<!>(_, _)
}
for ((_ : String, _ : Int) in C()) {
<!INAPPLICABLE_CANDIDATE!>foo<!>(_, _)
}
val (x, _) = A()
val (_, y) = A()
foo(x, y)
<!INAPPLICABLE_CANDIDATE!>foo<!>(x, _)
foo(_, y)
val (`_`, z) = A()
foo(_, z)
val (_, `_`) = A()
<!INAPPLICABLE_CANDIDATE!>foo<!>(_, y)
val (unused, _) = A()
}
fun foo(x: Int, y: String) {}