ICSharpCode.NRefactory.CSharp.Resolver.CSharpResolver.WithCheckForOverflow C# (CSharp) Method

WithCheckForOverflow() public method

Sets whether the current context is checked.
public WithCheckForOverflow ( bool checkForOverflow ) : CSharpResolver
checkForOverflow bool
return CSharpResolver
		public CSharpResolver WithCheckForOverflow(bool checkForOverflow)
		{
			if (checkForOverflow == this.checkForOverflow)
				return this;
			return new CSharpResolver(compilation, conversions, context, checkForOverflow, isWithinLambdaExpression, currentTypeDefinitionCache, localVariableStack, objectInitializerStack);
		}
		

Usage Example

Esempio n. 1
0
        public void AdditionWithOverflow()
        {
            AssertConstant(int.MinValue, resolver.WithCheckForOverflow(false).ResolveBinaryOperator(
                               BinaryOperatorType.Add, MakeConstant(int.MaxValue), MakeConstant(1)));

            AssertError(typeof(int), resolver.WithCheckForOverflow(true).ResolveBinaryOperator(
                            BinaryOperatorType.Add, MakeConstant(int.MaxValue), MakeConstant(1)));
        }
All Usage Examples Of ICSharpCode.NRefactory.CSharp.Resolver.CSharpResolver::WithCheckForOverflow
CSharpResolver