back out the indexer change until I can figure it out
[mono.git] / mcs / mcs / TODO
1 Dead Code Elimination bugs:
2 ---------------------------
3
4         I should also resolve all the children expressions in Switch, Fixed, Using.
5
6 Major tasks:
7 ------------
8
9         Pinned and volatile require type modifiers that can not be encoded
10         with Reflection.Emit.
11
12         Properties and 17.6.3: Finish it.
13
14         Implement base indexer access.
15
16 readonly variables and ref/out
17         
18 BUGS
19 ----
20
21 * Check for Final when overriding, if the parent is Final, then we cant
22   allow an override.
23
24 * Interface indexers
25
26         I have not figured out why the Microsoft version puts an
27         `instance' attribute, and I am not generating this `instance' attribute.
28
29         Explanation: The reason for the `instance' attribute on
30         indexers is that indexers only apply to instances
31
32 * Arrays
33
34         We need to make sure at *compile time* that the arguments in
35         the expression list of an array creation are always positive.
36
37 * Indexer bugs:
38
39         the following wont work:
40
41         x [0] = x [1] = N
42
43         if x has indexers, the value of x [N] set is set to void.  This needs to be
44         fixed.
45
46 * Array declarations
47
48         Multi-dim arrays are declared as [,] instead of [0..,0..]
49
50 * Break/Continue statements
51
52         A finally block should reset the InLoop/LoopBegin/LoopEnd, as
53         they are logically outside the scope of the loop.
54
55 * Break/continue part 2.
56
57         They should transfer control to the finally block if inside a try/catch
58         block.
59
60 * Method Registration and error CS111
61
62         The way we use the method registration to signal 111 is wrong.
63         
64         Method registration should only be used to register methodbuilders,
65         we need an alternate method of checking for duplicates.
66
67 * We need to catch:
68
69         extern string Property {
70                 get { } 
71         }
72
73         The get there should only have a semicolon
74         
75 *
76 > // CSC sets beforefieldinit
77 > class X {
78 >   // .cctor will be generated by compiler
79 >   public static readonly object O = new System.Object ();
80 >   public static void Main () {}
81 > }
82
83
84 PENDING TASKS
85 -------------
86
87 * Merge test 89 and test-34
88
89 * Revisit
90
91         Primary-expression, as it has now been split into 
92         non-array-creation-expression and array-creation-expression.
93                 
94 * Static flow analysis
95
96         Required to warn about reachability of code and definite
97         assignemt as well as missing returns on functions.
98
99 * Code cleanup
100
101         The information when registering a method in InternalParameters
102         is duplicated, you can always get the types from the InternalParameters
103
104 * Emit modreq for volatiles
105
106         Handle modreq from public apis.
107
108 * Emit `pinned' for pinned local variables.
109
110         Both `modreq' and pinned will require special hacks in the compiler.
111
112 * Make sure that we are pinning the right variable
113
114 * Maybe track event usage?  Currently I am not tracking these, although they
115   are fields.
116
117 * Merge tree.cs, rootcontext.cs
118
119 OPTIMIZATIONS
120 -------------
121
122 * Implement loop inversion for `For' as well.
123
124 * There is too much unshared code between MemberAccess.Resolve and SimpleName
125   resolve.  
126  
127 * User Defined Conversions is doing way too many calls to do union sets that are not needed
128
129 * Add test case for destructors
130
131 * Places that use `Ldelema' are basically places where I will be
132   initializing a value type.  I could apply an optimization to 
133   disable the implicit local temporary from being created (by using
134   the method in New).
135
136 * Dropping TypeContainer as an argument to EmitContext
137
138         My theory is that I can get rid of the TypeBuilder completely from
139         the EmitContext, and have typecasts where it is used (from
140         DeclSpace to where it matters).  
141
142         The only pending problem is that the code that implements Aliases
143         is on TypeContainer, and probably should go in DeclSpace.
144
145 * Casts need to trigger a name resolution against types only.
146
147         currently we use a secret hand shake, probably we should use
148         a differen path, and only expressions (memberaccess, simplename)
149         would participate in this protocol.
150
151 * Use of local temporary in UnaryMutator
152
153         We should get rid of the Localtemporary there for some cases
154
155 * Emitcontext
156
157         Do we really need to instanciate this variable all the time?
158
159         It could be static for all we care, and just use it for making
160         sure that there are no recursive invocations on it.
161
162 * Use of EmitBranchable
163
164         Currently I use brfalse/brtrue in the code for statements, instead of
165         using the EmitBranchable function that lives in Binary
166
167 * ConvertImplicit
168
169         Currently ConvertImplicit will not catch things like:
170
171         - IntLiteral in a float context to generate a -FloatLiteral.
172         Instead it will perform an integer load followed by a conversion.
173
174 * Tests
175
176         Write tests for the various reference conversions.  We have
177         test for all the numeric conversions.
178
179 * Optimizations
180
181         In Indexers and Properties, probably support an EmitWithDup
182         That emits the code to call Get and then leaves a this pointer
183         in the stack, so that later a Store can be emitted using that
184         this pointer (consider Property++ or Indexer++)
185
186 * Optimizations: variable allocation.
187
188         When local variables of a type are required, we should request
189         the variable and later release it when we are done, so that
190         the same local variable slot can be reused later on.
191
192 * Add a cache for the various GetArrayMethod operations.
193
194 * TypeManager.FindMembers:
195
196         Instead of having hundreds of builder_to_blah hash table, have
197         a single one that maps a TypeBuilder `t' to a set of classes
198         that implement an interface that supports FindMembers.
199
200 * MakeUnionSet Callers
201
202         If the types are the same, there is no need to compute the unionset,
203         we can just use the list from one of the types.
204
205 * Factor all the FindMembers in all the FindMembers providers.
206
207 * Factor the lookup code for class declarations an interfaces
208   (interface.cs:GetInterfaceByName)
209
210 RECOMMENDATIONS
211 ---------------
212
213 * Use of lexer.Location in the parser
214
215         Currently we do:
216
217         TOKEN nt TERMINAL nt TERMINAL nt3 {
218                 $$ = new Blah ($2, $4, $6, lexer.Location);
219         }
220
221         This is bad, because the lexer.Location is for the last item in `nt3'
222
223         We need to change that to use this pattern:
224
225         TOKEN { oob_stack.Push (lexer.Location) } nt TERMINAL nt TERMINAL nt3 {
226                 $$ = new Blah ($3, $5, $7, (Location) oob_stack.Pop ());
227         }
228
229         Notice how numbering of the arguments changes as the
230         { oob_stack.Push (lexer.Location) } takes a "slot"  in the productions.
231
232 * local_variable_declaration
233
234         Not sure that this grammar is correct, we might have to
235         resolve this during semantic analysis.
236
237 * Idea
238
239         MethodGroupExpr
240
241         These guys should only appear as part of an Invocation, so we
242         probably can afford to have a special callback:
243
244                 Expression.ResolveAllowMemberGroups
245
246         This is only called by Invocation (or anyone that consumes 
247         MethodGroupExprs)
248
249         And the regular DoResolve and DoResolveLValue do emit the error
250         654 `Method referenced without argument list'.  
251
252         Otherwise, a resolution will return a MethodGroupExpr which is
253         not guaranteed to have set its `Expression.Type' to a non-null
254         value.