Skip to content

[Bug]: Template parameters cannot be used in object/array values, even if they are constrained #7118

@witemple-msft

Description

@witemple-msft

Describe the bug

The checker doesn't currently allow template parameters to be used in array or object value contexts, even if they are constrained to valueof.

I suspect this has to do with decorator argument checking.

Reproduction

https://typespec.io/playground/?c=CmV4dGVybiBkZWMgZm9vKHRhcmdldDogUmVmbGVjdGlvbi5Nb2RlbCwgb3DEDnM6IHZhbHVlb2YgeyB2OiBzdHJpbmc7IH0pOwrMTGJhcttMYXJny0nGRFtdxENA5ACFI8VbViB9KccQW1ZdKQptxDwgWDxWIMRobmRzz0E%2BIHt9&e=%40typespec%2Fopenapi3&options=%7B%7D

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions