Issue 24575 - sumtype fails to match lambdas with anonymous arguments
Summary: sumtype fails to match lambdas with anonymous arguments
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-31 21:48 UTC by crazymonkyyy
Modified: 2024-12-01 16:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description crazymonkyyy 2024-05-31 21:48:13 UTC
```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 Richard (Rikki) Andrew Cattermole 2024-05-31 22:02:20 UTC
This is expected behavior.

Those lambdas are templates, adding names stops that.
Comment 2 dlangBugzillaToGithub 2024-12-01 16:42:39 UTC
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