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

error TS1206: on anonymous class #8176

Closed
devpaul opened this issue Apr 19, 2016 · 1 comment
Closed

error TS1206: on anonymous class #8176

devpaul opened this issue Apr 19, 2016 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@devpaul
Copy link

devpaul commented Apr 19, 2016

I am trying to use a decorator with an anonymous class (class expression) on TypeScript 1.8.9 and am receiving the error: "error TS1206: Decorators are not valid here."

const decorator: MethodDecorator = function (target: Object, propertyKey: string,
    descriptor: TypedPropertyDescriptor<any>): TypedPropertyDescriptor<any> {
    return descriptor;
};
const C = class { 
    @decorator method() {} 
};

I didn't see anything addressing decorating anonymous classes in the roadmap, so I am filing this issue to either provide clarification to other people in my situation or to mark a bug.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 19, 2016

looks like a duplicate of #7342

@mhegazy mhegazy closed this as completed Apr 19, 2016
@mhegazy mhegazy added the Duplicate An existing issue was already created label Apr 19, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
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