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

"Decorators are not valid here" for methods inside an instantiated class #8257

Closed
nevir opened this issue Apr 22, 2016 · 1 comment
Closed
Labels
Duplicate An existing issue was already created

Comments

@nevir
Copy link

nevir commented Apr 22, 2016

TypeScript Version: 1.8.10

Code

export default new class Foo {
  @someDecorator
  someMethod() {}
}

Will result in an error on @someDecorator:

error TS1206: Decorators are not valid here.

It can be worked around via

class Foo {
  @someDecorator
  someMethod() {}
}
export default new Foo();
@mhegazy
Copy link
Contributor

mhegazy commented Apr 22, 2016

duplicate of #7342

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants