[Mono-bugs] [Bug 653502] Runtime crash: An exception was thrown by the type initializer for PredicteOf'1

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Nov 16 10:06:54 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=653502

https://bugzilla.novell.com/show_bug.cgi?id=653502#c4


--- Comment #4 from Rainer Mager <rainer at qythyx.com> 2010-11-16 15:06:53 UTC ---
I just noticed one more thing about this. It seems to be related to Arrays.
Basically, if my initial source of data is an array of objects (structs only?)
then I can't do LINQ queries over it.

I found a quick fix, but it adds overhead.


Problem Case:
SomeStruct[] arr = new SomeStruct[] { xxx, yyy, zz };
arr.Sum(item => item.IntProp);



Solved Case:
SomeStruct[] arr = new SomeStruct[] { xxx, yyy, zz };
new List<SomeStruct>(arr).Sum(item => item.IntProp);


Basically, initializing a List with the Array and then using the List instead
solves it. But, as I mentioned, there is overhead in this and it is not a good
solution.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list