// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
public enum AssemblyContentType
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
[Flags]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
[Flags]
// CallingConventions is a set of Bits representing the calling conventions in the system.
+#nullable enable
namespace System.Reflection
{
[Flags]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
internal enum CorElementType : byte
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using System;
-
// This enumeration defines the access modes for a dynamic assembly.
// EE uses these enum values..look for m_dwDynamicAssemblyAccess in Assembly.hpp
+#nullable enable
namespace System.Reflection.Emit
{
[Flags]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection.Emit
{
public struct EventToken
public override int GetHashCode() => Token;
- public override bool Equals(object obj) => obj is EventToken et && Equals(et);
+ public override bool Equals(object? obj) => obj is EventToken et && Equals(et);
public bool Equals(EventToken obj) => obj.Token == Token;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection.Emit
{
/// <summary>
public override int GetHashCode() => Token;
- public override bool Equals(object obj) => obj is FieldToken ft && Equals(ft);
+ public override bool Equals(object? obj) => obj is FieldToken ft && Equals(ft);
public bool Equals(FieldToken obj) => obj.Token == Token && obj._class == _class;
** See $(RepoRoot)\src\inc\OpCodeGen.pl for more information.**
==============================================================*/
-using System;
-
+#nullable enable
namespace System.Reflection.Emit
{
public enum FlowControl
**
===========================================================*/
-using System;
-using System.Reflection;
-using System.Runtime.InteropServices;
-
+#nullable enable
namespace System.Reflection.Emit
{
// The Label class is an opaque representation of a label used by the
return m_label;
}
- public override bool Equals(object obj)
+ public override bool Equals(object? obj)
{
if (obj is Label)
return Equals((Label)obj);
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection.Emit
{
public struct MethodToken
public override int GetHashCode() => Token;
- public override bool Equals(object obj) => obj is MethodToken mt && Equals(mt);
+ public override bool Equals(object? obj) => obj is MethodToken mt && Equals(mt);
public bool Equals(MethodToken obj) => obj.Token == Token;
** See $(RepoRoot)\src\inc\OpCodeGen.pl for more information.**
==============================================================*/
-using System;
-
+#nullable enable
namespace System.Reflection.Emit
{
public enum OpCodeType
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection.Emit
{
//
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
using System.Threading;
namespace System.Reflection.Emit
}
}
- private static volatile string[] g_nameCache;
+ private static volatile string[]? g_nameCache;
- public string Name
+ public string? Name
{
get
{
// Create and cache the opcode names lazily. They should be rarely used (only for logging, etc.)
// Note that we do not any locks here because of we always get the same names. The last one wins.
- string[] nameCache = g_nameCache;
+ string[]? nameCache = g_nameCache;
if (nameCache == null)
{
nameCache = new string[0x11f];
return name;
// Create ilasm style name from the enum value name.
- name = Enum.GetName(typeof(OpCodeValues), opCodeValue).ToLowerInvariant().Replace('_', '.');
+ name = Enum.GetName(typeof(OpCodeValues), opCodeValue)!.ToLowerInvariant().Replace('_', '.');
Volatile.Write(ref nameCache[idx], name);
return name;
}
}
- public override bool Equals(object obj)
+ public override bool Equals(object? obj)
{
if (obj is OpCode)
return Equals((OpCode)obj);
return Value;
}
- public override string ToString()
+ public override string? ToString()
{
return Name;
}
** See $(RepoRoot)\src\inc\OpCodeGen.pl for more information.**
==============================================================*/
-using System;
-
+#nullable enable
namespace System.Reflection.Emit
{
public enum OperandType
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-
-using System;
-
+#nullable enable
namespace System.Reflection.Emit
{
// This Enum matchs the CorFieldAttr defined in CorHdr.h
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection.Emit
{
public enum PackingSize
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection.Emit
{
/// <summary>
public override int GetHashCode() => Token;
- public override bool Equals(object obj) => obj is ParameterToken pt && Equals(pt);
+ public override bool Equals(object? obj) => obj is ParameterToken pt && Equals(pt);
public bool Equals(ParameterToken obj) => obj.Token == Token;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection.Emit
{
public struct PropertyToken
public override int GetHashCode() => Token;
- public override bool Equals(object obj) => obj is PropertyToken pt && Equals(pt);
+ public override bool Equals(object? obj) => obj is PropertyToken pt && Equals(pt);
public bool Equals(PropertyToken obj) => obj.Token == Token;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection.Emit
{
public struct SignatureToken
public override int GetHashCode() => Token;
- public override bool Equals(object obj) => obj is SignatureToken st && Equals(st);
+ public override bool Equals(object? obj) => obj is SignatureToken st && Equals(st);
public bool Equals(SignatureToken obj) => obj.Token == Token;
** See $(RepoRoot)\src\inc\OpCodeGen.pl for more information.**
==============================================================*/
-using System;
-
+#nullable enable
namespace System.Reflection.Emit
{
public enum StackBehaviour
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection.Emit
{
public struct StringToken
public override int GetHashCode() => Token;
- public override bool Equals(object obj) => obj is StringToken st && Equals(st);
+ public override bool Equals(object? obj) => obj is StringToken st && Equals(st);
public bool Equals(StringToken obj) => obj.Token == Token;
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection.Emit
{
public struct TypeToken
public override int GetHashCode() => Token;
- public override bool Equals(object obj) => obj is TypeToken tt && Equals(tt);
+ public override bool Equals(object? obj) => obj is TypeToken tt && Equals(tt);
public bool Equals(TypeToken obj) => obj.Token == Token;
// EventAttributes are an enum defining the attributes associated with and Event.
// These are defined in CorHdr.h and are a combination of bits and enums.
+#nullable enable
namespace System.Reflection
{
[Flags]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
using System.Globalization;
namespace System.Reflection
public virtual int HandlerOffset => 0;
public virtual int HandlerLength => 0;
public virtual int FilterOffset => throw new InvalidOperationException(SR.Arg_EHClauseNotFilter);
- public virtual Type CatchType => null;
+ public virtual Type? CatchType => null;
public override string ToString()
{
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
[Flags]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
// This Enum matchs the CorFieldAttr defined in CorHdr.h
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
[Flags]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
public enum ImageFileMachine
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable // TODO-NULLABLE: Re-review
namespace System.Reflection
{
public struct InterfaceMapping
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
[Flags]
NestedType = 0x80,
All = Constructor | Event | Field | Method | Property | TypeInfo | NestedType,
}
-}
\ No newline at end of file
+}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
[Flags]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
// This Enum matchs the CorMethodImpl defined in CorHdr.h
// ParameterAttributes is an enum defining the attributes that may be
// associated with a Parameter. These are defined in CorHdr.h.
+#nullable enable
namespace System.Reflection
{
// This Enum matchs the CorParamAttr defined in CorHdr.h
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
public readonly struct ParameterModifier
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
[Flags]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
public enum ProcessorArchitecture
// PropertyAttributes is an enum which defines the attributes that may be associated
// with a property. The values here are defined in Corhdr.h.
+#nullable enable
namespace System.Reflection
{
// This Enum matchs the CorPropertyAttr defined in CorHdr.h
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
[Flags]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
[Flags]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using System.Runtime.InteropServices;
-
+#nullable enable
namespace System.Reflection
{
// This Enum matchs the CorTypeAttr defined in CorHdr.h
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Reflection
{
//
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
using System.Globalization;
namespace System.Reflection
// This class can only be created from inside the EE.
private RuntimeExceptionHandlingClause() { }
- private RuntimeMethodBody _methodBody;
+ private RuntimeMethodBody _methodBody = null!;
private ExceptionHandlingClauseOptions _flags;
private int _tryOffset;
private int _tryLength;
}
}
- public override Type CatchType
+ public override Type? CatchType
{
get
{
if (_flags != ExceptionHandlingClauseOptions.Clause)
throw new InvalidOperationException(SR.Arg_EHClauseNotClause);
- Type type = null;
+ Type? type = null;
if (!MetadataToken.IsNullToken(_catchMetadataToken))
{