MustCaptureVariable() публичный Метод

public MustCaptureVariable ( INamedBlockVariable local ) : bool
local INamedBlockVariable
Результат bool
Пример #1
0
		Expression DoResolveBase (ResolveContext ec)
		{
			type = local_info.VariableType;

			Expression e = Block.GetConstantExpression (Name);
			if (e != null)
				return e.Resolve (ec);

			VerifyAssigned (ec);

			//
			// If we are referencing a variable from the external block
			// flag it for capturing
			//
			if (ec.MustCaptureVariable (local_info)) {
				if (local_info.AddressTaken)
					AnonymousMethodExpression.Error_AddressOfCapturedVar (ec, this, loc);

				if (ec.IsVariableCapturingRequired) {
					AnonymousMethodStorey storey = local_info.Block.Explicit.CreateAnonymousMethodStorey (ec);
					storey.CaptureLocalVariable (ec, local_info);
				}
			}

			resolved |= ec.DoFlowAnalysis;
			eclass = ExprClass.Variable;
			return this;
		}