diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 9c65fe208a..380c08919b 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -1175,8 +1175,8 @@ pub fn (mut c Checker) struct_init(mut node ast.StructInit) ast.Type { // Do not allow empty uninitialized interfaces sym := c.table.get_type_symbol(field.typ) if sym.kind == .interface_ { - // TODO error - c.warn('interface field `${type_sym.name}.$field.name` must be initialized', + // 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) } // Do not allow empty uninitialized sum types diff --git a/vlib/v/checker/tests/import_symbol_private_err.out b/vlib/v/checker/tests/import_symbol_private_err.out index 578d96a3e2..e5685a4147 100644 --- a/vlib/v/checker/tests/import_symbol_private_err.out +++ b/vlib/v/checker/tests/import_symbol_private_err.out @@ -1,3 +1,15 @@ +vlib/v/checker/tests/import_symbol_private_err.vv:11:6: notice: interface field `io.ReaderWriterImpl.r` must be initialized + 9 | since(now()) + 10 | _ = {'h': 2}.exists('h') + 11 | _ = ReaderWriterImpl{} + | ~~~~~~~~~~~~~~~~~~ + 12 | } +vlib/v/checker/tests/import_symbol_private_err.vv:11:6: notice: interface field `io.ReaderWriterImpl.w` must be initialized + 9 | since(now()) + 10 | _ = {'h': 2}.exists('h') + 11 | _ = ReaderWriterImpl{} + | ~~~~~~~~~~~~~~~~~~ + 12 | } vlib/v/checker/tests/import_symbol_private_err.vv:3:20: error: module `time` function `since()` is private 1 | import v.scanner 2 | import v.parser @@ -10,10 +22,10 @@ vlib/v/checker/tests/import_symbol_private_err.vv:4:13: error: module `io` type 3 | import time { now, since } 4 | import io { ReaderWriterImpl } | ~~~~~~~~~~~~~~~~ - 5 | + 5 | 6 | fn main() { vlib/v/checker/tests/import_symbol_private_err.vv:7:18: error: constant `v.scanner.single_quote` is private - 5 | + 5 | 6 | fn main() { 7 | println(scanner.single_quote) | ~~~~~~~~~~~~ @@ -45,4 +57,4 @@ vlib/v/checker/tests/import_symbol_private_err.vv:11:6: error: type `io.ReaderWr 10 | _ = {'h': 2}.exists('h') 11 | _ = ReaderWriterImpl{} | ~~~~~~~~~~~~~~~~~~ - 12 | } \ No newline at end of file + 12 | } diff --git a/vlib/v/checker/tests/interface_init_err.out b/vlib/v/checker/tests/interface_init_err.out index 238395c279..2a5e6ad2e5 100644 --- a/vlib/v/checker/tests/interface_init_err.out +++ b/vlib/v/checker/tests/interface_init_err.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/interface_init_err.vv:15:7: error: interface field `Server.handler` must be initialized +vlib/v/checker/tests/interface_init_err.vv:15:7: notice: interface field `Server.handler` must be initialized 13 | 14 | fn main() { 15 | _ := Server{}