Skip to content

Commit 5cb3e74

Browse files
committed
приведение возвращаемого методом значения
1 parent 20747ca commit 5cb3e74

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/OneScript.Native/Compiler/MethodCompiler.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,10 +1286,15 @@ private Expression CreateMethodCall(CallNode node)
12861286
var methodInfo = symbol.Method;
12871287
if (methodInfo is ContextMethodInfo contextMethod)
12881288
{
1289-
return DirectClrCall(
1289+
var call = DirectClrCall(
12901290
GetMethodBinding(binding, symbol),
12911291
contextMethod.GetWrappedMethod(),
12921292
args);
1293+
1294+
if (call.Type == typeof(IValue))
1295+
return Expression.TypeAs(call, typeof(BslValue));
1296+
1297+
return call;
12931298
}
12941299

12951300
if (methodInfo is BslNativeMethodInfo nativeMethod)

0 commit comments

Comments
 (0)