[FIR] Display actual type for argument type mismatch error

Previously the argument type was being used for the actual type error
display. However, safe-call arguments are unwrapped which causes
nullable types to be displayed as non-null. Change to use the actual
type provided by the diagnostic instead of extracting the type from
the argument.

#KT-58844 Fixed
This commit is contained in:
Brian Norman
2023-06-15 08:25:22 -05:00
committed by Space Team
parent a7ff0cfc9d
commit 269dfc61c8
10 changed files with 57 additions and 3 deletions
@@ -11,7 +11,7 @@ compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:2:74: error: cannot a
compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:7:20: error: 'this' is not defined in this context
class B(other: B = this)
^
compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:10:32: error: argument type mismatch: actual type is kotlin/Function0<ERROR CLASS: Cannot access ''<this>'' before the instance has been initialized> but kotlin/Int was expected
compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:10:32: error: argument type mismatch: actual type is kotlin/Function0<ERROR CLASS: Unknown return lambda parameter type> but kotlin/Int was expected
constructor(x: Int) : this({
^
compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:12:9: error: cannot access '<this>' before the instance has been initialized