diff --git a/crates/codegen/src/class_decl.rs b/crates/codegen/src/class_decl.rs index e7bd747..902fbe2 100644 --- a/crates/codegen/src/class_decl.rs +++ b/crates/codegen/src/class_decl.rs @@ -593,7 +593,7 @@ pub fn gen_method_point(method: &FunctionDecl, ctx: &mut Context, cg: &mut RustC cg.addln(" = core::mem::transmute(func_ptr);"); if mutable_self { - cg.add_indented("func(self as *mut Self as *const core::ffi::c_void"); + cg.add_indented("func(self as *mut Self as *mut core::ffi::c_void"); } else { cg.add_indented("func(self as *const Self as *const core::ffi::c_void"); } diff --git a/mist-test/src/items/class_test.mist b/mist-test/src/items/class_test.mist index e6153cf..7562983 100644 --- a/mist-test/src/items/class_test.mist +++ b/mist-test/src/items/class_test.mist @@ -22,6 +22,8 @@ pub class Animal "Unknown".to_string() } + pub virtual void speak_mut(&mut self){} + pub void test_speak<'a>(&'a self) { assert_eq!(self.speak(), "Woof!");