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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user