Skip to content

Incorrect behavior for constant #57770

@pshao25

Description

@pshao25

TypeSpec:

enum Colors {
  green,
}
/** Employee properties */
model EmployeeProperties {
  /** the favorite color */
  @Azure.ClientGenerator.Core.alternateType("green")
  favoriteColor: Colors;
}

Refer this playground.

Expected: csharp emitter should generate a struct named Colors but now it is generated as enum, with value "green", type of favoriteColor is Colors.
Actual: type of favoriteColor is constant "green"

Metadata

Metadata

Labels

CodeGenIssues that relate to code generationMgmtThis issue is related to a management package.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions