F# type conflict

83 Views Asked by At

I am using the parseFile function from Fantomas.FCS as follows:

open FSharp.Compiler.Text
open Fantomas.FCS.Parse
// ... 
let ast, errors = parseFile false (FSharp.Compiler.Text.SourceText.ofString "let mutable x = 3") []

However, the compiler says that

The type 'FSharp.Compiler.Text.ISourceText' is not compatible with the type 'FSharp.Compiler.Text.ISourceText (Fantomas.FCS, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null)'

I have located the file here, which seems to be in the nuget package FSharp.Compiler.Service. However, downloading the latest version of that does not resolve the conflict. I then looked at the version Fantomas.FCS (version 5.0.0-beta-002) is using. It seems that Fantomas is obtaining the FSharp.Compiler.Text namespace files from github: https://github.com/fsprojects/fantomas/blob/master/paket.dependencies. I have tried to use paket to download these files, using a similar setup as Fantomas, but had issues with transitive dependencies. The method also seems messy. Is there a way to resolve the type incompatibility?

0

There are 0 best solutions below

Related Questions in F#

Related Questions in F#-COMPILER-SERVICES