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

Debug Failure in transformClassLike in "ghost" after #56955 #58269

Open
jakebailey opened this issue Apr 21, 2024 · 1 comment
Open

Debug Failure in transformClassLike in "ghost" after #56955 #58269

jakebailey opened this issue Apr 21, 2024 · 1 comment
Assignees
Labels
Bug A bug in TypeScript

Comments

@jakebailey
Copy link
Member

jakebailey commented Apr 21, 2024

πŸ”Ž Search Terms

Error Debug Failure at transformClassLike

πŸ•— Version & Regression Information

  • This is a crash

⏯ Playground Link

No response

πŸ’» Code

$ git clone git@github.com:TryGhost/Ghost.git
$ cd Ghost
$ git rev-parse HEAD
69372d9018f156d56ae271b6d8e378efb9ea3012
$ yarn
$ node --enable-source-maps ~/work/TypeScript/built/local/tsc.js -p ghost/tsconfig.json

πŸ™ Actual behavior

/home/jabaile/work/TypeScript/src/compiler/program.ts:2918
            throw e;
            ^


Error: Debug Failure.
    at transformClassLike (/home/jabaile/work/TypeScript/src/compiler/transformers/esDecorators.ts:700:19)
    at visitClassDeclaration (/home/jabaile/work/TypeScript/src/compiler/transformers/esDecorators.ts:1094:30)
    at visitor (/home/jabaile/work/TypeScript/src/compiler/transformers/esDecorators.ts:432:24)
    at visitArrayWorker (/home/jabaile/work/TypeScript/src/compiler/visitorPublic.ts:345:57)
    at visitNodes2 (/home/jabaile/work/TypeScript/src/compiler/visitorPublic.ts:258:21)
    at visitLexicalEnvironment (/home/jabaile/work/TypeScript/src/compiler/visitorPublic.ts:383:18)
    at visitEachChildOfSourceFile (/home/jabaile/work/TypeScript/src/compiler/visitorPublic.ts:1779:13)
    at visitEachChild (/home/jabaile/work/TypeScript/src/compiler/visitorPublic.ts:603:38)
    at transformSourceFile (/home/jabaile/work/TypeScript/src/compiler/transformers/esDecorators.ts:317:25)
    at transformSourceFileOrBundle (/home/jabaile/work/TypeScript/src/compiler/transformers/utilities.ts:130:54)

Node.js v20.12.2

πŸ™‚ Expected behavior

No crash.

Additional information about the issue

This bisects to #56955, at:

Debug.assertIsDefined(classInfo.classThis);
@jakebailey
Copy link
Member Author

Source file is ghost/ghost/src/listeners/example.listener.ts, node is:

export class ExampleListener {
    constructor(
        @Inject('logger') private logger: Logger
    ) {}

    @OnEvent(ExampleEvent)
    async logEvents(event: ExampleEvent) {
        this.logger.info(`Received an event with a message: ${event.data.message}`);
    }
}

Which does crash the playground when I put it there.

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Apr 22, 2024
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.5.0 milestone Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants