Skip to content

Regression on SDK 5.0.300: When using an identifier like __SOURCE_DIRECTORY__ in a type parameter one get FS3045 compilation error. #11610

@da9l

Description

@da9l

Please provide a succinct description of the issue.

When using SDK 5.0.300 and one uses an identifier in a type parameter one get a FS3045 compilation error.
It works on SDK 5.0.203

Provide the steps required to reproduce the problem:

  1. Use SDK 5.0.300
  2. Compile the code below, also see FS3045 error reproduction repro
open System
open FSharp.Data

type Sample = XmlProvider<Schema="Sample.xsd",
                          ResolutionFolder=__SOURCE_DIRECTORY__>

Expected behavior

It should work as it does in SDK 5.0.203.

Actual behavior

A FS3045 compilation error.

Known workarounds

  1. Use SDK 5.0.203
  2. Put the identifier into a [<Literal>] value.
[<Literal>]
let refDir = __SOURCE_DIRECTORY__
type Sample = XmlProvider<Schema="Sample.xsd",
                          ResolutionFolder=refDir>

Provide any related information (optional):

  • Operating system: Windows 10
  • .NET Runtime kind (.NET Core, .NET Framework, Mono): dotnet-sdk 5.0.300
  • Editing Tools (e.g. Visual Studio Version, Visual Studio): Visual Studio Code (probably not related)

Metadata

Metadata

Labels

Impact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.Regression

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions