Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking βSign up for GitHubβ, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interface ... extends number
interface extends only refers to a type
This is the behavior in every version I tried, and I reviewed the FAQ for entries about interface extension
Playground link with relevant code
export interface MessageId extends number {}
error TS2693: 'number' only refers to a type, but is being used as a value here.
Informative error about why an interface cannot extend number (or string -- the error is the same besides the type name)
number
string
The text was updated successfully, but these errors were encountered:
I would think of a message like: an interface cannot extend a primitive type like 'number'; an interface can only extend named types and classes
an interface cannot extend a primitive type like 'number'; an interface can only extend named types and classes
What do you think?
Sorry, something went wrong.
Is this issue being worked on? I would like to look into this as a first issue.
I was actually working on it, sorry I forgot to mention that earlier
Anyone working on this? Or can I take this up?
Successfully merging a pull request may close this issue.
Bug Report
interface extends only refers to a type
This is the behavior in every version I tried, and I reviewed the FAQ for entries about interface extension
Playground link with relevant code
error TS2693: 'number' only refers to a type, but is being used as a value here.
Informative error about why an interface cannot extend
number
(orstring
-- the error is the same besides the type name)The text was updated successfully, but these errors were encountered: