FIR: pass the explicit expected type to block type

This helps avoid adding redundant return Unit into block.
This commit is contained in:
Jinseong Jeon
2020-12-08 14:34:25 -08:00
committed by Dmitriy Novozhilov
parent 0ea6b32c01
commit 4ab0897d7d
7 changed files with 23 additions and 19 deletions
@@ -167,7 +167,7 @@ object Visibilities {
<this>.put(key = Private, value = 0) /*~> Unit */
<this>.put(key = Internal, value = 1) /*~> Unit */
<this>.put(key = Protected, value = 1) /*~> Unit */
return <this>.put(key = Public, value = 2) /*~> Unit */
<this>.put(key = Public, value = 2) /*~> Unit */
}
)
private get
@@ -572,12 +572,11 @@ FILE fqName:<root> fileName:/typeVariableAfterBuildMap.kt
$this: GET_VAR '<this>: kotlin.collections.MutableMap<<root>.Visibility, kotlin.Int> declared in <root>.Visibilities.ORDERED_VISIBILITIES.<anonymous>' type=kotlin.collections.MutableMap<<root>.Visibility, kotlin.Int> origin=null
key: GET_OBJECT 'CLASS OBJECT name:Protected modality:FINAL visibility:public superTypes:[<root>.Visibility]' type=<root>.Visibilities.Protected
value: CONST Int type=kotlin.Int value=1
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.Unit declared in <root>.Visibilities.ORDERED_VISIBILITIES'
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public abstract fun put (key: K of kotlin.collections.MutableMap, value: V of kotlin.collections.MutableMap): V of kotlin.collections.MutableMap? declared in kotlin.collections.MutableMap' type=kotlin.Int? origin=null
$this: GET_VAR '<this>: kotlin.collections.MutableMap<<root>.Visibility, kotlin.Int> declared in <root>.Visibilities.ORDERED_VISIBILITIES.<anonymous>' type=kotlin.collections.MutableMap<<root>.Visibility, kotlin.Int> origin=null
key: GET_OBJECT 'CLASS OBJECT name:Public modality:FINAL visibility:public superTypes:[<root>.Visibility]' type=<root>.Visibilities.Public
value: CONST Int type=kotlin.Int value=2
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public abstract fun put (key: K of kotlin.collections.MutableMap, value: V of kotlin.collections.MutableMap): V of kotlin.collections.MutableMap? declared in kotlin.collections.MutableMap' type=kotlin.Int? origin=null
$this: GET_VAR '<this>: kotlin.collections.MutableMap<<root>.Visibility, kotlin.Int> declared in <root>.Visibilities.ORDERED_VISIBILITIES.<anonymous>' type=kotlin.collections.MutableMap<<root>.Visibility, kotlin.Int> origin=null
key: GET_OBJECT 'CLASS OBJECT name:Public modality:FINAL visibility:public superTypes:[<root>.Visibility]' type=<root>.Visibilities.Public
value: CONST Int type=kotlin.Int value=2
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-ORDERED_VISIBILITIES> visibility:private modality:FINAL <> ($this:<root>.Visibilities) returnType:kotlin.collections.Map<<root>.Visibility, kotlin.Int>
correspondingProperty: PROPERTY name:ORDERED_VISIBILITIES visibility:private modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Visibilities