Skip to content

Regression: Compiler crash on call expression with private identifier on an any typed variable in 4.2RC #42860

Closed
@dragomirtitian

Description

@dragomirtitian

Bug Report

🔎 Search Terms

A call expression with a private identifier coming from an any typed variable crashes the compiler

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions 4.1 and 4.2
class A {
    #m: () => void
    method(thing: any) {
        thing.#m();
    }
};
Compiler Options
{
  "compilerOptions": {
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "alwaysStrict": true,
    "esModuleInterop": true,
    "declaration": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": 2,
    "target": "ES2017",
    "jsx": "React",
    "module": "ESNext"
  }
}

Playground Link: Provided

🙁 Actual behavior

Compiler crashes

🙂 Expected behavior

Compiler should not crash.

Regression appears to have been introduced in fix for #42166 (PR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFix AvailableA PR has been opened for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions