-
Notifications
You must be signed in to change notification settings - Fork 11
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
Generics Support #8
Comments
You're correct, generics are not yet supported, I've ran into this issue the day before your comment. |
Awesome! I'm working on a new Rust WASM front-end framework that uses typestates a lot, and this crate took out a massive amount of boilerplate. Those generics are the main thing I need! |
@jquesada2016 I've just pushed a change to the mod my_state {
pub struct MyState<State: MyStateState> {
pub state: State,
}
pub struct State1<T> {
data: T,
}
trait State1State {
fn new<T>() -> State1<T>;
fn done(self);
}
#[doc(hidden)]
mod __private {
pub trait MyStateState {}
}
pub trait MyStateState: __private::MyStateState {}
impl<__T: ?::core::marker::Sized> MyStateState for __T where __T: __private::MyStateState {}
impl<T> __private::MyStateState for State1<T> {}
} I'd be very grateful if you would help me test it by using the |
You got it good sir! I'm on it now. P.S. |
@jmg-duarte do you need me to write tests or just give you feedback? |
I won't say no to more tests, however, what I really need is feedback |
@jmg-duarte generics have been working very good for me thus far! I tested it with constraints and some lifetime bounds and have had no issues thus far! Thank you again for your work! |
That's great to know! I'll be merging the branch in the near future (hopefully today!) and adding some other features (namely the export). |
@jmg-duarte I added an issue for a problem I discovered with generics as currently implemented. I added a new issue instead of posting it here because it was a bit longer. The issue number is #27. |
Hey @jquesada2016, I saw it already and had a nice draft and answer lined up but the browser had other plans 🤷♂️ I'll try to handle the issues you raised ASAP. Thank you for the time spent reporting issues! |
Attempting to do the following results in an error:
The above produces the following error:
This seems to tell me generics are not yet supported? If not, are there any plans for supporting generics?
The text was updated successfully, but these errors were encountered: