From 62a692b29c0bc1676db340dab837687b95e526bf Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 11 Sep 2020 13:59:28 +0200 Subject: [PATCH] checker: make the "unnecessary default" error a warning for now --- vlib/v/checker/checker.v | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 347caa59ad..53966f066e 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -370,17 +370,17 @@ pub fn (mut c Checker) struct_decl(decl ast.StructDecl) { } if field.default_expr is ast.IntegerLiteral as lit { if lit.val == '0' { - c.error('unnecessary default value of `0`: struct fields are zeroed by default', + c.warn('unnecessary default value of `0`: struct fields are zeroed by default', lit.pos) } } else if field.default_expr is ast.StringLiteral as lit { if lit.val == '' { - c.error("unnecessary default value of '': struct fields are zeroed by default", + c.warn("unnecessary default value of '': struct fields are zeroed by default", lit.pos) } } else if field.default_expr is ast.BoolLiteral as lit { if lit.val == false { - c.error('unnecessary default value `false`: struct fields are zeroed by default', + c.warn('unnecessary default value `false`: struct fields are zeroed by default', lit.pos) } }