diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v
index 4d935fca58c760..e09143f6ec932f 100644
--- a/vlib/v/checker/checker.v
+++ b/vlib/v/checker/checker.v
@@ -2801,7 +2801,6 @@ pub fn (mut c Checker) expr(mut node ast.Expr) ast.Type {
 		return ast.void_type
 	}
 	match mut node {
-		ast.NodeError {}
 		ast.ComptimeType {
 			c.error('incorrect use of compile-time type', node.pos)
 		}
@@ -3182,6 +3181,7 @@ pub fn (mut c Checker) expr(mut node ast.Expr) ast.Type {
 			}
 			return ast.bool_type
 		}
+		ast.NodeError {}
 	}
 	return ast.void_type
 }
diff --git a/vlib/v/scanner/scanner.v b/vlib/v/scanner/scanner.v
index b169ce42026d55..c063088d4a2c0b 100644
--- a/vlib/v/scanner/scanner.v
+++ b/vlib/v/scanner/scanner.v
@@ -603,14 +603,14 @@ fn (mut s Scanner) scan_all_tokens_in_buffer() {
 }
 
 fn (mut s Scanner) scan_remaining_text() {
+	is_skip_comments := s.comments_mode == .skip_comments
 	for {
 		t := s.text_scan()
-		if s.comments_mode == .skip_comments && t.kind == .comment {
-			continue
-		}
-		s.all_tokens << t
-		if t.kind == .eof || s.should_abort {
-			break
+		if !(is_skip_comments && t.kind == .comment) {
+			s.all_tokens << t
+			if t.kind == .eof || s.should_abort {
+				break
+			}
 		}
 	}
 }