[BUGFIX beta] Local variables should win over helpers #17135
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, this would have tried to resolve and invoke the helper
foo
, ignoring the presence of thefoo
local variable. This is inconsistent with our general lexical lookup rules. This will now invokefoo
local variable as a contextual component.In other words, this removes the remaining "dot rule" exceptions for contextual components, as per RFC #311:
This commit also fixed another related issue:
Previously, this would have tried to resolve and invoke the
foo-bar
component. This is an unintended consequence (i.e. a bug) of the "dot rule" implementation. This will now raise aTypeError
in development mode and result in undefined behavior in production builds (probably some other runtime error deep inside the Glimmer VM internals).Fixes #17121, #16510.