http://d.puremagic.com/issues/show_bug.cgi?id=11361
Summary: [2.064 beta] Variant fails to compile with functions/delegates that contain const parameters. Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity: regression Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: opantm2+db...@gmail.com --- Comment #0 from Kapps <opantm2+db...@gmail.com> 2013-10-25 18:29:27 PDT --- Example: import std.variant; const(char[]) t1(const(char[]) c) { return c; } void main() { auto fn = &t1; Variant v = fn; } Output: dmd test.d /Users/kapps/dev/dmd/phobos/std/variant.d(515): Error: can only initialize const member _expand_field_0 inside constructor /Users/kapps/dev/dmd/phobos/std/variant.d(585): Error: template instance std.variant.VariantN!(32LU).VariantN.handler!(const(char[]) function(const(char[]))) error instantiating /Users/kapps/dev/dmd/phobos/std/variant.d(535): instantiated from here: opAssign!(const(char[]) function(const(char[]) c)) test.d(9): instantiated from here: __ctor!(const(char[]) function(const(char[]) c)) /Users/kapps/dev/dmd/phobos/std/variant.d(535): Error: template instance std.variant.VariantN!(32LU).VariantN.opAssign!(const(char[]) function(const(char[]) c)) error instantiating test.d(9): instantiated from here: __ctor!(const(char[]) function(const(char[]) c)) test.d(9): Error: template instance std.variant.VariantN!(32LU).VariantN.__ctor!(const(char[]) function(const(char[]) c)) error instantiating -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------