DMD does not allow stringof on function alias of a function that takes arguments

d coder dlang.coder at gmail.com
Sat Jun 2 04:40:33 PDT 2012


Greetings All

Using DMD 2.059, the following code does not compile. DMD does not allow me
to apply stringof on a function alias of a function that takes one or more
arguments. It compiles and runs fine for functions that do not take any
arguments.

Is it a bug, or am I doing something wrong here?

Regards
- Puneet

class Foo {
  void foo() { }
  void frop(int n) { }
}

void callfoo(alias F, T) (T t) {
  import std.stdio;
  writeln(F.stringof);
}

void main() {
  Foo f = new Foo();
  callfoo!(Foo.foo)(f); // This works
  callfoo!(Foo.frop)(f); // This does not work
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120602/1888778b/attachment-0001.html>


More information about the Digitalmars-d mailing list