diff --git a/lang/src/son.rs b/lang/src/son.rs index 7f7b2673..708554a4 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -24,6 +24,7 @@ use { fmt::{self, Debug, Display, Write}, format_args as fa, mem, ops::{self, Range}, + usize, }, hashbrown::hash_map, 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( ty::Id::VOID, Kind::Return { file: self.ci.file },