My TypeScript codebase is filled with code snippets like the one below...
export interface SomeType {
name: string;
}
export interface SomeComposedType {
things: [SomeType];
}
Everything was working smoothly until I started experiencing issues such as
Property '0' is missing in type
as well as
Argument of type 'SomeType[]' is not assignable to parameter of type '[SomeType]'
I'm quite perplexed by these errors. I had believed that
let x:SomeType[] = []
is the same as
let x: Array<SomeType> = []
but is
let x:[SomeType] = []
also equivalent and accurate?