egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.49k stars 209 forks source link

[bug] generates a dts error when typeof this is encountered #1020

Open chenglu4343 opened 8 months ago

chenglu4343 commented 8 months ago

my code

export default class {
  name: 'foo' | 'bar'

  logName(name:typeof this.name) {
    console.log(name)
  }
}

generate dts

declare class export_default{
    name: 'foo' | 'bar';
    logName(name: typeof this$1.name): void;
}

export { export_default as default };

my versions

  "devDependencies": {
    "tsup": "^7.2.0"
  },
  "dependencies": {
    "typescript": "^5.2.2"
  }

Upvote & Fund

Fund with Polar