示例#1
0
            internal LocalBoxStorage(LambdaCompiler compiler, ParameterExpression variable)
                : base(compiler, variable)
            {
                var boxType = typeof(StrongBox <>).MakeGenericType(variable.Type);

                _boxValueField = boxType.GetField("Value");
                _boxLocal      = compiler.GetNamedLocal(boxType, variable);
            }
示例#2
0
 internal LocalStorage(LambdaCompiler compiler, ParameterExpression variable)
     : base(compiler, variable)
 {
     // ByRef variables are supported. This is used internally by
     // the compiler when emitting an inlined lambda invoke, to
     // handle ByRef parameters. BlockExpression prevents this
     // from being exposed to user created trees.
     _local = compiler.GetNamedLocal(variable.IsByRef ? variable.Type.MakeByRefType() : variable.Type, variable);
 }