Bug 9712 – IFTI does not support deducing static array types from array literal arguments

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-13T15:13:00Z
Last change time
2013-03-27T05:16:27Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
timon.gehr
Blocks
9711

Comments

Comment #0 by timon.gehr — 2013-03-13T15:13:27Z
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 by timon.gehr — 2013-03-13T15:23:10Z
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 by timon.gehr — 2013-03-13T15:25:17Z
*** Issue 9711 has been marked as a duplicate of this issue. ***
Comment #3 by andrej.mitrovich — 2013-03-13T15:46:29Z
This would complement Issue 3652 nicely, which has a partial implementation for the upcoming 2.063.
Comment #4 by k.hara.pg — 2013-03-13T19:08:45Z
Comment #5 by github-bugzilla — 2013-03-15T09:58:44Z
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