Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Didn't support Typescript5 Decorator #8149

Closed
grapewheel opened this issue Jan 13, 2024 · 1 comment
Closed

Didn't support Typescript5 Decorator #8149

grapewheel opened this issue Jan 13, 2024 · 1 comment
Labels
bug Something isn't working typescript Something for TypeScript

Comments

@grapewheel
Copy link

What version of Bun is running?

1.0.6+969da088f5db3258a803ec186012e30f992829b4

What platform is your computer?

Linux 6.6.11-1-lts x86_64 unknown (archlinux)

What steps can reproduce the bug?

function DI<T extends new (...args: any[]) => any>(
  target: T,
  context: ClassDecoratorContext<T>
) {
  if (context.kind !== "class") throw "The DI only used in a Class";
  return target;
}

console.log("loading di...");

@DI
export default class Master {
  async hello() {
    return new Response("Hello world");
  }
}

console.log("loaded di...");

/**
* import Master from './master'
* just run below:
* loading di...
*/

What is the expected behavior?

/**
* import Master from './master'
* run below:
* loading di...
* loaded di...
*/

What do you see instead?

No response

Additional information

No response

@grapewheel grapewheel added the bug Something isn't working label Jan 13, 2024
@Electroid Electroid added the typescript Something for TypeScript label Jan 16, 2024
@sirenkovladd
Copy link
Contributor

Duplicate of #4122

@paperdave paperdave closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working typescript Something for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants