checker: make an error message less ambiguous
parent
4c8703416e
commit
1960c6f4cb
|
@ -509,8 +509,7 @@ pub fn (c mut Checker) array_init(array_init mut ast.ArrayInit) table.Type {
|
||||||
if array_init.exprs.len == 0 {
|
if array_init.exprs.len == 0 {
|
||||||
type_sym := c.table.get_type_symbol(c.expected_type)
|
type_sym := c.table.get_type_symbol(c.expected_type)
|
||||||
if type_sym.kind != .array {
|
if type_sym.kind != .array {
|
||||||
// c.error('array_init: cannot use `[]` with non array.')
|
c.error('array_init: no type specified (maybe: `[]Type` instead of `[]`)', array_init.pos)
|
||||||
c.error('array_init: cannot use `[]` with non array. (maybe: `[]Type` instead of `[]`)', array_init.pos)
|
|
||||||
return table.void_type
|
return table.void_type
|
||||||
}
|
}
|
||||||
// TODO: seperate errors once bug is fixed with `x := if expr { ... } else { ... }`
|
// TODO: seperate errors once bug is fixed with `x := if expr { ... } else { ... }`
|
||||||
|
|
Loading…
Reference in New Issue