Issues an error when a non-comptime function in the same crate is called from a comptime context:
error: `id` cannot be called in a `comptime` context here
┌─ /.../non_comptime_local_fn_call/src/main.nr:3:18
│
3 │ let _a = id(3);
│ ----- This function must be `comptime` or in a separate crate to be called
│
Additional Context
This limitation is because all comptime items are elaborated before non-comptime items within a crate.
Documentation*
Check one:
[ ] No documentation needed.
[ ] Documentation included in this PR.
[x] [For Experimental Features] Documentation to be submitted in a separate PR.
PR Checklist*
[x] I have tested the changes locally.
[x] I have formatted the changes with Prettier and/or cargo fmt on default settings.
Description
Problem*
Resolves https://github.com/noir-lang/noir/issues/5333
Summary*
Issues an error when a non-comptime function in the same crate is called from a comptime context:
Additional Context
This limitation is because all comptime items are elaborated before non-comptime items within a crate.
Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.