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

Stack overflow on Core.check_equiv #3224

Closed
mtzguido opened this issue Mar 21, 2024 · 0 comments
Closed

Stack overflow on Core.check_equiv #3224

mtzguido opened this issue Mar 21, 2024 · 0 comments
Labels

Comments

@mtzguido
Copy link
Member

mtzguido commented Mar 21, 2024

noeq
type vcode = {
    t : Type u#2;
    up : t -> int;
}

let x = true
let tt : term = `(Mkvcode?.up)

let _ = assert True by (
  let g = cur_env () in
  let u = check_equiv g tt (`(match x with | true -> Mkvcode?.up)) in
  match u with
  | Some u, _ ->
    dump "ok"
  | _, [] ->
    dump "fail and no issue?"
  | _, i::is ->
    dump (FStar.Issue.render_issue i)
)

and

let _ = assert True by (
  let g = cur_env () in
  let u = tc_term g (`(fun projectee -> match projectee as proj_ret returns Mkvcode?.t proj_ret -> int with | Mkvcode t up -> up)) in
  match u with
  | Some u, _ ->
    dump "ok"
  | _, [] ->
    dump "fail and no issue?"
  | _, i::is ->
    dump (FStar.Issue.render_issue i)
)

both fail with a stack overflow. The bug is in the core typechecker, in the case for a matches with returns annotations. Posting a PR now.

mtzguido added a commit to mtzguido/FStar that referenced this issue Mar 21, 2024
mtzguido added a commit that referenced this issue Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant