microsoft / microsoft/typespec

Designate an int enum as "Flags"

Open
#1,237 1 comment 0 reactions 0 assignees View on GitHub
design:needed
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
2d 2h
Merged PRs (30d)
104

Description

[Some languages have decorators](https://learn.microsoft.com/en-us/dotnet/api/system.flagsattribute?view=net-7.0) that can add functionality to enums that are meant to be a set of bit fields. Will [CADL enums](https://microsoft.github.io/cadl/docs/language-basics/enums/) support a decorator for enums so that language generators can take advantage of this?

Contributor guide

Open the contributing guide

Research direction

Start with the linked CADL enums documentation and the referenced FlagsAttribute behavior. Determine how enum decorators are represented and how language generators consume them. Done means the issue's intended decorator support and generator-facing semantics are specified and consistently supported.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.