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

Warning 23 is dubious #6179

Closed
vicuna opened this issue Sep 16, 2013 · 1 comment
Closed

Warning 23 is dubious #6179

vicuna opened this issue Sep 16, 2013 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Sep 16, 2013

Original bug ID: 6179
Reporter: @dbuenzli
Status: closed (set by @xavierleroy on 2016-12-07T10:36:46Z)
Resolution: won't fix
Priority: normal
Severity: tweak
Version: 4.00.1
Category: ~DO NOT USE (was: OCaml general)
Related to: #6608

Bug description

I'm unable to understand the rationale behind that warning.

My take on this is that I may in the future want to add new fields to my record without having to change my copy function and want to live without the warning meanwhile.

type t = { a : int };;

type t = { a : int; }

let copy r = { r with a = r.a };;

Warning 23: all the fields are explicitly listed in this record:
the 'with' clause is useless.
val copy : t -> t =

@vicuna
Copy link
Author

vicuna commented Jan 21, 2014

Comment author: @damiendoligez

I didn't know this trick. Anyway, if you don't like warning 23, just disable it.

I should add: we get reports of this shape (warning shouldn't exist) for almost all values of , so we tend not to take them very seriously...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant