fork download
  1. using System;
  2. public class Test
  3. {
  4. static int d ( Func<int,int> g ) {
  5. return g(g(1)); }
  6. static int p (int x) {
  7. Func<int,int> f = y => x + y;
  8. return d (f); }
  9.  
  10. public static void Main()
  11. {
  12. Console.WriteLine(d(3));
  13. }
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
2
10
42
11
compilation info
prog.cs(12,35): error CS1502: The best overloaded method match for `Test.d(System.Func<int,int>)' has some invalid arguments
prog.cs(4,12): (Location of the symbol related to previous error)
prog.cs(12,35): error CS1503: Argument `#1' cannot convert `int' expression to type `System.Func<int,int>'
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty