Record type inference suggestion
Note that if the record {a: int; b: int} is declared last, then type + argument name type inference will not work. Switching the order around resolves the issue. However, this behaviour can be a little mentally jarring.
The lightweight syntax is very useful. It'd be great to strengthen it up.
module Eg1 =
type AB = {a: int; b: int}
type A = {a: int}
type B = {b: int}
let a = {a=1}
let b = {b=2}
let ab = {a=1;b=2}
module Eg2 =
type A = {a: int}
type B = {b: int}
type AB = {a: int; b: int} // < NB. only the order has changed
let a = {a=1} // fail
let b = {b=2} // fail
// note that example 3 resolves the ambiguity with the dot syntax on the first named field, but that's not the point.
module Eg3 =
type A = {a: int}
type B = {b: int}
type AB = {a: int; b: int}
let a = {A.a=1}
let b = {B.b=2}
let ab = {a=1;b=2}
Marking this as approvedinprinciple, per my comment below
We will open an RFC for this in due course, though the change should not be large
https://github.com/fsharp/FSharpLangDesign/tree/master/RFCs
Don Syme, F# Language Evolution
2 comments

Don Syme commented
Yes, it looks reasonable to be more flexible here. I will mark this as approvedinprinciple

Gauthier Segay commented
There was a relevant thread there:
https://groups.google.com/forum/#!topic/fsharpopensource/vb3pTUAcRVs