mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ast: fix call_expr.str() with propagate_option or propagate_result (#14550)
This commit is contained in:
@@ -303,7 +303,13 @@ pub fn (x Expr) str() string {
|
|||||||
}
|
}
|
||||||
CallExpr {
|
CallExpr {
|
||||||
sargs := args2str(x.args)
|
sargs := args2str(x.args)
|
||||||
propagate_suffix := if x.or_block.kind == .propagate_option { ' ?' } else { '' }
|
propagate_suffix := if x.or_block.kind == .propagate_option {
|
||||||
|
'?'
|
||||||
|
} else if x.or_block.kind == .propagate_result {
|
||||||
|
'!'
|
||||||
|
} else {
|
||||||
|
''
|
||||||
|
}
|
||||||
if x.is_method {
|
if x.is_method {
|
||||||
return '${x.left.str()}.${x.name}($sargs)$propagate_suffix'
|
return '${x.left.str()}.${x.name}($sargs)$propagate_suffix'
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user