Skip to content

Commit 1a9b09d

Browse files
committed
приведение к строке через ToString
1 parent b6c2923 commit 1a9b09d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/OneScript.Native/Compiler/ExpressionHelpers.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ private static Expression TryFindConversionOp(Expression value, Type targetType)
297297
// если будет ненадежно - поиграем с поиском статических конверсий
298298
try
299299
{
300+
if (targetType == typeof(string))
301+
{
302+
return Expression.Call(value, "ToString", null, null);
303+
}
304+
300305
return Expression.Convert(value, targetType);
301306
}
302307
catch (InvalidOperationException)

0 commit comments

Comments
 (0)