init commit
This commit is contained in:
13
test/pass_and_access_struct_fields_in_functions.shd
Normal file
13
test/pass_and_access_struct_fields_in_functions.shd
Normal file
@@ -0,0 +1,13 @@
|
||||
Foo :: struct {
|
||||
some_data : float;
|
||||
}
|
||||
|
||||
foo :: (f : Foo) -> float {
|
||||
return f.some_data * 2.0;
|
||||
}
|
||||
|
||||
vertex main :: () {
|
||||
f : Foo;
|
||||
f.some_data = 4.0;
|
||||
d : float = foo(f);
|
||||
}
|
||||
Reference in New Issue
Block a user