Skip to content

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

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

Closed
jakebailey opened this issue Apr 21, 2024 Β· 2 comments Β· Fixed by #60224
Closed

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

jakebailey opened this issue Apr 21, 2024 Β· 2 comments Β· Fixed by #60224
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue Rescheduled This issue was previously scheduled to an earlier milestone

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 [email protected]: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
@RyanCavanaugh RyanCavanaugh added the Rescheduled This issue was previously scheduled to an earlier milestone label Jul 26, 2024
@rbuckton
Copy link
Contributor

The crash seems to be due to using parameter decorators with Stage 3 decorator emit, which doesn't support parameter decorators.

@typescript-bot typescript-bot added Fix Available A PR has been opened for this issue labels Oct 14, 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 Fix Available A PR has been opened for this issue Rescheduled This issue was previously scheduled to an earlier milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants