[Issue 9295] New: More implicit type conversion in array literals
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jan 11 10:50:51 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9295
Summary: More implicit type conversion in array literals
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2013-01-11 10:50:50 PST ---
I think this code should compile:
void main() {
auto vec = [1.0, 2]; // OK
auto mat = [[1.0], [2]]; // error
}
Currently dmd v.2.062alpha gives:
test.d(3): Error: incompatible types for (([1]) ? ([2])): 'double[]' and
'int[]'
A person on IRC has suggested that in some cases this is not what you want.
Please add some of such examples below.
--
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