FStarLang / FStarLang/FStar

Nested patterns, refinements and branches with Tot functions

Open
#522 2 comments 0 reactions 1 assignee Claimed by @nikswamy View on GitHub
area/usability component/inference component/typechecker kind/bug
Dominant language
F*
Stars
3.1k
Forks
266
Avg merge
21h 1m
Merged PRs (30d)
54

Description

Type inference fails incorrectly in this case

```
module NestedPatternsAndTotBranches

assume val f : unit -> Tot (option nat)
assume val h : int -> Tot int
assume val k : unit -> Tot int

let ff () : unit -> Tot int =
let y = f () in
match 0, y (* fails: y expected to have type (option int) rather than (option nat) *) with
| _, Some r -> (fun z -> h r)
| _ -> k
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.