// note. this ctor is only necessary for the decompiler pipeline // so it's only internal but not public // ahhh... why don't we have friend classes/methods?! internal Lambda(MethodBase method, Sig decompiledSig, Block decompiledBody) : base(NodeType.Lambda) { Method = method; Sig = decompiledSig; _body = decompiledBody; }
public Lambda(MethodBase method, InvocationStyle invocationStyle) : base(NodeType.Lambda) { Method = method.AssertNotNull(); InvocationStyle = invocationStyle; Sig = new Sig(this); }
// note. we need this constructor to provide information // about method's parameters without having to decompile it // // the point is that to get sig's symbols we've got to know their ids // but the ids need to be synchronized with Refs in decompiled body // that's why a simple call to Sig::Syms need to decompile the entire body public ParamInfo(Sig sig, int index, String name, Type type) { Sig = sig; Index = index; Name = name.IsNullOrEmpty() ? "$p" + index : name; Type = type; }
public ParamInfo(Sig sig, int index) { Sig = sig; Index = index; Name = Sym.Name; Type = Sym.Type; }
protected override int EigenHashCode() { return(base.EigenHashCode() ^ InvocationStyle.SafeHashCode() ^ Sig.SafeHashCode() ^ Method.SafeHashCode()); }
public Lambda(Sig sig) : base(NodeType.Lambda) { Sig = sig; }
// note. this one is necessary to preserve all metadata that we might need later on // e.g. for the purpose of determining whether this particular argument is an "out" one public ParamInfo(Sig sig, int index, ParameterInfo metadata) : this(sig, index, metadata.AssertNotNull().Name, metadata.AssertNotNull().ParameterType) { Metadata = metadata; }