Skip to content

Commit aa81c9f

Browse files
CopilotT-Gro
andcommitted
Fix amap to remain a function, only unwrap when accessing g
Co-authored-by: T-Gro <[email protected]>
1 parent 00c306a commit aa81c9f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Compiler/Checking/import.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,15 +694,16 @@ let multisetDiscriminateAndMap nodef tipf (items: ('Key list * 'Value) list) =
694694
tips @ nodes
695695

696696
/// Import an IL type definition as a new F# TAST Entity node.
697-
let rec ImportILTypeDef (amap: ImportMap) m scoref (cpath: CompilationPath) enc nm (tdef: ILTypeDef) =
697+
let rec ImportILTypeDef amap m scoref (cpath: CompilationPath) enc nm (tdef: ILTypeDef) =
698698
let lazyModuleOrNamespaceTypeForNestedTypes =
699699
InterruptibleLazy(fun _ ->
700700
let cpath = cpath.NestedCompPath nm ModuleOrType
701701
ImportILTypeDefs amap m scoref cpath (enc@[tdef]) tdef.NestedTypes
702702
)
703703

704704
let nullableFallback =
705-
if amap.g.langFeatureNullness && amap.g.checkNullness then
705+
let amapValue = amap()
706+
if amapValue.g.langFeatureNullness && amapValue.g.checkNullness then
706707
// Immediately read the attrs to avoid keeping a reference to tdef.CustomAttrsStored
707708
let attrs = tdef.CustomAttrsStored.GetCustomAttrs(tdef.MetadataIndex)
708709
Nullness.FromClass(Nullness.AttributesFromIL(tdef.MetadataIndex, Given attrs))

0 commit comments

Comments
 (0)