Ejemplo n.º 1
0
        private CodeContractStatement(ICSharpStatement statement,
                                      IInvocationExpression invocationExpression,
                                      CodeContractStatementType statementType)
            : base(statement)
        {
            Contract.Requires(invocationExpression != null);

            _invocationExpression = invocationExpression;
            _statementType        = statementType;

            // Due to weird bug in CC compiler, I can't use the same variable in Contract.Requires
            // and in lambda expression.
            _codeContractExpression = JetBrains.Util.Lazy.Of(
                () => Assertions.ContractStatementFactory.TryCreateAssertion(_invocationExpression), true);
        }
        private CodeContractStatement(ICSharpStatement statement, 
            IInvocationExpression invocationExpression,
            CodeContractStatementType statementType)
            : base(statement)
        {
            Contract.Requires(invocationExpression != null);

            _invocationExpression = invocationExpression;
            _statementType = statementType;

            // Due to weird bug in CC compiler, I can't use the same variable in Contract.Requires
            // and in lambda expression.
            _codeContractExpression = JetBrains.Util.Lazy.Lazy.Of(
                () => Assertions.ContractStatementFactory.TryCreateAssertion(_invocationExpression));
        }