Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion src/fsharp/CompileOps.fs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3631,6 +3631,13 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
| Some(importsBase)-> importsBase.GetDllInfos() @ dllInfos
| None -> dllInfos

member tcImports.AllAssemblyResolutions() =
CheckDisposed()
let ars = resolutions.GetAssemblyResolutions()
match importsBase with
| Some(importsBase)-> importsBase.AllAssemblyResolutions() @ ars
| None -> ars

member tcImports.TryFindDllInfo (m,assemblyName,lookupOnly) =
CheckDisposed()
let rec look (t:TcImports) =
Expand Down Expand Up @@ -3966,7 +3973,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
{ resolutionFolder = tcConfig.implicitIncludeDir
outputFile = tcConfig.outputFile
showResolutionMessages = tcConfig.showExtensionTypeMessages
referencedAssemblies = [| for r in resolutions.GetAssemblyResolutions() -> r.resolvedPath |]
referencedAssemblies = Array.distinct [| for r in tcImports.AllAssemblyResolutions() -> r.resolvedPath |]
temporaryFolder = FileSystem.GetTempPathShim() }

// The type provider should not hold strong references to disposed
Expand Down
4 changes: 3 additions & 1 deletion tests/fsharp/typeProviders/helloWorld/provider.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ type public GlobalNamespaceProvider() =


[<TypeProvider>]
type public Provider() =
type public Provider(config: TypeProviderConfig) =
let thisAssembly = typeof<Provider>.Assembly
let modul = thisAssembly.GetModules().[0]
let rootNamespace = "FSharp.HelloWorld"
let nestedNamespaceName1 = "FSharp.HelloWorld.NestedNamespace1"
let nestedNamespaceName2 = "FSharp.HelloWorld.Nested.Nested.Nested.Namespace2"

do if not (config.ReferencedAssemblies |> Seq.exists (fun s -> s.Contains("FSharp.Core")) ) then
failwith "expected FSharp.Core in type provider config references"

// Test provision of erase methods with static parameters
let helloWorldMethodWithStaticParameters =
Expand Down