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(6,1): error TS2322: Type '{ type: string; }[]' is not assignable to type 'FolderContentItem[]'.
Type '{ type: string; }' is not assignable to type 'FolderContentItem'.
Types of property 'type' are incompatible.
Type 'string' is not assignable to type '"folder" | "file"'.
The text was updated successfully, but these errors were encountered:
It doesn't depend specifically on map, it's because the constant {type:'folder'} is misinterpreted as {type:string}:
interfaceFolderContentItem{type: "folder";}functionfoo(){// return type is { type: string }return{type:'folder'};}leta:FolderContentItem=foo();// error
TypeScript Version: 1.8.0 / nightly (2.0.0-dev.201xxxxx) 2.0.2@rc
Code
Expected behavior:
Compiled successfully
Actual behavior:
The text was updated successfully, but these errors were encountered: