Skip to content

isolatedDeclaration panics when it encounters a private constructor #3917

@MichaelMitchell-at

Description

@MichaelMitchell-at
$ RUST_BACKTRACE=full node
Welcome to Node.js v18.20.1.
Type ".help" for more information.
> require('oxc-transform').isolatedDeclaration("hello.ts", `export class Foo { public constructor() {} }`)
{
  sourceText: 'export declare class Foo {\n\tconstructor();\n}\n',
  errors: []
}
> require('oxc-transform').isolatedDeclaration("hello.txt", `export class Foo { private constructor() {} }`)
thread '<unnamed>' panicked at crates/oxc_isolated_declarations/src/class.rs:225:17:
internal error: entered unreachable code
stack backtrace:
   0:        0x112ca43e8 - _napi_register_module_v1
   1:        0x112c228d8 - <unknown>
   2:        0x112ca747c - _napi_register_module_v1
   3:        0x112ca87f4 - _napi_register_module_v1
   4:        0x112ca7664 - _napi_register_module_v1
   5:        0x112ca75f8 - _napi_register_module_v1
   6:        0x112ca75ec - _napi_register_module_v1
   7:        0x112ca9f48 - _napi_register_module_v1
   8:        0x112ca9fe4 - _napi_register_module_v1
   9:        0x112c3a080 - _napi_register_module_v1
  10:        0x112c454bc - _napi_register_module_v1
  11:        0x112c42340 - _napi_register_module_v1
  12:        0x112c4fa24 - _napi_register_module_v1
  13:        0x112c1ed5c - <unknown>
zsh: abort      RUST_BACKTRACE=full node

Metadata

Metadata

Assignees

Labels

C-bugCategory - Bug

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions