-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Index into a tuple with non constant integer #20081
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
|
@pytorchbot retest this please |
|
@pytorchbot rebase this please |
| /*allow_conversions*/ true); | ||
| if (list == tuple_val) { | ||
| throw ErrorReport(loc) | ||
| << "Cannot index into a " << tuple_typ->python_str() |
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.
This could be more clear, maybe something like ... non-constant index because it has multiple element types
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.
Agreed that would be a little more clear, but then it wouldn't handle the zero-tuple case, and i think it's still clear as is
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.
@eellison is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Fix for #16962
This needs fixing because we turn lists into tuples when constantify a module, so indexing into a Tuple of one type with a non-constant integer is quite common.