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

Static methods, and deconflict various namespaces #128

Merged
merged 6 commits into from
Nov 25, 2020
Merged

Static methods, and deconflict various namespaces #128

merged 6 commits into from
Nov 25, 2020

Conversation

adetaylor
Copy link
Collaborator

Fixes #89.

Also fixes a problem where we didn't allow std::unique_ptr to be passed through function shims we generate, and fixes various problems which occurred with name conflicts.

This adds tests for many things which currently fail,
but will be addressed in subsequent commits in this PR:

* Passing unique_ptrs through our generated C++.
* Conflicting function names between namespaces.
* It enables the pre-existing static function test.
Previously this didn't work as we stripped off the
parameterization of the std::unique_ptr, and we also didn't
know we needed to use std::move.
This is a significant set of interrelated changes.

The main goals are:
* Support static member functions
* Handle conflicting function and method names correctly.

Identifying static member functions is a bit awkward as it
requires us to hold off on converting a given ForeignFn until
we've looked in subsequent impl blocks that are generated by
bindgen. Otherwise, this is relatively straightforward.

Deconflicting names is more complex. See the comment in
bridge_name_tracker.rs.
@adetaylor adetaylor merged commit 1ce4715 into main Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static methods don't work
1 participant