[FIR] Fix enhancement of FlexibleNullability and EnhancedNullability

- Add utilities to add new attribute to ConeAttributes
- Get rid of FlexibleNullability attribute (it can be easily inferred
    for any flexible type at any moment)
- Fix determining of EnhancedNullability attribute
This commit is contained in:
Dmitriy Novozhilov
2021-03-09 14:51:19 +03:00
parent 0108f8a1b4
commit 65ea4e184a
290 changed files with 1395 additions and 2037 deletions
@@ -12,18 +12,19 @@ fun test1() {
}
fun test2() {
var x: Int?
var x: @FlexibleNullability Int?
val x$delegate: HashMap<String, Int> = hashMapOf<String, Int>()
local get(): Int? {
return x$delegate.getValue<Int?, Int?>(thisRef = null, property = ::x)
local get(): @FlexibleNullability Int? {
return x$delegate.getValue<@FlexibleNullability Int?, @FlexibleNullability Int?>(thisRef = null, property = ::x)
}
local set(<set-?>: Int?) {
x$delegate.setValue<Int?>(thisRef = null, property = ::x, value = <set-?>)
local set(<set-?>: @FlexibleNullability Int?) {
x$delegate.setValue<@FlexibleNullability Int?>(thisRef = null, property = ::x, value = <set-?>)
}
<set-x>(<set-?> = 0)
val <unary>: Int? = <get-x>()
val <unary>: @FlexibleNullability Int? = <get-x>()
<set-x>(<set-?> = <unary>.inc())
<unary> /*~> Unit */
<set-x>(<set-?> = <get-x>().plus(other = 1))
}