fork download
  1. using System;
  2. namespace Main{
  3.  
  4. class Test<T>{
  5.  
  6. public Test(T Value){
  7. X.Foo(Value);
  8. }
  9. }
  10.  
  11.  
  12. class X{
  13. public static void Foo(int value){
  14. Console.WriteLine("Foo Int: "+value);
  15. }
  16.  
  17. public static void Foo(float value){
  18. Console.WriteLine("Foo Float: "+value);
  19. }
  20.  
  21. public static void Main(){
  22. Test<float> f = new Test<float>(5.0f);
  23. Test<int> i = new Test<int>(5);
  24. return;
  25. }
  26. }
  27. }
Compilation error #stdin compilation error #stdout 0.01s 33480KB
stdin
Standard input is empty
compilation info
prog.cs(7,15): error CS1502: The best overloaded method match for `Main.X.Foo(int)' has some invalid arguments
prog.cs(13,28): (Location of the symbol related to previous error)
prog.cs(7,15): error CS1503: Argument `#1' cannot convert `T' expression to type `int'
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty