dotnet / dotnet/fsharp

Syntax error with string interpolation - Unexpected identifier in binding

Open
#14,394 1 comment 0 reactions 0 assignees View on GitHub
Area-Compiler-Syntax Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

In this PR: https://github.com/dotnet/fsharp/pull/14383 an additional (highly suspect .ToString() was need to get it to compile.

Without ToString():
![image](https://user-images.githubusercontent.com/5175830/204112289-c9cf0058-d1c6-4fb2-b1d0-d59b29db0f23.png)
With ToString():
![image](https://user-images.githubusercontent.com/5175830/204112329-5a0f3149-1e4c-4bae-bb0a-7234cca2c85c.png)

For the non-ToString() version the compiler produces this:
````
FSharp.Compiler.Service -> C:\kevinransom\fsharp\artifacts\bin\FSharp.Compiler.Service\Debug\netstandard2.0\FSharp.Compiler.Service.d
ll
C:\kevinransom\fsharp\vsintegration\src\FSharp.VS.FSI\fsiSessionToolWindow.fs(538,9): error FS0588: The block following this 'let' is u
nfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving
this block an explicit result. [C:\kevinransom\fsharp\vsintegration\src\FSharp.VS.FSI\FSharp.VS.FSI.fsproj]
C:\kevinransom\fsharp\vsintegration\src\FSharp.VS.FSI\fsiSessionToolWindow.fs(547,9): error FS0010: Unexpected identifier in binding. E
xpected incomplete structured construct at or before this point or other token. [C:\kevinransom\fsharp\vsintegration\src\FSharp.VS.FSI\
FSharp.VS.FSI.fsproj]
C:\kevinransom\fsharp\vsintegration\src\FSharp.VS.FSI\fsiSessionToolWindow.fs(537,5): error FS3118: Incomplete value or function defini
tion. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. [C:\kevinransom
\fsharp\vsintegration\src\FSharp.VS.FSI\FSharp.VS.FSI.fsproj]
````

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.