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

Attempting to bind values to reserved name should trigger a warning #739

Closed
ogoffart opened this issue Dec 11, 2021 Discussed in #738 · 2 comments
Closed

Attempting to bind values to reserved name should trigger a warning #739

ogoffart opened this issue Dec 11, 2021 Discussed in #738 · 2 comments

Comments

@ogoffart
Copy link
Member

Discussed in #738

Originally posted by hbina December 11, 2021
I have wasted a disgusting amount of time only to realize that row is a reserved keyword. I basically had something like this compiled without warning, which does not even make any sense because row here is shadowed by the reserved name anyways.

for row in bson.inner : HorizontalBox {
    key := Text {
        text: row.key;
    }
    value := Text {
        text: row.value;
    }
}
```</div>
@ogoffart
Copy link
Member Author

This is actually valid, and we use that quite a lot in our own code:

for x in foobar : Text { text: x; }
// or
for item in foobar : SomeStuff { item:item; }

The problem in the original example is that key and value element are not direct child.

Eventually we should change the lookup rules: #273

@ogoffart
Copy link
Member Author

Lookup changes are done with the new syntax.
Closing this issue now.

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