~sircmpwn/hare#835: 
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

Status
REPORTED
Submitter
~ecs
Assigned to
No-one
Submitted
1 year, 11 months ago
Updated
a year ago
Labels
design

~sebsite 1 year, 11 months ago*

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

let s: []str = ["foo", "bar"];
fmt::println([s...]...)!;

Or more minimally:

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

~sebsite 1 year, 11 months ago

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

~sebsite 1 year, 7 days 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 year 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.