Microsoft.CSharp.RuntimeBinder.RuntimeBinder.CreateLocal C# (CSharp) Method

CreateLocal() private method

private CreateLocal ( Type type, bool bIsOut, Microsoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbol local ) : EXPR
type System.Type
bIsOut bool
local Microsoft.CSharp.RuntimeBinder.Semantics.LocalVariableSymbol
return Microsoft.CSharp.RuntimeBinder.Semantics.EXPR
        private EXPR CreateLocal(Type type, bool bIsOut, LocalVariableSymbol local)
        {
            CType ctype = _symbolTable.GetCTypeFromType(type);
            if (bIsOut)
            {
                Debug.Assert(ctype.IsParameterModifierType());
                ctype = _semanticChecker.GetTypeManager().GetParameterModifier(
                    ctype.AsParameterModifierType().GetParameterType(),
                    true);
            }

            // If we can convert, do that. If not, cast it.
            EXPRLOCAL exprLocal = _exprFactory.CreateLocal(EXPRFLAG.EXF_LVALUE, local);
            EXPR result = _binder.tryConvert(exprLocal, ctype);
            if (result == null)
            {
                result = _binder.mustCast(exprLocal, ctype);
            }
            result.flags |= EXPRFLAG.EXF_LVALUE;
            return result;
        }