could this be a F# 6 indexer bug?

Viewed 123

let's consider this code:

type T =
    {
        a: int
    }    

let d =
    [
        "a", [{a = 0}; {a = 1}; {a = 2}]
        "b", [{a = 3}; {a = 4}; {a = 5}]
    ] |> Map

If I want to access the data with a = 0:

d.["a"].[0].a  <- works
d["a"].[0].a   <- now works with F#6
d["a"][0]      <- returns {a = 0}

but

d["a"][0].a    <- typecheck error This value is not a function and cannot be applied.

if I wrap the expression in parenthesis:

(d["a"][0]).a  <- it works

Is this expected, or could it be a F#6 parsing bug?

1 Answers
Related