D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10406 - std.conv.to of string array to fixed sized array
Summary: std.conv.to of string array to fixed sized array
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2013-06-18 10:46 UTC by bearophile_hugs
Modified: 2020-03-21 03:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2013-06-18 10:46:33 UTC
import std.conv: to;
void main() {
    auto xy = ["1", "2"].to!(int[2]);
}


DMD 2.063.2 gives:

...\dmd2\src\phobos\std\conv.d(1325): Error: cannot implicitly convert expression (result) of type int[] to int[2u]
...\dmd2\src\phobos\std\conv.d(276): Error: template instance std.conv.toImpl!(int[2u], string[]) error instantiating
temp.d(3):        instantiated from here: to!(string[])
temp.d(3): Error: template instance std.conv.to!(int[2u]).to!(string[]) error instantiating