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.
Second test case: auto deduceLength(T,size_t n)(T[n] a){ return a; } static assert(is(typeof(deduceLength([1,2,3]))==int[3]));
*** Issue 9711 has been marked as a duplicate of this issue. ***
This would complement Issue 3652 nicely, which has a partial implementation for the upcoming 2.063.
https://github.com/D-Programming-Language/dmd/pull/1744
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