Function pointers are working

This commit is contained in:
nub31
2025-06-08 15:54:36 +02:00
parent 535bb1bf38
commit de071808e6
10 changed files with 165 additions and 152 deletions

View File

@@ -1,23 +1,24 @@
namespace main
struct Human {
age: ^u64
age: u64
print_age: func() = () => {
}
}
export func main(args: []^string): i64 {
let age: u64 = 23
let me = alloc Human {
age = &age
age = 23
}
me.age^ = 24.5
me.print_age()
test(me.age^)
print_age()
return 0
}
func test(me: u64) {
c::printf("%d\n", me)
func print_age() {
c::puts("TEST")
}