dotnet / dotnet/fsharp

Wrong let expression parsing

Open
#7,741 9 comments 1 reaction 3 assignees Claimed by @T-Gro View on GitHub
Area-Compiler-Syntax Bug Impact-Medium
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

The contents of `do` in the following code should be parsed as a sequence of let expression and x, but it's parsed as let expression in sequence of the sum and x.

```fsharp
do
let x = 1 in x + 1
x
```

In addition to the unexpected tree form it also creates a wrong scope for `x`.

Screenshot 2019-10-17 at 14 35 50

[AST viewer](https://jindraivanek.gitlab.io/ast-viewer/#?code=CYewUABFEDYKYBcIA8IF4IEYIEsB2KEA1FpNMkA&defines=Q&filename=Q)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.