diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs old mode 100755 new mode 100644 index c066fabdd1d..17a37a1bf22 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -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) = @@ -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 diff --git a/tests/fsharp/typeProviders/helloWorld/provider.fsx b/tests/fsharp/typeProviders/helloWorld/provider.fsx index 4ea849999e9..520821d00cd 100644 --- a/tests/fsharp/typeProviders/helloWorld/provider.fsx +++ b/tests/fsharp/typeProviders/helloWorld/provider.fsx @@ -108,13 +108,15 @@ type public GlobalNamespaceProvider() = [] -type public Provider() = +type public Provider(config: TypeProviderConfig) = let thisAssembly = typeof.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 =