61 references to ERR_ConstOutOfRangeChecked
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Conversions.cs (1)
3265
Error(diagnostics, ErrorCode.
ERR_ConstOutOfRangeChecked
, syntax, sourceValue.Value!, destination!);
Errors\ErrorFacts.cs (1)
797
or ErrorCode.
ERR_ConstOutOfRangeChecked
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenTupleTest.cs (2)
25400
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "-1").WithArguments("-1", "byte").WithLocation(13, 39),
25403
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "-2").WithArguments("-2", "byte").WithLocation(14, 44));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\NumericIntPtrTests.cs (1)
2382
static DiagnosticDescription errorOutOfRangeChecked(string destinationType, string value) => Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, $"({destinationType})x").WithArguments(value, AsNative(destinationType));
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (1)
IOperation\IOperationTests_IConversionExpression.cs (1)
3783
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(E2)E1.One").WithArguments("1000", "E2").WithLocation(6, 27),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (55)
Semantics\ConstantTests.cs (25)
783
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "S8.Max + 1").WithArguments("128", "S8").WithLocation(32, 11),
786
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "U8.Max + 1").WithArguments("256", "U8").WithLocation(33, 11),
789
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "S16.Max + 1").WithArguments("32768", "S16").WithLocation(34, 11),
792
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "U16.Max + 1").WithArguments("65536", "U16").WithLocation(35, 11),
807
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "2 + S8.Max").WithArguments("129", "S8").WithLocation(42, 11),
810
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "2 + U8.Max").WithArguments("257", "U8").WithLocation(43, 11),
813
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "2 + S16.Max").WithArguments("32769", "S16").WithLocation(44, 11),
816
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "2 + U16.Max").WithArguments("65537", "U16").WithLocation(45, 11),
831
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "U8.Min - U8.MinPlusOne").WithArguments("-1", "byte").WithLocation(53, 11),
834
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "U16.Min - U16.MinPlusOne").WithArguments("-1", "ushort").WithLocation(55, 11),
843
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "S8.Min - S8.Max").WithArguments("-255", "sbyte").WithLocation(62, 11),
846
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "U8.Min - U8.Max").WithArguments("-255", "byte").WithLocation(63, 11),
849
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "S16.Min - S16.Max").WithArguments("-65535", "short").WithLocation(64, 11),
852
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "U16.Min - U16.Max").WithArguments("-65535", "ushort").WithLocation(65, 11),
867
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "S8.Max - S8.Min").WithArguments("255", "sbyte").WithLocation(72, 11),
870
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "S16.Max - S16.Min").WithArguments("65535", "short").WithLocation(74, 11),
879
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "S8.Min - 2").WithArguments("-130", "S8").WithLocation(82, 11),
882
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "U8.Min - 2").WithArguments("-2", "U8").WithLocation(83, 11),
885
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "S16.Min - 2").WithArguments("-32770", "S16").WithLocation(84, 11),
888
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "U16.Min - 2").WithArguments("-2", "U16").WithLocation(85, 11),
1749
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)0x8888888888888888").WithArguments("9838263505978427528", "int").WithLocation(20, 29),
1752
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(uint)0x8888888888888888").WithArguments("9838263505978427528", "uint").WithLocation(21, 31),
1755
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(long)0x8888888888888888").WithArguments("9838263505978427528", "long").WithLocation(22, 31),
1758
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(ulong)1E50").WithArguments("1E+50", "ulong").WithLocation(23, 33),
2948
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(byte)300").WithArguments("300", "byte")
Semantics\InterpolationTests.cs (1)
657
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)1E10").WithArguments("10000000000", "int").WithLocation(6, 22),
Semantics\NativeIntegerTests.cs (1)
6519
static DiagnosticDescription errorOutOfRangeChecked(string destinationType, string value) => Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, $"({destinationType})x").WithArguments(value, destinationType);
Semantics\NullableConversionTests.cs (16)
754
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int?)double.MaxValue").WithArguments(double.MaxValue.ToString(), "int").WithLocation(15, 13),
757
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int?)double.NaN").WithArguments(double.NaN.ToString(), "int").WithLocation(16, 13),
760
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int?)double.NegativeInfinity").WithArguments(double.NegativeInfinity.ToString(), "int").WithLocation(17, 13),
763
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int?)double.PositiveInfinity").WithArguments(double.PositiveInfinity.ToString(), "int").WithLocation(18, 13),
766
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int?)float.MaxValue").WithArguments(float.MaxValue.ToString(), "int").WithLocation(22, 13),
769
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int?)float.NaN").WithArguments(float.NaN.ToString(), "int").WithLocation(23, 13),
772
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int?)float.NegativeInfinity").WithArguments(float.NegativeInfinity.ToString(), "int").WithLocation(24, 13),
775
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int?)float.PositiveInfinity").WithArguments(float.PositiveInfinity.ToString(), "int").WithLocation(25, 13),
778
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)double.MaxValue").WithArguments(double.MaxValue.ToString(), "int").WithLocation(29, 13),
781
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)double.NaN").WithArguments(double.NaN.ToString(), "int").WithLocation(30, 13),
784
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)double.NegativeInfinity").WithArguments(double.NegativeInfinity.ToString(), "int").WithLocation(31, 13),
787
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)double.PositiveInfinity").WithArguments(double.PositiveInfinity.ToString(), "int").WithLocation(32, 13),
790
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)float.MaxValue").WithArguments(float.MaxValue.ToString(), "int").WithLocation(36, 13),
793
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)float.NaN").WithArguments(float.NaN.ToString(), "int").WithLocation(37, 13),
796
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)float.NegativeInfinity").WithArguments(float.NegativeInfinity.ToString(), "int").WithLocation(38, 13),
799
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)float.PositiveInfinity").WithArguments(float.PositiveInfinity.ToString(), "int").WithLocation(39, 13)
Semantics\RawInterpolationTests.cs (1)
672
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)1E10").WithArguments("10000000000", "int").WithLocation(6, 24),
Semantics\SemanticErrorTests.cs (11)
1821
new ErrorDescription { Code = (int)ErrorCode.
ERR_ConstOutOfRangeChecked
, Line = 6, Column = 34 },
1822
new ErrorDescription { Code = (int)ErrorCode.
ERR_ConstOutOfRangeChecked
, Line = 8, Column = 34 });
1847
new ErrorDescription { Code = (int)ErrorCode.
ERR_ConstOutOfRangeChecked
, Line = 7, Column = 34 },
1848
new ErrorDescription { Code = (int)ErrorCode.
ERR_ConstOutOfRangeChecked
, Line = 8, Column = 34 });
1863
new ErrorDescription { Code = (int)ErrorCode.
ERR_ConstOutOfRangeChecked
, Line = 6, Column = 34 },
1864
new ErrorDescription { Code = (int)ErrorCode.
ERR_ConstOutOfRangeChecked
, Line = 7, Column = 34 },
1865
new ErrorDescription { Code = (int)ErrorCode.
ERR_ConstOutOfRangeChecked
, Line = 8, Column = 34 });
8427
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)0xFFFFFFFF").WithArguments("4294967295", "int"),
8429
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "(int)(uint.MaxValue - 1)").WithArguments("4294967294", "int"));
8446
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "E.C + 1").WithArguments("256", "E"),
8448
Diagnostic(ErrorCode.
ERR_ConstOutOfRangeChecked
, "E.A - 1").WithArguments("-1", "E"));