angular/packages/compiler-cli/src/ngtsc
Alex Rickabaugh 628f957c4a fix(ivy): add strictLiteralTypes to align Ivy + VE checking of literals (#35462)
Under View Engine's default (non-fullTemplateTypeCheck) checking, object and
array literals which appear in templates are treated as having type `any`.
This allows a number of patterns which would not otherwise compile, such as
indexing an object literal by a string:

```html
{{ {'a': 1, 'b': 2}[value] }}
```

(where `value` is `string`)

Ivy, meanwhile, has always inferred strong types for object literals, even
in its compatibility mode. This commit fixes the bug, and adds the
`strictLiteralTypes` flag to specifically control this inference. When the
flag is `false` (in compatibility mode), object and array literals receive
the `any` type.

PR Close #35462
2020-02-21 12:36:12 -08:00
..
annotations fix(compiler): use FatalDiagnosticError to generate better error messages (#35244) 2020-02-20 11:25:24 -08:00
core fix(ivy): add strictLiteralTypes to align Ivy + VE checking of literals (#35462) 2020-02-21 12:36:12 -08:00
cycles test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34736) 2020-01-15 14:58:09 -05:00
diagnostics refactor(compiler): rename diagnostics/src/code.ts to diagnostics/src/error_code.ts (#35067) 2020-01-31 11:25:27 -08:00
entry_point test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34736) 2020-01-15 14:58:09 -05:00
file_system Revert "feat(ngcc): pause async ngcc processing if another process has the lockfile (#35131)" 2020-02-19 11:14:31 -08:00
imports fix(ivy): support emitting a reference to interface declarations (#34849) 2020-02-04 10:40:46 -08:00
incremental fix(ivy): recompile on template change in ngc watch mode on Windows (#34015) 2020-02-04 10:40:23 -08:00
indexer refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 09:00:00 -08:00
metadata feat(ivy): throw compilation error when providing undecorated classes (#34460) 2019-12-18 15:04:51 -08:00
modulewithproviders refactor(ivy): change ImportMode enum to ImportFlags (#34649) 2020-01-23 10:31:49 -08:00
partial_evaluator fix(ngcc): correctly detect emitted TS helpers in ES5 (#35191) 2020-02-21 09:06:47 -08:00
perf refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
reflection fix(ngcc): correctly detect emitted TS helpers in ES5 (#35191) 2020-02-21 09:06:47 -08:00
resource fix(compiler-cli): add sass as a valid css preprocessor extension (#35052) 2020-01-31 13:28:40 -08:00
routing perf(ivy): use module resolution cache (#34332) 2019-12-12 14:06:38 -08:00
scope refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 09:00:00 -08:00
shims refactor(ivy): compute ignoreFiles for compilation on initialization (#34792) (#35346) 2020-02-11 13:31:22 -08:00
switch build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871) 2019-02-28 12:06:36 -08:00
testing fix(ivy): support emitting a reference to interface declarations (#34849) 2020-02-04 10:40:46 -08:00
transform fix(ivy): catch FatalDiagnosticError thrown from preanalysis phase (#34801) 2020-01-27 10:58:27 -08:00
translator refactor(ivy): consistently translate types to ts.TypeNode (#34021) 2020-01-06 11:06:08 -08:00
typecheck fix(ivy): add strictLiteralTypes to align Ivy + VE checking of literals (#35462) 2020-02-21 12:36:12 -08:00
util fix(ivy): support emitting a reference to interface declarations (#34849) 2020-02-04 10:40:46 -08:00
program.ts refactor(ivy): compute ignoreFiles for compilation on initialization (#34792) (#35346) 2020-02-11 13:31:22 -08:00
synthetic_files_compiler_host.ts feat: add support for TypeScript 3.3 (and drop older versions) (#29004) 2019-03-13 10:38:37 -07:00
tsc_plugin.ts refactor(ivy): use ClassDeclaration in more ReflectionHost methods (#29209) 2019-03-21 22:20:23 +00:00