-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Improve sugared value's error message #42889
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
Conversation
💊 CI failures summary and remediationsAs of commit e302a92 (more details on the Dr. CI page):
Extra GitHub checks: 1 failed
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 28 times. |
eellison
left a comment
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.
Looks good pending move to more specific SugaredValue PythonValue
| // what can we do with this thing? | ||
| // use it as a value e.g. `this + 4` | ||
| virtual Value* asValue(const SourceRange& loc, Function& m) { | ||
| throw ErrorReport(loc) << kind() << " cannot be used as a value"; |
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.
Can you move this to PythonValue (which is the specific closed over value).
| struct VISIBILITY_HIDDEN PythonValue : public SugaredValue { |
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.
Done.
337b3a8 to
e302a92
Compare
facebook-github-bot
left a comment
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.
@gmagogsfm has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Codecov Report
@@ Coverage Diff @@
## master #42889 +/- ##
=======================================
Coverage 67.91% 67.91%
=======================================
Files 384 384
Lines 49839 49839
=======================================
+ Hits 33847 33849 +2
+ Misses 15992 15990 -2
Continue to review full report at Codecov.
|
|
@gmagogsfm merged this pull request in 174cbff. |
Stack from ghstack:
I think most (if not all) cases where this code path is reached can be attributed to closing over a global variable.
Improving error message to make this clearer to users.
close #41288