fork(1) download
  1. public interface IInterface { }
  2.  
  3. public class MyClass { }
  4.  
  5. public class Program {
  6. public static void Foo(IInterface myVariable) { }
  7.  
  8. public static void Main() {
  9. Foo(new MyClass());
  10. }
  11. }
Compilation error #stdin compilation error #stdout 0.01s 131264KB
stdin
Standard input is empty
compilation info
prog.cs(9,6): error CS1502: The best overloaded method match for `Program.Foo(IInterface)' has some invalid arguments
prog.cs(6,24): (Location of the symbol related to previous error)
prog.cs(9,10): error CS1503: Argument `#1' cannot convert `MyClass' expression to type `IInterface'
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty