On Monday, 2 January 2017 at 15:28:57 UTC, Nordlöw wrote:
Should I file a bug report?
Yes please
On Monday, 2 January 2017 at 14:38:53 UTC, Nordlöw wrote:
I've tried as many combinations of `return` and `scope` as I
can think of such as
Update:
Qualifying `asStatic` with `@safe pure nothrow @nogc` as
T[length] asStatic(T, size_t length)(T[length] arr)
@safe pure nothrow @nogc
{
r
On Sunday, 1 January 2017 at 18:00:54 UTC, Stefan Koch wrote:
Try:
auto asStatic(T, size_t length)(scope T[length] arr)
{
return arr;
}
I've tried as many combinations of `return` and `scope` as I can
think of such as
T[length] asStatic(T, size_t length)(return scope T[length]
On Sunday, 1 January 2017 at 17:41:46 UTC, Nordlöw wrote:
now fails on Git master (after DIP-1000 has been merged) as
When compiled with `-transition=safe`, that is.
On Sunday, 1 January 2017 at 17:41:46 UTC, Nordlöw wrote:
The code
auto asStatic(T, size_t length)(T[length] arr)
{
return arr;
}
@safe pure nothrow @nogc unittest
{
auto x = [1, 2, 3].asStatic;
static assert(is(typeof(x) == int[x.length]));
static assert(is(typeof([1, 2, 3].as
On Sunday, 1 January 2017 at 18:00:54 UTC, Stefan Koch wrote:
Try:
auto asStatic(T, size_t length)(scope T[length] arr)
{
return arr;
}
Fails as
array_ex.d(72,10): Error: parameter arr is 'return' but function
does not return any indirections
array_ex.d(80,27): Error: template instanc
The code
auto asStatic(T, size_t length)(T[length] arr)
{
return arr;
}
@safe pure nothrow @nogc unittest
{
auto x = [1, 2, 3].asStatic;
static assert(is(typeof(x) == int[x.length]));
static assert(is(typeof([1, 2, 3].asStatic) ==
int[x.length]));
}
now fails on Git master (