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

typedef vs. GADT #11446

Closed
Simn opened this issue Dec 24, 2023 · 0 comments
Closed

typedef vs. GADT #11446

Simn opened this issue Dec 24, 2023 · 0 comments
Assignees

Comments

@Simn
Copy link
Member

Simn commented Dec 24, 2023

I noticed today that this doesn't work:

typedef Td = E<String>;

enum E<T> {
	// C(s:String):E<String>;
	C(s:String):Td;
}

function match<T>(e:E<T>) {
	return switch (e) {
		case C(s): s; // Unrecognized pattern: C(s)
	}
}

function main() {
	match(C("foo"));
}

The commented out version works fine, so this must either be a missing follow or some lame syntax-level check.

Merry Christmas anyway

@Simn Simn self-assigned this Dec 24, 2023
@Simn Simn closed this as completed in ed838d7 Dec 24, 2023
0b1kn00b pushed a commit to 0b1kn00b/haxe that referenced this issue Jan 25, 2024
kLabz pushed a commit that referenced this issue Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant