-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Milestone
Description
Describe the bug
Of the struct types listed in Annex C of the C# 7.x draft, only a few are specified as readonly struct
. In .NET however, most of them are defined as readonly struct
.
Is this allowed, and is it an extension?
Example
Types that are readonly struct
in .NET but plain struct
in Annex C include:
- System.Int32
- System.Span<T>
- System.Runtime.CompilerServices.TaskAwaiter<TResult>
Expected behavior
Could be solved in any of these ways:
- make them
readonly struct
in the standard, too - declare that an implementation can add
readonly
to standard library struct types - as above, but also change every
readonly struct
in Annex C to plainstruct
Additional context
Similar to #870 on attributes.