Skip to content

Prevent repeated warnings with recursive modules#1191

Merged
lpw25 merged 3 commits intoocaml:trunkfrom
lpw25:fix-7553
Sep 11, 2017
Merged

Prevent repeated warnings with recursive modules#1191
lpw25 merged 3 commits intoocaml:trunkfrom
lpw25:fix-7553

Conversation

@lpw25
Copy link
Copy Markdown
Contributor

@lpw25 lpw25 commented Jun 5, 2017

This fixes PR#7553 and similar issues with recursive modules where warnings are reported multiple times.

Copy link
Copy Markdown
Contributor

@jberdine jberdine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm no expert, but looks good to me, and low risk.

@@ -0,0 +1,20 @@
module A = struct type foo end;;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;; needed? And also below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use Misc.protect_refs here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@alainfrisch
Copy link
Copy Markdown
Contributor

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.

@lpw25
Copy link
Copy Markdown
Contributor Author

lpw25 commented Sep 11, 2017

I think it would be good to disable warnings also when computing [init], i.e. when calling [approx_modtype].

This PR does disable warnings for approx_modtype

@lpw25
Copy link
Copy Markdown
Contributor Author

lpw25 commented Sep 11, 2017

Rebased and changes entry added.

@alainfrisch
Copy link
Copy Markdown
Contributor

This PR does disable warnings for approx_modtype

Ah yes, sorry, I missed the re-definition of this function.

LGTM now.

@lpw25
Copy link
Copy Markdown
Contributor Author

lpw25 commented Sep 11, 2017

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.

@lpw25 lpw25 merged commit e85d5ec into ocaml:trunk Sep 11, 2017
stedolan pushed a commit to stedolan/ocaml that referenced this pull request Mar 21, 2023
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants