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

pull/5814/head
Delyan Angelov 2020-07-12 12:04:39 +03:00
parent 40da32a141
commit 23c8e1f06d
1 changed files with 4 additions and 0 deletions

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()