can't pass []a into variadic (a | b)...

comes up in fmt::println, for example. not sure this is fixable, but i'm writing it down in case anyone else has ideas

Assigned to
1 year, 1 month ago
a month ago

~sebsite 1 year, 1 month ago*

An idea I just thought of: maybe the following should work:

let s: []str = ["foo", "bar"];

Or more minimally:

let s: []str = ["foo", "bar"];
let s: []fmt::formattable = [s...];

~sebsite 1 year, 1 month ago

...accidentally re-invented VLAs nvm, disregard above

~sebsite 2 months ago

I don't think this is possible to implement without VLAs. Not only would VLAs massively complicate the type system, but implicit VLAs are a massive footgun in general. Even if they aren't implicit, VLAs aren't a good way to solve this problem. I can't think of any other problems which are actually best solved with VLAs, so I don't think we should add them.

~ecs a month ago

yeah, i agree that this is likely unsolvable, i'd mostly like to keep the ticket open in order to mark this as a known design issue

Register here or Log in to comment, or comment via email.