I'm facing an issue with a code snippet that looks like this:
export class TagCloud {
tags: [Tag];
locations: [Location];
constructor() {
this.tags = new Array<Tag>();
this.locations = new Array<Location>();
}
}
Despite the functionality being correct, I am encountering the following errors:
error TS2322: Type 'Tag[]' is not assignable to type '[Tag]'. Property '0' is missing in type 'Tag[]'.
error TS2322: Type 'Location[]' is not assignable to type '[Lo cation]'. Property '0' is missing in type 'Location[]'.
I want to understand what mistake I might have made here (as I mentioned, the code still works as expected).
The typings are based on the es6-shim Type descriptions (https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/es6-shim).