fix(ivy): use any for generic context checks when !strictTemplates (#34649)
Previously, the template type-checker would always construct a generic template context type with correct bounds, even when strictTemplates was disabled. This meant that type-checking of expressions involving that type was stricter than View Engine. This commit introduces a 'strictContextGenerics' flag which behaves similarly to other 'strictTemplates' flags, and switches the inference of generic type parameters on the component context based on the value of this flag. PR Close #34649
This commit is contained in:

committed by
Andrew Kushnir

parent
2cf7d0fd05
commit
e69d02c69f
@ -972,7 +972,8 @@ export declare class AnimationEvent {
|
||||
});
|
||||
|
||||
it('should constrain types using type parameter bounds', () => {
|
||||
env.tsconfig({fullTemplateTypeCheck: true, strictInputTypes: true});
|
||||
env.tsconfig(
|
||||
{fullTemplateTypeCheck: true, strictInputTypes: true, strictContextGenerics: true});
|
||||
env.write('test.ts', `
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {Component, Input, NgModule} from '@angular/core';
|
||||
|
Reference in New Issue
Block a user