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

pull/9544/head
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
1 changed files with 1 additions and 1 deletions

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 {} c.ensure_type_exists(utyp, struct_init.pos) or {}
type_sym := c.table.get_type_symbol(utyp) type_sym := c.table.get_type_symbol(utyp)
if !c.inside_unsafe && type_sym.kind == .sum_type { 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{}`, // Make sure the first letter is capital, do not allow e.g. `x := string{}`,
// but `x := T{}` is ok. // but `x := T{}` is ok.