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

[BUGFIX beta] Assert when local variables shadow modifier invocations #17137

Merged
merged 1 commit into from
Oct 20, 2018

Conversation

chancancode
Copy link
Member

Expanding #17132 to cover modifiers.

{{#let this.foo as |foo|}}
  <div {{foo}} />
         ~~~ shadowed modifier invocation!
{{/let}}

Previously, this would have tried to resolve and invoke the modifier foo, ignoring the presence of the foo local variable. This is inconsistent with our general lexical lookup rules. This is now an error (assertion).

This paves the way for allowing "contextual modifiers" in the future, where the local variable foo contains an invocable modifier value.

Expanding #17132 to cover modifiers.

```hbs
{{#let this.foo as |foo|}}
  <div {{foo}} />
         ~~~ shadowed modifier invocation!
{{/let}}
```

Previously, this would have tried to resolve and invoke the modifier `foo`,
ignoring the presence of the `foo` local variable. This is inconsistent
with our general lexical lookup rules. This is now an error (assertion).

This paves the way for allowing "contextual modifiers" in the future, where
the local variable `foo` contains an invocable modifier value.
@chancancode chancancode force-pushed the assert-local-variable-shadowing-modifier-invocation branch from b85c38c to 74b8f60 Compare October 20, 2018 01:38
@rwjblue rwjblue merged commit 6d57f74 into master Oct 20, 2018
@rwjblue rwjblue deleted the assert-local-variable-shadowing-modifier-invocation branch December 4, 2018 20:57
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 this pull request may close these issues.

2 participants