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
Right now we can not display file notes if the error originates in a builtin. Example:
import"substrate";
contractFoo {
function chain_extension() publicpure {}
}
Results in
thread 'main' panicked at 'internal error: entered unreachable code: note without file position', src/sema/diagnostics.rs:171:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
We could just remove the panic and drop the note:
warning: chain_extension is already defined as a function
┌─ /home/glow/code/solang/test.sol:3:13
│
3 │ function chain_extension() public pure {}
│ ^^^^^^^^^^^^^^^
However instead of just dropping the note, it would be nice to support notes for code without a source file.
The text was updated successfully, but these errors were encountered:
In this case, the note is there to point to the location of the function definition, which doesn't exist but there is no location. So, the note should not be generated for builtin functions. Having said that, the error message itself should probably say "{} is already defined as a builtin function".
Right now we can not display file notes if the error originates in a builtin. Example:
Results in
We could just remove the panic and drop the note:
However instead of just dropping the note, it would be nice to support notes for code without a source file.
The text was updated successfully, but these errors were encountered: