angular-docs-cn/packages/compiler-cli/test
JoostK 51156f3f07 fix(core): allow proper type inference when `ngFor` is used with a `trackBy` function (#42692)
In #41995 the type of `TrackByFunction` was changed such that the
declaration of a `trackBy` function did not cause the item type to be
widened to the `trackBy`'s item type, which may be a supertype of the
iterated type. This has introduced situations where the template type
checker is now reporting errors for cases where a `trackBy` function is
no longer assignable to `TrackByFunction`.

This commit fixes the error by also including the item type `T` in
addition to the constrained type parameter `U`, allowing TypeScript to
infer an appropriate `T`.

Fixes #42609

PR Close #42692
2021-07-13 14:08:05 -07:00
..
compliance fix(compiler): incorrect context object being referenced from listener instructions inside embedded views (#42755) 2021-07-12 11:58:18 -07:00
diagnostics feat(compiler-cli): add support for TypeScript 4.0 (#38076) 2020-08-24 13:06:59 -07:00
metadata refactor(compiler-cli): ensure compatibility with noImplicitOverride (#42512) 2021-07-12 13:11:14 -07:00
ngtsc fix(core): allow proper type inference when `ngFor` is used with a `trackBy` function (#42692) 2021-07-13 14:08:05 -07:00
transformers fix(compiler-cli): update type castings for JSON.parse usage (#40710) 2021-02-09 10:48:43 -08:00
BUILD.bazel fix(compiler-cli): `readConfiguration` existing options should override options in tsconfig (#40694) 2021-02-11 13:29:51 -08:00
extract_i18n_spec.ts refactor(compiler): `element.sourceSpan` should span the `outerHTML` (#38581) 2020-09-02 14:47:31 -07:00
mocks.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ngc_spec.ts fix(compiler-cli): show a more specific error for Ivy NgModules (#41534) 2021-04-13 07:34:45 -07:00
perform_compile_spec.ts fix(compiler-cli): fix extending angularCompilerOptions from non relative extension less TypeScript configuration files (#41349) 2021-04-07 09:37:44 -07:00
perform_watch_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test_support.ts test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
typescript_support_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00