Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Jul 8, 2024
1 parent 4bbdfcd commit 16cf20f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vlib/v/gen/c/testdata/struct_fn_member_print.c.must_have
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
static string main__MyStruct_str(main__MyStruct it) { return indent_main__MyStruct_str(it, 0);}
static string main__Function_str() { return _SLIT("fn (int)");}
string _t1 = main__Function_str();
3 changes: 3 additions & 0 deletions vlib/v/gen/c/testdata/struct_fn_member_print.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MyStruct{
func: fn (int)
}
18 changes: 18 additions & 0 deletions vlib/v/gen/c/testdata/struct_fn_member_print.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module main

type Function = fn (int)

struct MyStruct {
func Function @[required]
}

fn implementation(size int) {
println('size is ${size}')
}

fn main() {
m := MyStruct{
func: implementation
}
println('${m}')
}

0 comments on commit 16cf20f

Please sign in to comment.