Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed

This commit is contained in:
Mikhail Glukhikh
2020-03-04 17:54:33 +03:00
parent 186e0b0cba
commit 8884cbe415
2268 changed files with 1175 additions and 19754 deletions
@@ -1,19 +0,0 @@
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_PARAMETER
annotation class ann(val name: String)
const val ok = "OK"
class A
val withoutName = fun () {}
val extensionWithoutName = fun A.() {}
fun withAnnotation() = @ann(ok) fun () {}
val withReturn = fun (): Int { return 5}
val withExpression = fun() = 5
val funfun = fun() = fun() = 5
val parentesized = (fun () {})
val parentesizedWithType = checkSubtype<() -> Unit>((fun () {}))
val withType = checkSubtype<() -> Unit>((fun () {}))
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_PARAMETER
@@ -1,7 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
fun <T> foo(f : (T) -> T) : T = throw Exception()
fun test() {
val a : Int = foo(fun (x) = x)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
fun <T> foo(f : (T) -> T) : T = throw Exception()
@@ -1,18 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
val bar = fun() {}
val bas = fun() {}
fun gar(p: Any?) = fun() {}
fun gas(p: Any?) = fun() {}
fun outer() {
val bar = fun() {}
val bas = fun() {}
fun gar(p: Any?) = fun() {}
fun gas(p: Any?) = fun() {}
gar(fun() {})
gar(fun() {})
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
val bar = fun() {}
@@ -1,9 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE
val label_fun = label@ fun () {
return@label
}
val parenthesized_label_fun = (label@ fun () {
return@label
})
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE
val label_fun = label@ fun () {
@@ -1,20 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE
interface B {
fun b_fun() {}
}
fun test(param: String) {
val local_val = 4
val bar = fun B.(fun_param: Int) {
param.length
b_fun()
val inner_bar = local_val + fun_param
<!UNRESOLVED_REFERENCE!>bar<!>
}
<!UNRESOLVED_REFERENCE!>inner_bar<!>
<!UNRESOLVED_REFERENCE!>fun_param<!>
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE
interface B {
@@ -1,31 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
fun <T> parameter() = fun (t: T) = t
fun <T> receiver() = fun T.() = this
fun <T> returnType() = fun (): T = null!!
val <T> T.fromVal: () -> T get() = fun (): T = this@fromVal
fun devNull(a: Any?){}
fun <O> outer() {
fun <T> parameter() = fun (t: T) = t
fun <T> receiver() = fun T.() = this
fun <T> returnType() = fun (): T = null!!
devNull(fun (t: O) = t)
devNull(fun O.() = this)
devNull(fun (): O = null!!)
}
class Outer<O> {
fun <T> parameter() = fun (t: T) = t
fun <T> receiver() = fun T.() = this
fun <T> returnType() = fun (): T = null!!
init {
devNull(fun (t: O) = t)
devNull(fun O.() = this)
devNull(fun (): O = null!!)
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
fun <T> parameter() = fun (t: T) = t