[Issue 1649] New: Variant coercion fails with delegates
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Nov 8 08:47:50 PST 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1649
Summary: Variant coercion fails with delegates
Product: D
Version: 2.007
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: diagnostic
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: bugzilla at digitalmars.com
ReportedBy: dhasenan at gmail.com
---
auto v = Variant({ return false; });
v.coerce!(bool delegate());
---
This produces the output:
/home/gareis/prog/dmd/src/phobos/std/variant.d(565): function
std.variant.VariantN!(maxSize).VariantN.coerce!(bool delegate()).coerce
expected to return a value of type bool delegate()
/home/gareis/prog/dmd/src/phobos/std/variant.d(5): template instance
std.variant.VariantN!(maxSize).VariantN.coerce!(bool delegate()) error
instantiating
It should static assert false if the type you are trying to coerce to is not
supported (struct, delegate, etc).
--
More information about the Digitalmars-d-bugs
mailing list