moonbitlang / core

MoonBit's Core library
https://moonbitlang.com/
Apache License 2.0
475 stars 54 forks source link

Inappropriate parentheses removed #632

Closed Lampese closed 3 days ago

Lampese commented 5 days ago

Before format:

test "panic op_get" {
  @deque.Deque::[1, 2, 3][-1] |> ignore
  (@deque.Deque::[1, 2, 3])[-1] |> ignore
}

then:

test "panic op_get" {
  @deque.Deque::[1, 2, 3][-1] |> ignore
  @deque.Deque::[1, 2, 3][-1] |> ignore
}

Based on the feedback I received on the coverage tool, the results obtained from these two writing methods are different, but the formatting tool removed parentheses for them.

qazxcdswe123 commented 3 days ago

Thank you for the report. This is an oversight, but we are deprecating the syntax T::[] so this shouldn't be an issue.