Remove dependency on Windows.Forms
[mono.git] / mcs / mcs / TODO
1 * Emitcontext
2
3         Do we really need to instanciate this variable all the time?
4
5         It could be static for all we care, and just use it for making
6         sure that there are no recursive invocations on it.
7
8 * Static-ization
9
10         Since AppDomain exists, maybe we can get rid of all the stuff
11         that is part of the `compiler instance' and just use globals
12         everywhere.
13
14 * FindMembers
15
16         Move our utility FindMembers from TypeContainer to Decl, because interfaces
17         are also scanned with it.
18
19 * Visibility
20
21         I am not reporting errors on visibility yet.
22
23 * Enumerations
24
25         Currently I am not resolving enumerations.
26
27         Either I track them with `RecordEnum' as I do with classes,
28         structs and interfaces or I rewrite the code to visit type
29         containers and `walk' the enums with this process. 
30
31 * Known problems:
32
33   Cast expressions
34
35         They should should use:
36
37                 OPEN_PARENS type CLOSE_PARENS
38
39         instead of the current production which is wrong, because it
40         only handles a few cases.
41
42         Complex casts like:
43
44                 Array r = (string []) object
45
46         Wont be parsed.
47   
48 * Interfaces
49
50         For indexers, the output of ix2.cs is different from our
51         compiler and theirs.  They use a DefaultMemberAttribute, which
52         I have yet to figure out:
53
54         .class interface private abstract auto ansi INTERFACE
55         {
56                 .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) 
57                 = ( 01 00 04 49 74 65 6D 00 00 )                      // ...Item..
58                 ...
59         }
60
61 * Interface indexers
62
63         I have not figured out why the Microsoft version puts an
64         `instance' attribute, and I am not generating this `instance' attribute.
65
66         Explanation: The reason for the `instance' attribute on
67         indexers is that indexers only apply to instances
68
69 * Constructors
70
71         Currently it calls the parent constructor before initializing fields.
72         It should do it the other way around.
73
74 * Use of EmitBranchable
75
76         Currently I use brfalse/brtrue in the code for statements, instead of
77         using the EmitBranchable function that lives in Binary
78
79 * Create an UnimplementedExpcetion
80
81         And use that instead of plain Exceptions to flag compiler errors.
82
83 * ConvertImplicit
84
85         Currently ConvertImplicit will not catch things like:
86
87         - IntLiteral in a float context to generate a -FloatLiteral.
88         Instead it will perform an integer load followed by a conversion.
89
90 * In class.cs: Method.Define
91
92         Need to use FindMembers to lookup the member for reporting
93         whether a new is needed or not.  
94
95 * virtual-method.cs breaks
96
97         It breaks on the call to: new B ();
98
99         Where B is a class defined in the source code, my guess is that
100         the look for ".ctor" fails
101
102 * Foreach on structure returns does not work
103
104         I am generating invalid code instead of calling ldarga for the
105         structure, I am calling ldarg:
106
107         struct X {
108                 public IEnumerator GetEnumerator ();
109         }
110
111         X x;
112
113         foreach (object a in x){
114                 ...
115         }
116
117         I need to get the address of that bad boy
118
119 * Using Alias
120
121         Need to reset the aliases for each compilation unit, so an
122         alias defined in a file does not have any effect on another one:
123
124         File.cs
125         =======
126         namespace A {
127                 using X = Blah;
128
129                 class Z : X {           <-- This X is `Blah' 
130         }
131
132         File2.cs
133         namespace {
134                 class Y : X {           <-- This X Is not `Blah' 
135                 }
136         }
137
138         I think we can implement Aliases by having an `Alias' context in all
139         the toplevel TypeContainers of a compilation unit.  The children typecontainers
140         just chain to the parents to resolve the information.
141
142         The driver advances the Alias for each file compiled, so that each file
143         has its own alias set.
144
145 * Tests
146
147         Write tests for the various reference conversions.  We have
148         test for all the numeric conversions.
149
150 * Handle destructors specially
151
152         Turn ~X () { a () } into:
153         void Finalize () { try { a (); } finally { base.Finalize (); } }
154
155 * Handle volatile
156
157 * Support Re-Throw exceptions:
158
159         try {
160                 X ();
161         } catch (SomeException e){
162                 LogIt ();
163                 throw;
164         }
165
166 * Remove the tree dumper
167
168         And make all the stuff which is `public readonly' be private unless
169         required.
170
171 * Use of lexer.Location in the parser
172
173         Currently we do:
174
175         TOKEN nt TERMINAL nt TERMINAL nt3 {
176                 $$ = new Blah ($2, $4, $6, lexer.Location);
177         }
178
179         This is bad, because the lexer.Location is for the last item in `nt3'
180
181         We need to change that to use this pattern:
182
183         TOKEN { $$ = lexer.Location } nt TERMINAL nt TERMINAL nt3 {
184                 $$ = new Blah ($3, $5, $7, (Location) $2);
185         }
186
187         Notice how numbering of the arguments changes, as the { $$ =
188         lexer.Location } takes up a number
189
190 * Method Names
191
192         Method names could be; `IFACE.NAME' in the method declaration,
193         stating that they implement a specific interface method.
194
195         We currently fail to parse it.
196
197 * Namespaces
198
199         Apparently:
200
201                 namespace X {
202                 }
203
204                 namespace X {
205                 }
206
207         Is failing to create a single namespace
208
209 * Arrays
210
211         We need to make sure at *compile time* that the arguments in
212         the expression list of an array creation are always positive.
213
214 * Fix the new parameter mess that we introduced to support ref/outo
215
216 * Reducer and -Literal
217
218         Maybe we should never handle -Literal in Unary expressions and let
219         the reducer take care of it always?
220
221 * Implement dead code elimination in statement.cs
222
223         It is pretty simple to implement dead code elimination in 
224         if/do/while
225
226 * Implement short circuit evaluation.
227
228         Currently our and/or operations do not implement short circuit
229         evaluation.  
230
231 * Foreach and arrays
232
233         Support foreach (T t in Array)
234
235         And optimize to deal with the array rather than getting the enumerator
236         out of it.
237
238 * Indexer bugs:
239
240         the following wont work:
241
242         x [0] = x [1] = N
243
244         if x has indexers, the value of x [N] set is set to void.  This needs to be
245         fixed.
246
247 * Preincrement/pre-decrement is not working on array elements. 
248
249         We are catching this now.  But it does not work.
250
251 * local_variable_declaration
252
253         Not sure that this grammar is correct, we might have to
254         resolve this during semantic analysis.