symbol
does not match interface
#29713
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Milestone
TypeScript Version: playground and 3.3
Search Terms: symbol interface
Code
Expected behavior:
symbol
is a non-nullish primitive, as such, it should be able to potentially match any interface.Actual behavior:
Type error.
Playground Link: https://www.typescriptlang.org/play/#src=const%20sym%3A%20symbol%20%3D%20Symbol()%3B%0D%0A%0D%0Afunction%20f(arg%3A%20%7B%20constructor%3F%3A%20unknown%20%7D)%3A%20void%20%7B%0D%0A%7D%0D%0A%0D%0Af(sym)%3B
Related Issues: #29536 (discovered in relation to #28900), #1863, #24587
The text was updated successfully, but these errors were encountered: