Skip to content

Commit a638fcc

Browse files
committed
add compatible
1 parent 247f08f commit a638fcc

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

CSharp.lua/CoreSystem.Lua/CoreSystem/Collections/Dictionary.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ local DictionaryEnumerator = define("System.DictionaryEnumerator", {
158158
return true
159159
else
160160
if kind then
161-
kind.Key, kind.Value = kind.Key:default(), kind.Value:default()
161+
kind.Key, kind.Value = kind.__genericTKey__:default(), kind.__genericTValue__:default()
162162
elseif kind == false then
163163
this.current = t.__genericTValue__:default()
164164
else

CSharp.lua/CoreSystem.Lua/CoreSystem/Collections/EqualityComparer.lua

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
local System = System
1818
local define = System.define
1919
local throw = System.throw
20+
local equalsObj = System.equalsObj
2021
local compareObj = System.compareObj
2122
local ArgumentException = System.ArgumentException
2223
local ArgumentNullException = System.ArgumentNullException
@@ -34,13 +35,7 @@ EqualityComparer = define("System.EqualityComparer", function (T)
3435
end
3536
end
3637
else
37-
if T.class == 'S' then
38-
equals = T.EqualsObj
39-
else
40-
equals = function (x, y)
41-
return x:EqualsObj(y)
42-
end
43-
end
38+
equals = equalsObj
4439
end
4540
local defaultComparer
4641
return {

CSharp.lua/CoreSystem.Lua/CoreSystem/Core.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,7 @@ local function compareObj(a, b)
10411041
throw(System.ArgumentException("Argument_ImplementIComparable"))
10421042
end
10431043

1044+
System.equalsObj = equalsObj
10441045
System.compareObj = compareObj
10451046

10461047
Object = defCls("System.Object", {

0 commit comments

Comments
 (0)