Open joshi-monster opened 13 hours ago
Type unification does remove the inferred variant, but only if unifying directly with a named type. I suppose we'll have to iterate over tuples and remove any inferred variants inside those too. I'm pretty sure tuples are the only datatype which can contain values with variant information, since anything else requires unification and so the variants would be removed there.
Thanks both. You looking into this @GearsDatapacks ?
Yep. I have a working implementation. I can PR it now
You're a machine!
(Gleam nightly)
compiles, except for a "redundant record update" warning. It is important that the values here are wrapped in tuples - the size of the tuple doesn't matter, and a
Box
record works correctly.There might be a second bug here about type unification not dropping the inferred variant, but it also works without having 2 different values for the compiler to infer:
produces
I'm sorry Gears ~ :purple_heart: