diff --git a/vlib/v/gen/c/comptime.v b/vlib/v/gen/c/comptime.v index 500aed8d9d..06fd4dd26c 100644 --- a/vlib/v/gen/c/comptime.v +++ b/vlib/v/gen/c/comptime.v @@ -477,7 +477,8 @@ fn (mut g Gen) comptime_for(node ast.ComptimeFor) { rec_sym := g.table.sym(method.receiver_type) if rec_sym.kind == .struct_ { if _ := g.table.find_field_with_embeds(rec_sym, 'Context') { - if method.generic_names.len > 0 { + if method.generic_names.len > 0 + || (method.params.len > 1 && method.attrs.len == 0) { continue } } diff --git a/vlib/vweb/vweb_app_test.v b/vlib/vweb/vweb_app_test.v index b46e35d6f0..a70bd1bdcd 100644 --- a/vlib/vweb/vweb_app_test.v +++ b/vlib/vweb/vweb_app_test.v @@ -92,3 +92,17 @@ fn (mut app App) some_helper(result T) ApiSuccessResponse { fn (mut app App) ok() vweb.Result { return app.json(app.some_helper(123)) } + +struct ExampleStruct { + example int +} + +fn (mut app App) request_raw_2() vweb.Result { + stuff := []ExampleStruct{} + return app.request_raw(stuff) +} + +// should compile, this is a helper method, not exposed as a route +fn (mut app App) request_raw(foo []ExampleStruct) vweb.Result { + return app.text('Hello world') +}