Make TypeMapper use signatureWriter for scripts expression evaluation;

Support nullability detection for IrScriptSymbol;

tests in IJ commit: "[scripting] Introduce tests for KT-51755"
This commit is contained in:
Nikolay Egorov
2022-06-02 11:01:26 +03:00
committed by teamcity
parent 1c04162690
commit 149402cf00
2 changed files with 5 additions and 1 deletions
@@ -102,7 +102,10 @@ object AbstractTypeMapper {
mapType(context, type.original(), mode, sw)
typeConstructor.isScript() ->
Type.getObjectType(context.getScriptInternalName(typeConstructor))
Type.getObjectType(context.getScriptInternalName(typeConstructor)).let {
sw?.writeClass(it)
it
}
else ->
throw UnsupportedOperationException("Unknown type $type")
@@ -43,6 +43,7 @@ fun IrType.isNullable(): Boolean =
SimpleTypeNullability.NOT_SPECIFIED -> classifier.owner.superTypes.any(IrType::isNullable)
SimpleTypeNullability.DEFINITELY_NOT_NULL -> false
}
is IrScriptSymbol -> nullability == SimpleTypeNullability.MARKED_NULLABLE
else -> error("Unsupported classifier: $classifier")
}
is IrDynamicType -> true