Skip to content

change assert to evaluate at comptime for approxEqRel - #25369

Open
pollend wants to merge 1 commit into
ziglang:masterfrom
pollend:comptime-for-approxEqRel
Open

change assert to evaluate at comptime for approxEqRel#25369
pollend wants to merge 1 commit into
ziglang:masterfrom
pollend:comptime-for-approxEqRel

Conversation

@pollend

@pollend pollend commented Sep 27, 2025

Copy link
Copy Markdown

This assert can be evaluated at comptime.

Signed-off-by: Michael Pollind <mpollind@gmail.com>
@triallax

triallax commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

i'm pretty sure the assert gets evaluated at comptime regardless

@pollend pollend closed this Oct 8, 2025
@pollend
pollend deleted the comptime-for-approxEqRel branch October 8, 2025 01:09
@nektro

nektro commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

prior to this patch it'd be a runtime panic instead of a compile error.

@pollend
pollend restored the comptime-for-approxEqRel branch October 8, 2025 02:56
@pollend pollend reopened this Oct 8, 2025
@pollend

pollend commented Oct 8, 2025

Copy link
Copy Markdown
Author

this compiles in compiler explorer this should be a compile time error: https://godbolt.org/z/PW6zjz551

@triallax

triallax commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

prior to this patch it'd be a runtime panic instead of a compile error.

huh, i even checked the generated assembly but i suppose it didn't show any problems because i was using f64 rather than an invalid type, that's my bad

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.

3 participants