Skip to content

Commit

Permalink
Provided Types virtualization (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
DedSec256 authored and auduchinok committed May 11, 2023
1 parent a3fb799 commit a1a3316
Show file tree
Hide file tree
Showing 7 changed files with 613 additions and 298 deletions.
2 changes: 1 addition & 1 deletion src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2855,7 +2855,7 @@ module EstablishTypeDefinitionCores =
let ctxt = ProvidedTypeContext.Create(lookupILTypeRef, lookupTyconRef)

// Create a new provided type which captures the reverse-remapping tables.
let theRootTypeWithRemapping = theRootType.PApply ((fun x -> ProvidedType.ApplyContext(x, ctxt)), m)
let theRootTypeWithRemapping = theRootType.PApply ((fun x -> x.ApplyContext(ctxt)), m)

let isRootGenerated, rootProvAssemStaticLinkInfoOpt =
let stRootAssembly = theRootTypeWithRemapping.PApply((fun st -> st.Assembly), m)
Expand Down
8 changes: 1 addition & 7 deletions src/Compiler/Driver/CompilerImports.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1884,13 +1884,7 @@ and [<Sealed>] TcImports
// NOTE: The types provided by GetTypes() are available for name resolution
// when the namespace is "opened". This is part of the specification of the language
// feature.
let tys =
providedNamespace.PApplyArray((fun provider -> provider.GetTypes()), "GetTypes", m)

let ptys =
[|
for ty in tys -> ty.PApply((fun ty -> ty |> ProvidedType.CreateNoContext), m)
|]
let ptys = providedNamespace.PApplyArray(GetProvidedTypes, "GetTypes", m)

for st in ptys do
tcImportsStrong.InjectProvidedNamespaceOrTypeIntoEntity(
Expand Down
559 changes: 399 additions & 160 deletions src/Compiler/TypedTree/TypeProviders.fs

Large diffs are not rendered by default.

Loading

0 comments on commit a1a3316

Please sign in to comment.