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

Compatibility with name-out-of-scope warning #41

Open
mroch opened this issue Aug 12, 2022 · 0 comments
Open

Compatibility with name-out-of-scope warning #41

mroch opened this issue Aug 12, 2022 · 0 comments
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.

Comments

@mroch
Copy link

mroch commented Aug 12, 2022

In our project (https://github.com/facebook/flow) we generally enable the name-out-of-scope warning. The code generated by [%expect ...] seems to trip it:

Error (warning 40 [name-out-of-scope]): this record of type Expect_test_common.File.Location.t contains fields that are 
not visible in the current scope: filename line_number line_start start_pos end_pos.
They will not be selected if the type becomes unknown.

I think it's coming from here:

ppx_expect/src/main.ml

Lines 11 to 20 in a1f22ff

[%expr
({ filename =
Expect_test_common.File.Name.of_string
[%e estring ~loc (File.Name.to_string filename)]
; line_number = [%e eint ~loc line_number]
; line_start = [%e eint ~loc line_start]
; start_pos = [%e eint ~loc start_pos]
; end_pos = [%e eint ~loc end_pos]
}
: Expect_test_common.File.Location.t)]

Would you mind explicitly scoping that record, or perhaps suppressing the warning?

@github-iron github-iron added the forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system. label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.
Projects
None yet
Development

No branches or pull requests

2 participants