FIR: support type inference for assignments, fix related lambda inference
This commit is contained in:
@@ -7,7 +7,14 @@ var b: MutableSet<String>? = null
|
||||
field = HashSet()
|
||||
}
|
||||
|
||||
var <T> MutableSet<T>.d: T? get() = null
|
||||
set(_) {}
|
||||
|
||||
fun <T> produce(): T = TODO()
|
||||
|
||||
fun foo() {
|
||||
var c: MutableSet<String>? = null
|
||||
c = HashSet()
|
||||
|
||||
c!!.d = produce()
|
||||
}
|
||||
+20
-2
@@ -4,9 +4,27 @@ FILE: hashSet.kt
|
||||
public final var b: R|kotlin/collections/MutableSet<kotlin/String>|? = Null(null)
|
||||
public get(): R|kotlin/collections/MutableSet<kotlin/String>|?
|
||||
public set(_: R|kotlin/collections/MutableSet<kotlin/String>|?): R|kotlin/Unit| {
|
||||
F|/b| = R|java/util/HashSet.HashSet|()
|
||||
F|/b| = R|java/util/HashSet.HashSet|<R|kotlin/String|>()
|
||||
}
|
||||
public final var <T> R|kotlin/collections/MutableSet<T>|.d: R|T|?
|
||||
public get(): R|T|? {
|
||||
^ Null(null)
|
||||
}
|
||||
public set(_: R|T|?): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun <T> produce(): R|T| {
|
||||
^produce R|kotlin/TODO|()
|
||||
}
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lvar c: R|kotlin/collections/MutableSet<kotlin/String>|? = Null(null)
|
||||
R|<local>/c| = R|java/util/HashSet.HashSet|()
|
||||
R|<local>/c| = R|java/util/HashSet.HashSet|<R|kotlin/String|>()
|
||||
when (lval <bangbang>: R|kotlin/collections/MutableSet<kotlin/String>|? = R|<local>/c|) {
|
||||
==($subj$, Null(null)) -> {
|
||||
throw R|kotlin/KotlinNullPointerException.KotlinNullPointerException|()
|
||||
}
|
||||
else -> {
|
||||
R|<local>/<bangbang>|!
|
||||
}
|
||||
}
|
||||
.R|/d| = R|/produce|<R|T|?>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user