F# Compiler Services incorrectly parses program

Viewed 253

UPDATE:

I now realize that the question was stupid, I should have just filed the issue. In hindsight, I don't see why I even asked this question.
The issue is here: https://github.com/fsharp/FSharp.Compiler.Service/issues/544


Original question:

I'm using FSharp Compiler Services for parsing some F# code.
The particular piece of code that I'm facing right now is this:

  let f x y = x+y
  let g = f 1
  let h = (g 2) + 3

This program yields a TAST without the (+) call on the last line. That is, the compiler service returns TAST as if the last line was just let h = g 2.

The question is: is this is a legitimate bug that I ought to report or am I missing something?


Some notes

  1. Here is a repo containing minimal repro (I didn't want to include it in this question, because Compiler Services require quite a bit of dancing around).
  2. Adding more statements after the let h line does not change the outcome.
  3. When compiled to IL (as opposed to parsed with Compiler Services), it seems to work as expected (e.g. see fiddle)
  4. If I make g a value, the program parses correctly.
  5. If I make g a normal function (rather than partially applied one), the program parses correctly.
1 Answers
Related