Rikki's Borrow Checker
Meta
jared771 at gmail.com
Sun Aug 30 05:14:08 UTC 2026
On Saturday, 29 August 2026 at 15:26:31 UTC, xoxorwr wrote:
> On Thursday, 27 August 2026 at 20:49:32 UTC, Richard (Rikki)
> Andrew Cattermole wrote:
>> On 28/08/2026 8:35 AM, Walter Bright wrote:
>>> https://github.com/dlang/dmd/pull/23572
>>>
>>> Give it a whirl, and let us know what you think!
>>
>> Thanks Walter for the merge!
>>
>> This unblocks my sumtypes and matching DIP/PR.
>>
>> It'll allow me to solve for the following program corruption:
>>
>> ```d
>> st.match {
>> (ref v) => st = ST.init, v
>> };
>> ```
>
> `match` with lambda syntax onto sumtypes is more inconsistent
> clutter this language doesn't need.
>
> This will ruin D, yet again.
>
> Pattern matching on sumtypes belongs in `switch`, it's a type
> switch, not justification for closures.
I proposed an alternate model that includes switch expressions
with Rust-like destructuring (not fully implemented but a good
chunk works):
https://github.com/dlang/dmd/pull/23744
More information about the Digitalmars-d
mailing list