diff options
Diffstat (limited to 'src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/EventSinkHelperWriter.cs')
-rw-r--r-- | src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/EventSinkHelperWriter.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/EventSinkHelperWriter.cs b/src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/EventSinkHelperWriter.cs index 0367e79bdd..862419cc98 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/EventSinkHelperWriter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/TCEAdapterGen/EventSinkHelperWriter.cs @@ -8,6 +8,7 @@ namespace System.Runtime.InteropServices.TCEAdapterGen { using System.Reflection; using System.Reflection.Emit; using System.Collections; + using System.Diagnostics; using System.Diagnostics.Contracts; internal class EventSinkHelperWriter { @@ -65,7 +66,7 @@ namespace System.Runtime.InteropServices.TCEAdapterGen { // Retrieve the delegate type from the add_XXX method. MethodInfo AddMeth = m_EventItfType.GetMethod( "add_" + aMethods[cMethods].Name ); ParameterInfo[] aParams = AddMeth.GetParameters(); - Contract.Assert(aParams.Length == 1, "All event interface methods must take a single delegate derived type and have a void return type"); + Debug.Assert(aParams.Length == 1, "All event interface methods must take a single delegate derived type and have a void return type"); Type DelegateCls = aParams[0].ParameterType; // Define the delegate instance field. @@ -119,7 +120,7 @@ namespace System.Runtime.InteropServices.TCEAdapterGen { { // Retrieve the method info for the invoke method on the delegate. MethodInfo DelegateInvokeMethod = DelegateCls.GetMethod( "Invoke" ); - Contract.Assert(DelegateInvokeMethod != null, "Unable to find method Delegate.Invoke()"); + Debug.Assert(DelegateInvokeMethod != null, "Unable to find method Delegate.Invoke()"); // Retrieve the return type. Type ReturnType = Method.ReturnType; @@ -229,7 +230,7 @@ namespace System.Runtime.InteropServices.TCEAdapterGen { if ( ReturnType == typeof(IntPtr) ) il.Emit( OpCodes.Ldc_I4_0 ); else - Contract.Assert(false, "Unexpected type for Primitive type."); + Debug.Assert(false, "Unexpected type for Primitive type."); break; } } @@ -254,7 +255,7 @@ namespace System.Runtime.InteropServices.TCEAdapterGen { { // Retrieve the constructor info for the base classe's constructor. ConstructorInfo DefaultBaseClsCons = typeof(Object).GetConstructor(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public, null, Array.Empty<Type>(), null ); - Contract.Assert(DefaultBaseClsCons != null, "Unable to find the constructor for class " + m_InputType.Name); + Debug.Assert(DefaultBaseClsCons != null, "Unable to find the constructor for class " + m_InputType.Name); // Define the default constructor. MethodBuilder Cons = OutputTypeBuilder.DefineMethod( ".ctor", |