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

Implicits are too eager #3339

Open
mtzguido opened this issue Jul 2, 2024 · 0 comments
Open

Implicits are too eager #3339

mtzguido opened this issue Jul 2, 2024 · 0 comments

Comments

@mtzguido
Copy link
Member

mtzguido commented Jul 2, 2024

Old issue, but something I'd like to revisit now.

In the snippet below, we want to make a list of functions of some_ty, just like f1, but trying to write this list triggers an implicit instantiation for f1 and does not check. This should not happen IMO since the expected type for that position is some_ty, which has an implicit.

open FStar.List.Tot
let some_ty = (#x:int) -> l:(list int){length l == x} -> bool
let f1 : some_ty = fun _ -> true
let funcs : list some_ty = [f1]     

Workarounds are annotating f1 <: some_ty or eta expanding (fun #x -> f1 #x).

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