added return statement

This commit is contained in:
Andrew Segavac
2021-05-30 09:57:41 -06:00
parent 806835f2b9
commit b82566f710
4 changed files with 135 additions and 65 deletions

View File

@@ -1,6 +1,6 @@
// adds a and b, but also 4 for some reason
fn add(a: I32, b: I32): I32 {
let foo = 4;
let foo = 4; // because I feel like it
let test_float: F32 = {
10.2
};
@@ -11,6 +11,18 @@ fn subtract(a: I32, b: I32): I32 {
a - b
}
fn return_type_test(a: F64): F64 {
return a * 2.0;
}
fn i_hate_this(a: F64): F64 {
return {
return {
return a;
};
};
}
fn main(): I32 {
add(4, subtract(5, 2))
}