restore checker.v
parent
573a564aba
commit
f8c7213ee3
|
|
@ -3544,9 +3544,12 @@ pub fn (mut c Checker) prefix_expr(mut node ast.PrefixExpr) ast.Type {
|
|||
for mut expr is ast.ParExpr {
|
||||
expr = expr.expr
|
||||
}
|
||||
if expr in [ast.BoolLiteral, ast.CallExpr, ast.CharLiteral, ast.FloatLiteral,
|
||||
ast.IntegerLiteral, ast.InfixExpr, ast.StringLiteral, ast.StringInterLiteral] {
|
||||
c.error('cannot take the address of $expr', node.pos)
|
||||
match expr {
|
||||
ast.BoolLiteral, ast.CallExpr, ast.CharLiteral, ast.FloatLiteral, ast.IntegerLiteral,
|
||||
ast.InfixExpr, ast.StringLiteral, ast.StringInterLiteral {
|
||||
c.error('cannot take the address of $expr', node.pos)
|
||||
}
|
||||
else {}
|
||||
}
|
||||
if mut node.right is ast.IndexExpr {
|
||||
typ_sym := c.table.sym(node.right.left_type)
|
||||
|
|
|
|||
Loading…
Reference in New Issue