parser: do not all string casts
parent
b91a537c35
commit
7fc7c05e9d
|
@ -523,6 +523,10 @@ fn (p mut Parser) cast(typ string) {
|
|||
}
|
||||
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.check(.rpar)
|
||||
|
|
Loading…
Reference in New Issue