mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This commit adds support in the template type-checking engine for handling the logical not operation and the safe navigation operation. Safe navigation in particular is tricky, as the View Engine implementation has a rather inconvenient flaw. View Engine checks a safe navigation operation `a?.b` as: ```typescript (a != null ? a!.b : null as any) ``` The type of this expression is always 'any', as the false branch of the ternary has type 'any'. Thus, using null-safe navigation throws away the type of the result, and breaks type-checking for the rest of the expression. A flag is introduced in the type-checking configuration to allow Ivy to mimic this behavior when needed. Testing strategy: TCB tests included. PR Close #29698 |
||
|---|---|---|
| .. | ||
| integrationtest | ||
| ngcc | ||
| src | ||
| test | ||
| BUILD.bazel | ||
| index.ts | ||
| ngtools2.ts | ||
| package.json | ||
| tsconfig-build.json | ||
| tsconfig.json | ||