fix(language-service): infer type of elements of array-like objects (#36312)
Currently the language service only provides support for determining the type of array-like members when the array-like object is an `Array`. However, there are other kinds of array-like objects, including `ReadonlyArray`s and `readonly`-property arrays. This commit adds support for retrieving the element type of arbitrary array-like objects. Closes #36191 PR Close #36312
This commit is contained in:

committed by
Alex Rickabaugh

parent
38ad1d97ab
commit
fe2b6923ba
@ -174,6 +174,8 @@ export class TemplateReference {
|
||||
index = null;
|
||||
myClick(event: any) {}
|
||||
birthday = new Date();
|
||||
readonlyHeroes: ReadonlyArray<Readonly<Hero>> = this.heroes;
|
||||
constNames = [{name: 'name'}] as const ;
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
Reference in New Issue
Block a user