Skip to content

Supply a better error message for a decorator on a method overload #6064

Description

@DanielRosenwasser

From #5608.

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

function readonly(target, key, descriptor) {
  descriptor.writable = false;
}

Expected: A decorator can only decorate a method implementation, not an overload.
Actual: Decorators are not valid here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions