angular-cn/packages/compiler-cli/test
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
..
compliance build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
diagnostics build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
helpers build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ngtsc fix(compiler-cli): use ModuleWithProviders type if static eval fails (#37126) 2020-06-03 13:23:16 -07:00
transformers build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
BUILD.bazel build: derive ts_library dep from jasmine_node_test boostrap label if it ends in `_es5` (#34736) 2020-01-15 14:58:07 -05:00
extract_i18n_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
mocks.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ngc_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
perform_compile_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04: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 build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
typescript_support_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00