yutannihilation / savvy

A simple R extension interface using Rust
https://yutannihilation.github.io/savvy/guide/
MIT License
70 stars 4 forks source link

Add more checks on optional arguments #244

Closed yutannihilation closed 5 months ago

yutannihilation commented 5 months ago

A followup of #243

Check the position of optional args

Probably this should be rejected.

fn foo(x: Option<i32>, y: i32) -> savvy::Result<()> {
    Ok(())
}

Option<Option<T>>

If option is true, i.e., inspecting the inside of Option, this should fail

https://github.com/yutannihilation/savvy/blob/8b14d5b60801f44290f1163b29d7b5d2ee00e852/savvy-bindgen/src/ir/savvy_fn.rs#L62