updated rust ast through structs to work

This commit is contained in:
Andrew Segavac
2021-08-08 11:42:26 -06:00
parent 37d998d6b5
commit 10df785c8f
8 changed files with 343 additions and 619 deletions

View File

@@ -65,19 +65,19 @@ impl User {
}
}
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();
}
}
// 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();
// }
// }