Skip to content

isolatedDeclarations does not support well-known symbols as properties #4016

Closed
@MichaelMitchell-at

Description

@MichaelMitchell-at

Tested version: 0.16.3

> require('oxc-transform').isolatedDeclaration('hello.ts', `
    export class Foo {
      [Symbol.hasInstance](): boolean {
        return false;
      }
    }
`)
{
  sourceText: 'export declare class Foo {}\n',
  errors: [
    'TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.'
  ]
}

Expected:

export declare class Foo {
    [Symbol.hasInstance](): boolean;
}

Actual:

export declare class Foo {}

TS behavior for reference

Metadata

Metadata

Assignees

Labels

A-isolated-declarationsIsolated DeclarationsC-enhancementCategory - New feature or requestE-Help WantedExperience level - For the experienced collaborators

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions