-
Notifications
You must be signed in to change notification settings - Fork 470
Pass existing location to children prop #7540
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
base: master
Are you sure you want to change the base?
Conversation
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/win32-x64
commit: |
@mediremi could you try this one out please? |
@@ -23,21 +23,6 @@ | |||
addValueReference ComponentAsProp.res:12:24 --> ComponentAsProp.res:12:13 | |||
addValueReference ComponentAsProp.res:13:16 --> React.res:3:0 | |||
addValueReference ComponentAsProp.res:11:14 --> ComponentAsProp.res:6:34 | |||
addValueReference ComponentAsProp.res:9:6 --> ComponentAsProp.res:6:12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zth, any thoughts on whether this is problematic or not?
@@ -1208,7 +1208,7 @@ let append_children_prop (config : Jsx_common.jsx_config) mapper | |||
| "react" -> Lident "ReactDOM" | |||
| _generic -> module_access_name config "Elements" | |||
in | |||
Exp.apply | |||
Exp.apply ~loc:child.pexp_loc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this change is responsible for the changes in the dead code analysis. But this change does not seem necessary to fix the location issue in error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an explanation as to why this would happen. More non-dummy locations should lead to more value dependencies found in the dead code analysis, which just traverses the typed ast.
Unless, somehow, this change affects the locations produced during type inference.
@nojaf I've tested this PR on my project and it fixes the issues I encountered 🎉 Thanks for fixing this 🙏 |
Fixes #7537
Fixes #7538