fork download
  1. import std.stdio;
  2.  
  3. template foo(int number)
  4. {
  5. immutable int foo = number;
  6. immutable int bar = number;
  7. }
  8.  
  9. void main()
  10. {
  11. writeln(foo!(123));
  12.  
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/dmd2/src/phobos/std/stdio.d(1247): Error: cannot have parameter of type void
/usr/lib/dmd2/src/phobos/std/stdio.d(1247): Error: variable std.stdio.writeln!(void).writeln._param_0 voids have no value
stdout
Standard output is empty