dead code is not an error #118
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#118
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
During debugging, it is useful to insert a return statement in the middle of a function.
Currently this fails with
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "dead code at Location { row: 116, column: 13 }"', nac3artiq/src/lib.rs:447:44
This should be demoted to a warning and the compilation should continue.
And generally: how should we report warnings?
iirc currently the only functions that need to return warnings are
check_blocks
andcheck_stmts
, whose return types areResult<bool, String>
. Maybe we can change it to something likeResult<(bool, Vec<WarningMsg>), String>
? and just print out the sorted warning messages if nac3 is not configured to suppress warnings.I think we should implement something like the diagnostic class in the legacy compiler. Returning an result will only work for errors.