@@ -41,7 +41,10 @@ module Impl =
41
41
System.Collections.ObjectModel.ReadOnlyCollection<_>( Seq.toArray arr) :> IList<_>
42
42
let makeXmlDoc ( XmlDoc x ) = makeReadOnlyCollection ( x)
43
43
44
- let rescopeEntity viewedCcu ( entity : Entity ) =
44
+ let rescopeEntity optViewedCcu ( entity : Entity ) =
45
+ match optViewedCcu with
46
+ | None -> mkLocalEntityRef entity
47
+ | Some viewedCcu ->
45
48
match tryRescopeEntity viewedCcu entity with
46
49
| None -> mkLocalEntityRef entity
47
50
| Some eref -> eref
@@ -1847,9 +1850,13 @@ and FSharpParameter(cenv, typ:TType, topArgInfo:ArgReprInfo, mOpt, isParamArrayA
1847
1850
override x.ToString () =
1848
1851
" parameter " + ( match x.Name with None -> " <unnamed" | Some s -> s)
1849
1852
1850
- and FSharpAssemblySignature internal ( cenv , topAttribs : TypeChecker.TopAttribs option , mtyp : ModuleOrNamespaceType ) =
1853
+ and FSharpAssemblySignature private ( cenv , topAttribs : TypeChecker.TopAttribs option , optViewedCcu : CcuThunk option, mtyp : ModuleOrNamespaceType ) =
1851
1854
1852
- new ( g , thisCcu , tcImports , topAttribs , mtyp ) = FSharpAssemblySignature( cenv( g, thisCcu, tcImports), topAttribs, mtyp)
1855
+ // Assembly signature for a referenced/linked assembly
1856
+ new ( cenv , ccu : CcuThunk ) = FSharpAssemblySignature(( if ccu.IsUnresolvedReference then cenv else ( new cenv( cenv.g, ccu, cenv.tcImports))), None, Some ccu, ccu.Contents.ModuleOrNamespaceType)
1857
+
1858
+ // Assembly signature for an assembly produced via type-checking.
1859
+ new ( g , thisCcu , tcImports , topAttribs , mtyp ) = FSharpAssemblySignature( cenv( g, thisCcu, tcImports), topAttribs, None, mtyp)
1853
1860
1854
1861
member __.Entities =
1855
1862
@@ -1858,10 +1865,7 @@ and FSharpAssemblySignature internal (cenv, topAttribs: TypeChecker.TopAttribs o
1858
1865
if entity.IsNamespace then
1859
1866
yield ! loop entity.ModuleOrNamespaceType
1860
1867
else
1861
- let entityRef =
1862
- match tryRescopeEntity cenv.thisCcu entity with
1863
- | None -> mkLocalEntityRef entity
1864
- | Some eref -> eref
1868
+ let entityRef = rescopeEntity optViewedCcu entity
1865
1869
yield FSharpEntity( cenv, entityRef) |]
1866
1870
1867
1871
loop mtyp |> makeReadOnlyCollection
@@ -1885,7 +1889,7 @@ and FSharpAssembly internal (cenv, ccu: CcuThunk) =
1885
1889
member __.FileName = ccu.FileName
1886
1890
member __.SimpleName = ccu.AssemblyName
1887
1891
member __.IsProviderGenerated = ccu.IsProviderGenerated
1888
- member __.Contents = FSharpAssemblySignature(( if ccu.IsUnresolvedReference then cenv else ( new cenv ( cenv.g , ccu, cenv.tcImports ))), None , ccu.Contents.ModuleOrNamespaceType )
1892
+ member __.Contents = FSharpAssemblySignature( cenv, ccu)
1889
1893
1890
1894
override x.ToString () = x.QualifiedName
1891
1895
0 commit comments