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
interfaceITodo{activity: Lowercase<string>,// (Error) Type 'string' is not assignable to type 'Lowercase<string>'.description: Uppercase<string>,// (Error) Type 'string' is not assignable to type 'Uppercase<string>'.}consttodo: ITodo={activity: 'Fishing'.toLowerCase(),description: 'Fishing with your mom'.toUpperCase(),}console.log(todo);
The text was updated successfully, but these errors were encountered:
Because both toLowerCase() and toUpperCase() return a string, not Lowercase<string> or Uppercase<string>. Changing this would be a breaking change. The issue for this is still open: #44268
.toLowerCase() is just another method that returns a string, like any other; the compiler doesnβt have any context to know this particular string is compatible with Lowercase<string>.
Bug Report
π Search Terms
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
The text was updated successfully, but these errors were encountered: