noir-lang / noir

Noir is a domain specific language for zero knowledge proofs
https://noir-lang.org
Apache License 2.0
871 stars 188 forks source link

fix: keep comptime let statements during elaboration #5307

Closed guipublic closed 2 months ago

guipublic commented 3 months ago

Description

Problem*

Resolves Zac issue on using comptime let statements

Summary*

A let statement evaluates to a unit value, so replacing it with its evaluation is incorrect. Instead, we keep the evaluated statement, which should properly replace the rhs with comptime values.

Additional Context

Documentation*

Check one:

PR Checklist*

guipublic commented 2 months ago

I believe the issue is fixed by additional work on comptimes. Do you confirm that I can close this PR @jfecher?

jfecher commented 2 months ago

Confirmed this is fixed on current master in the elaborator at least