Skip to content

Decorator cannot set on top of overload method #5608

@falsandtru

Description

@falsandtru

I want to use a following design.

// hello.ts
class C {
  @readonly
  method()
  method() { }
}

function readonly(target, key, descriptor) {
  descriptor.writable = false;
}
$ node built/local/tsc.js hello.ts --noEmit --target ES5
hello.ts(2,3): error TS1206: Decorators are not valid here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions