Skip to content

Unfinished let error if a line of string interpolation starts with a format instructions inside of a module #13728

@MangelMaxime

Description

@MangelMaxime

Please provide a succinct description of the issue.

Repro steps

Provide the steps required to reproduce the problem:

module T =

    let evalute path =
        if true then
            let errors = ""

            let msg =
                $"""An error occured while loading {path}
Original error:
%s{errors}"""

            printfn "%s" msg

image

If I add at least 3 spaces at the beginning of the line %s{errors}""" then the error goes away.

There is no error if the function is not under a module:

image

Expected behavior

No error should be reported.

Actual behavior

The is a compilation error.

Known workarounds

Use string concatenation instead of string interpolation.

Related information

Provide any related information (optional):

  • Operating system: Windows
  • .NET Runtime kind (.NET Core, .NET Framework, Mono): .NET Code 6.0.302
  • Editing Tools (e.g. Visual Studio Version, Visual Studio) VSCode + Ionide

Metadata

Metadata

Assignees

Labels

Area-Compiler-Syntaxlexfilter, indentation and parsingBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions