dslx_fmt removes comment in return line if that is a unary expression
hzeller opened this issue · comments
Henner Zeller commented
Consider this input:
$BUILD_PATH/xls/dslx/dslx_fmt /dev/stdin << EOF
fn foo(x: u32) -> u32 {
!x // trivial expression
}
EOF
The comment in the line is removed:
fn foo(x: u32) -> u32 {
!x
}
Interestingly, this does not happen if the return value is just x
or a binary x + x
expression; the unary !x
expression seems to trigger this.