You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'name' must be of type 'string', but here has type 'string[]'.
test.ts(2,1): error TS2322: Type 'string[]' is not assignable to type 'string'.
This stops when I change the name to something else;
var spam:string[];
name = ["foo","bar","baz"];
When I try to reproduce it with different names other than name, problem seems to go away. I think this is either related to the var name (reserved word?) or some caching.
-d
The text was updated successfully, but these errors were encountered:
This has been a common source if confusion. issue #1351 is tracking removing the definition of "name" and "length" from the library to avoid these issues.
Hello,
When I start a new .ts file and do;
It compiles as expected.
Then I change name's type;
Compiler complains thus;
This stops when I change the name to something else;
When I try to reproduce it with different names other than name, problem seems to go away. I think this is either related to the var name (reserved word?) or some caching.
-d
The text was updated successfully, but these errors were encountered: