Trying to compile a trivial type provider with recent versions of ProvidedTypes.fs fails to find unique overload for method 'GetDirectoryName' in writeBinaryAndReportMappings().
Repro steps
module Acme
open System
open System.Reflection
open ProviderImplementation
open ProviderImplementation.ProvidedTypes
open Microsoft.FSharp.Core.CompilerServices
open Microsoft.FSharp.Quotations
[<TypeProvider>]
type NoProvider (config : TypeProviderConfig) as this =
inherit TypeProviderForNamespaces (config)
let ns = "Nothing.Provided"
let asm = Assembly.GetExecutingAssembly()
let t = ProvidedTypeDefinition(asm, ns, "Empty", Some typeof<obj>)
do this.AddNamespace(ns, [t])
[<assembly:TypeProviderAssembly>]
do ()
Expected behavior
I expect the code to compile without errors.
Actual behavior
ProvidedTypes.fs(12620,31): error FS0041: A unique overload for method 'GetDirectoryName' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: Path.GetDirectoryName(path: ReadOnlySpan<char>) : ReadOnlySpan<char>, Path.GetDirectoryName(path: string) : string
Known workarounds
Add a type annotation of type string to the outfile argument of writeBinaryAndReportMappings()
Description
Trying to compile a trivial type provider with recent versions of ProvidedTypes.fs fails to find unique overload for method 'GetDirectoryName' in writeBinaryAndReportMappings().
Repro steps
Expected behavior
I expect the code to compile without errors.
Actual behavior
ProvidedTypes.fs(12620,31): error FS0041: A unique overload for method 'GetDirectoryName' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: Path.GetDirectoryName(path: ReadOnlySpan<char>) : ReadOnlySpan<char>, Path.GetDirectoryName(path: string) : string
Known workarounds
Add a type annotation of type
string
to theoutfile
argument of writeBinaryAndReportMappings()Related information