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

"Using indexers" of C# does not work #1165

Open
waytoeden opened this issue Sep 23, 2024 · 0 comments
Open

"Using indexers" of C# does not work #1165

waytoeden opened this issue Sep 23, 2024 · 0 comments

Comments

@waytoeden
Copy link

waytoeden commented Sep 23, 2024

var setter = prop.GetSetMethod();
if (setter != null && setter.IsPublic)
{
    if (prop.GetIndexParameters().Length > 0)
    {
        if (!prop.GetIndexParameters()[0].ParameterType.IsAssignableFrom(typeof(string)))
        {
            itemSetter.Add(setter);
        }
    }
    else
    {
        emitRegisterFunc(il, emitPropertyWrap(wrapTypeBuilder, prop, setter, false), Utils.SETTER_IDX, prop.Name);
    }
}

Request for modification as below , also getter

var setter = prop.GetSetMethod();
if (setter != null && setter.IsPublic)
{
    if (prop.GetIndexParameters().Length > 0)
    {
        if (prop.GetIndexParameters()[0].ParameterType.IsAssignableFrom(typeof(string)))
        {
            itemSetter.Add(setter);
        }
    }
    else
    {
        emitRegisterFunc(il, emitPropertyWrap(wrapTypeBuilder, prop, setter, false), Utils.SETTER_IDX, prop.Name);
    }
}
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

1 participant