diff --git a/src/compiler/compiler.rs b/src/compiler/compiler.rs index ba6f965f..09e708d5 100644 --- a/src/compiler/compiler.rs +++ b/src/compiler/compiler.rs @@ -831,6 +831,18 @@ mod test { assert!(result.is_ok()); + // TODO should no-arg calls be allowed? + let circuit = " + machine caller (signal n) (signal b: field) { + smth <== a() -> final; + } + "; + + let debug_sym_ref_factory = DebugSymRefFactory::new("", circuit); + let result = TLDeclsParser::new().parse(&debug_sym_ref_factory, circuit); + + assert!(result.is_ok()); + // Wrong transition operator let circuit = " machine caller (signal n) (signal b: field) { diff --git a/src/parser/build.rs b/src/parser/build.rs index 3fea23b1..b5cee63a 100644 --- a/src/parser/build.rs +++ b/src/parser/build.rs @@ -67,5 +67,8 @@ pub fn build_hyper_transition( state: Identifier, call: Statement, ) -> Statement { - Statement::HyperTransition(dsym, state, Box::new(call)) + match call { + Statement::Call(_, _, _, _) => Statement::HyperTransition(dsym, state, Box::new(call)), + _ => unreachable!("Hyper transition must include a call statement"), + } }