Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::marker::PhantomData;
- trait Class {
- type Parent;
- }
- struct ObjectClass<S: ObjectScript>(PhantomData<S>)
- where
- S::Parent: ObjectChild;
- trait ObjectChild {}
- impl<S: ObjectScript> ObjectChild for ObjectClass<S>
- where
- S::Parent: ObjectChild {}
- trait ObjectScript : Class
- where
- <Self as Class>::Parent: ObjectChild {}
- struct Test;
- impl Class for Test {
- type Parent = ObjectClass<Self>;
- }
- impl ObjectScript for Test {}
Add Comment
Please, Sign In to add comment