Skip to content

Implementing a prim type in a class expression should report errorΒ #60484

Closed
@bvanjoi

Description

@bvanjoi

πŸ”Ž Search Terms

class expression implement primitive type

πŸ•— Version & Regression Information

  • This changed between versions 5.2.2__ and 5.3.3___

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.3.3#code/MYewdgzgLgBAgjAvDYAbAhhCMBCMCWAtgA6oCmhZYU2YAroQEZkBOMA3gL4BQ3am2AMIES5StVoNmbLkA

πŸ’» Code

class C implements number {} // report that class cannot implement primitive type

const A = class B implements number {} // this code should report the same error, but it actually does not.

πŸ™ Actual behavior

Refer to the comment above

πŸ™‚ Expected behavior

Refer to the comment above

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions