Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sumtype fails to match lambdas with anonymous arguments #9872

Open
dlangBugzillaToGithub opened this issue May 31, 2024 · 1 comment
Open
Labels
Arch:x86_64 Issues specific to x86_64 OS:Linux Issues specific to Linux Severity:Enhancement

Comments

@dlangBugzillaToGithub
Copy link

crazymonkyyy reported this on 2024-05-31T21:48:13Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=24575

CC List

  • alphaglosined

Description

```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
@dlangBugzillaToGithub
Copy link
Author

alphaglosined commented on 2024-05-31T22:02:20Z

This is expected behavior.

Those lambdas are templates, adding names stops that.

@LightBender LightBender removed the P1 label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch:x86_64 Issues specific to x86_64 OS:Linux Issues specific to Linux Severity:Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants