[FIR] Typing for try-catch

This commit is contained in:
Simon Ogorodnik
2019-05-15 15:47:45 +03:00
committed by Mikhail Glukhikh
parent 30e097a1e0
commit b469eb293b
5 changed files with 27 additions and 12 deletions
@@ -1,9 +1,9 @@
FILE fqName:<root> fileName:/catchParameterAccess.kt
FUN name:test visibility:public modality:FINAL <> (f:kotlin.Function0<kotlin.Unit>) returnType:IrErrorType
FUN name:test visibility:public modality:FINAL <> (f:kotlin.Function0<kotlin.Unit>) returnType:kotlin.Nothing?
VALUE_PARAMETER name:f index:0 type:kotlin.Function0<kotlin.Unit>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test (f: kotlin.Function0<kotlin.Unit>): IrErrorType declared in <root>'
TRY type=IrErrorType
RETURN type=kotlin.Nothing from='public final fun test (f: kotlin.Function0<kotlin.Unit>): kotlin.Nothing? declared in <root>'
TRY type=kotlin.Nothing?
try: ERROR_CALL 'Unresolved reference: <Unresolved name: f>#' type=IrErrorType
CATCH parameter=val e: java.lang.Exception [val] declared in <root>.test
VAR name:e type:java.lang.Exception [val]
+2 -2
View File
@@ -1,7 +1,7 @@
FILE fqName:<root> fileName:/tryCatch.kt
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
TRY type=IrErrorType
TRY type=kotlin.Unit
try: CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
CATCH parameter=val e: kotlin.Throwable [val] declared in <root>.test1
VAR name:e type:kotlin.Throwable [val]
@@ -10,7 +10,7 @@ FILE fqName:<root> fileName:/tryCatch.kt
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in <root>'
TRY type=IrErrorType
TRY type=kotlin.Int
try: BLOCK type=kotlin.Int origin=null
CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
CONST Int type=kotlin.Int value=42
@@ -9,7 +9,7 @@ FILE fqName:<root> fileName:/tryCatchWithImplicitCast.kt
then: RETURN type=kotlin.Nothing from='public final fun testImplicitCast (a: kotlin.Any): kotlin.Unit declared in <root>'
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
VAR name:t type:kotlin.String [val]
TRY type=IrErrorType
TRY type=kotlin.String
try: GET_VAR 'a: kotlin.Any declared in <root>.testImplicitCast' type=kotlin.Any origin=null
CATCH parameter=val e: kotlin.Throwable [val] declared in <root>.testImplicitCast
VAR name:e type:kotlin.Throwable [val]