1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: add support for -d debug_stmts to ease debugging checker panics

This commit is contained in:
Delyan Angelov 2020-07-12 12:04:39 +03:00
parent 40da32a141
commit 23c8e1f06d

View File

@ -2044,6 +2044,10 @@ fn (mut c Checker) stmts(stmts []ast.Stmt) {
}
c.expected_type = table.void_type
for stmt in stmts {
$if debug_stmts? {
stmt_pos := stmt.position()
eprintln('file: ${c.file.path:-30} | stmt pos: $stmt_pos')
}
if c.scope_returns {
if unreachable.line_nr == -1 {
unreachable = stmt.position()