We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e6a98b commit c65d064Copy full SHA for c65d064
glib-macros/tests/test.rs
@@ -281,12 +281,16 @@ fn subclassable() {
281
}
282
283
impl ObjectImpl for Foo {}
284
+
285
+ impl Foo {
286
+ pub(super) fn test(&self) {}
287
+ }
288
289
290
pub trait FooExt: IsA<Foo> + 'static {
291
fn test(&self) {
- let _self = self.as_ref().downcast_ref::<Foo>().unwrap().imp();
- unimplemented!()
292
+ let imp = self.as_ref().upcast_ref::<Foo>().imp();
293
+ imp.test();
294
295
296
@@ -296,6 +300,11 @@ fn subclassable() {
300
pub struct Foo(ObjectSubclass<imp::Foo>);
297
301
298
302
303
304
+ use foo::FooExt;
305
306
+ let obj = glib::Object::new::<foo::Foo>();
307
+ obj.test();
299
308
309
310
#[test]
0 commit comments