added funciton declaration
This commit is contained in:
@@ -64,3 +64,20 @@ impl User {
|
||||
return self.id;
|
||||
}
|
||||
}
|
||||
|
||||
type TestTrait trait {
|
||||
fn classMethod(id: I64): Self;
|
||||
fn instanceMethod(self: Self): I64;
|
||||
fn defaultImpl(self: Self): I64 {
|
||||
return self.instanceMethod;
|
||||
}
|
||||
}
|
||||
|
||||
impl TestTrait for User {
|
||||
fn classMethod(id: I64): Self {
|
||||
return User{id: id,};
|
||||
}
|
||||
fn instanceMethod(self: Self): I64 {
|
||||
return self.get_id();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user