Removed stale comments from Object.cs
[mono.git] / mcs / mcs / TODO
1 Major tasks:
2 ------------
3
4         Pinned and volatile require type modifiers that can not be encoded
5         with Reflection.Emit.
6
7         Properties and 17.6.3: Finish it.
8
9         Implement base indexer access.
10
11 MethodGroupExpr
12
13         These guys should only appear as part of an Invocation, so we
14         probably can afford to have a special callback:
15
16                 Expression.ResolveAllowMemberGroups
17
18         This is only called by Invocation (or anyone that consumes 
19         MethodGroupExprs)
20
21         And the regular DoResolve and DoResolveLValue do emit the error
22         654 `Method referenced without argument list'.  
23
24         Otherwise, a resolution will return a MethodGroupExpr which is
25         not guaranteed to have set its `Expression.Type' to a non-null
26         value.
27
28 readonly variables and ref/out
29         
30 BUGS
31 ----
32
33 * Check for Final when overriding, if the parent is Final, then we cant
34   allow an override.
35
36 * Add test case for destructors
37
38 * Do not declare a .property on things that are just implementations, that
39   comes from the parent, just do the method.
40
41 * Currently the code path for 108/109 reporting is not being ran for methods
42   as we need to compare method signatures.  But since we retrieve the expensive
43   method arguments in the method, we probably should do 108/109 processing there.
44
45 * Emit warning on hiding members without NEW not only in members.
46
47 * Implement visibility.
48  
49 * Adding variables.
50
51         We do add variables in a number of places, and this is erroneous:
52
53         void a (int b)
54         {
55                 int b;
56         }
57
58         Also:
59
60         void a (int b)
61         {
62                 foreach (int b ...)
63                         ;
64         }
65
66 * Visibility
67
68         I am not reporting errors on visibility yet.
69
70 * Interface indexers
71
72         I have not figured out why the Microsoft version puts an
73         `instance' attribute, and I am not generating this `instance' attribute.
74
75         Explanation: The reason for the `instance' attribute on
76         indexers is that indexers only apply to instances
77
78 * Arrays
79
80         We need to make sure at *compile time* that the arguments in
81         the expression list of an array creation are always positive.
82
83 * Implement dead code elimination in statement.cs
84
85         It is pretty simple to implement dead code elimination in 
86         if/do/while
87
88 * Indexer bugs:
89
90         the following wont work:
91
92         x [0] = x [1] = N
93
94         if x has indexers, the value of x [N] set is set to void.  This needs to be
95         fixed.
96
97 * Array declarations
98
99         Multi-dim arrays are declared as [,] instead of [0..,0..]
100
101 * Break/Continue statements
102
103         A finally block should reset the InLoop/LoopBegin/LoopEnd, as
104         they are logically outside the scope of the loop.
105
106 * Break/continue part 2.
107
108         They should transfer control to the finally block if inside a try/catch
109         block.
110
111 * Method Registration and error CS111
112
113         The way we use the method registration to signal 111 is wrong.
114         
115         Method registration should only be used to register methodbuilders,
116         we need an alternate method of checking for duplicates.
117
118 * We need to catch:
119
120         extern string Property {
121                 get { } 
122         }
123
124         The get there should only have a semicolon
125         
126 *
127 > // CSC sets beforefieldinit
128 > class X {
129 >   // .cctor will be generated by compiler
130 >   public static readonly object O = new System.Object ();
131 >   public static void Main () {}
132 > }
133
134
135 PENDING TASKS
136 -------------
137
138 * Constant Folding
139
140         Constant Folding does not take into account Enumerations, we should maybe
141         extract the underlying value, and constant fold on it.
142
143 * Revisit
144
145         Primary-expression, as it has now been split into 
146         non-array-creation-expression and array-creation-expression.
147                 
148 * Static flow analysis
149
150         Required to warn about reachability of code and definite
151         assignemt as well as missing returns on functions.
152
153 * Code cleanup
154
155         The information when registering a method in InternalParameters
156         is duplicated, you can always get the types from the InternalParameters
157
158 * Emit modreq for volatiles
159
160         Handle modreq from public apis.
161
162 * Emit `pinned' for pinned local variables.
163
164         Both `modreq' and pinned will require special hacks in the compiler.
165
166 * Make sure that we are pinning the right variable
167
168 OPTIMIZATIONS
169 -------------
170
171 * Use of local temporary in UnaryMutator
172
173         We should get rid of the Localtemporary there for some cases
174
175 * Emitcontext
176
177         Do we really need to instanciate this variable all the time?
178
179         It could be static for all we care, and just use it for making
180         sure that there are no recursive invocations on it.
181
182 * Static-ization
183
184         Since AppDomain exists, maybe we can get rid of all the stuff
185         that is part of the `compiler instance' and just use globals
186         everywhere.
187
188
189 * Constructors
190
191         Currently it calls the parent constructor before initializing fields.
192         It should do it the other way around.
193
194 * Use of EmitBranchable
195
196         Currently I use brfalse/brtrue in the code for statements, instead of
197         using the EmitBranchable function that lives in Binary
198
199 * ConvertImplicit
200
201         Currently ConvertImplicit will not catch things like:
202
203         - IntLiteral in a float context to generate a -FloatLiteral.
204         Instead it will perform an integer load followed by a conversion.
205
206 * Tests
207
208         Write tests for the various reference conversions.  We have
209         test for all the numeric conversions.
210
211 * Remove the tree dumper, cleanup `public readonly' 
212
213         And make all the stuff which is `public readonly' be private unless
214         required.
215
216 * Optimizations
217
218         In Indexers and Properties, probably support an EmitWithDup
219         That emits the code to call Get and then leaves a this pointer
220         in the stack, so that later a Store can be emitted using that
221         this pointer (consider Property++ or Indexer++)
222
223
224 * Optimizations: variable allocation.
225
226         When local variables of a type are required, we should request
227         the variable and later release it when we are done, so that
228         the same local variable slot can be reused later on.
229
230 * Add a cache for the various GetArrayMethod operations.
231
232 * Optimization:
233
234         Do not use StatementCollections, use ArrayLists of Statements,
235         and then "copy" it out to arrays.  Then reuse the existing
236         Statement structures.
237
238 * TypeManager.FindMembers:
239
240         Instead of having hundreds of builder_to_blah hash table, have
241         a single one that maps a TypeBuilder `t' to a set of classes
242         that implement an interface that supports FindMembers.
243
244 * MakeUnionSet Callers
245
246         If the types are the same, there is no need to compute the unionset,
247         we can just use the list from one of the types.
248
249 RECOMMENDATIONS
250 ---------------
251
252 * Use of lexer.Location in the parser
253
254         Currently we do:
255
256         TOKEN nt TERMINAL nt TERMINAL nt3 {
257                 $$ = new Blah ($2, $4, $6, lexer.Location);
258         }
259
260         This is bad, because the lexer.Location is for the last item in `nt3'
261
262         We need to change that to use this pattern:
263
264         TOKEN { oob_stack.Push (lexer.Location) } nt TERMINAL nt TERMINAL nt3 {
265                 $$ = new Blah ($3, $5, $7, (Location) oob_stack.Pop ());
266         }
267
268         Notice how numbering of the arguments changes as the
269         { oob_stack.Push (lexer.Location) } takes a "slot"  in the productions.
270
271 * local_variable_declaration
272
273         Not sure that this grammar is correct, we might have to
274         resolve this during semantic analysis.
275
276
277 * Try/Catch
278
279         Investigate what is  the right value to return  from `Emit' in
280         there (ie, for the `all code paths return')
281         
282
283 * Optimizations
284
285         Only create one `This' instance per class, and reuse it.
286
287         Maybe keep a pool of constants/literals (zero, 1)?
288
289 ************
290 Potential bug:
291
292         We would need to decode the shortname before we lookup members?
293         
294         Maybe not.
295
296 interface I {
297         void A ();
298 }
299
300 class X : I {
301         void I.A ();
302 }
303
304 class Y : X, I {
305         void I.A () {}
306 }
307
308
309
310 *************
311