[Mono-bugs] [Bug 334737] New: mcs generates invalid code for indexers which have a value type

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Oct 17 18:39:34 EDT 2007


           Summary: mcs generates invalid code for indexers which have a
                    value type
           Product: Mono: Compilers
           Version: 1.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: rharinath at novell.com
        ReportedBy: vargaz at gmail.com
         QAContact: mono-bugs at ximian.com
          Found By: ---

using System;

public struct SymbolId {

public interface IAttributesCollection {
        object this[SymbolId name] { get; set; }

class Program
        public static object SetDictionaryValue(object self, SymbolId name,
object value) {
                IAttributesCollection dict = null;

                return dict[name] = value;

        static void Main ()

In SetDictionaryValue, the following IL is generated:
       .locals init (
                class IAttributesCollection     V_0,
                object  V_1)
        IL_0000:  ldnull
        IL_0001:  stloc.0
        IL_0002:  ldarg.2
        IL_0003:  stloc.1
        IL_0004:  ldloc.0
        IL_0005:  ldloc.1
        IL_0006:  ldarg.2
        IL_0007:  callvirt instance void class
IAttributesCollection::set_Item(valuetype SymbolId, object)
        IL_000c:  ldloc.1
        IL_000d:  ret

The second argument to set_Item has type object, while it should have type
SymbolId. This issue is causing problems when using IronPython.

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