Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
type_cases: propagate refined ty_arg to Parmatch checks #1583
This PR actually does a bit more than what the title says:
However, the type we expect these values to have is the
type (_,_) eq = Refl : ('a, 'a) eq type empty = (int, string) eq let f () = match None with | (None : empty option) -> ()
The match is currently flagged as non-exhaustive.
If we somehow propagated the information we got from typechecking the pattern, then we would notice that the match actually is exhaustive.
let f x = match x with | (None : empty option) -> ()
which doesn't trigger the warning.
The last commit does the suggested change: instead of using an instance of the original
Jan 31, 2018
Thomas Refis (2018/02/06 03:40 -0800):
By the way, doesn't this indicate that there is a problem with the Makefiles? Ping @diml who is (I believe) the author of `expect`.
I think it would be better to move expect to the ocamltest directory, so that the two would be compiled at the same time, that is, during make world and make world.opt. Then one would be sure to have an up-to-date expect no matter how the tests are run, after make world. Indeed, given that a test can now be run directly by ocamltest, the problem can not be resolved only by virtue of makefile tricks, at least not in the realm of those running the tests. Hence the suggestion above.
referenced this pull request
Mar 6, 2018
@trefis with this commit the