FIR: substitute the whole lambda body after builder inference

This commit is contained in:
Tianyu Geng
2021-07-26 15:56:56 -07:00
committed by teamcityserver
parent f737d8002e
commit 0026560bd7
7 changed files with 30 additions and 27 deletions
@@ -10,7 +10,7 @@ fun main() {
buildList {
add(3)
object : A {
override fun foo(): MutableList<String> = this@buildList
override fun foo(): MutableList<String> = <!RETURN_TYPE_MISMATCH!>this@buildList<!>
}
}
buildList {
@@ -19,12 +19,12 @@ fun main() {
}
buildList {
add("3")
val x: MutableList<Int> = this@buildList
val x: MutableList<Int> = <!INITIALIZER_TYPE_MISMATCH!>this@buildList<!>
}
buildList {
val y: CharSequence = ""
add(y)
val x: MutableList<String> = this@buildList
val x: MutableList<String> = <!INITIALIZER_TYPE_MISMATCH!>this@buildList<!>
}
buildList {
add("")
@@ -37,8 +37,8 @@ fun test() {
get()?.hashCode()
get()?.<!NONE_APPLICABLE!>equals<!>(1)
val x = get()
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
x?.hashCode()
x?.<!NONE_APPLICABLE!>equals<!>(1)
x.equals("")
}
val ret3 = build {
@@ -50,20 +50,20 @@ fun test() {
get()?.hashCode()
get()?.<!NONE_APPLICABLE!>equals<!>(1)
val x = get()
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
x?.hashCode()
x?.<!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {}
if (get() === null) {}
if (x != null) {
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
x?.hashCode()
x?.<!NONE_APPLICABLE!>equals<!>(1)
x.equals("")
x.hashCode()
x.toString()
x.test()
x<!UNNECESSARY_SAFE_CALL!>?.<!>test2()
x?.test2()
x.test2()
}
@@ -166,8 +166,8 @@ fun test() {
get()?.hashCode()
get()?.<!NONE_APPLICABLE!>equals<!>(1)
val x = get()
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
x?.hashCode()
x?.<!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {}
if (get() === null) {}
@@ -296,8 +296,8 @@ fun test() {
get()?.hashCode()
get()?.<!NONE_APPLICABLE!>equals<!>(1)
val x = get()
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
x?.hashCode()
x?.<!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {}
if (get() === null) {}