-
Notifications
You must be signed in to change notification settings - Fork 121
Broadcasting and slicing updates #2326
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: main
Are you sure you want to change the base?
Conversation
for index in &index_expr.indices { | ||
let index = self.compile_index(index); | ||
let span = Span { | ||
lo: index_expr.span.lo, |
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 lo span doesn't feel correct
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.
There is no right answer here since the source syntax is different from Q#'s syntax.
The idea is that this source code
a[1, 2, 3, 4]
will get compiled to
a[1][2][3][4]
The span in your comment is the span of the expression being indexed. For example, if we are currently building a[1][2][3]
, the expression being indexed is a[1][2]
. But in the source code this corresponds to a[1, 2
, and that's what I'm setting the span to, which doesn't feel as intuitive as in Q#, but it's a best effort solution. Let me know if you can think of something better.
This PR completes some postponed items from #2149: