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

`sequence<sequence<long>>` isn't supported as an argument #12528

Closed
jdm opened this issue Jul 20, 2016 · 1 comment
Closed

`sequence<sequence<long>>` isn't supported as an argument #12528

jdm opened this issue Jul 20, 2016 · 1 comment

Comments

@jdm
Copy link
Member

@jdm jdm commented Jul 20, 2016

  void passSequenceSequence(sequence<sequence<long>> seq);

yields

    fn PassSequenceSequence(&self, seq: Vec<i32>) -> ();
@jdm
Copy link
Member Author

@jdm jdm commented Jul 20, 2016

The problem is caused by using type.unroll() rather than type.inner in various places in Codegen.py. However, if a sequence type is nullable, we actually need type.inner.inner.

bors-servo added a commit that referenced this issue Jul 21, 2016
Support sequences of sequences in generated bindings.

This fixes a blocker for #11897. `unroll` recursively gets the inner type of any sequence type encountered, so it's inappropriate for codegen that only wants the immediate inner type. However, if a type identifies as a sequence and is nullable, we need to reach through the nullable wrapper first. Gecko does very similar things.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12528 (github issue number if applicable).
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12541)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.