[Issue 10961] New: Assigning a void[] to a Variant results in compiler errors.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Sep 3 16:35:46 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10961
Summary: Assigning a void[] to a Variant results in compiler
errors.
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: opantm2+dbugs at gmail.com
--- Comment #0 from Kapps <opantm2+dbugs at gmail.com> 2013-09-03 16:35:45 PDT ---
The following sample code:
import std.variant, std.stdio;
void main() {
void[] elements = new void[4];
Variant v = elements;
writeln(v);
}
Results in the following compiler errors:
variant.d(425): Error: expression (*zis)[index] is void and has no value
variant.d(675): Error: variable
std.variant.VariantN!(32LU).VariantN.get!void.get.Buf.result variables cannot
be of type void
variant.d(678): Error: a struct is not a valid initializer for a _error_
variant.d(683): Error: cannot return non-void from void function
variant.d(471): Error: template instance
std.variant.VariantN!(32LU).VariantN.get!void error instantiating
variant.d(562): instantiated from here: handler!(void[])
variant.d(512): instantiated from here: opAssign!(void[])
test.d(6): instantiated from here: __ctor!(void[])
variant.d(471): Error: [arg[0LU].get()] of type void[] has no value
variant.d(440): Error: switch case fallthrough - use 'goto case;' if intended
variant.d(485): Error: switch case fallthrough - use 'goto case;' if intended
variant.d(562): Error: template instance
std.variant.VariantN!(32LU).VariantN.handler!(void[]) error instantiating
variant.d(512): instantiated from here: opAssign!(void[])
test.d(6): instantiated from here: __ctor!(void[])
variant.d(512): Error: template instance
std.variant.VariantN!(32LU).VariantN.opAssign!(void[]) error instantiating
test.d(6): instantiated from here: __ctor!(void[])
test.d(6): Error: template instance
std.variant.VariantN!(32LU).VariantN.__ctor!(void[]) error instantiating
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list