Closed
Conversation
…ead before definition Fixes that in some cases `@let` declarations that are read before they're defined were producing multiple diagnostics.
fe0a8b6 to
ed10722
Compare
…trol flow blocks When we process `@if` and `@for` blocks, we create a scope around their expressions in order to encapsulate the aliases to them. The problem is that this doesn't represent the actual structure since the expression is part of the outer scope. This surfaces by not raising the "used before declared" diagnostic for `@let` declarations. These changes resolve the issue by processing the expression as a part of the parent scope. Fixes angular#56842.
crisbeto
commented
Jul 4, 2024
| this.expressionScopes.set(branch, expressionScope); | ||
| const outerScope = Scope.forNodes(this.tcb, this.scope, branch, [], null); | ||
| outerScope.render().forEach((stmt) => this.scope.addStatement(stmt)); | ||
| this.expressionScopes.set(branch, outerScope); |
Member
Author
There was a problem hiding this comment.
This is the only line that actually changed. The rest of the diff here is renaming expressionScope to outerScope to be a bit more accurate.
Member
Author
|
Since these changes also affect |
JoostK
approved these changes
Jul 4, 2024
Member
|
This PR was merged into the repository by commit d7ab5c3. The changes were merged into the following branches: main, 18.1.x |
pkozlowski-opensource
pushed a commit
that referenced
this pull request
Jul 5, 2024
…trol flow blocks (#56843) When we process `@if` and `@for` blocks, we create a scope around their expressions in order to encapsulate the aliases to them. The problem is that this doesn't represent the actual structure since the expression is part of the outer scope. This surfaces by not raising the "used before declared" diagnostic for `@let` declarations. These changes resolve the issue by processing the expression as a part of the parent scope. Fixes #56842. PR Close #56843
pkozlowski-opensource
pushed a commit
that referenced
this pull request
Jul 5, 2024
…trol flow blocks (#56843) When we process `@if` and `@for` blocks, we create a scope around their expressions in order to encapsulate the aliases to them. The problem is that this doesn't represent the actual structure since the expression is part of the outer scope. This surfaces by not raising the "used before declared" diagnostic for `@let` declarations. These changes resolve the issue by processing the expression as a part of the parent scope. Fixes #56842. PR Close #56843
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes a couple of issues when we check if a
@letdeclaration is used before it is defined:fix(compiler-cli): avoid duplicate diagnostics for let declarations read before definition
Fixes that in some cases
@letdeclarations that are read before they're defined were producing multiple diagnostics.fix(compiler-cli): used before declared diagnostic not firing for control flow blocks
When we process
@ifand@forblocks, we create a scope around their expressions in order to encapsulate the aliases to them. The problem is that this doesn't represent the actual structure since the expression is part of the outer scope. This surfaces by not raising the "used before declared" diagnostic for@letdeclarations.These changes resolve the issue by processing the expression as a part of the parent scope.
Fixes #56842.