1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: fix error of -foo.bar() (#9646)

This commit is contained in:
zakuro
2021-04-09 16:54:03 +09:00
committed by GitHub
parent 67ec33218e
commit e6a67e7172
2 changed files with 30 additions and 5 deletions

View File

@@ -507,11 +507,7 @@ fn (mut p Parser) prefix_expr() ast.PrefixExpr {
// p.warn('unsafe')
// }
p.next()
mut right := if op == .minus {
p.expr(int(token.Precedence.call))
} else {
p.expr(int(token.Precedence.prefix))
}
mut right := p.expr(int(token.Precedence.prefix))
p.is_amp = false
if mut right is ast.CastExpr {
right.in_prexpr = true