Skip to content

Commit e9c6d8b

Browse files
committed
report correct refs
1 parent 077aa21 commit e9c6d8b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/fsharp/CompileOps.fs

100755100644
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3631,6 +3631,13 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
36313631
| Some(importsBase)-> importsBase.GetDllInfos() @ dllInfos
36323632
| None -> dllInfos
36333633

3634+
member tcImports.AllAssemblyResolutions() =
3635+
CheckDisposed()
3636+
let ars = resolutions.GetAssemblyResolutions()
3637+
match importsBase with
3638+
| Some(importsBase)-> importsBase.AllAssemblyResolutions() @ ars
3639+
| None -> ars
3640+
36343641
member tcImports.TryFindDllInfo (m,assemblyName,lookupOnly) =
36353642
CheckDisposed()
36363643
let rec look (t:TcImports) =
@@ -3966,7 +3973,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
39663973
{ resolutionFolder = tcConfig.implicitIncludeDir
39673974
outputFile = tcConfig.outputFile
39683975
showResolutionMessages = tcConfig.showExtensionTypeMessages
3969-
referencedAssemblies = [| for r in resolutions.GetAssemblyResolutions() -> r.resolvedPath |]
3976+
referencedAssemblies = Array.distinct [| for r in tcImports.AllAssemblyResolutions() -> r.resolvedPath |]
39703977
temporaryFolder = FileSystem.GetTempPathShim() }
39713978

39723979
// The type provider should not hold strong references to disposed

tests/fsharp/typeProviders/helloWorld/provider.fsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,15 @@ type public GlobalNamespaceProvider() =
108108

109109

110110
[<TypeProvider>]
111-
type public Provider() =
111+
type public Provider(config: TypeProviderConfig) =
112112
let thisAssembly = typeof<Provider>.Assembly
113113
let modul = thisAssembly.GetModules().[0]
114114
let rootNamespace = "FSharp.HelloWorld"
115115
let nestedNamespaceName1 = "FSharp.HelloWorld.NestedNamespace1"
116116
let nestedNamespaceName2 = "FSharp.HelloWorld.Nested.Nested.Nested.Namespace2"
117117

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

119121
// Test provision of erase methods with static parameters
120122
let helloWorldMethodWithStaticParameters =

0 commit comments

Comments
 (0)