vweb: default init methods (#7779)

pull/7789/head
Daniel Däschle 2021-01-01 17:24:54 +01:00 committed by GitHub
parent e237df3c1c
commit ac22fe998a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -448,7 +448,8 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
if !is_range_slice {
g.write('&')
}
} else if !node.receiver_type.is_ptr() && node.left_type.is_ptr() && node.name != 'str' {
} else if !node.receiver_type.is_ptr() && node.left_type.is_ptr() && node.name != 'str' &&
node.from_embed_type == 0 {
g.write('/*rec*/*')
}
if node.free_receiver && !g.inside_lambda && !g.is_builtin_mod {

View File

@ -58,6 +58,12 @@ pub mut:
form_error string
}
// declaring init_once in your App struct is optional
pub fn (ctx Context) init_once() {}
// declaring init in your App struct is optional
pub fn (ctx Context) init() {}
pub struct Cookie {
name string
value string