mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: remove check for option being initialized (#18280)
This commit is contained in:
parent
16ef1d95fb
commit
5812579d53
@ -645,7 +645,8 @@ fn (mut c Checker) struct_init(mut node ast.StructInit, is_field_zero_struct_ini
|
||||
break
|
||||
}
|
||||
}
|
||||
if sym.kind == .interface_ && (!has_noinit && sym.language != .js) {
|
||||
if !field.typ.has_flag(.option) && sym.kind == .interface_
|
||||
&& (!has_noinit && sym.language != .js) {
|
||||
// TODO: should be an error instead, but first `ui` needs updating.
|
||||
c.note('interface field `${type_sym.name}.${field.name}` must be initialized',
|
||||
node.pos)
|
||||
|
Loading…
Reference in New Issue
Block a user