OCamlPro / flambda-task-force

13 stars 1 forks source link

Assignment warning should use the warning settings of the source of the setfield #157

Open lpw25 opened 8 years ago

lpw25 commented 8 years ago

Since the Assignment_to_non_mutable_value comes from the middle-end it is likely to be emitted not on the file which contains the dubious assignment, but on another file which depends on it. This is reasonable and expected, however that makes it difficult to mark a particular assignment as safe: you must turn the warning off for all dependencies of the original file rather than for the file itself.

I think that flambda should remember the -w options for files and use the options for the file containing the offending write to decide whether or not the write should cause the warning to be emitted.