checker: allow C values in enum

pull/4516/head
Daniel Däschle 2020-04-19 22:26:04 +02:00 committed by GitHub
parent 6c59b306c7
commit b62bb22fa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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