mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Previously, when generating template type-checking code, casts to 'any' were produced as `expr as any`, regardless of the expression. However, for certain expression types, this led to precedence issues with the cast. For example, `a !== b` is a `ts.BinaryExpression`, and wrapping it directly in the cast yields `a !== b as any`, which is semantically equivalent to `a !== (b as any)`. This is obviously not what is intended. Instead, this commit adds a list of expression types for which a "bare" wrapping is permitted. For other expressions, parentheses are added to ensure correct precedence: `(a !== b) as any` PR Close #34649 |
||
|---|---|---|
| .. | ||
| diagnostics | ||
| metadata | ||
| ngtsc | ||
| transformers | ||
| extract_i18n.ts | ||
| language_services.ts | ||
| main.ts | ||
| perform_compile.ts | ||
| perform_watch.ts | ||
| tooling.ts | ||
| typescript_support.ts | ||
| version.ts | ||