angular-docs-cn/packages/compiler-cli
Alex Rickabaugh 4253662231 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:11 -08:00
..
integrationtest feat(ngcc): automatically clean outdated ngcc artifacts (#35079) 2020-01-31 17:02:44 -08:00
ngcc fix(ngcc): correctly detect emitted TS helpers in ES5 (#35191) 2020-02-21 09:06:46 -08:00
src fix(ivy): add strictLiteralTypes to align Ivy + VE checking of literals (#35462) 2020-02-21 12:36:11 -08:00
test fix(ivy): incorrectly generating shared pure function between null and object literal (#35481) 2020-02-20 15:23:58 -08:00
BUILD.bazel build: remove dependency on `@types/chokidar` (#35371) 2020-02-19 12:49:52 -08:00
index.ts refactor(compiler-cli): Move diagnostics files to language service (#33809) 2019-11-14 09:29:07 -08:00
package.json feat(ngcc): automatically clean outdated ngcc artifacts (#35079) 2020-01-31 17:02:44 -08:00
tsconfig-build.json build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
tsconfig.json perf(ivy): ngcc - only find dependencies when targeting a single entry-point (#30525) 2019-07-09 09:40:46 -07:00