After installing VS 15.5 preview 1, this fails:
[<EntryPoint>]
let main argv =
let factorials =
[ for x in 0..10 do
let rec factorial x =
match x with
| 0 -> 1
| x -> x * factorial(x - 1)
yield factorial x
]
for f in factorials do printf "%i" f
0 // return an integer exit code

This happens even in VS 15.4 now.
@dhwed Oh wow, that's a regression. The culprit will be https://github.com/Microsoft/visualfsharp/pull/3536
@cartermp I'll start working on a fix for this regression tomorrow
Workaround 1 - in this case compiling in "Release" mode makes NRE go away
Workaround 2 - lift the let rec out of the list/array/sequence expression, adding any captured variables as arguments
Fixed by undoing the fix, When we fix the fix it will all be fixed
Most helpful comment
Fixed by undoing the fix, When we fix the fix it will all be fixed