Error_ValueCannotBeConverted() public method

public Error_ValueCannotBeConverted ( ResolveContext ec, System.TypeSpec target, bool expl ) : void
ec ResolveContext
target System.TypeSpec
expl bool
return void
Ejemplo n.º 1
0
Archivo: const.cs Proyecto: mdae/MonoRT
        protected virtual Constant DoResolveValue(ResolveContext ec)
        {
            Constant value = initializer.ResolveAsConstant(ec, this);

            if (value == null)
            {
                return(null);
            }

            Constant c = value.ConvertImplicitly(MemberType);

            if (c == null)
            {
                if (TypeManager.IsReferenceType(MemberType))
                {
                    Error_ConstantCanBeInitializedWithNullOnly(MemberType, Location, GetSignatureForError(), Report);
                }
                else
                {
                    value.Error_ValueCannotBeConverted(ec, Location, MemberType, false);
                }
            }

            return(c);
        }