Skip to content

[core] Decorators are not added onto the anonymous type via metadata syntax #6169

Closed
@ArcturusZhang

Description

@ArcturusZhang

If we have this:

model Foo {
  p: {
    a: string;
  };

we have the following syntax to add decorators to the anonymous model:

@@clientName(Foo.p::type, "NewName");

but in its type graph, the anonymous type never gets that decorator. And therefore it does not work at all.
Playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:coreIssues for @typespec/compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions