angular-cn/packages/compiler-cli/test/ngtsc
Alex Rickabaugh 6ba5fdc208 fix(ivy): generate a better error for template var writes (#34339)
In Ivy it's illegal for a template to write to a template variable. So the
template:

```html
<ng-template let-somevar>
  <button (click)="somevar = 3">Set var to 3</button>
</ng-template>
```

is erroneous and previously would fail to compile with an assertion error
from the `TemplateDefinitionBuilder`. This error wasn't particularly user-
friendly, though, as it lacked the context of which template or where the
error occurred.

In this commit, a new check in template type-checking is added which detects
such erroneous writes and produces a true diagnostic with the appropriate
context information.

Closes #33674

PR Close #34339
2019-12-12 13:13:32 -08:00
..
fake_core fix(core): make QueryList implement Iterable in the type system (#33536) 2019-11-19 13:43:53 -08:00
BUILD.bazel build: remove redundant `@types/source-map` dependency (#31468) 2019-07-11 17:18:12 -04:00
component_indexing_spec.ts feat(ivy): index template references, variables, bound attributes/events (#31535) 2019-07-25 13:09:10 -07:00
env.ts test(ivy): driveDiagnostics() works incrementally (#33862) 2019-11-20 11:46:02 -08:00
incremental_error_spec.ts perf(ivy): reuse prior analysis work during incremental builds (#34288) 2019-12-12 13:11:45 -08:00
incremental_spec.ts perf(ivy): reuse prior analysis work during incremental builds (#34288) 2019-12-12 13:11:45 -08:00
modulewithproviders_spec.ts refactor(ivy): include generic type for `ModuleWithProviders` in .d.ts files (#34235) 2019-12-10 16:34:47 -08:00
monorepo_spec.ts fix(ivy): emit fs-relative paths when rootDir(s) aren't in effect (#33828) 2019-11-19 12:41:24 -08:00
ngtsc_spec.ts refactor(compiler): i18n - render legacy i18n message ids (#34135) 2019-12-03 10:15:53 -08:00
scope_spec.ts fix(ivy): retain JIT metadata unless JIT mode is explicitly disabled (#33671) 2019-11-20 12:55:43 -08:00
sourcemap_utils.ts refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
template_mapping_spec.ts perf(ivy): move attributes array into component def (#32798) 2019-10-09 13:16:55 -07:00
template_typecheck_spec.ts fix(ivy): generate a better error for template var writes (#34339) 2019-12-12 13:13:32 -08:00