angular-cn/packages/compiler-cli/test/ngtsc
Alex Rickabaugh 965a688c97 fix(compiler-cli): use ModuleWithProviders type if static eval fails (#37126)
When the compiler encounters a function call within an NgModule imports
section, it attempts to resolve it to an NgModule-annotated class by
looking at the function body and evaluating the statements there. This
evaluation can only understand simple functions which have a single
return statement as their body. If the function the user writes is more
complex than that, the compiler won't be able to understand it and
previously the PartialEvaluator would return a "DynamicValue" for
that import.

With this change, in the event the function body resolution fails the
PartialEvaluator will now attempt to use its foreign function resolvers to
determine the correct result from the function's type signtaure instead. If
the function is annotated with a correct ModuleWithProviders type, the
compiler will be able to understand the import without static analysis of
the function body.

PR Close #37126
2020-06-03 13:23:16 -07:00
..
fake_core build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
BUILD.bazel test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34736) 2020-01-15 14:58:07 -05:00
component_indexing_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
env.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
incremental_error_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
incremental_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
modulewithproviders_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
monorepo_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ngtsc_spec.ts fix(compiler-cli): use ModuleWithProviders type if static eval fails (#37126) 2020-06-03 13:23:16 -07:00
scope_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
sourcemap_utils.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
template_mapping_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
template_typecheck_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00