From c8dcbcb649684d043d0d26732535e83101accc0c Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 7 Feb 2020 14:53:07 +0100 Subject: [PATCH] parser: allow `as` in consts --- vlib/compiler/expression.v | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vlib/compiler/expression.v b/vlib/compiler/expression.v index 72d0425050..e3af20c76c 100644 --- a/vlib/compiler/expression.v +++ b/vlib/compiler/expression.v @@ -692,6 +692,11 @@ fn (p mut Parser) expression() string { } } } + // `as` cast + // TODO remove copypasta + if p.tok == .key_as { + return p.key_as(typ, ph) + } return typ }