Skip to content

Need a way to disable arg marshalling for decorators #3570

@timotheeguerin

Description

@timotheeguerin

Clear and concise description of the problem

There is some decorators what would want to get the original value non marshalled(like the @example decorator).

There is a few options:

  1. add a getRawArg(index: number): Entity on the DecoratorContext. - Problem is you cannot call then a decorator with context.call() that depend on this.
  2. Add a $example.disableArgMarshalling - Problem is that tspd then cannot generate the right signature for this decorator as it won't know about this flag.
  3. Add a modifier on the decorator declaration extern raw dec example(target, value: valueof unknown)

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:coreIssues for @typespec/compilerdesign:neededA design request has been raised that needs a proposaltriaged:core

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions