Didn't find an existing issue for this. Sorry, if missed.
As described here:
https://forum.dlang.org/post/[email protected]
There is an error during an attempt to fill an array of Nullable!uint during the execution of
void main()
{
import std.typecons;
Nullable!uint[] arr;
arr.length = 5;
arr[] = 1;
}
The suggested workaround is, currently, using a cast:
arr[] = cast(Nullable!uint)1;
Also an option would be:
import std.algorithm;
fill(arr, 1);
Comment #1 by sascha.orlov — 2016-03-12T18:34:11Z
The error is:
Error: cannot implicitly convert expression (1) of type int to Nullable!uint[]
Comment #2 by sascha.orlov — 2016-03-12T20:14:13Z
filling via
arr[] = Nullable!uint(1);
is also possible
Comment #3 by razvan.nitu1305 — 2023-02-13T14:52:17Z
This is not a compiler bug, but at most a phobos one.
Comment #4 by robert.schadek — 2024-12-01T16:26:19Z