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

stop blacklisting Wrapper and illegal code is generated #88

Closed
fitzgen opened this issue Oct 14, 2016 · 2 comments
Closed

stop blacklisting Wrapper and illegal code is generated #88

fitzgen opened this issue Oct 14, 2016 · 2 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Oct 14, 2016

Input adapted from double_replaces.hpp by removing the --blacklist-type Wrapper flag:

// bindgen-flags: -- --std=c++11

namespace JS {

namespace detail {

template<typename T>
struct Wrapper {
    struct Wrapped {
        T t;
    };
    using Type = Wrapped;
};

template <typename T>
using MaybeWrapped = typename Wrapper<T>::Type;

}

template<typename T>
class Rooted {
    detail::MaybeWrapped<T> ptr;
};

}

/**
 * <div rustbindgen replaces="MaybeWrapped"></div>
 */
template <typename T>
using replacement_MaybeWrapped = T;

Generated type definition for Wrapper_Wrapped is missing the template parameter:

error[E0412]: type name `T` is undefined or not in scope
  --> tests/expectations/replaces_double_from_outside.rs:18:41
   |
18 | pub type Wrapper_Type = Wrapper_Wrapped<T>;
   |                                         ^ undefined or not in scope
   |
   = help: no candidates by the name of `T` found in your project; maybe you misspelled the name or forgot to import an external crate?

error: aborting due to previous error
@emilio
Copy link
Contributor

emilio commented Oct 14, 2016

Patch (now in #85): emilio@6484e3e

@emilio
Copy link
Contributor

emilio commented Oct 19, 2016

#85 landed.

@emilio emilio closed this as completed Oct 19, 2016
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

No branches or pull requests

2 participants