WebSharper

This method in UI.Next was failing to translate:

1
2
3
4
5
6
7
8
9
10
11
12
13
    let TreeReduce (defaultValue: 'A) (reduction: 'A -> 'A -> 'A) (array: 'A[]) : 'A =
        let l = array.Length
        let rec loop off len =
            match len with
            | n when n <= 0 -> defaultValue
            | 1 when off >= 0 && off < l ->
                array.[off]
            | n ->
                let l2 = len / 2
                let a = loop off l2
                let b = loop (off + l2) (len - l2)
                reduction a b
        loop 0 l

because of l = array.Length being inlined to the argument into loop 0 l because breaker was not checking if the variable is used in function declarations or not.