Amber
Amber copied to clipboard
[BUG] `seq` works differently on different bash versions
Amber range echo 2..2 produces bash code: echo $(seq 2 1)
For bash version 3.2.57(1)-release it produces output: 2 1. Bash in newer version doesn't have this issue.
We should add some kind of check for range bounds to return no output, in order to standardise behaviour in all enviroments. Something like:
fun range(start: Num, end: Num): [Num] {
let range = [Num]
if end != start {
range = trust $seq {start} {end}$ as [Num]
}
return range
}
i think a hotfix should be a compiler warning about this issue until we come up with a long term solution