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
Actual behavior: TS2416 error: Property 'type' in type 'TextChannel' is not assignable to the same property in base type 'BaseChannel'. Type 'string' is not assignable to type '"text" | "voice" | "direct"'.
This is an interesting case of the widening of 'text' into string inside a mutable location.
While this is being discussed, this.type inside the constructor works:
exportclassBaseChannel{type: 'text'|'voice'|'direct';}exportclassTextChannelextendsBaseChannel{// type = 'text';constructor(){super()this.type='text'}}
TypeScript Version: 3.6.0-dev.20190711
Search Terms: string not assignable to type string
Code
Expected behavior: assign successfully
Actual behavior: TS2416 error:
Property 'type' in type 'TextChannel' is not assignable to the same property in base type 'BaseChannel'. Type 'string' is not assignable to type '"text" | "voice" | "direct"'.
Playground Link: ⛓️
Related Issues: did not find any
The text was updated successfully, but these errors were encountered: