mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Merge ffb5c7504f
into 8e26ca3f5a
This commit is contained in:
commit
c93435ccac
@ -708,8 +708,7 @@ fn (mut c Checker) struct_init(mut node ast.StructInit, is_field_zero_struct_ini
|
||||
}
|
||||
if !field.typ.has_flag(.option) && sym.kind == .interface_
|
||||
&& (!has_noinit && sym.language != .js) && !node.has_update_expr {
|
||||
// TODO: should be an error instead, but first `ui` needs updating.
|
||||
c.note('interface field `${type_sym.name}.${field.name}` must be initialized',
|
||||
c.error('interface field `${type_sym.name}.${field.name}` must be initialized',
|
||||
node.pos)
|
||||
}
|
||||
// Do not allow empty uninitialized sum types
|
||||
|
@ -1,4 +1,4 @@
|
||||
vlib/v/checker/tests/interface_init_err.vv:15:7: notice: interface field `Server.handler` must be initialized
|
||||
vlib/v/checker/tests/interface_init_err.vv:15:7: error: interface field `Server.handler` must be initialized
|
||||
13 |
|
||||
14 | fn main() {
|
||||
15 | _ := Server{}
|
||||
|
Loading…
Reference in New Issue
Block a user