Make TypeNameParser consistently use tabs
[mono-project.git] / netcore / System.Private.CoreLib / src / System / Nullable.cs
blob8958c0fab8b498744510bce65d1a6d371c9f4313
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 namespace System
7 partial struct Nullable<T>
9 //
10 // These are called by the JIT
14 // JIT implementation of box valuetype System.Nullable`1<T>
16 static object? Box (T? o)
18 if (!o.hasValue)
19 return null;
21 return o.value;
24 static T? Unbox (object o)
26 if (o == null)
27 return null;
28 return (T) o;
31 static T? UnboxExact (object o)
33 if (o == null)
34 return null;
35 if (o.GetType() != typeof (T))
36 throw new InvalidCastException();
38 return (T) o;