public Lambda(MethodBase method, InvocationStyle invocationStyle) : base(NodeType.Lambda) { Method = method.AssertNotNull(); InvocationStyle = invocationStyle; Sig = new Sig(this); }
public override int GetHashCode() { if (_lambda != null) { return(_lambda.GetHashCode()); } return(Syms.Fold(InvocationStyle.SafeHashCode() ^ Ret.SafeHashCode(), (h, p) => h ^ p.SafeHashCode())); }
public Sig(MethodBase method, InvocationStyle invocationStyle) { Method = method; _invocationStyle = invocationStyle; var parc = 0; var @params = new List <ParamInfo>(); if (method.IsInstance() || method.IsConstructor) { @params.Add(new ParamInfo(this, parc++, "this", method.DeclaringType)); } method.GetParameters().ForEach((p, i) => @params.Add(new ParamInfo(this, parc++, p))); Syms = @params.Select((p, i) => new Param(p.Name, p.Type)).ToReadOnly(); }
public int EquivHashCode() { return(Params.Fold(InvocationStyle.SafeHashCode() ^ Ret.SafeHashCode(), (h, p) => h ^ p.SafeHashCode())); }
protected override int EigenHashCode() { return(base.EigenHashCode() ^ InvocationStyle.SafeHashCode() ^ Sig.SafeHashCode() ^ Method.SafeHashCode()); }