Skip to content

Type behavior of __proto__ isn't correct. #42358

@Jack-Works

Description

@Jack-Works

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions