On Friday, 8 January 2021 at 14:07:29 UTC, Luhrel wrote:
Example a3 is straightforward the primary use case for
staticArray:
auto a3 = [1,2,3].staticArray;
I really don't like the `.staticArray` because it's
non-esthetic. I don't know if it's really argument, mainly
because it's very personal.
The worst thing about it is you have to import std.array, so
probably people won't bother scrolling to the top to add the
import and losing/bookmarking their place, and will just count
the items themselves. When it was originally proposed, it was in
object.d.
I think if the DIP proposed a literal syntax instead of a new
variable declaration syntax, it would be much less of a burden to
the compiler. I think we don't have any partial (variable) type
inference syntax ATM.
Correct. I'll rewrite this example.
There should be a type conversion:
```
int[2] bar() { return [1,2]; }
long[$] a6 = bar(); // implicit conversion
static assert(is(typeof(a6) == long[2]));
```
Error: cannot implicitly convert expression `bar()` of type
`int[2]` to `long[]`