fork download
  1. using System;
  2. class Program
  3. {
  4. public static void Write(short v) { }
  5. static void Main(string[] args)
  6. {
  7. Write(1);//ok
  8. Write((int)1);//ok
  9. int i=1;
  10. Write(i);//error!?
  11. }
  12. }
  13.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(10,25): error CS1502: The best overloaded method match for `Program.Write(short)' has some invalid arguments
prog.cs(4,36): (Location of the symbol related to previous error)
prog.cs(10,25): error CS1503: Argument `#1' cannot convert `int' expression to type `short'
Compilation failed: 2 error(s), 0 warnings
stdout

Standard output is empty