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

The typechecker rejects polymorphic annotations inside a Promise #88

Closed
yannham opened this issue Jun 10, 2020 · 0 comments
Closed

The typechecker rejects polymorphic annotations inside a Promise #88

yannham opened this issue Jun 10, 2020 · 0 comments

Comments

@yannham
Copy link
Member

yannham commented Jun 10, 2020

Describe the bug
A program which contains a let annotated (using either Promise or Assume) by a polymorphic type, itself located inside a Promise (which triggers the "strict" or "static" typechecking mode), is unduly rejected.

To Reproduce

let f =
    Promise(forall a. a -> a, let g = 
    Promise(forall a. a -> a, fun x => x)
    in g)
in f 2

which results in

Typechecked: Err("The following types dont match Arrow(Constant(119), Constant(119))
-- Forall(Ident(\"a\"), Concrete(Arrow(Concrete(Var(Ident(\"a\"))), Concrete(Var(Ident(\"a\"))))))")
Evaluation finished with result:
Num(2.0)

Expected behavior
Well-typed programs with polymorphic annotations inside a promise should typecheck. In particular, the previous example should result in the output:

Typechecked: Ok(Types(Dyn))
Evaluation finished with result:
Num(2.0)
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