We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d64f3f commit 4a8a146Copy full SHA for 4a8a146
1 file changed
ngc/Context.fs
@@ -54,6 +54,15 @@ type Context =
54
let types = List.ofArray (asm.GetTypes())
55
List.iter (fun (t:Type) -> this.types.Add(new Symbol(t.FullName),t)) types
56
57
+ member public this.captureLocal(localName: Symbol, typeBuilder: TypeBuilder) =
58
+ let local = this.locals.[localName]
59
+ match local with
60
+ | Local (_,t) ->
61
+ let field = typeBuilder.DefineField(localName.Name,t,FieldAttributes.Static ||| FieldAttributes.Private)
62
+ this.locals.[localName] <- Field (field, t)
63
+ | Field (fb,_) -> ()
64
+ | Arg (_,_) -> failwithf "Unable to capture parameter %A" localName.Name
65
+
66
let create () =
67
let context = new Context()
68
context
0 commit comments