[Mono-bugs] [Bug 637526] New: Invalid IL code in Enumerable.cs
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Sep 7 10:33:46 EDT 2010
https://bugzilla.novell.com/show_bug.cgi?id=637526
https://bugzilla.novell.com/show_bug.cgi?id=637526#c0
Summary: Invalid IL code in Enumerable.cs
Classification: Mono
Product: Mono: Class Libraries
Version: 2.6.x
Platform: x86
OS/Version: Windows XP
Status: NEW
Severity: Critical
Priority: P5 - None
Component: Sys.Core
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: anidotnet at gmail.com
QAContact: mono-bugs at lists.ximian.com
CC: anidotnet at gmail.com
Found By: Customer
Blocker: ---
Description of Problem:
I have the following function to remove a particular character from a string
public static string Remove(this string strA, char target)
{
char[] charArr = strA.ToCharArray();
var targetArr = new List<char>();
targetArr.AddRange(
charArr.Where(
character =>
!character.ToString(CultureInfo.InvariantCulture).Equals(
target.ToString(CultureInfo.InvariantCulture),
StringComparison.InvariantCultureIgnoreCase)));
return new string(targetArr.ToArray());
}
using this function in .Net framework gives rise to
"Hello World".Remove('l') ---> Heo Word
but Mono throws the following exception
System.InvalidProgramException: Invalid IL code in (wrapper delegate-invoke)
System.Func`2<char, bool>:invoke_bool__this___char (char): IL_004d: castclass
0x00000007
at
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[System.Char].MoveNext
() [0x00059] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.6.7\mcs\class\System.Core\System.Linq\Enumerable.cs:2305
at System.Collections.Generic.List`1[System.Char].AddEnumerable
(IEnumerable`1 enumerable) [0x0001a] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.6.7\mcs\class\corlib\System.Collections.Generic\List.cs:125
at System.Collections.Generic.List`1[System.Char].AddRange (IEnumerable`1
collection) [0x00020] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.6.7\mcs\class\corlib\System.Collections.Generic\List.cs:139
at AbstractClass.Extensions.StringExtensions.Remove (System.String strA, Char
target) [0x000de] in
C:\Docs\Quasar\Quasar.Core\Extensions\StringExtensions.cs:263
at QuasarDemo.Tests.ExtensionTest.RunStringTest () [0x00000] in <filename
unknown>:0
at QuasarDemo.Tests.ExtensionTest.Run () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
(object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x000d0] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.6.7\mcs\class\corlib\System.Reflection\MonoMethod.cs:213
Steps to reproduce the problem:
1. Compile the afore-mentioned function on Mono 2.6.7 and run it in Windows XP
Actual Results:
Calling the function is throwing the following exception
System.InvalidProgramException: Invalid IL code in (wrapper delegate-invoke)
System.Func`2<char, bool>:invoke_bool__this___char (char): IL_004d: castclass
0x00000007
Expected Results:
The function should produce the following result as like .net framework
"Hello World".Remove('l') ---> Heo Word
How often does this happen?
Every time I compile and run the above code in Mono 2.6.7
Additional Information:
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list