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

[BETA] {{link-to}} causes local variable shadowing error #17869

Closed
chancancode opened this issue Apr 5, 2019 · 0 comments
Closed

[BETA] {{link-to}} causes local variable shadowing error #17869

chancancode opened this issue Apr 5, 2019 · 0 comments

Comments

@chancancode
Copy link
Member

{{#let ... as |hash|}}
  {{#link-to "some.route" model (query-params foo=bar)}}some link{{/link-to}}
{{/let}}

On beta and canary, this causes the local variable shadowing error, because #17779 transformed the above into...

{{#let ... as |hash|}}
  {{#link-to route="some.route" model=model query=(hash foo=bar)}}some link{{/link-to}}
{{/let}}

In particular, it added a hash helper invocation which is now conflicting with the hash local variable.

I think the fix is to move the assertion plugin above the new transform plugin.

wycats pushed a commit that referenced this issue Apr 6, 2019
wycats pushed a commit that referenced this issue Apr 6, 2019
…tions)

This doesn't really "fix" the issue, it just silent this particular
assertion basically. This is ok, because the test will fail when we
implement the "everything is a value" semantics, at which point we
can fix it by renaming the hash helper. (We could fix it now by
renaming the offending hash local variable too, but that would be
pretty difficult to do correctly.)

Closes #17869.
chancancode added a commit that referenced this issue Apr 6, 2019
[BUGFIX beta] Fix for #17869 (link-to causing `hash` local variable assertions)
wycats pushed a commit that referenced this issue Apr 6, 2019
(cherry picked from commit 1cff9f1)
@wycats wycats closed this as completed in 5656cc5 Apr 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant