The below code appears to incorrectly error when emitting .d.ts with oxc, but works as expected with TypeScript:
export class NumberRange implements Iterable<number> {
private start: number;
private end: number;
constructor(start: number, end: number) {
this.start = start;
this.end = end;
}
[Symbol.iterator](): Iterator<number> {
let current = this.start;
const end = this.end;
return {
next(): IteratorResult<number> {
if (current <= end) {
return { value: current++, done: false };
} else {
return { value: undefined, done: true };
}
},
};
}
}
message: 'TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.',
See also, similar swc bug in swc-project/swc#9859
The below code appears to incorrectly error when emitting
.d.tswithoxc, but works as expected with TypeScript:message: 'TS9038: Computed property names on class or object literals cannot be inferred with --isolatedDeclarations.',See also, similar
swcbug in swc-project/swc#9859