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

Type behavior of __proto__ isn't correct. #42358

Closed
Jack-Works opened this issue Jan 15, 2021 · 2 comments
Closed

Type behavior of __proto__ isn't correct. #42358

Jack-Works opened this issue Jan 15, 2021 · 2 comments

Comments

@Jack-Works
Copy link
Contributor

Bug Report

The __proto__ in the object literal has special meanings in JavaScript and TypeScript doesn't recognize that.

🔎 Search Terms

__proto__

🕗 Version & Regression Information

  • It never worked IMO

💻 Code

class X { echo() { return this } }
const y = { __proto__: X.prototype }

🙁 Actual behavior

Type of y is `{ proto: X }

🙂 Expected behavior

Type of y is X

@MartinJohns
Copy link
Contributor

MartinJohns commented Jan 15, 2021

Duplicate of #38385. Literally the first issue after yours when searching for __proto__ (the search term you listed).

@Jack-Works
Copy link
Contributor Author

Oh I'm sorry

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