Skip to content

Incorrect error in extended interface when base interface has this member #7276

New issue

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

Closed
RyanCavanaugh opened this issue Feb 28, 2016 · 0 comments
Closed
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@RyanCavanaugh
Copy link
Member

TypeScript Version:

master

Code

interface Foo<T extends Bar> { x: T }

interface Bar {
    thing: this;
}

interface Something extends Bar {
    other: Foo<this>;
}

Expected behavior:
No error

Actual behavior:
Error

error TS2344: Type 'this' does not satisfy the constraint 'Bar'.
  Type 'Something' is not assignable to type 'Bar'.
    Types of property 'thing' are incompatible.
      Type 'Something' is not assignable to type 'this'.
@DanielRosenwasser DanielRosenwasser self-assigned this Feb 29, 2016
@DanielRosenwasser DanielRosenwasser added the Bug A bug in TypeScript label Feb 29, 2016
@mhegazy mhegazy added this to the TypeScript 2.0 milestone Apr 26, 2016
@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label May 2, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants