On Saturday, 22 March 2014 at 13:01:11 UTC, Nordlöw wrote:
gives same error

That's because you made the alias local, UFCS only works with global symbols right now (which is actually by design, though I don't think it is a great design). So this works:

// move these out to module scope
    import std.string;
    alias z = toStringz;

unittest {
    import std.stdio: wln = writeln;
    wln(typeof("a".z).stringof); // now we're good/
}

Reply via email to