Add original KotlinType to rendered IrErrorType

Also improve an error message in `IrType.erasedUpperBound`, which seems
like a frequent first place where the JVM IR backend crashes in case an
error type has made it past psi2ir.

This will help in diagnosing problems such as KT-45016.
This commit is contained in:
Alexander Udalov
2021-03-01 20:28:27 +01:00
parent cd9463ae8d
commit e3dc112c5f
7 changed files with 60 additions and 59 deletions
@@ -2,11 +2,11 @@ FILE fqName:<root> fileName:/useNextParamInLambda.kt
FUN name:f visibility:public modality:FINAL <> (f1:kotlin.Function0<kotlin.String>, f2:kotlin.Function0<kotlin.String>) returnType:kotlin.String
VALUE_PARAMETER name:f1 index:0 type:kotlin.Function0<kotlin.String>
EXPRESSION_BODY
FUN_EXPR type=kotlin.Function0<IrErrorType> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:IrErrorType
FUN_EXPR type=kotlin.Function0<IrErrorType(null)> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:IrErrorType(null)
BLOCK_BODY
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): IrErrorType declared in <root>.f'
ERROR_CALL 'Unresolved reference: <Unresolved name: f2>#' type=IrErrorType
RETURN type=kotlin.Nothing from='local final fun <anonymous> (): IrErrorType(null) declared in <root>.f'
ERROR_CALL 'Unresolved reference: <Unresolved name: f2>#' type=IrErrorType(null)
VALUE_PARAMETER name:f2 index:1 type:kotlin.Function0<kotlin.String>
EXPRESSION_BODY
FUN_EXPR type=kotlin.Function0<kotlin.String> origin=LAMBDA