fix(ivy): align VE + Ivy #ref types in fullTemplateTypeCheck: false (#33261)

In View Engine, with fullTemplateTypeCheck mode disabled, the type of any
inferred based on the entity being referenced. This is a bug, since the
goal with fullTemplateTypeCheck: false is for Ivy and VE to be aligned in
terms of type inference.

This commit adds a 'checkTypeOfReference' flag in the TypeCheckingConfig
to control this inference, and sets it to false when fullTemplateTypeCheck
is disabled.

PR Close #33261
This commit is contained in:
Alex Rickabaugh
2019-10-18 17:20:17 -07:00
committed by Andrew Kushnir
parent ba29e4d953
commit 77240e1b60
5 changed files with 33 additions and 0 deletions

View File

@ -435,6 +435,7 @@ export class NgtscProgram implements api.Program {
// - error TS2531: Object is possibly 'null'.
// - error TS2339: Property 'value' does not exist on type 'EventTarget'.
checkTypeOfDomEvents: false,
checkTypeOfReferences: true,
checkTypeOfPipes: true,
strictSafeNavigationTypes: true,
};
@ -449,6 +450,7 @@ export class NgtscProgram implements api.Program {
checkTypeOfOutputEvents: false,
checkTypeOfAnimationEvents: false,
checkTypeOfDomEvents: false,
checkTypeOfReferences: false,
checkTypeOfPipes: false,
strictSafeNavigationTypes: false,
};