typescript-go
typescript-go copied to clipboard
Error with deriving implicit type from initializer
In the following example, I get the error "implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer" with the native preview, whereas in regular typescript this type checks:
class ReactiveMap<K, V> {
private readonly _map;
constructor(entries?: readonly (readonly [K, V])[] | null) {
this._map = new Map(entries);
}
clear(): void {
this._map.clear();
}
}
with regular ts, type is correctly inferred:
I also tried with a local build from fix-921 branch for (#921) since the error looks the same, but it still produces the error also with that branch build.