1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker,ci: use c.note for "direct sum type init..."; fixes /v -prod cmd/vls

This commit is contained in:
Delyan Angelov 2021-03-31 12:38:54 +03:00
parent 23a6ce00e2
commit 6daefde5cb
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -470,7 +470,7 @@ pub fn (mut c Checker) struct_init(mut struct_init ast.StructInit) table.Type {
c.ensure_type_exists(utyp, struct_init.pos) or {}
type_sym := c.table.get_type_symbol(utyp)
if !c.inside_unsafe && type_sym.kind == .sum_type {
c.warn('direct sum type init (`x := SumType{}`) will be removed soon', struct_init.pos)
c.note('direct sum type init (`x := SumType{}`) will be removed soon', struct_init.pos)
}
// Make sure the first letter is capital, do not allow e.g. `x := string{}`,
// but `x := T{}` is ok.