Skip to content

Improve type resolution of unlabeled blocks#2309

Merged
Techatrix merged 2 commits into
zigtools:masterfrom
FnControlOption:noreturn
May 13, 2025
Merged

Improve type resolution of unlabeled blocks#2309
Techatrix merged 2 commits into
zigtools:masterfrom
FnControlOption:noreturn

Conversation

@FnControlOption

Copy link
Copy Markdown
Contributor

If the last statement of an unlabeled block is a noreturn, the block becomes noreturn also. Otherwise, the block is void.

This will be helpful for peer type resolution:

const foo = bar() catch |err| {
    // do stuff
    return;
};

@Techatrix Techatrix merged commit 747849c into zigtools:master May 13, 2025
6 checks passed
@FnControlOption FnControlOption deleted the noreturn branch May 14, 2025 04:37
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.

2 participants