Skip to content

Commit 84dece3

Browse files
DedSec256auduchinok
authored andcommitted
Provided Types virtualization (#2)
1 parent bff7523 commit 84dece3

7 files changed

Lines changed: 634 additions & 309 deletions

File tree

src/Compiler/Checking/CheckDeclarations.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3057,7 +3057,7 @@ module EstablishTypeDefinitionCores =
30573057
let ctxt = ProvidedTypeContext.Create(lookupILTypeRef, lookupTyconRef)
30583058

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

30623062
let isRootGenerated, rootProvAssemStaticLinkInfoOpt =
30633063
let stRootAssembly = theRootTypeWithRemapping.PApply((fun st -> st.Assembly), m)

src/Compiler/Driver/CompilerImports.fs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,13 +1994,7 @@ and [<Sealed>] TcImports
19941994
// NOTE: The types provided by GetTypes() are available for name resolution
19951995
// when the namespace is "opened". This is part of the specification of the language
19961996
// feature.
1997-
let tys =
1998-
providedNamespace.PApplyArray((fun provider -> provider.GetTypes()), "GetTypes", m)
1999-
2000-
let ptys =
2001-
[|
2002-
for ty in tys -> ty.PApply((fun ty -> ty |> ProvidedType.CreateNoContext), m)
2003-
|]
1997+
let ptys = providedNamespace.PApplyArray(GetProvidedTypes, "GetTypes", m)
20041998

20051999
for st in ptys do
20062000
tcImportsStrong.InjectProvidedNamespaceOrTypeIntoEntity(

src/Compiler/TypedTree/TypeProviders.fs

Lines changed: 414 additions & 171 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)