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

Always allow local function type parameters #11520

Merged
merged 4 commits into from
Feb 7, 2024
Merged

Conversation

Simn
Copy link
Member

@Simn Simn commented Jan 30, 2024

Currently, only named block-level functions are allowed to have type parameters. This PR changes it so that:

  • named value functions var x = function f<T>() {} are changed to var x = { function f<T>() {}; f; } and
  • unnamed value functions are also generated like that with a generated name.

It's not supported for Java and C# because it doesn't work there. I've confirmed that the manually expanded version also doesn't work, so this is not a new problem.

The test for this comes with a new unbound type parameter warning when generating hxb:

 WARNING  C:\git\haxe\tests\unit\src\unit\issues\Issue11513.hx

   | (WUnboundTypeParameter) Unbound type parameter send.TBody

This is the case I mention here and thus also not new. I don't remember why the original problem disappeared in the first place, but it's definitely still a problem.

@skial skial mentioned this pull request Feb 1, 2024
1 task
@Simn Simn merged commit 341ed94 into development Feb 7, 2024
106 checks passed
@Simn Simn deleted the more_fun_params branch February 7, 2024 16:13
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

Successfully merging this pull request may close these issues.

1 participant