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

Inferring implicits arguments in return position (and error localization) #109

Open
nikswamy opened this issue Nov 6, 2023 · 0 comments

Comments

@nikswamy
Copy link
Collaborator

nikswamy commented Nov 6, 2023

fn initialize_context' (sid:sid_t) (uds:A.larray U8.t (US.v uds_len)) 
                       (#p:perm) (#uds_bytes:Ghost.erased (Seq.seq U8.t))
  requires A.pts_to uds #p uds_bytes
  returns _:option ctxt_hndl_t
  ensures A.pts_to uds #p uds_bytes
{
  rewrite emp as (session_state_perm InUse);
  let st = take_session_state sid InUse;
  match st 
  {
    None ->
    {
      with s. rewrite (session_state_perm s) as emp;
      None //#ctxt_hndl_t
    }
    
    Some st ->
    {
      admit()
    }
  }
}
  • We should pass the expected type from the annotation to F* when elaborating the returned None . Currently, we fail to infer that instantiation and report a peroperly localized error ( - Could not infer implicit arguments in None).
  • But, we also report an unresolved (universe) uvar in deep compress blaming the entire definition, which masks the localized error above.
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

1 participant