Thread overview
[Issue 12323] std.typecons.Nullable of a fixed-size array
Dec 17, 2022
Iain Buclaw
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=12323

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4

--
November 12
https://issues.dlang.org/show_bug.cgi?id=12323

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #1 from Nick Treleaven <nick@geany.org> ---
Still happens with dmd v2.109.0.

--
November 12
https://issues.dlang.org/show_bug.cgi?id=12323

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Nick Treleaven <nick@geany.org> ---
Sorry, the error messages are different now:

nullableslice.d(10): Error: constructor
`std.typecons.Nullable!(int[5]).Nullable.this(inout(int[5]) value) inout` is
not callable using argument types `(int[])`
nullableslice.d(10):        cannot pass argument `array(iota(5))` of type
`int[]` to parameter `inout(int[5]) value`
nullableslice.d(13): Error: constructor
`std.typecons.Nullable!(int[5]).Nullable.this(inout(int[5]) value) inout` is
not callable using argument types `(immutable(int)[])`
nullableslice.d(13):        cannot pass argument `idup(array(iota(5)))` of type
`immutable(int)[]` to parameter `inout(int[5]) value`

That is actually correct because the type system can't know at compile-time that `array` or `idup` will each return a slice that has 5 elements.

--