Skip to content

InvokeGet on an instance field works, while it fails on static field. #4

@PiotrZierhoffer

Description

@PiotrZierhoffer

As a first note, I work on mono, not the very newest version from git, but quite new. I may test it on other versions as well, but I will have problems testing it on .NET.

Wiki tells us, that InvokeGet is for properties, yet I see it works with instance fields as well.

So this works:

var value = Dynamic.InvokeGet(target, "myField");

but this does not:

var context = InvokeContext.CreateStatic(target.GetType());
var value = Dynamic.InvokeGet(context, "myStaticField");

It fails with:

Microsoft.CSharp.RuntimeBinder.RuntimeBinderException:
`TargetType` does not contain a definition for `get_myStaticField`.

Am I doing something wrong or is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions