Fix builder inference tests

This commit is contained in:
Victor Petukhov
2021-05-26 17:54:28 +03:00
parent 4a767c597e
commit bd7fb56a24
25 changed files with 78 additions and 124 deletions
@@ -72,7 +72,7 @@ fun poll14(flag: Boolean): Flow<String> {
fun poll15(flag: Boolean): Flow<String> {
return flow {
val inv = if (flag) { ::bar5 } else { ::foo5 }
inv(<!NO_VALUE_FOR_PARAMETER{LT}!>)<!>
inv()
}
}
@@ -93,7 +93,7 @@ fun poll17(flag: Boolean): Flow<String> {
fun poll4(): Flow<String> {
return flow {
val inv = try { ::bar } finally { ::foo }
inv(<!NO_VALUE_FOR_PARAMETER{LT}!>)<!>
inv()
}
}
@@ -121,7 +121,7 @@ fun poll43(): Flow<String> {
fun poll44(): Flow<String> {
return flow {
val inv = try { ::bar5 } finally { ::foo5 }
inv(<!NO_VALUE_FOR_PARAMETER{LT}!>)<!>
inv()
}
}
@@ -142,7 +142,7 @@ fun poll46(): Flow<String> {
fun poll5(): Flow<String> {
return flow {
val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::foo }
inv(<!NO_VALUE_FOR_PARAMETER{LT}!>)<!>
inv()
}
}
@@ -170,7 +170,7 @@ fun poll53(): Flow<String> {
fun poll54(): Flow<String> {
return flow {
val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::foo5 }
inv(<!NO_VALUE_FOR_PARAMETER{LT}!>)<!>
inv()
}
}
@@ -38,7 +38,7 @@ class Flow<out R>(private val block: suspend FlowCollector<R>.() -> Unit)
fun poll7(): Flow<String> {
return flow {
val inv = ::bar<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv(<!NO_VALUE_FOR_PARAMETER{LT}!>)<!>
inv()
}
}
@@ -24,7 +24,7 @@ fun test() {
get()?.test2()
get().test2()
get()?.hashCode()
get()?.equals(1)
get()?.<!NONE_APPLICABLE!>equals<!>(1)
// there is `String?.equals` extension
get().equals("")
}
@@ -35,10 +35,10 @@ fun test() {
get()?.test2()
get().test2()
get()?.hashCode()
get()?.equals(1)
get()?.<!NONE_APPLICABLE!>equals<!>(1)
val x = get()
x?.hashCode()
x?.equals(1)
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
x.equals("")
}
val ret3 = build {
@@ -48,22 +48,22 @@ fun test() {
get()?.test2()
get().test2()
get()?.hashCode()
get()?.equals(1)
get()?.<!NONE_APPLICABLE!>equals<!>(1)
val x = get()
x?.hashCode()
x?.equals(1)
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {}
if (get() === null) {}
if (x != null) {
x?.hashCode()
x?.equals(1)
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
x.equals("")
x.hashCode()
x.toString()
x.test()
x?.test2()
x<!UNNECESSARY_SAFE_CALL!>?.<!>test2()
x.test2()
}
@@ -94,7 +94,7 @@ fun test() {
emit(null)
val x = get()
if (x == null) {
x.toString("")
x.<!NONE_APPLICABLE!>toString<!>("")
}
""
@@ -134,7 +134,7 @@ fun test() {
emit(null)
val x = get()
if (x === null) {
x.toString("")
x.<!NONE_APPLICABLE!>toString<!>("")
}
""
@@ -164,24 +164,24 @@ fun test() {
get()?.test2()
get().test2()
get()?.hashCode()
get()?.equals(1)
get()?.<!NONE_APPLICABLE!>equals<!>(1)
val x = get()
x?.hashCode()
x?.equals(1)
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {}
if (get() === null) {}
if (x == null) {
x?.hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
}
if (x == null) {
x?.equals(1)
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
}
if (x == null) {
x?.test2()
x<!UNNECESSARY_SAFE_CALL!>?.<!>test2()
}
if (x == null) {
@@ -189,15 +189,15 @@ fun test() {
}
if (x === null) {
x?.hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
}
if (x === null) {
x?.equals(1)
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
}
if (x === null) {
x?.test2()
x<!UNNECESSARY_SAFE_CALL!>?.<!>test2()
}
if (x === null) {
@@ -294,21 +294,21 @@ fun test() {
get()?.test2()
get().test2()
get()?.hashCode()
get()?.equals(1)
get()?.<!NONE_APPLICABLE!>equals<!>(1)
val x = get()
x?.hashCode()
x?.equals(1)
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {}
if (get() === null) {}
if (x == null) {
x?.hashCode()
x?.equals(1)
x?.test2()
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
x<!UNNECESSARY_SAFE_CALL!>?.<!>test2()
x.test2()
}
""
}
}
}