@@ -21,6 +21,9 @@ It is expected that a conforming C# implementation will supply a significantly
21
21
22
22
## C.2 Standard Library Types defined in ISO/IEC 23271
23
23
24
+ > * Note:* Some ` struct ` types below have the ` readonly ` modifier. This modifier was not available
25
+ > when ISO/IEC 23271 was released, but is required for conforming implementations of this specification. * end note*
26
+
24
27
``` csharp
25
28
namespace System
26
29
{
@@ -91,10 +94,10 @@ namespace System
91
94
public AttributeTargets ValidOn { get ; }
92
95
}
93
96
94
- public struct Boolean { }
95
- public struct Byte { }
96
- public struct Char { }
97
- public struct Decimal { }
97
+ public readonly struct Boolean { }
98
+ public readonly struct Byte { }
99
+ public readonly struct Char { }
100
+ public readonly struct Decimal { }
98
101
public abstract class Delegate { }
99
102
100
103
public class DivideByZeroException : ArithmeticException
@@ -104,7 +107,7 @@ namespace System
104
107
public DivideByZeroException (string message , Exception innerException );
105
108
}
106
109
107
- public struct Double { }
110
+ public readonly struct Double { }
108
111
109
112
public abstract class Enum : ValueType
110
113
{
@@ -137,10 +140,10 @@ namespace System
137
140
Exception innerException );
138
141
}
139
142
140
- public struct Int16 { }
141
- public struct Int32 { }
142
- public struct Int64 { }
143
- public struct IntPtr { }
143
+ public readonly struct Int16 { }
144
+ public readonly struct Int32 { }
145
+ public readonly struct Int64 { }
146
+ public readonly struct IntPtr { }
144
147
145
148
public class InvalidCastException : Exception
146
149
{
@@ -215,8 +218,8 @@ namespace System
215
218
public OverflowException (string message , Exception innerException );
216
219
}
217
220
218
- public struct SByte { }
219
- public struct Single { }
221
+ public readonly struct SByte { }
222
+ public readonly struct Single { }
220
223
221
224
public sealed class StackOverflowException : Exception
222
225
{
@@ -240,10 +243,10 @@ namespace System
240
243
Exception innerException );
241
244
}
242
245
243
- public struct UInt16 { }
244
- public struct UInt32 { }
245
- public struct UInt64 { }
246
- public struct UIntPtr { }
246
+ public readonly struct UInt16 { }
247
+ public readonly struct UInt32 { }
248
+ public readonly struct UInt64 { }
249
+ public readonly struct UIntPtr { }
247
250
248
251
public struct ValueTuple <T1 >
249
252
{
@@ -506,16 +509,16 @@ namespace System.Runtime.CompilerServices
506
509
void OnCompleted (Action continuation );
507
510
}
508
511
509
- public struct TaskAwaiter : ICriticalNotifyCompletion , INotifyCompletion
512
+ public readonly struct TaskAwaiter : ICriticalNotifyCompletion , INotifyCompletion
510
513
{
511
514
public bool IsCompleted { get ; }
512
515
public void GetResult ();
513
516
}
514
517
515
- public struct TaskAwaiter <T > : ICriticalNotifyCompletion , INotifyCompletion
518
+ public readonly struct TaskAwaiter <TResult > : ICriticalNotifyCompletion , INotifyCompletion
516
519
{
517
520
public bool IsCompleted { get ; }
518
- public T GetResult ();
521
+ public TResult GetResult ();
519
522
}
520
523
521
524
public readonly struct ValueTaskAwaiter : ICriticalNotifyCompletion , INotifyCompletion
@@ -524,10 +527,10 @@ namespace System.Runtime.CompilerServices
524
527
public void GetResult ();
525
528
}
526
529
527
- public readonly struct ValueTaskAwaiter <T > : ICriticalNotifyCompletion , INotifyCompletion
530
+ public readonly struct ValueTaskAwaiter <TResult > : ICriticalNotifyCompletion , INotifyCompletion
528
531
{
529
532
public bool IsCompleted { get ; }
530
- public T GetResult ();
533
+ public TResult GetResult ();
531
534
}
532
535
533
536
}
@@ -556,12 +559,12 @@ namespace System.Threading.Tasks
556
559
``` csharp
557
560
namespace System
558
561
{
559
- public ref struct ReadOnlySpan <T >
562
+ public readonly ref struct ReadOnlySpan <T >
560
563
{
561
564
public int Length { get ; }
562
565
public ref readonly T this [int index ] { get ; }
563
566
}
564
- public ref struct Span <T >
567
+ public readonly ref struct Span <T >
565
568
{
566
569
public int Length { get ; }
567
570
public ref T this [int index ] { get ; }
0 commit comments