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:
Ayaz Hafiz
2020-03-30 00:10:34 -07:00
committed by Alex Rickabaugh
parent 38ad1d97ab
commit fe2b6923ba
3 changed files with 49 additions and 13 deletions

View File

@ -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({