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

Can't access property 'item' in dynamic object #885

Closed
RobWalker opened this issue May 5, 2021 · 2 comments · Fixed by #886
Closed

Can't access property 'item' in dynamic object #885

RobWalker opened this issue May 5, 2021 · 2 comments · Fixed by #886

Comments

@RobWalker
Copy link

This looks to be related to #642 but isn't solved but that fix.

The following test will fail:

        [Fact]
        public void CanAccessMemberNamedItemThroughExpando()
        {
            var parent = (IDictionary<String, Object>)new ExpandoObject();
            var child = (IDictionary<String, Object>)new ExpandoObject();
            var values = (IDictionary<String, Object>)new ExpandoObject();

            parent["child"] = child;
            child["item"] = values;
            values["title"] = "abc";

            _engine.SetValue("parent", parent);
            Assert.Equal("abc", _engine.Execute("parent.child.item.title").GetCompletionValue());
        }

Replacing the name item with zzitem (in both places) allows the test to pass.

Thanks.

@lahma
Copy link
Collaborator

lahma commented May 5, 2021

Thanks for the report, fixed in #886 .

@RobWalker
Copy link
Author

Thanks for the amazingly fast response!

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

Successfully merging a pull request may close this issue.

2 participants