D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9712 - IFTI does not support deducing static array types from array literal arguments
Summary: IFTI does not support deducing static array types from array literal arguments
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
: 9711 (view as issue list)
Depends on:
Blocks: 9711
  Show dependency treegraph
 
Reported: 2013-03-13 15:13 UTC by timon.gehr
Modified: 2013-03-27 05:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description timon.gehr 2013-03-13 15:13:27 UTC
With DMD 2.062, the following code fails to compile:

auto func(T)(T[2] arg){ return arg; }
static assert(is(typeof(func([1,2]))==int[2]));

The code should compile.
Comment 1 timon.gehr 2013-03-13 15:23:10 UTC
Second test case:

auto deduceLength(T,size_t n)(T[n] a){ return a; }
static assert(is(typeof(deduceLength([1,2,3]))==int[3]));
Comment 2 timon.gehr 2013-03-13 15:25:17 UTC
*** Issue 9711 has been marked as a duplicate of this issue. ***
Comment 3 Andrej Mitrovic 2013-03-13 15:46:29 UTC
This would complement Issue 3652 nicely, which has a partial implementation for the upcoming 2.063.
Comment 5 github-bugzilla 2013-03-15 09:58:44 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/f189f2898f5ef5f8ad03e9bd65c371d87cb39036
fix Issue 9712 - IFTI does not support deducing static array types from array literal arguments

https://github.com/D-Programming-Language/dmd/commit/0abdc798c436925bc59569105d88233e038592fc
Merge pull request #1744 from 9rnsr/fix9712

Issue 9712 - IFTI does not support deducing static array types from array literal arguments