From b62bb22fa63e3396264e70ad572e6cd82c771f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=C3=A4schle?= Date: Sun, 19 Apr 2020 22:26:04 +0200 Subject: [PATCH] checker: allow C values in enum --- vlib/v/checker/checker.v | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 339ba607d9..42a91eb870 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -767,6 +767,12 @@ pub fn (c mut Checker) enum_decl(decl ast.EnumDecl) { ast.IntegerLiteral {} ast.PrefixExpr {} else { + if field.expr is ast.Ident { + expr := field.expr as ast.Ident + if expr.is_c { + continue + } + } mut pos := field.expr.position() if pos.pos == 0 { pos = field.pos