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
Compiler fails to warn about pattern Top _ when Top is a 0-ary constructor #4675
Comments
Comment author: @damiendoligez This is a feature that was implemented to facilitate automatic generation of OCaml code... |
Comment author: Pascal Cuoq I can see how some camlp4 extensions may get lighter this way, Shouldn't the pattern generated by camlp4 be something that
|
Comment author: Etienne Millon I agree with Pascal Cuoq. It may be nice to factor some camlp4 code, but it creates a nasty compatibility issue. |
Comment author: @damiendoligez In 3.12.0, there will be a warning (off by default) for when you give |
Original bug ID: 4675
Reporter: Pascal Cuoq
Status: closed (set by @damiendoligez on 2009-12-08T16:49:41Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.0+beta
Fixed in version: 3.12.0+dev
Category: ~DO NOT USE (was: OCaml general)
Has duplicate: #4717 #4835 #4911
Related to: #4052
Monitored by: lynxiamen "Etienne Millon" "Julien Signoles" "Richard Jones" @alainfrisch
Bug description
type t = Top | Base of int ;;
type t = Top | Base of int
let f x = match x with Base _ -> 0 | Top _ -> 1 ;;
Résultat obtenu :
val f : t -> int =
Résultat attendu :
Error: The constructor Top expects 0 argument(s),
but is here applied to 1 argument(s)
The text was updated successfully, but these errors were encountered: