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
Property 'getSomething' in type 'B' is not assignable to the same property in base type 'i'.
Type '() => string' is not assignable to type '() => "a" | "b"'.
Type 'string' is not assignable to type '"a" | "b"'.
TypeScript Version: 3.2.0
Search Terms:
union, interface, extends
Code
Expected behavior:
Compiles just fine
Actual behavior:
Gives error:
Playground Link:
https://www.typescriptlang.org/play/index.html#src=interface%20i%20%7B%0D%0A%20%20%20%20getSomething()%3A%20'a'%20%7C%20'b'%3B%0D%0A%7D%0D%0A%0D%0Aclass%20B%20implements%20i%20%7B%0D%0A%20%20%20%20getSomething()%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20'a'%3B%0D%0A%20%20%20%20%7D%0D%0A%7D
Related Issues:
No
The text was updated successfully, but these errors were encountered: