Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentException with example code #2

Closed
slimshader opened this issue Jan 21, 2017 · 3 comments
Closed

ArgumentException with example code #2

slimshader opened this issue Jan 21, 2017 · 3 comments

Comments

@slimshader
Copy link

slimshader commented Jan 21, 2017

Hi,

I just created fresh project in Unity 5.5, with empty GO and MB attached (in zip). This results in exception:

ArgumentException: does not implement right interface
System.Collections.Generic.Comparer1+DefaultComparer[ZeroFormatter.KeyTuple2[Gender,System.Int32]].Compare (KeyTuple2 x, KeyTuple2 y) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:771)
System.Array.compare[KeyTuple2] (KeyTuple2 value1, KeyTuple2 value2, IComparer1 comparer) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:319)
System.Array.qsort[KeyTuple2,Person] (ZeroFormatter.KeyTuple2[] keys, .Person[] items, Int32 low0, Int32 high0, IComparer1 comparer) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:619) System.Array.Sort[KeyTuple2,Person] (ZeroFormatter.KeyTuple2[] keys, .Person[] items, Int32 index, Int32 length, IComparer1 comparer) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:303)
Rethrow as InvalidOperationException: The comparer threw an exception.
System.Array.Sort[KeyTuple2,Person] (ZeroFormatter.KeyTuple2[] keys, .Person[] items, Int32 index, Int32 length, IComparer1 comparer) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:303) MasterMemory.Memory2[ZeroFormatter.KeyTuple2[Gender,System.Int32],Person].FastSort (IEnumerable1 datasource, System.Func2 indexSelector, IComparer1 comparer) (at Assets/MasterMemory/Memory.cs:360)
MasterMemory.Memory2[ZeroFormatter.KeyTuple2[Gender,System.Int32],Person]..ctor (IEnumerable1 datasource, System.Func2 indexSelector, Boolean rootMemory) (at Assets/MasterMemory/Memory.cs:87)
MasterMemory.Memory2[ZeroFormatter.KeyTuple2[Gender,System.Int32],Person]..ctor (IEnumerable1 datasource, System.Func2 indexSelector) (at Assets/MasterMemory/Memory.cs:77)
MemoryTesting.Start () (at Assets/MemoryTesting.cs:71)

I am using unitypackage from releases for MasterMemory (0.1.0) and binary (dll) releases for ZeroFormatter (1.6.0)

MemoryTesting.zip

@neuecc
Copy link
Member

neuecc commented Jan 23, 2017

Thank you for testing!
Are you generated comparers from MasterMemory.CodeGenerator.exe?
https://github.com/neuecc/MasterMemory#unity-supports

and we needs MasterMemoryHintAttribute (sorry, currenly undocumented feature) on top of file.

[assembly: MasterMemoryHint(typeof(Person), typeof(int), typeof(KeyTuple<Gender, int>))]

sorry, I need to write more document.

@slimshader
Copy link
Author

To be honest I am not sure what I should generate. I am testing for Windows platform so I should not be affected by IL2CPP issue, right?

It is a pleasure to test your stuff :)

@neuecc
Copy link
Member

neuecc commented Jan 30, 2017

I need to make three pattern

  • for .NET, .NET Core - it allows .NET 4.5 API
  • for Unity(not IL2CPP) - it allows dynamic code generation
  • for Unity(IL2CPP) - require pre code generation

However, due to share of the code, now Unity is only IL2CPP (ZeroFormatter is also the same reason).

@neuecc neuecc closed this as completed Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants