mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: make let shift operators work with all types
This commit is contained in:
committed by
Alexander Medvednikov
parent
1b5f724df0
commit
3080959084
@@ -2411,15 +2411,15 @@ fn (p mut Parser) expression() string {
|
||||
else {
|
||||
p.next()
|
||||
p.gen(' << ')
|
||||
p.check_types(p.expression(), typ)
|
||||
return 'int'
|
||||
p.check_types(p.expression(), 'integer')
|
||||
return typ
|
||||
}
|
||||
}
|
||||
if p.tok == .righ_shift {
|
||||
p.next()
|
||||
p.gen(' >> ')
|
||||
p.check_types(p.expression(), typ)
|
||||
return 'int'
|
||||
p.check_types(p.expression(), 'integer')
|
||||
return typ
|
||||
}
|
||||
// + - | ^
|
||||
for p.tok in [.plus, .minus, .pipe, .amp, .xor] {
|
||||
|
||||
Reference in New Issue
Block a user