http://d.puremagic.com/issues/show_bug.cgi?id=11206
monarchdo...@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID | --- Comment #2 from monarchdo...@gmail.com 2013-10-09 09:02:30 PDT --- (In reply to comment #1) > So, what? > > Basically you are complainig about: > > import std.stdio; > > struct AGG > { > int[1] t; > double d; > } > > void main() > { > AGG tarr2 = AGG(1); > writeln(tarr2); > } > > which prints AGG([1], nan). ...Unsure what you are trying to show? the "AGG(1)". > AGG(1) is a struct literal which is valid in D. I'm arguing that AGG should not be constructible taking a 1. > Integer literal is a valid > initializer for static array. Statement "AGG!S ts1 = AGG!S(1);" is rejected > because (unfortunately) 1 is not convertible to struct. Yes, integer is a valid initializer for a static array, and it is also a valid initializer for a struct that holds an int. However, 1 is not convertible to a struct, not is it convertible to a static array. AGG(1) should not compile, because 1 is not convertible to typeof(AGG.tupleof[0]); What's happening is an implicit *construction* of a static array, in a context where implicit construction is not allowed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------