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

Nested fat arrow closures cause false positive for UndefinedVariable #329

Closed
stefanfisk opened this issue Oct 14, 2024 · 2 comments · Fixed by #334
Closed

Nested fat arrow closures cause false positive for UndefinedVariable #329

stefanfisk opened this issue Oct 14, 2024 · 2 comments · Fixed by #334
Labels

Comments

@stefanfisk
Copy link

Here's a simple example that generates UndefinedVariable for the second $item in the array.

$fn = fn($item) => [
    $item,
    fn($arg) => $arg,
    $item,
];

This works fine.

$fn = function($item) {
    return [
        $item,
        fn($arg) => $arg,
        $item,
    ];
}

I am using v2.11.19 but the issue has been around for years, I've just never gotten around to opening an issue.

@sirbrillig sirbrillig added the bug label Oct 15, 2024
@sirbrillig
Copy link
Owner

Thank you for the report! I don't think I ever did enough testing with nested fat arrow functions.

@sirbrillig
Copy link
Owner

Should be fixed by #334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants