fork download
  1. using System;
  2. public class Test
  3. {
  4. public static void Main()
  5. {
  6. object o = 1300135;
  7. int i;
  8. if(o is int)
  9. {
  10. i = o as int;
  11. }
  12. else
  13. {
  14. i = -1;
  15. }
  16. Console.WriteLine(i);
  17. }
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(10,31): error CS0077: The `as' operator cannot be used with a non-nullable value type `int'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty