Skip to content

Fix erroneous loading of cmis for some module type errors (see #13098)#13099

Merged
Octachron merged 5 commits intoocaml:trunkfrom
ncik-roberts:fix-module-printing-issue
Apr 16, 2024
Merged

Fix erroneous loading of cmis for some module type errors (see #13098)#13099
Octachron merged 5 commits intoocaml:trunkfrom
ncik-roberts:fix-module-printing-issue

Conversation

@ncik-roberts
Copy link
Copy Markdown
Contributor

Fix #13098.

All commits pass the test suite. You can review commit-by-commit if you want to see the regression test (with bad output) in the first commit.

I am a unsure that the test case will be useful in perpetuity — its method for detecting "erroneous loading of cmis" is a bit roundabout. I am open to suggestions here.

@ncik-roberts ncik-roberts force-pushed the fix-module-printing-issue branch from 42179b8 to 46c7738 Compare April 15, 2024 13:07
(** [wrap_printing_env_error env f] does something else in addition to
[wrap_printing_env ~error:true env f]: it also wraps all functions
in the returned [Location.error] value to disable the loading of cmis.
*)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

something else is a bit unclear. I would propose

[wrap_printing_env_error env f] ensures that all printing functions in a `Location.error` report
are evaluated within the [wrap_printing_env ~error:true env] context

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 adopted your suggestion with the additional sentence (The original call to [f] is also evaluated within that context.).

Copy link
Copy Markdown
Member

@Octachron Octachron left a comment

Choose a reason for hiding this comment

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

The fix is correct if a bit heavy-handed.

At the same time, this tends to confirm my bias that we want to go away from using Format.formatter -> unit as a partial formatted document implementation.

@Octachron Octachron merged commit e4b325e into ocaml:trunk Apr 16, 2024
@ncik-roberts ncik-roberts deleted the fix-module-printing-issue branch April 16, 2024 13:51
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.

Some type error printing erroneously loads cmis

2 participants