Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove warning about patter discard not allowed for union case that takes no data #401

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions src/ProvidedTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7529,7 +7529,7 @@ namespace ProviderImplementation.ProvidedTypes
// See bug https://github.com/fsprojects/FSharp.TypeProviders.SDK/issues/236
override __.IsSZArray =
match kind with
| TypeSymbolKind.SDArray _ -> true
| TypeSymbolKind.SDArray -> true
| _ -> false
#endif
override this.GetMember(_name, _mt, _bindingFlags) = notRequired this "GetMember" this.Name
Expand Down Expand Up @@ -8342,16 +8342,16 @@ namespace ProviderImplementation.ProvidedTypes
// all `#r` implied by a load script. However until it is fixed we need to delay the recomputation
// of the referenced assemblies.
module private TypeProviderConfigFix =

let GetCurrentReferencedAssemblyPaths(config: TypeProviderConfig) : string array =

// Ideally this would always return the correct thing
let given = config.ReferencedAssemblies

#if DISABLE_TypeProviderConfigFix
given
#else
// We additionally scrape the config option in case any new references have been added
let GetCurrentReferencedAssemblyPaths(config: TypeProviderConfig) : string array =
// Ideally this would always return the correct thing
let given = config.ReferencedAssemblies

#if DISABLE_TypeProviderConfigFix
given
#else
// We additionally scrape the config option in case any new references have been added
let additional =
try

Expand Down Expand Up @@ -8947,7 +8947,7 @@ namespace ProviderImplementation.ProvidedTypes

//do System.Diagnostics.Debugger.Break()

let initialTargetAssemblyPaths = TypeProviderConfigFix.GetCurrentReferencedAssemblyPaths(config)
let initialTargetAssemblyPaths = TypeProviderConfigFix.GetCurrentReferencedAssemblyPaths(config)

/// Find which assembly defines System.Object etc.
let systemRuntimeScopeRef =
Expand Down Expand Up @@ -8999,18 +8999,18 @@ namespace ProviderImplementation.ProvidedTypes
let targetAssembliesTable_ = ConcurrentDictionary<string, Choice<Assembly, _>>()
let targetAssemblies_ = ResizeArray<Assembly>()
let targetAssembliesQueue = ResizeArray<_>()
let registerTargetAssemblyPaths (targetAssemblyPaths: string array) =
let registerTargetAssemblyPaths (targetAssemblyPaths: string array) =
targetAssembliesQueue.Add (fun () ->
for ref in targetAssemblyPaths do
let simpleName = Path.GetFileNameWithoutExtension ref
if not (targetAssembliesTable_.ContainsKey simpleName) then
if not (targetAssembliesTable_.ContainsKey simpleName) then
let reader = mkReader ref
targetAssembliesTable_.[simpleName] <- reader
match reader with
| Choice2Of2 _ -> ()
| Choice1Of2 asm -> targetAssemblies_.Add asm)

do registerTargetAssemblyPaths initialTargetAssemblyPaths
| Choice1Of2 asm -> targetAssemblies_.Add asm)
do registerTargetAssemblyPaths initialTargetAssemblyPaths

// We do a one-off registration of any additional target assemblies that are available in the compilation
// context once the type provider starts to be used in earnest, that is when the static parameters
Expand Down Expand Up @@ -9450,8 +9450,8 @@ namespace ProviderImplementation.ProvidedTypes
let backingDataSource = Some (checkFreshMethods, getFreshMethods, getFreshInterfaces, getFreshMethodOverrides)

let getStaticParameters() =
// By the time we are asked for static parameters, all DLLs will have been registered
registerAdditionalTargetAssembliesOnce.Force()
// By the time we are asked for static parameters, all DLLs will have been registered
registerAdditionalTargetAssembliesOnce.Force()
x.StaticParams |> List.map convStaticParameterDefToTgt

let applyStaticParameters =
Expand Down
Loading