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

Interpreter.getAttribute scans attributes of parent scopes but ignores dictionaries #286

Open
almondtools opened this issue Aug 26, 2021 · 1 comment

Comments

@almondtools
Copy link

I found an unexpected behavior on resolving dictionaries and tracked it down to attribute resolution.

I found this code:

        // got to root scope and no definition, try dictionaries in group and up
        final ST self = scope.st;
        STGroup g = self.impl.nativeGroup;
        Object o = getDictionary(g, name);
        if ( o!=null ) return o;

        // not found, report unknown attr
        throw new STNoSuchAttributeException(name, scope);

According to the comment ("try dictionaries in group and up") dictionaries of parent scopes should have been resolved, but the code does not.

Now what is wrong? The comment or the code?

Actually I cannot reduce my code to a reproducing example, but I can try to provide a new example if the code is considered wrong.

@almondtools almondtools changed the title Interpreter.getAttribute scans Attributes of parent scopes but ignores dictionaries Interpreter.getAttribute scans attributes of parent scopes but ignores dictionaries Aug 26, 2021
@parrt
Copy link
Member

parrt commented Aug 27, 2021

Hmm...That does seem strange but unfortunately I'm not sure what the correct behavior is because it's been so long and I don't have time to investigate at the moment sorry!

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

2 participants