adding interesting asert

This commit is contained in:
Jakub Doka 2024-11-17 21:43:02 +01:00
parent f83194359c
commit 1c135a3050
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143

View file

@ -24,6 +24,7 @@ use {
fmt::{self, Debug, Display, Write}, fmt::{self, Debug, Display, Write},
format_args as fa, mem, format_args as fa, mem,
ops::{self, Range}, ops::{self, Range},
usize,
}, },
hashbrown::hash_map, hashbrown::hash_map,
hbbytecode::DisasmError, hbbytecode::DisasmError,
@ -2792,6 +2793,11 @@ impl<'a> Codegen<'a> {
} }
} }
debug_assert_eq!(
lexer::Lexer::new(&self.file().file[pos as usize..]).eat().kind,
TokenKind::Return
);
let ret = self.ci.nodes.new_node_nop( let ret = self.ci.nodes.new_node_nop(
ty::Id::VOID, ty::Id::VOID,
Kind::Return { file: self.ci.file }, Kind::Return { file: self.ci.file },