Skip to content

Commit bebb835

Browse files
authored
Add Nullable Annotation To Some Library Methods (#1268)
* Add Nullable Annotation To Library Methods * minor tweak
1 parent 1094cac commit bebb835

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

standard/standard-library.md

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ namespace System
3232
public class ArgumentException : SystemException
3333
{
3434
public ArgumentException();
35-
public ArgumentException(string message);
36-
public ArgumentException(string message, Exception innerException);
35+
public ArgumentException(string? message);
36+
public ArgumentException(string? message, Exception? innerException);
3737
}
3838

3939
public class ArithmeticException : Exception
4040
{
4141
public ArithmeticException();
42-
public ArithmeticException(string message);
43-
public ArithmeticException(string message, Exception innerException);
42+
public ArithmeticException(string? message);
43+
public ArithmeticException(string? message, Exception? innerException);
4444
}
4545

4646
public abstract class Array : IList, ICollection, IEnumerable
@@ -53,9 +53,9 @@ namespace System
5353
public class ArrayTypeMismatchException : Exception
5454
{
5555
public ArrayTypeMismatchException();
56-
public ArrayTypeMismatchException(string message);
57-
public ArrayTypeMismatchException(string message,
58-
Exception innerException);
56+
public ArrayTypeMismatchException(string? message);
57+
public ArrayTypeMismatchException(string? message,
58+
Exception? innerException);
5959
}
6060

6161
[AttributeUsageAttribute(AttributeTargets.All, Inherited = true,
@@ -103,8 +103,8 @@ namespace System
103103
public class DivideByZeroException : ArithmeticException
104104
{
105105
public DivideByZeroException();
106-
public DivideByZeroException(string message);
107-
public DivideByZeroException(string message, Exception innerException);
106+
public DivideByZeroException(string? message);
107+
public DivideByZeroException(string? message, Exception? innerException);
108108
}
109109

110110
public readonly struct Double { }
@@ -117,9 +117,9 @@ namespace System
117117
public class Exception
118118
{
119119
public Exception();
120-
public Exception(string message);
121-
public Exception(string message, Exception innerException);
122-
public sealed Exception InnerException { get; }
120+
public Exception(string? message);
121+
public Exception(string? message, Exception? innerException);
122+
public sealed Exception? InnerException { get; }
123123
public virtual string Message { get; }
124124
}
125125

@@ -135,9 +135,9 @@ namespace System
135135
public sealed class IndexOutOfRangeException : Exception
136136
{
137137
public IndexOutOfRangeException();
138-
public IndexOutOfRangeException(string message);
139-
public IndexOutOfRangeException(string message,
140-
Exception innerException);
138+
public IndexOutOfRangeException(string? message);
139+
public IndexOutOfRangeException(string? message,
140+
Exception? innerException);
141141
}
142142

143143
public readonly struct Int16 { }
@@ -148,24 +148,24 @@ namespace System
148148
public class InvalidCastException : Exception
149149
{
150150
public InvalidCastException();
151-
public InvalidCastException(string message);
152-
public InvalidCastException(string message, Exception innerException);
151+
public InvalidCastException(string? message);
152+
public InvalidCastException(string? message, Exception? innerException);
153153
}
154154

155155
public class InvalidOperationException : Exception
156156
{
157157
public InvalidOperationException();
158-
public InvalidOperationException(string message);
159-
public InvalidOperationException(string message,
160-
Exception innerException);
158+
public InvalidOperationException(string? message);
159+
public InvalidOperationException(string? message,
160+
Exception? innerException);
161161
}
162162

163163
public class NotSupportedException : Exception
164164
{
165165
public NotSupportedException();
166-
public NotSupportedException(string message);
167-
public NotSupportedException(string message,
168-
Exception innerException);
166+
public NotSupportedException(string? message);
167+
public NotSupportedException(string? message,
168+
Exception? innerException);
169169
}
170170

171171
public struct Nullable<T>
@@ -177,8 +177,8 @@ namespace System
177177
public class NullReferenceException : Exception
178178
{
179179
public NullReferenceException();
180-
public NullReferenceException(string message);
181-
public NullReferenceException(string message, Exception innerException);
180+
public NullReferenceException(string? message);
181+
public NullReferenceException(string? message, Exception? innerException);
182182
}
183183

184184
public class Object
@@ -188,7 +188,7 @@ namespace System
188188
public virtual bool Equals(object obj);
189189
public virtual int GetHashCode();
190190
public Type GetType();
191-
public virtual string ToString();
191+
public virtual string? ToString();
192192
}
193193

194194
[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Struct |
@@ -199,24 +199,24 @@ namespace System
199199
public sealed class ObsoleteAttribute : Attribute
200200
{
201201
public ObsoleteAttribute();
202-
public ObsoleteAttribute(string message);
203-
public ObsoleteAttribute(string message, bool error);
202+
public ObsoleteAttribute(string? message);
203+
public ObsoleteAttribute(string? message, bool error);
204204
public bool IsError { get; }
205-
public string Message { get; }
205+
public string Message? { get; }
206206
}
207207

208208
public class OutOfMemoryException : Exception
209209
{
210210
public OutOfMemoryException();
211-
public OutOfMemoryException(string message);
212-
public OutOfMemoryException(string message, Exception innerException);
211+
public OutOfMemoryException(string? message);
212+
public OutOfMemoryException(string? message, Exception? innerException);
213213
}
214214

215215
public class OverflowException : ArithmeticException
216216
{
217217
public OverflowException();
218-
public OverflowException(string message);
219-
public OverflowException(string message, Exception innerException);
218+
public OverflowException(string? message);
219+
public OverflowException(string? message, Exception? innerException);
220220
}
221221

222222
public readonly struct SByte { }
@@ -225,15 +225,15 @@ namespace System
225225
public sealed class StackOverflowException : Exception
226226
{
227227
public StackOverflowException();
228-
public StackOverflowException(string message);
229-
public StackOverflowException(string message, Exception innerException);
228+
public StackOverflowException(string? message);
229+
public StackOverflowException(string? message, Exception? innerException);
230230
}
231231

232232
public sealed class String : IEnumerable<Char>, IEnumerable
233233
{
234234
public int Length { get; }
235235
public char this [int index] { get; }
236-
public static string Format(string format, params object[] args);
236+
public static string Format(string format, params object?[] args);
237237
}
238238

239239
public class SystemException : Exception
@@ -248,7 +248,7 @@ namespace System
248248
public sealed class TypeInitializationException : Exception
249249
{
250250
public TypeInitializationException(string fullTypeName,
251-
Exception innerException);
251+
Exception? innerException);
252252
}
253253

254254
public readonly struct UInt16 { }
@@ -288,13 +288,13 @@ namespace System.Collections
288288
{
289289
bool IsFixedSize { get; }
290290
bool IsReadOnly { get; }
291-
object this [int index] { get; set; }
292-
int Add(object value);
291+
object? this [int index] { get; set; }
292+
int Add(object? value);
293293
void Clear();
294-
bool Contains(object value);
295-
int IndexOf(object value);
296-
void Insert(int index, object value);
297-
void Remove(object value);
294+
bool Contains(object? value);
295+
int IndexOf(object? value);
296+
void Insert(int index, object? value);
297+
void Remove(object? value);
298298
void RemoveAt(int index);
299299
}
300300
}
@@ -354,7 +354,7 @@ namespace System.Runtime.CompilerServices
354354
{
355355
public sealed class IndexerNameAttribute : Attribute
356356
{
357-
public IndexerNameAttribute(String indexerName);
357+
public IndexerNameAttribute(string indexerName);
358358
}
359359

360360
public static class Unsafe
@@ -387,8 +387,8 @@ namespace System
387387
public class OperationCanceledException : Exception
388388
{
389389
public OperationCanceledException();
390-
public OperationCanceledException(string message);
391-
public OperationCanceledException(string message, Exception innerException);
390+
public OperationCanceledException(string? message);
391+
public OperationCanceledException(string? message, Exception? innerException);
392392
}
393393

394394
public readonly ref struct ReadOnlySpan<T>
@@ -605,7 +605,7 @@ namespace System.Runtime.CompilerServices
605605
public static class FormattableStringFactory
606606
{
607607
public static FormattableString Create(string format,
608-
params object[] arguments);
608+
params object?[] arguments);
609609
}
610610

611611
public interface ICriticalNotifyCompletion : INotifyCompletion

0 commit comments

Comments
 (0)