Beispiel #1
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        private IOperand GetRewrittenOperand(OperandCapture capture, IOperand target)
        {
            using (TypeTemplate.CreateScope <TypeTemplate.TField>(capture.OperandType))
            {
                if (capture.HoistingClosure == this)
                {
                    return(new Field <TypeTemplate.TField>(target, capture.HoistedField));
                }
                else if (m_Parent != null)
                {
                    return(m_Parent.GetRewrittenOperand(capture, m_ParentField.AsOperand <TypeTemplate.TField>(target)));
                }
                else
                {
                    Debug.Fail("Captured operand is not hoisted.");
                    throw new Exception();
                }
            }
        }