Bug 24575 – sumtype fails to match lambdas with anonymous arguments

Status
NEW
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-05-31T21:48:13Z
Last change time
2024-12-01T16:42:39Z
Assigned to
No Owner
Creator
crazymonkyyy
Moved to GitHub: phobos#9872 →

Comments

Comment #0 by crazymonkyyy — 2024-05-31T21:48:13Z
```d import std; struct tree(T){ alias node=typeof(this)[2]*; SumType!(T,node) data; bool isleaf()=> data.match!( (T)=>true, (node)=>false); } unittest{ tree!int foo; } ``` adding names to the lamdas arguments cause it to compile
Comment #1 by alphaglosined — 2024-05-31T22:02:20Z
This is expected behavior. Those lambdas are templates, adding names stops that.
Comment #2 by robert.schadek — 2024-12-01T16:42:39Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9872 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB