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

Fix RCA panic on lambda with explicit return #2194

Merged
merged 4 commits into from
Feb 20, 2025
Merged

Conversation

swernli
Copy link
Collaborator

@swernli swernli commented Feb 20, 2025

This fixes a quirk leftover from the fixes in #649 and #793. Those introduced and then updated a conditional that avoided unifying certain types during type checking, but it turns out it was always safe to unconditionally unify the types once #649 introduced the explicit return type tracking. With this fix, the lifted lambda callables with explicit returns have the correct output type instead of always being Unit and RCA is able to use that type information as expected, avoiding the panic.

Fixes #2186

This fixes a quirk leftover from the fixes in #649 and #793. Those introduced and then updated a conditional that avoided unifying certain types during type checking, but it turns out it was always safe to unconditionally unify the types once #649 introduced the explicit return type tracking. With this fix, the lifted lambda callables with explicit returns have the correct output type instead of always being `Unit` and RCA is able to use that type information as expected, avoiding the panic.

Fixes #2186
@swernli swernli enabled auto-merge February 20, 2025 23:34
@swernli swernli added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit dbb0e57 Feb 20, 2025
18 checks passed
@swernli swernli deleted the swernli/issue2186 branch February 20, 2025 23:50
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.

Compiler panic when using "return" inside function lamda with nested Arrays
3 participants