Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ? operator #105

Open
franziskuskiefer opened this issue Dec 7, 2024 · 1 comment
Open

Support ? operator #105

franziskuskiefer opened this issue Dec 7, 2024 · 1 comment

Comments

@franziskuskiefer
Copy link
Collaborator

The question mark operator is not supported.

The following Rust code

fn inner() -> Result<(), u8> {
    Err(1)
}

fn call_it() -> Result<(), u8> {
    inner()?;
    Ok(())
}

generates the following C code.

core_result_Result_55 eurydice_tests_call_it(void)
{
  KRML_HOST_EPRINTF("KaRaMeL abort at %s:%d\n%s\n",
    __FILE__,
    __LINE__,
    "Eurydice error: Failure(\"TODO: TraitTypes core::result::{core::ops::try_trait::Try for core::result::Result<T, E>[TraitClause@0, TraitClause@1]}#26<T@0, T@1>[TraitClause@0, TraitClause@1]::Residual\")\n");
  KRML_HOST_EXIT(255U);
}
@msprotz
Copy link
Contributor

msprotz commented Dec 23, 2024

This boils down to support for associated types, which would require a little bit of feature work, to encode the associated types in trait parameters as type arguments to pre-monomorphized functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants