diff --git a/crates/codegen/src/class_decl.rs b/crates/codegen/src/class_decl.rs index 458be07..016f0a9 100644 --- a/crates/codegen/src/class_decl.rs +++ b/crates/codegen/src/class_decl.rs @@ -614,7 +614,7 @@ pub fn gen_method_point(method: &FunctionDecl, ctx: &mut Context, cg: &mut RustC param.name.gen_rust(ctx, cg); } - cg.addln(");"); + cg.addln(")"); cg.indent -= 1; cg.add_indentedln("}"); diff --git a/mist-test/src/items/class_test.mist b/mist-test/src/items/class_test.mist index 4c79741..9c74c73 100644 --- a/mist-test/src/items/class_test.mist +++ b/mist-test/src/items/class_test.mist @@ -23,6 +23,10 @@ pub class Mammal : Animal { } pub fn args_test(*self, x i32, y *str) {} + + pub fn returning<'a>(*self) *'a str { + "Mammal" + } } pub class Dog : Mammal { @@ -35,6 +39,10 @@ pub class Dog : Mammal { pub override(Animal) fn speak(*self) { println!("Woof!"); } + + pub override fn returning(*self) *str { + "Dog" + } } pub fn run_tests() { @@ -43,4 +51,6 @@ pub fn run_tests() { dawg.args_test(10, "hello"); dawg.test_speak(); + + println!("{}", dawg.returning()); }