Skip to content

[Regression 5.3.2] TS2339 property cannot be resolved when generic type has the same name #56661

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
ClementValot opened this issue Dec 4, 2023 · 2 comments

Comments

@ClementValot
Copy link

ClementValot commented Dec 4, 2023

πŸ”Ž Search Terms

generic types
regression
5.3.2
TS2339

πŸ•— Version & Regression Information

  • This changed between versions 5.2.2 and 5.3.2

⏯ Playground Link

No response

πŸ’» Code

// minimal code for reproduction: Have a class extend another, and have a property with the same name as a generic type
class BaseClass {}

class Item<data> extends BaseClass {
  data: data;
  getData() {
    return this.data;
  }
}

πŸ™ Actual behavior

TS2339: Property 'data' does not exist on type 'Item'.

πŸ™‚ Expected behavior

No transpiler errors

Additional information about the issue

Note: compilerOptions are default

While it may be bad design to have properties and generic types share names, I didn't find it listed anywhere as a breaking change; my mistake if it is :)

Good luck!

@ClementValot ClementValot changed the title [Regresssion 5.3.2] TS2339 property cannot be resolved when generic type has the same name [Regression 5.3.2] TS2339 property cannot be resolved when generic type has the same name Dec 4, 2023
@MartinJohns
Copy link
Contributor

Duplicate of #56620.

@ClementValot
Copy link
Author

Indeed, why it didn't turn up when I filtered by TS2339 in the search bar is beyond my comprehension πŸ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants