[fine] starting to work on methods

This commit is contained in:
John Doty 2024-01-22 06:04:13 -08:00
parent fde5579479
commit 0d48bfb113
4 changed files with 22 additions and 8 deletions

View file

@ -1,14 +1,23 @@
class Point {
x: f64;
y: f64;
fun something_static() -> f64 {
12
}
fun square_length(self) -> f64 {
self.x * self.x + self.y * self.y
}
}
fun test() -> f64 {
let pt = new Point { x: 7, y: 23 };
let z = pt.x;
let z = pt.x + pt.square_length() + Point::something_static();
z
}
// @ignore WIP: Methods
// @no-errors
// @eval: Float(7.0)
// @compiles-to: