We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I had a problem with subtyping in pairs and I reduced it to this program:
module Pairs val test1 : (x:int{x>0} * unit) let test1 = 2, () val test2 : (x:int * unit) let test2 = test1
It fails with:
pairs.fst(7,12-7,17): Subtyping check failed; expected type (Tuple2 int unit); got type (Tuple2 x:int{(x > 0)} unit)
The text was updated successfully, but these errors were encountered:
AFAIK this is a known limitation. Adding polarities would solve this, but for now you can build explicit coercion functions:
val coerce : (nat * unit) -> (int * unit) let coerce p = let (x1,x2) = p in (x1,x2) val test2' : (x:int * unit) let test2' = coerce test1
Sorry, something went wrong.
There is already an issue about this #65, closing as duplicate.
Code for #241
5d6d95e
No branches or pull requests
I had a problem with subtyping in pairs and I reduced it to this program:
It fails with:
The text was updated successfully, but these errors were encountered: