Why doesn't this code do what I'd expect it to, and how can I fix it?

    unittest{
        import std.traits : Parameters;
        // Works as expected
        alias dg = int delegate(int value);
enum bool dgcallable = is(typeof((){dg(Parameters!dg.init);}));
        pragma(msg, dgcallable); // Prints true
        // Doesn't work as expected
        alias dgref = int delegate(ref int value);
enum bool dgrefcallable = is(typeof((){dgref(Parameters!dgref.init);}));
        pragma(msg, dgrefcallable); // Prints false
    }

Thanks!

Reply via email to