Skip to content

Commit 04bf949

Browse files
committed
проверка на сравнимость
1 parent 971d555 commit 04bf949

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ScriptEngine/Machine/GenericIValueComparer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This Source Code Form is subject to the terms of the
55
at http://mozilla.org/MPL/2.0/.
66
----------------------------------------------------------*/
77

8+
using System;
89
using System.Collections.Generic;
910
using OneScript.Values;
1011
using ScriptEngine.Machine.Contexts;
@@ -42,7 +43,7 @@ public int Compare(IValue x, IValue y)
4243
if (ReferenceEquals(x, y))
4344
return 0;
4445

45-
if (x.SystemType == y.SystemType)
46+
if (x is IComparable && x.SystemType == y.SystemType )
4647
return x.CompareTo(y);
4748
else
4849
return x.ToString().CompareTo(y.ToString());

0 commit comments

Comments
 (0)