Skip to content
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

Subclass property sharing name with type parameter can't be resolved #56689

Closed
ssalbdivad opened this issue Dec 6, 2023 · 2 comments
Closed
Labels
Duplicate An existing issue was already created

Comments

@ssalbdivad
Copy link

ssalbdivad commented Dec 6, 2023

πŸ”Ž Search Terms

subclass property type parameter resolution 2339

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://tsplay.dev/wEYkOw

πŸ’» Code

class Leg {}

class Foo<t> extends Leg {
    t = {} as t

    // should allow this access since t was declared as a property on Foo
    foo = this.t 
}

πŸ™ Actual behavior

Error on accessing t: Property 't' does not exist on type 'Foo<t>'.ts(2339)

πŸ™‚ Expected behavior

Should allow t to be accessed.

Additional information about the issue

No response

@MartinJohns
Copy link
Contributor

Duplicate of #56620.

@typescript-bot
Copy link
Collaborator

This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
4 participants