public override bool Equals(object o) { if (o == this) { return(true); } if (!(o is MethodDescriptor)) { return(false); } MethodDescriptor md = (MethodDescriptor)o; return(ret.Equals(md.ret) && Sharpen.Arrays.Equals(@params, md.@params)); }
public override bool Equals(object o) { if (o == this) { return(true); } if (!(o is FieldDescriptor)) { return(false); } FieldDescriptor fd = (FieldDescriptor)o; return(type.Equals(fd.type)); }
public virtual bool IsStrictSuperset(VarType val) { int valType = val.type; if (valType == ICodeConstants.Type_Unknown && type != ICodeConstants.Type_Unknown) { return(true); } if (val.arrayDim > 0) { return(this.Equals(Vartype_Object)); } else if (arrayDim > 0) { return(valType == ICodeConstants.Type_Null); } bool res = false; switch (type) { case ICodeConstants.Type_Int: { res = (valType == ICodeConstants.Type_Short || valType == ICodeConstants.Type_Char ); goto case ICodeConstants.Type_Short; } case ICodeConstants.Type_Short: { res |= (valType == ICodeConstants.Type_Byte); goto case ICodeConstants.Type_Char; } case ICodeConstants.Type_Char: { res |= (valType == ICodeConstants.Type_Shortchar); goto case ICodeConstants.Type_Byte; } case ICodeConstants.Type_Byte: case ICodeConstants.Type_Shortchar: { res |= (valType == ICodeConstants.Type_Bytechar); goto case ICodeConstants.Type_Bytechar; } case ICodeConstants.Type_Bytechar: { res |= (valType == ICodeConstants.Type_Boolean); break; } case ICodeConstants.Type_Object: { if (valType == ICodeConstants.Type_Null) { return(true); } else if (this.Equals(Vartype_Object)) { return(valType == ICodeConstants.Type_Object && !val.Equals(Vartype_Object)); } break; } } return(res); }