Skip to content

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

Closed
@jakebailey

Description

@jakebailey

πŸ”Ž 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);

Activity

jakebailey

jakebailey commented on Apr 22, 2024

@jakebailey
MemberAuthor

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.

added
RescheduledThis issue was previously scheduled to an earlier milestone
on Jul 26, 2024
rbuckton

rbuckton commented on Oct 14, 2024

@rbuckton
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

    Participants

    @rbuckton@jakebailey@RyanCavanaugh@typescript-bot

    Issue actions

      Debug Failure in transformClassLike in "ghost" after #56955 Β· Issue #58269 Β· microsoft/TypeScript