7 Probably remove the parameter mapping as well for iterators,
8 and just embed the knowledge on the parameter class.
10 Moving Iterators/Anonymous to a more comprehensive Field-based setup
11 --------------------------------------------------------------------
14 Maybe turn LocalVariableReference into Field access?
17 One issue to consider if iterators/references in anon-methods
18 to a setup where we use a FieldExpr plus a "clever" instance
19 expression is that the LocalVariableReference will transform
20 itself into something else during Resolve, but the resulting
21 information must still be tracked in the LocalInfo
23 I believe this is because:
25 EmitMeta should not generate locals for things that have been
26 captured, so it is important to track this information.
28 Which means that we eliminate the knowledge about captured
29 information from LocalVariableReference/ParameterReference
30 during the Emit phase, but we still need it during the resolve
35 In foreach, I do not like the if (.. InIterator) special
36 handling that we have there, it should be handled differently.
41 Maybe move this to Topblock? There is a fixme there.
47 Move MapVariable from CodeGen into Block?
51 Necesitamos que a-capture8.cs pruebe si la asignacion funciona o no.
55 Al emitir instancias de variables
56 (EmitCaptureVariableInstance) parece ser que el loop de iteracion:
58 while (si.ScopeBlock.ID != li.Block.ID)
60 está mas actulizado que el codigo similar para parámetros, es posible
61 que sea bitrot de parámetros o que en los parámetros usamos otra estrategia
62 (lo segundo es más razonable).
66 En algún lugar no pongo el `FieldBuilder' a un valor con los
67 iteradores, ver expression.cs: 3616, local_info.FieldBuilder es nulo.
71 a-parameter4.cs falla por que no se liga el método anónimo
76 CaptureContext cc = ContextForParameter (ec.CurrentBlock.Toplevel, name);
78 cc.EmitParameter (ec, name);
82 That should be a static method, and call the instance method
83 in the right CaptureContext, instead of having the CaptureContext
88 The code that links ScopeInfos together, its replicated in 3 places.
92 Need to audit the code now that use DeclareLocal, and that this uses
93 a differnent code path than the main mcs.
97 We can optimize and make sure that we point to a separate class that
98 only holds the parameters.
100 We need to nest anonymous method hosts as anonymous classes, currently
101 they are all toplevel.
103 Need to fix the order in which types are closed: currently we are not
104 compatible with the MS requirement that the parent has to be created
105 before the children are.
107 Would be nice to name the anonymous methods after the method container name.
111 We cluster blocks at the scope level, not at the level the declaration
112 when its really needed:
128 So we cluster them on separate anonymous helper classes, which
129 means the resulting is not as efficient.
131 Optimization from MS:
133 When creating an anonymous method that is static, cache its value.
135 I do not like the call to DoInit() in anonymous.cs, move it?
137 Parameter assignment seems too simple.
139 Tests and pending features:
141 Support access to parameters of a delegate (see a11.cs)
143 How do parameters map to nested anonymous methods?
145 Helper classes should be nested classes of the original host class.
146 (permission: access private fields from another part)
148 Switch statement is broken (because it uses ILGenerator during
149 the Resolve phase, which with the `anonymous' branch is no longer
150 the case: so we have to delay the creation of labels until they
151 are needed, during the Emit phase).
153 Iteratorks are broken.
157 For testing, set ec.IG == null during resolve, restore value
160 Currently it is commented out: there is a bug in the
161 statement.cs changes (see the old-statement.cs, the compiler
162 fails during bootstrap)
164 Need to set `S.R.CompilerServices.CompilerGeneratedAttribute'
165 on classes that the compiler generates.