FIR2IR strip FlexibleNullability on IMPLICIT_NOTNULL

This commit is contained in:
Dmitry Petrov
2021-11-23 18:56:53 +03:00
committed by Space
parent 196f087b54
commit badfade2fd
43 changed files with 414 additions and 151 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ FILE fqName:<root> fileName:/JCTreeUser.kt
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.JCTree.JCTypeApply
GET_VAR 'var tree: <root>.JCTree [var] declared in <root>.Owner.<get-foo>' type=<root>.JCTree origin=null
then: RETURN type=kotlin.Nothing from='public final fun <get-foo> (): kotlin.String declared in <root>.Owner'
TYPE_OP type=@[FlexibleNullability] kotlin.String origin=IMPLICIT_NOTNULL typeOperand=@[FlexibleNullability] kotlin.String
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:clazz type:@[FlexibleNullability] kotlin.String? visibility:public' type=@[FlexibleNullability] kotlin.String? origin=GET_PROPERTY
receiver: TYPE_OP type=<root>.JCTree.JCTypeApply origin=IMPLICIT_CAST typeOperand=<root>.JCTree.JCTypeApply
GET_VAR 'var tree: <root>.JCTree [var] declared in <root>.Owner.<get-foo>' type=<root>.JCTree origin=null
+2 -1
View File
@@ -13,9 +13,10 @@ class Owner<out T : JCTree> {
get(): String {
var tree: JCTree = <this>.<get-tree>()
when {
tree is JCTypeApply -> return tree /*as JCTypeApply */.#clazz /*!! @FlexibleNullability String */
tree is JCTypeApply -> return tree /*as JCTypeApply */.#clazz /*!! String */
}
return ""
}
}