FIR: rename EXPRESSION_REQUIRED to EXPRESSION_EXPECTED

This commit is contained in:
Mikhail Glukhikh
2021-04-16 10:23:54 +03:00
parent 26ea0be635
commit 9894b97058
17 changed files with 38 additions and 40 deletions
@@ -1,5 +1,5 @@
fun foo1() = <!EXPRESSION_REQUIRED!>while (b()) {}<!>
fun foo1() = <!EXPRESSION_EXPECTED!>while (b()) {}<!>
fun foo2() = <!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>for (i in 10) {}<!>
@@ -15,7 +15,7 @@ fun main() {
}
//KT-351 Distinguish statement and expression positions
val w = <!EXPRESSION_REQUIRED!>while (true) {}<!>
val w = <!EXPRESSION_EXPECTED!>while (true) {}<!>
fun foo() {
var z = 2
@@ -149,12 +149,12 @@ fun bar(a: Unit) {}
fun testStatementInExpressionContext() {
var z = 34
val a1: Unit = <!EXPRESSION_REQUIRED!>z = 334<!>
val a1: Unit = <!EXPRESSION_EXPECTED!>z = 334<!>
val f = for (i in 1..10) {}
if (true) return <!EXPRESSION_REQUIRED!>z = 34<!>
return <!EXPRESSION_REQUIRED!>while (true) {}<!>
if (true) return <!EXPRESSION_EXPECTED!>z = 34<!>
return <!EXPRESSION_EXPECTED!>while (true) {}<!>
}
fun testStatementInExpressionContext2() {
val a2: Unit = <!EXPRESSION_REQUIRED!>while(true) {}<!>
val a2: Unit = <!EXPRESSION_EXPECTED!>while(true) {}<!>
}
@@ -4,7 +4,7 @@
fun foo(block: () -> (() -> Int)) {}
fun test() {
val x = <!EXPRESSION_REQUIRED!>fun named1(x: Int): Int { return 1 }<!>
val x = <!EXPRESSION_EXPECTED!>fun named1(x: Int): Int { return 1 }<!>
x <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><Function1<Int, Int>>() }
foo { fun named2(): Int {return 1} }
@@ -45,12 +45,12 @@ fun test() {
x4 checkType { _<Function1<Int, Unit>>() }
{ y: Int -> fun named14(): Int {return 1} }
val b = (<!EXPRESSION_REQUIRED, UNRESOLVED_REFERENCE!>fun named15(): Boolean { return true }<!>)()
val b = (<!EXPRESSION_EXPECTED, UNRESOLVED_REFERENCE!>fun named15(): Boolean { return true }<!>)()
baz(<!EXPRESSION_REQUIRED!>fun named16(){}<!>)
baz(<!EXPRESSION_EXPECTED!>fun named16(){}<!>)
}
fun bar() = <!EXPRESSION_REQUIRED!>fun named() {}<!>
fun bar() = <!EXPRESSION_EXPECTED!>fun named() {}<!>
fun <T> run(block: () -> T): T = null!!
fun run2(block: () -> Unit): Unit = null!!
@@ -5,5 +5,5 @@ fun foo() {
fun A.foo() {}
(fun A.foo() {})
run(<!EXPRESSION_REQUIRED!>fun foo() {}<!>)
run(<!EXPRESSION_EXPECTED!>fun foo() {}<!>)
}
@@ -13,11 +13,11 @@ fun box() : Boolean {
var c = A()
val d = c;
c %= A();
return (c != d) && <!EXPRESSION_REQUIRED!>(c.p = "yeah")<!>
return (c != d) && <!EXPRESSION_EXPECTED!>(c.p = "yeah")<!>
}
fun box2() : Boolean {
var c = A()
return <!EXPRESSION_REQUIRED!>(c.p = "yeah")<!> && true
return <!EXPRESSION_EXPECTED!>(c.p = "yeah")<!> && true
}