Skip to content

simplify wait() #58595

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

Conversation

nsajko
Copy link
Contributor

@nsajko nsajko commented May 31, 2025

Copy link

Hello! I am a bot.

Thank you for your pull request!

I have assigned @DilumAluthge to this pull request.

@DilumAluthge can either choose to review this pull request themselves, or they can choose to find someone else to review this pull request.

@DilumAluthge DilumAluthge requested a review from kpamnany May 31, 2025 14:16
@DilumAluthge
Copy link
Member

@kpamnany Can you review this?

@DilumAluthge
Copy link
Member

FWIW, IIUC, the two aren't exactly identical.

Julia is allowed (in future Julia versions) to disable @asserts by default, perhaps based on optimization level.

In contrast, IIUC, a typeassert will never be disabled.

@nsajko
Copy link
Contributor Author

nsajko commented May 31, 2025

Julia is allowed (in future Julia versions) to disable @asserts by default, perhaps based on optimization level.

Yeah, I forgot about that when composing the commit message, but I think that's actually the strongest point in favor of this PR. A typeassert to a concrete literal type is free but can improve inference, so it seems like it's preferable to keep the typeassert regardless of optimization level.

@nsajko nsajko force-pushed the wait_just_typeassert_instead_if_asserting_isa branch from db71ae7 to 2ffeca1 Compare May 31, 2025 20:12
@nsajko nsajko changed the title wait(): just typeassert instead of asserting isa simplify wait() May 31, 2025
@DilumAluthge
Copy link
Member

I'll remove Kiran's review request, given that Keno is reviewing this PR.

I'll also assign this PR to Keno.

@DilumAluthge DilumAluthge removed the request for review from kpamnany May 31, 2025 20:20
@DilumAluthge DilumAluthge assigned Keno and unassigned DilumAluthge May 31, 2025
Copy link
Member

@Keno Keno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor comments, LGTM otherwise.

@nsajko nsajko force-pushed the wait_just_typeassert_instead_if_asserting_isa branch from 728bc54 to 2edc278 Compare May 31, 2025 21:53
Copy link
Member

@kpamnany kpamnany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@oscardssmith
Copy link
Member

failures look potentially real?

@Keno
Copy link
Member

Keno commented Jun 1, 2025

Real failures, but unrelated to the PR

@oscardssmith oscardssmith merged commit 905a44b into JuliaLang:master Jun 1, 2025
6 of 8 checks passed
@nsajko nsajko deleted the wait_just_typeassert_instead_if_asserting_isa branch June 1, 2025 08: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.

7 participants