Skip to content

Parser errors when using code quotations with anonymous records #18597

@edgarfgp

Description

@edgarfgp

Please provide a succinct description of the issue.

Using typed or untyped code quotation without adding an am extra space at the end result in parser errors

Repro steps

Provide the steps required to reproduce the problem:

  • Extra space at the end
open Microsoft.FSharp.Quotations
// A typed code quotation.
let expr : {| A: Expr<int> |} = {| A= <@ 1 + 1 @> |} // Ok 
// An untyped code quotation.
let expr2 : {| A: Expr |} = {| A = <@@ 1 + 1 @@> |} // Ok
Image
  • No extra space at the end
open Microsoft.FSharp.Quotations
// A typed code quotation.
let expr : {| A: Expr<int> |} = {| A= <@ 1 + 1 @>|} // Parser errors 
// An untyped code quotation.
let expr2 : {| A: Expr |} = {| A = <@@ 1 + 1 @@>|} //  // Parser errors 
Image Image

If possible attach a zip file with the repro case. This often makes it easier for others to reproduce.
The zip file should ideally represent the situation just before the call/step that is problematic.

Expected behavior

Code should be parseable without the needed of adding extra spaces

Actual behavior
compiler fails to parse the code.

Known workarounds

Always add extra space at the end

Related information

Provide any related information (optional):

  • Operating system
  • .NET Runtime kind (.NET Core, .NET Framework, Mono)
  • Editing Tools (e.g. Visual Studio Version, Visual Studio)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions