You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5502 Reporter: john_nowak Assigned to:@gasche Status: closed (set by @xavierleroy on 2013-08-31T10:46:28Z) Resolution: not a bug Priority: normal Severity: minor Version: 3.12.1 Category: ~DO NOT USE (was: OCaml general)
Bug description
The following should most likely be rejected but are accepted by the compiler:
fun (None _) -> 42
match None with None _ -> 42
...
This bug appears to only be present with wildcards; all other pattern arguments to nullary constructors result in the appropriate error.
The text was updated successfully, but these errors were encountered:
This is not a bug but a dubious feature. This behavior is intentional: Foo _ will ignore the constructor at any arity (including zero). This is so you don't have to write eg. Foo (_, _, _, _) if the arity is four, which would be rather painful.
PS: but you can ask to be warned in the case where this construct is used on a constant constructor (arity zero): it's warning 28, introduced in 3.12.0.
Original bug ID: 5502
Reporter: john_nowak
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2013-08-31T10:46:28Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 3.12.1
Category: ~DO NOT USE (was: OCaml general)
Bug description
The following should most likely be rejected but are accepted by the compiler:
fun (None _) -> 42
match None with None _ -> 42
...
This bug appears to only be present with wildcards; all other pattern arguments to nullary constructors result in the appropriate error.
The text was updated successfully, but these errors were encountered: