Skip to content

Commit

Permalink
fix(experimental): Skip over comptime functions in scan pass (#4893)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves #4892

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
jfecher authored Apr 23, 2024
1 parent 6a66138 commit f267d42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/noirc_frontend/src/hir/comptime/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ impl<'interner> Interpreter<'interner> {
/// These nodes will be modified in place, replaced with the
/// result of their evaluation.
pub fn scan_function(&mut self, function: FuncId) -> IResult<()> {
// Don't scan through functions that are already comptime. They may use comptime-only
// features (most likely HirExpression::Quote) that we'd otherwise error for.
if self.interner.function_modifiers(&function).is_comptime {
return Ok(());
}

let function = self.interner.function(&function);

let state = self.enter_function();
Expand Down

0 comments on commit f267d42

Please sign in to comment.