dotnet / dotnet/csharpstandard

Attribute type list does not contain decimal

Open
#1,522 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
815
Forks
99
Avg merge
1d 14h
Merged PRs (30d)
16

Description

Section 21.2.4 defines Attribute parameter types as follows:

```
21.2.4 Attribute parameter types
The types of positional and named parameters for an attribute class are limited to the attribute parameter types, which are:

One of the following types: bool, byte, char, double, float, int, long, sbyte, short, string, uint, ulong, ushort.
```

This list of types seems to be quite limited. I was very surprised that I can't use a decimal literal. I expect there is some complex reason why this list is so limited that I'm not aware of, but it would be nice to get decimal on the list.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.