mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
initial
This commit is contained in:
parent
ec35d76574
commit
100f441e3f
@ -135,6 +135,13 @@ fn (mut c Checker) struct_decl(mut node ast.StructDecl) {
|
|||||||
c.error('cannot use Result type as map value type', field.type_pos)
|
c.error('cannot use Result type as map value type', field.type_pos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if sym.kind == .function {
|
||||||
|
fn_info := sym.info as ast.FnType
|
||||||
|
if !field.typ.has_flag(.option) && fn_info.is_anon {
|
||||||
|
c.warn('direct function declaration is not recommended, use Option instead (?fn ...)',
|
||||||
|
field.type_pos)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if field.has_default_expr {
|
if field.has_default_expr {
|
||||||
c.expected_type = field.typ
|
c.expected_type = field.typ
|
||||||
|
Loading…
Reference in New Issue
Block a user