//
// Copyright 2001-2003 Ximian, Inc.
// Copyright 2003-2008 Novell, Inc.
+// Copyright 2011 Xamarin Inc
//
using System;
return c;
}
+ public override bool ContainsEmitWithAwait ()
+ {
+ return false;
+ }
+
public virtual Constant ConvertImplicitly (TypeSpec type)
{
if (this.type == type)
return this;
Constant c;
- if (TypeManager.IsEnumType (target_type)) {
+ if (target_type.IsEnum) {
c = TryReduce (ec, EnumSpec.GetUnderlyingType (target_type));
if (c == null)
return null;
public override void Emit (EmitContext ec)
{
if (Value)
- ec.Emit (OpCodes.Ldc_I4_1);
+ ec.EmitInt (1);
else
- ec.Emit (OpCodes.Ldc_I4_0);
+ ec.EmitInt (0);
}
public override bool IsDefaultValue {
public override void Emit (EmitContext ec)
{
if (Value == null) {
- ec.Emit (OpCodes.Ldnull);
+ ec.EmitNull ();
return;
}
public override void Emit (EmitContext ec)
{
- ec.Emit (OpCodes.Ldnull);
+ ec.EmitNull ();
// Only to make verifier happy
if (type.IsGenericParameter)
//
// Emits null pointer
//
- ec.Emit (OpCodes.Ldc_I4_0);
+ ec.EmitInt (0);
ec.Emit (OpCodes.Conv_U);
}
}