mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: make null warning an error
This commit is contained in:
parent
e70848a98b
commit
322eb8197d
@ -147,7 +147,7 @@ fn (mut c Checker) struct_decl(mut node ast.StructDecl) {
|
||||
if field.typ.is_ptr() {
|
||||
if field.default_expr is ast.IntegerLiteral {
|
||||
if !c.inside_unsafe && !c.is_builtin_mod && field.default_expr.val == '0' {
|
||||
c.warn('default value of `0` for references can only be used inside `unsafe`',
|
||||
c.error('default value of `0` for references can only be used inside `unsafe`',
|
||||
field.default_expr.pos)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user