[fine] WIP: Classes
This commit is contained in:
parent
e6c96fde38
commit
0ee89bf26b
7 changed files with 370 additions and 59 deletions
13
fine/tests/expression/class.fine
Normal file
13
fine/tests/expression/class.fine
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
class Point {
|
||||
x: f64;
|
||||
y: f64;
|
||||
}
|
||||
|
||||
fun test() -> f64 {
|
||||
let pt = new Point { x: 7, y: 23 };
|
||||
let z = pt.x;
|
||||
z
|
||||
}
|
||||
|
||||
// @ignore
|
||||
// @no-errors
|
||||
|
|
@ -1,10 +1,14 @@
|
|||
fun sum(x: list<f64>) -> f64 {
|
||||
75 // lol
|
||||
let result = 0;
|
||||
for v in x {
|
||||
result = result + v;
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
fun test() {
|
||||
fun test() -> f64 {
|
||||
let val = [1, 2, 3];
|
||||
sum(val);
|
||||
sum(val)
|
||||
}
|
||||
|
||||
// @no-errors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue