You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here we're trying to do a "rusty" println with a ! however in Noir a println is a regular function rather than a macro call.
Compiling this program results in the output
$ nargo compile
error: Expected macro call to return a `Quoted` but found a(n) `()`
┌─ src/main.nr:2:5
│
2 │ println!("foo");
│ --------------- Macro calls must return quoted values, otherwise there is no code to insert
│
error: This macro call is to a non-comptime function
┌─ src/main.nr:2:5
│
2 │ println!("foo");
│ --------------- Macro calls must be to comptime functions
│
Aborting due to 2 previous errors
These error messages could be improved as we've clearly found the std::println function but we could directly tell the user that they want to remove the ! from the function call in order to call it. For bonus points we can have a code suggestion in the lsp to remove the ! from this call.
The text was updated successfully, but these errors were encountered:
TomAFrench
changed the title
Suggest removal of the ! if user is attempting to call a function
Suggest removal of the ! if user is attempting to call a function as a macro
Oct 28, 2024
Consider the program below
Here we're trying to do a "rusty" println with a
!
however in Noir a println is a regular function rather than a macro call.Compiling this program results in the output
These error messages could be improved as we've clearly found the
std::println
function but we could directly tell the user that they want to remove the!
from the function call in order to call it. For bonus points we can have a code suggestion in the lsp to remove the!
from this call.The text was updated successfully, but these errors were encountered: