denoland / deno_core

The core engine at the heart of Deno
MIT License
233 stars 76 forks source link

`op2` allows `#[smi]` annotation for return type if we return "()" #758

Open bartlomieju opened 1 month ago

bartlomieju commented 1 month ago

This code should not compile:

#[op2(fast)]
#[smi]
fn op_get_exit_code(state: &mut OpState) {
  state.borrow_mut::<ExitCode>().get();
}

Notice that we annotate with #[smi] for return type, but we are returning ().