fork download
  1. import std.stdio;
  2.  
  3. float f() { return 3.14f; }
  4. int f() { return 10; }
  5.  
  6. void main()
  7. {
  8. int i = f();
  9. float f = f();
  10. writeln(i);
  11. writeln(f);
  12. }
  13.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.d(8): Error: function prog.f called with argument types:
	(())
matches both:
	prog.f()
and:
	prog.f()
prog.d(8): Error: cannot implicitly convert expression (f()) of type float to int
prog.d(9): Error: function prog.f called with argument types:
	(())
matches both:
	prog.f()
and:
	prog.f()
stdout
Standard output is empty