dslx_fmt adds unnecessary parentheses to array index
hongted opened this issue · comments
Ted Hong commented
Consider:
pub struct B {
value: u32,
}
pub struct A {
value: B[5],
}
pub fn f(A) -> A {
if A.B[0] == u32:0 {
zero!<A>()
} else {
A
}
}
dslx_fmt formats it to
pub struct B { value: u32 }
pub struct A { value: B[5] }
pub fn f(a: A) -> A { if (a.B[0]).value == u32:0 { zero!<A>() } else { a } }
Note extra parentheses around a.B[0]