2001-10-26 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / mcs / TODO
1 * Assignment
2
3         string a, b;
4         property string c;
5
6         a = c = b = "hello"
7
8         Problem is that setter properties do not return a value, so we must
9         create a temporary on the situation above to store the value of "b"
10         and then pass that on to "a".
11
12 * Optimizations
13
14         Handle if (!x) converting to remove the `!' and instead of using
15         a brfalse use a brtrue to jump to the end.
16
17 * LValueResolve
18
19         Maybe we should only call Resolve on RValues and LValueRsolve
20         on LValues so that DoREsolve can flag errors on properties
21         missing `get' and indexers without a get indexer.
22
23 * Emitcontext
24
25         Do we really need to instanciate this variable all the time?
26
27         It could be static for all we care, and just use it for making
28         sure that there are no recursive invocations on it.
29
30 * Static-ization
31
32         Since AppDomain exists, maybe we can get rid of all the stuff
33         that is part of the `compiler instance' and just use globals
34         everywhere.
35
36 * FindMembers
37
38         Move our utility FindMembers from TypeContainer to Decl, because interfaces
39         are also scanned with it.
40
41 * Ordering
42
43         Can a constant_expression invoke overloaded operators?
44         Explicit user-defined conversions?
45
46 * Visibility
47
48         I am not reporting errors on visibility yet.
49
50 * Enumerations
51
52         Currently I am not resolving enumerations.
53
54         Either I track them with `RecordEnum' as I do with classes,
55         structs and interfaces or I rewrite the code to visit type
56         containers and `walk' the enums with this process. 
57
58 * Known problems:
59
60   Cast expressions
61
62         They should should use:
63
64                 OPEN_PARENS type CLOSE_PARENS
65
66         instead of the current production which is wrong, because it
67         only handles a few cases.
68
69         Complex casts like:
70
71                 Array r = (string []) object
72
73         Wont be parsed.
74   
75 * Interfaces
76
77         For indexers, the output of ix2.cs is different from our
78         compiler and theirs.  They use a DefaultMemberAttribute, which
79         I have yet to figure out:
80
81         .class interface private abstract auto ansi INTERFACE
82         {
83                 .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) 
84                 = ( 01 00 04 49 74 65 6D 00 00 )                      // ...Item..
85                 ...
86         }
87
88 * Interface indexers
89
90         I have not figured out why the Microsoft version puts an
91         `instance' attribute, and I am not generating this `instance' attribute.
92
93         Explanation: The reason for the `instance' attribute on
94         indexers is that indexers only apply to instances
95
96 * Constructors
97
98         Currently it calls the parent constructor before initializing fields.
99         It should do it the other way around.
100
101 * Use of EmitBranchable
102
103         Currently I use brfalse/brtrue in the code for statements, instead of
104         using the EmitBranchable function that lives in Binary
105
106 * Create an UnimplementedExpcetion
107
108         And use that instead of plain Exceptions to flag compiler errors.
109
110 * ConvertImplicit
111
112         Currently ConvertImplicit will not catch things like:
113
114         - IntLiteral in a float context to generate a -FloatLiteral.
115         Instead it will perform an integer load followed by a conversion.
116
117 * In class.cs: Method.Define
118
119         Need to use FindMembers to lookup the member for reporting
120         whether a new is needed or not.  
121
122 * virtual-method.cs breaks
123
124         It breaks on the call to: new B ();
125
126         Where B is a class defined in the source code, my guess is that
127         the look for ".ctor" fails
128
129 * Foreach on structure returns does not work
130
131         I am generating invalid code instead of calling ldarga for the
132         structure, I am calling ldarg:
133
134         struct X {
135                 public IEnumerator GetEnumerator ();
136         }
137
138         X x;
139
140         foreach (object a in x){
141                 ...
142         }
143
144         I need to get the address of that bad boy
145
146 * Work todo:
147
148         Understand how methods are invoked on structs
149
150 * Using Alias
151
152         Need to reset the aliases for each compilation unit, so an
153         alias defined in a file does not have any effect on another one:
154
155         File.cs
156         =======
157         namespace A {
158                 using X = Blah;
159
160                 class Z : X {           <-- This X is `Blah' 
161         }
162
163         File2.cs
164         namespace {
165                 class Y : X {           <-- This X Is not `Blah' 
166                 }
167         }
168
169         I think we can implement Aliases by having an `Alias' context in all
170         the toplevel TypeContainers of a compilation unit.  The children typecontainers
171         just chain to the parents to resolve the information.
172
173         The driver advances the Alias for each file compiled, so that each file
174         has its own alias set.
175
176 * Tests
177
178         Write tests for the various reference conversions.  We have
179         test for all the numeric conversions.
180
181 * Handle destructors specially
182
183         Turn ~X () { a () } into:
184         void Finalize () { try { a (); } finally { base.Finalize (); } }
185
186 * Handle volatile
187
188 * Support Re-Throw exceptions:
189
190         try {
191                 X ();
192         } catch (SomeException e){
193                 LogIt ();
194                 throw;
195         }
196
197 * Implement lock()
198
199 * SimpleNames and ElementAccess
200
201         If a SimpleName makes it outside the ElementAccess, we should
202         flag a 246.  I am not sure the current hack in
203         Invocation.DoResolve is appropiate (catching 246 there), as I
204         am pretty sure, SimpleNames will appear elsewhere.
205
206 * Remove the tree dumper
207
208         And make all the stuff which is `public readonly' be private unless
209         required.
210
211 * Use of lexer.Location in the parser
212
213         Currently we do:
214
215         TOKEN nt TERMINAL nt TERMINAL nt3 {
216                 $$ = new Blah ($2, $4, $6, lexer.Location);
217         }
218
219         This is bad, because the lexer.Location is for the last item in `nt3'
220
221         We need to change that to use this pattern:
222
223         TOKEN { $$ = lexer.Location } nt TERMINAL nt TERMINAL nt3 {
224                 $$ = new Blah ($3, $5, $7, (Location) $2);
225         }
226
227         Notice how numbering of the arguments changes, as the { $$ =
228         lexer.Location } takes up a number
229
230