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

Make ReferencedAssemblies in type provider config report correct results #1037

Merged
merged 1 commit into from
Apr 12, 2016
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