Skip to content

Commit 0c888f4

Browse files
DedSec256auduchinok
authored andcommitted
Provided Types virtualization (#2)
1 parent e289d98 commit 0c888f4

File tree

7 files changed

+624
-309
lines changed

7 files changed

+624
-309
lines changed

src/Compiler/Checking/CheckDeclarations.fs

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

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

30543054
let isRootGenerated, rootProvAssemStaticLinkInfoOpt =
30553055
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
@@ -1997,13 +1997,7 @@ and [<Sealed>] TcImports
19971997
// NOTE: The types provided by GetTypes() are available for name resolution
19981998
// when the namespace is "opened". This is part of the specification of the language
19991999
// feature.
2000-
let tys =
2001-
providedNamespace.PApplyArray((fun provider -> provider.GetTypes()), "GetTypes", m)
2002-
2003-
let ptys =
2004-
[|
2005-
for ty in tys -> ty.PApply((fun ty -> ty |> ProvidedType.CreateNoContext), m)
2006-
|]
2000+
let ptys = providedNamespace.PApplyArray(GetProvidedTypes, "GetTypes", m)
20072001

20082002
for st in ptys do
20092003
tcImportsStrong.InjectProvidedNamespaceOrTypeIntoEntity(

src/Compiler/TypedTree/TypeProviders.fs

Lines changed: 397 additions & 161 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)