mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: do not all string casts
This commit is contained in:
parent
b91a537c35
commit
7fc7c05e9d
@ -523,6 +523,10 @@ fn (p mut Parser) cast(typ string) {
|
|||||||
}
|
}
|
||||||
p.error('cannot cast `$expr_typ` to `bool`')
|
p.error('cannot cast `$expr_typ` to `bool`')
|
||||||
}
|
}
|
||||||
|
// Strings can't be cast
|
||||||
|
if expr_typ == 'string' {
|
||||||
|
p.error('cannot cast `$expr_typ` to `$typ`')
|
||||||
|
}
|
||||||
p.cgen.set_placeholder(pos, '($typ)(')
|
p.cgen.set_placeholder(pos, '($typ)(')
|
||||||
}
|
}
|
||||||
p.check(.rpar)
|
p.check(.rpar)
|
||||||
|
Loading…
Reference in New Issue
Block a user