Prevent repeated warnings with recursive modules#1191
Conversation
jberdine
left a comment
There was a problem hiding this comment.
I'm no expert, but looks good to me, and low risk.
| @@ -0,0 +1,20 @@ | |||
| module A = struct type foo end;; | |||
There was a problem hiding this comment.
;; needed? And also below.
There was a problem hiding this comment.
They're here because this file is piped into the REPL not compiled
| match f () with | ||
| | res -> disabled := prev; res | ||
| | exception e -> disabled := prev; raise e | ||
|
|
There was a problem hiding this comment.
You could use Misc.protect_refs here.
There was a problem hiding this comment.
I'll change it to do that. (Although it would be slightly better if we had a protect_ref function as well, but I don't want to add that in this PR).
|
I think it would be good to disable warnings also when computing [init], i.e. when calling [approx_modtype]. See #1248. Also, a Change entry is missing. |
This PR does disable warnings for |
|
Rebased and changes entry added. |
Ah yes, sorry, I missed the re-definition of this function. LGTM now. |
|
Appveyor caught a principality warning, but I've fixed it now. Does "LGTM" constitute an approved review? I think Damien still wants people clicking the approved button. |
This fixes PR#7553 and similar issues with recursive modules where warnings are reported multiple times.