Initial import of the Generic MCS tree.
[mono.git] / mcs / gmcs / ChangeLog
1 2003-07-22  Ravi Pratap  <ravi@ximian.com>
2
3         * expression.cs (Invocation.OverloadResolve): Follow the spec more
4         closely: we eliminate methods in base types when we have an
5         applicable method in a top-level type.
6
7         Please see section 14.5.5.1 for an exact description of what goes
8         on. 
9
10         This fixes bug #45127 and a host of other related to corlib compilation.
11
12         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13         array is the method corresponding to the top-level type (this is
14         because of the changes made to icall.c) so we change this
15         accordingly.
16
17         (MethodGroupExpr.Name): This too.
18
19         * typemanager.cs (GetElementType): New method which does the right
20         thing when compiling corlib. 
21
22         * everywhere: Make use of the above in the relevant places.
23
24 2003-07-22  Martin Baulig  <martin@ximian.com>
25
26         * cs-parser.jay (invocation_expression): Moved
27         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
28         `cast_expression', but create a InvocationOrCast which later
29         resolves to either an Invocation or a Cast.
30
31         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
32         method; call this before EmitStatement() to make sure that this
33         expression can be used as a statement.
34
35         * expression.cs (InvocationOrCast): New class; resolves to either
36         an Invocation or a Cast.
37
38         * statement.cs (StatementExpression): Call ResolveStatement() on
39         the ExpressionStatement before emitting it.
40
41 2003-07-21  Martin Baulig  <martin@ximian.com>
42
43         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
44         `ref' and `out' attributes match; fixes #46220.
45         (MemberAccess.ResolveMemberAccess): You can't reference a type
46         through an expression; fixes #33180.
47         (Indexers.GetIndexersForType): Don't return the indexers from
48         interfaces the class implements; fixes #46502.
49
50 2003-07-21  Martin Baulig  <martin@ximian.com>
51
52         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
53         CS0661 checks; fixes bug #30442.
54
55 2003-07-21  Martin Baulig  <martin@ximian.com>
56
57         * decl.cs (AdditionResult): Added `Error'.
58
59         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
60
61         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
62         cs0031.cs actually work.
63
64  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
65  
66         * cs-parser.jay (namespace_name): do not use
67         namespace_or_type_name, use qualified_identifier, because
68         namespace_or_type_name will soon return a composed expression
69         instead of a string.
70  
71         (namespace_or_type_name): Instead of returning a string, now this
72         production returns an expression.
73  
74         * codegen.cs (EmitContext): Setup IsGeneric property based on
75         whether our DeclSpace is generic, our the method is generic.
76  
77         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
78         the method is generic.
79  
80         * cs-parser.jay (type_arguments, opt_type_argument_list,
81         type_parameters, type_parameter_list, opt_type_parameter_list,
82         type_parameter,, opt_type_parameter_constraints_clauses,
83         type_parameter_constraints_clauses,
84         type_parameter_constraint_clause, type_parameter_constraint,
85         interface_constraints): Add new production
86  
87         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
88         DeclSpace is generic or not.
89  
90         (DeclSpace.SetParameterInfo): New routine, used to set the
91         parameter info for a type.
92  
93         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
94         returns a GenericTypeExpr
95  
96         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
97         generic, lookup the generic argument.
98  
99         * attribute.cs: Do not allow TypeParameterExpressions in
100         Attributes.
101  
102         * class.cs: Do not allow the Main method to be defined in a
103         Generic container.
104  
105         * expression.cs (SizeOf): Do not allow generic types to be used as
106         arguments to sizeof.
107  
108         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
109         it: whether a type is generic or not.  Only works for types we are
110         currently building for now.
111         
112 2003-07-20  Martin Baulig  <martin@ximian.com>
113
114         * namespace.cs: Fixed that bug which caused a crash when compiling
115         the debugger's GUI.
116
117 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
118
119         * typemanager.cs (LookupTypeReflection): Never expose types which
120         are NotPublic, NestedPrivate, NestedAssembly, or
121         NestedFamANDAssem.  We used to return these, and later do a check
122         that would report a meaningful error, but the problem is that we
123         would not get the real match, if there was a name override.
124
125 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
126
127         * namespace.cs (Namespace, Name): Do not compute the namespace
128         name dynamically, compute it in the constructor.  This reduced
129         memory usage by 1697 KB.
130
131         * driver.cs: Use --pause to pause at the end.
132
133 2003-07-17  Peter Williams  <peter@newton.cx>
134
135         * Makefile: Change the name of the test target so that it doesn't
136         conflict with the recursive test target.
137
138 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
139
140         * expression.cs (LocalVariableReference.Emit, EmitAssign,
141         AddressOf): Do not use EmitThis, that was wrong, use the actual
142         this pointer.
143
144 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
145
146         * class.cs (MethodData.Define): While checking if a method is an
147         interface implementation, improve the test: If we are not public
148         (use new test here: use the computed MethodAttributes directly,
149         instead of the parsed modifier flags) check if the `implementing'
150         method comes from an interface or not.
151
152         * pending.cs (VerifyPendingMethods): Slightly better error
153         message.
154
155         * makefile: add test target that does the mcs bootstrap.
156
157 2003-07-16  Ravi Pratap  <ravi@ximian.com>
158
159         * interface.cs (Define): Do nothing here since there are no
160         members to populate etc. Move the attribute emission out of here
161         since this was just totally the wrong place to put it. Attribute
162         application happens during the 'Emit' phase, not in the 'Define'
163         phase.
164
165         (Emit): Add this method and move the attribute emission here
166
167         * rootcontext.cs (EmitCode): Call the Emit method on interface
168         types too.
169
170 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
171
172         * expression.cs (OverloadResolve): Report error only if Location
173         is not 'Null' which means that there was a probe going on.
174
175 2003-07-14  Martin Baulig  <martin@ximian.com>
176
177         * expression.cs (ConditionalLogicalOperator): New public class to
178         implement user defined conditional logical operators.
179         This is section 14.11.2 in the spec and bug #40505.
180
181 2003-07-14  Martin Baulig  <martin@ximian.com>
182
183         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
184
185 2003-07-14  Martin Baulig  <martin@ximian.com>
186
187         * codegen.cs (EmitContext.InFixedInitializer): New public field.
188
189         * ecore.cs (IVariable.VerifyFixed): New interface method.
190
191         * expression.cs (Unary.ResolveOperator): When resolving the `&'
192         operator, check whether the variable is actually fixed.  Fixes bug
193         #36055.  Set a variable definitely assigned when taking its
194         address as required by the spec.
195
196         * statement.cs (LocalInfo.IsFixed): New field.
197         (LocalInfo.MakePinned): Set `IsFixed' to true.
198
199 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
200
201         * attribute.cs (Attribute.Resolve): While doing a Member lookup
202         for .ctors, ensure that we only ask for members declared in the
203         attribute type (BindingFlags.DeclaredOnly).
204
205         Fixes bug #43632.
206
207         * expression.cs (Error_WrongNumArguments): Report error 1501
208         correctly the way CSC does.
209
210 2003-07-13  Martin Baulig  <martin@ximian.com>
211
212         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
213         lookup on the fully qualified name, to make things like "X.X" work
214         where "X.X" is a fully qualified type name, but we also have a
215         namespace "X" in the using list.  Fixes #41975.
216
217 2003-07-13  Martin Baulig  <martin@ximian.com>
218
219         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
220         function. If we're a CompoundAssign, we need to create an embedded
221         CompoundAssign, not an embedded Assign.
222         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
223         Fixes #45854.
224
225 2003-07-13  Martin Baulig  <martin@ximian.com>
226
227         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
228         work to fix bug #46088.
229
230 2003-07-13  Ravi Pratap <ravi@ximian.com>
231
232         * class.cs (Operator.Emit): Do not emit attributes here - it is
233         taken care of by the Method class that we delegate too. This takes
234         care of bug #45876.
235         
236 2003-07-10  Martin Baulig  <martin@ximian.com>
237
238         * expression.cs (TypeOfVoid): New class.
239         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
240
241 2003-07-10  Martin Baulig  <martin@ximian.com>
242
243         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
244         bug #35957.
245
246 2003-07-10  Martin Baulig  <martin@ximian.com>
247
248         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
249         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
250
251         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
252
253         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
254
255 2003-07-10  Martin Baulig  <martin@ximian.com>
256
257         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
258         of decimal.  Fixes #42850.
259
260         NOTE: I also fixed the created byte blob, but this doesn't work on
261         the MS runtime and csc never produces any byte blobs for decimal
262         arrays.
263
264 2003-07-10  Martin Baulig  <martin@ximian.com>
265
266         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
267         structs; fixes #32068.
268         (Block.AddChildVariableNames): Fixed #44302.
269
270 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
271
272         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
273         
274 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
275
276         * attribute.cs: And this test is onger needed.
277
278 2003-07-08  Martin Baulig  <martin@ximian.com>
279
280         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
281         inaccessible types.  Fixes #36313.
282
283         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
284
285         * namespace.cs (NamespaceEntry): Create implicit entries for all
286         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
287         implicit entries for N1.N2 and N1.
288
289 2003-07-08  Martin Baulig  <martin@ximian.com>
290
291         Rewrote the handling of namespaces to fix a lot of the issues
292         wrt. `using' aliases etc.
293
294         * namespace.cs (Namespace): Splitted this class into a
295         per-assembly `Namespace' and a per-file `NamespaceEntry'.
296
297         * typemanager.cs (TypeManager.IsNamespace): Removed.
298         (TypeManager.ComputeNamespaces): Only compute namespaces from
299         loaded assemblies here, not the namespaces from the assembly we're
300         currently compiling.
301
302 2003-07-08  Martin Baulig  <martin@ximian.com>
303
304         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
305
306 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
307
308         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
309         already fixed it.  
310
311         I thought about the memory savings here, but LookupTypeReflection
312         is used under already very constrained scenarios.  Compiling
313         corlib or mcs only exposes one hit, so it would not really reduce
314         any memory consumption.
315
316 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
317
318         * typemanager.cs: fixes bug #45889 by only adding public types from
319         other assemblies to the list of known types.
320
321 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
322
323         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
324         on the type we resolved.
325
326 2003-07-05  Martin Baulig  <martin@ximian.com>
327
328         * pending.cs (PendingImplementation.ParentImplements): Don't
329         create the proxy if the parent is abstract.
330
331         * class.cs (TypeContainer.DefineIndexers): Process explicit
332         interface implementations first.  Fixes #37714.
333
334 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
335
336         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
337         defined recursively;  but since we modify the input parameters
338         (left is set to `this' temporarily), we reset this value if the
339         left_is_explicit is false, which gives the original semantics to
340         the code.  
341
342         * literal.cs (NullPointer): new class used to represent a null
343         literal in a pointer context.
344
345         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
346         type is a pointer, use a NullPointer object instead of a
347         NullLiteral.   Closes 43687
348
349         (ExplicitConversion): Convert pointer values using
350         the conv opcode to the proper type.
351
352         * ecore.cs (New): change ValueTypeVariable property into a method,
353         that returns whether the valuetype is suitable for being used.
354
355         * expression.cs (Binary.DoNumericPromotions): Only return if we
356         the int constant was a valid uint, and we can return both left and
357         right as uints.  If not, we continue processing, to trigger the
358         type conversion.  This fixes 39018.
359
360         * statement.cs (Block.EmitMeta): During constant resolution, set
361         the CurrentBlock property on the emitcontext, so that we resolve
362         constants propertly.
363
364 2003-07-02  Martin Baulig  <martin@ximian.com>
365
366         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
367         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
368
369         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
370         than emitting it here.
371
372         * statement.cs: Fixed some more flow analysis bugs.
373
374 2003-07-02  Martin Baulig  <martin@ximian.com>
375
376         * class.cs (MethodData.Define): When implementing interface
377         methods, set Final unless we're Virtual.
378
379         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
380         check work for interface methods.
381
382 2003-07-01  Martin Baulig  <martin@ximian.com>
383
384         * ecore.cs (EmitContext.This): Replaced this property with a
385         GetThis() method which takes a Location argument.  This ensures
386         that we get the correct error location for a CS0188.
387
388 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
389
390         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
391         ImplicitStandardConversion.
392
393         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
394
395 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
396
397         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
398         optimization.
399
400 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
401
402         * class.cs (Constructor.Define): Turn off initlocals for unsafe
403         constructors.
404
405         (MethodData.Define): Turn off initlocals for unsafe methods.
406
407 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
408
409         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
410         complete;  Fixes #37521.
411
412         * delegate.cs: Use Modifiers.TypeAttr to compute the
413         TypeAttributes, instead of rolling our own.  This makes the flags
414         correct for the delegates.
415
416 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
417
418         * class.cs (Constructor.Define): Set the private flag for static
419         constructors as well.
420
421         * cs-parser.jay (statement_expression): Set the return value to
422         null, to avoid a crash when we catch an error.
423
424 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
425
426         * cs-parser.jay: Applied patch from Jackson that adds support for
427         extern and unsafe modifiers to destructor declarations.
428
429         * expression.cs: Report error 21 if the user is trying to index a
430         System.Array.
431
432         * driver.cs: Add an error message, suggested by the bug report.
433
434         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
435         if we do not have a ": this ()" constructor initializer.  Fixes 45149
436
437 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
438
439         * namespace.cs: Add some information to reduce FAQs.
440
441 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
442
443         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
444         underlying enumeration types.  Fixes #43915.
445
446         * expression.cs: Treat ushort/short as legal values to be used in
447         bitwise operations.
448
449 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
450
451         * delegate.cs: transfer custom attributes for paramenters from
452         the delegate declaration to Invoke and BeginInvoke.
453
454 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
455
456         * attribute.cs: handle custom marshalers and emit marshal info
457         for fields, too.
458
459 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
460
461         * makefile.gnu: Added anonymous.cs to the compiler sources.
462
463 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
464
465         * iterators.cs: Change the name of the proxy class to include two
466         underscores.
467
468         * cs-parser.jay: Update grammar to include anonymous methods.
469         
470         * anonymous.cs: new file.
471
472 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
473
474         * class.cs (Field.Define): Add missing test for pointers and
475         safety. 
476
477 2003-05-27  Ravi Pratap  <ravi@ximian.com>
478
479         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
480         we use the stobj opcode.
481
482         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
483         since it wasn't the correct fix. 
484
485         It still is puzzling that we are required to use stobj for IntPtr
486         which seems to be a ValueType.
487
488 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
489
490         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
491         during regular simple name resolution.   Now, the trick is that
492         instead of returning for processing the simplename, we do a
493         TypeManager.LookupType (ie, a rooted lookup as opposed to a
494         contextual lookup type).   If a match is found, return that, if
495         not, return for further composition.
496
497         This fixes long-standing 30485.
498
499         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
500         using the address to initialize an object, do an Stobj instead of
501         using the regular Stelem.
502
503         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
504         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
505         Because if we are a BaseIndexerAccess that value will be true.
506         Fixes 43643.
507
508         * statement.cs (GotoCase.Resolve): Return after reporting an
509         error, do not attempt to continue. 
510
511         * expression.cs (PointerArithmetic.Emit): If our operand is a
512         long, convert our constants to match the operand before
513         multiplying.  Convert to I type before adding.   Fixes 43670.
514         
515 2003-05-14  Ravi Pratap  <ravi@ximian.com>
516
517         * enum.cs (ImplicitConversionExists) : Rename to
518         ImplicitEnumConversionExists to remove ambiguity. 
519
520         * ecore.cs (NullCast): New type of cast expression class which
521         basically is very similar to EmptyCast with the difference being
522         it still is a constant since it is used only to cast a null to
523         something else
524         (eg. (string) null)
525
526         * convert.cs (ImplicitReferenceConversion): When casting a null
527         literal, we return a NullCast.
528
529         * literal.cs (NullLiteralTyped): Remove - I don't see why this
530         should be around anymore.
531
532         The renaming (reported was slightly wrong). Corrections:
533
534         ConvertImplicitStandard -> ImplicitConversionStandard
535         ConvertExplicitStandard -> ExplicitConversionStandard
536
537         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
538         before passing them in !
539
540         * convert.cs (ImplicitConversionStandard): When comparing for
541         equal expr and target types, ensure that expr is not a
542         NullLiteral.
543
544         In general, we must not be checking (expr_type ==
545         target_type) in the top level conversion methods
546         (ImplicitConversion, ExplicitConversion etc). This checking is
547         done in the methods that they delegate to.
548
549 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
550
551         * convert.cs: Move Error_CannotConvertType,
552         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
553         ImplicitNumericConversion, ImplicitConversionExists,
554         ImplicitUserConversionExists, StandardConversionExists,
555         FindMostEncompassedType, FindMostSpecificSource,
556         FindMostSpecificTarget, ImplicitUserConversion,
557         ExplicitUserConversion, GetConversionOperators,
558         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
559         TryImplicitIntConversion, Error_CannotConvertImplicit,
560         ConvertImplicitRequired, ConvertNumericExplicit,
561         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
562         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
563         its own file.
564
565         Perform the following renames:
566         
567         StandardConversionExists -> ImplicitStandardConversionExists
568         ConvertImplicit -> ImplicitConversion
569         ConvertImplicitStandard -> ImplicitStandardConversion
570         TryImplicitIntConversion -> ImplicitIntConversion
571         ConvertImplicitRequired -> ImplicitConversionRequired
572         ConvertNumericExplicit -> ExplicitNumericConversion
573         ConvertReferenceExplicit -> ExplicitReferenceConversion
574         ConvertExplicit -> ExplicitConversion
575         ConvertExplicitStandard -> ExplicitStandardConversion
576
577 2003-05-19  Martin Baulig  <martin@ximian.com>
578
579         * statement.cs (TypeInfo.StructInfo): Made this type protected.
580         (TypeInfo): Added support for structs having structs as fields.
581
582         * ecore.cs (FieldExpr): Implement IVariable.
583         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
584         VariableInfo for the field.
585
586 2003-05-18  Martin Baulig  <martin@ximian.com>
587
588         * expression.cs (This.DoResolve): Report a CS0027 if we're
589         emitting a field initializer.
590
591 2003-05-18  Martin Baulig  <martin@ximian.com>
592
593         * expression.cs (This.ResolveBase): New public function.
594         (This.DoResolve): Check for CS0188.
595
596         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
597         This.Resolve().
598
599         * ecore.cs (MethodGroupExpr.DoResolve): Set the
600         `instance_expression' to null if we don't have any non-static
601         methods.
602
603 2003-05-18  Martin Baulig  <martin@ximian.com>
604
605         Reworked the way how local variables and parameters are handled by
606         the flow analysis code.
607
608         * statement.cs (TypeInfo, VariableMap): New public classes.
609         (VariableInfo): New public class.  This is now responsible for
610         checking whether a variable has been assigned.  It is used for
611         parameters and local variables.
612         (Block.EmitMeta): Take the InternalParameters as argument; compute
613         the layout of the flow vectors here.
614         (Block.LocalMap, Block.ParameterMap): New public properties.
615         (FlowBranching): The .ctor doesn't get the InternalParameters
616         anymore since Block.EmitMeta() now computes the layout of the flow
617         vector.
618         (MyStructInfo): This class is now known as `StructInfo' and nested
619         in `TypeInfo'; we don't access this directly anymore.
620
621         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
622         property and removed IsAssigned(), IsFieldAssigned(),
623         SetAssigned() and SetFieldAssigned(); we now call them on the
624         VariableInfo so we don't need to duplicate this code everywhere.
625
626         * expression.cs (ParameterReference): Added `Block block' argument
627         to the .ctor.
628         (LocalVariableReference, ParameterReference, This): The new
629         VariableInfo class is now responsible for all the definite
630         assignment stuff.
631
632         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
633         IsParameterAssigned, SetParameterAssigned): Removed.
634
635 2003-05-18  Martin Baulig  <martin@ximian.com>
636
637         * typemanager.cs (InitCoreTypes): Try calling
638         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
639         the 3-args-version.  Corlib now also needs our `void_type'.
640         (GetMethod): Added overloaded version which takes an optional
641         `bool report_errors' to allow lookups of optional methods.
642
643 2003-05-12  Martin Baulig  <martin@ximian.com>
644
645         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
646         only used for locals and not for parameters.
647
648 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
649
650         * support.cs (InternalParameters.ParameterType): Return the
651         ExternalType of the parameter.
652
653         * parameter.cs (Parameter.ExternalType): drop the two arguments,
654         they were unused.
655
656 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
657
658         * class.cs (MethodData.Define): Do not set the `newslot' on
659         interface members, if they are also flagged as "override".
660
661         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
662         better code for ++i and i++.  This only works for static fields
663         and local variables.
664
665         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
666         want to pull the DeclSpace out of the builder_to_declspace instead
667         of the TypeBuilder (like in TypeContainer.FindMembers).
668
669         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
670         instead of LookupTypeContainer.  Fixes the crash on .NET for
671         looking up interface members.
672
673         * const.cs: Create our own emit context during the Definition
674         stage, so that constants are evaluated in the proper context, when
675         a recursive definition happens.
676
677 2003-05-11  Martin Baulig  <martin@ximian.com>
678
679         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
680         new block for a switch section.
681         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
682         the adding/lookup in the switch block.  Fixes #39828.
683
684 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
685
686         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
687         functionality: I needed to convert the data after I had performed
688         the add/sub operation into the operands type size.
689
690         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
691         pass the type for the box operation, otherwise the resulting
692         object would have been of type object.
693
694         (BoxedCast): Add constructor to specify the type to box as.
695
696 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
697
698         * iterators.cs: I was reusing the `count' variable inadvertently,
699         take steps to not allow this to happen.
700
701 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
702
703         * attribute.cs (Attribute.Resolve): Params attributes are encoded
704         by creating an array at the point where the params starts and
705         putting all those arguments there, then adjusting the size of the
706         array.
707
708 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
709
710         * expression.cs (New.AddressOf): Implement interface
711         IMemoryLocation.  This is used when the `new' operator is used in
712         the context of an invocation to a method on a value type.
713
714         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
715         example. 
716
717         * namespace.cs: Also check the using aliases here.
718
719         * driver.cs: Move the test for using validity after the types have
720         been entered, so we do a single pass that also includes the using
721         aliases. 
722
723         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
724         in the regular case.   CreateSiblingForFinally is doing extra
725         error checking.
726
727         * attribute.cs (GetAttributeArgumentExpression): Store the result
728         on an out value, and use the return value to indicate failure
729         instead of using null (which is a valid return for Constant.GetValue).
730
731         * statement.cs: Perform the analysis flow for the increment
732         portion after the statement, because this will be the real flow of
733         execution.  Fixes #42385
734
735         * codegen.cs (EmitContext.EmitArgument,
736         EmitContext.EmitStoreArgument): New helper functions when the
737         RemapToProxy flag is set.
738
739         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
740         function.
741
742         Add support for remapping parameters. 
743
744         * iterators.cs: Propagate parameter values;  Store parameter
745         values in the proxy classes.
746         
747 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
748
749         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
750         need a proxy reference;  I do not know what I was thinking
751
752         * cs-parser.jay (constructor_initializer): catch another error,
753         and display nice message.
754         
755         (field_declaration): catch void field declaration
756         to flag a better error. 
757
758         * class.cs (MemberBase.CheckBase): Report an error instead of a
759         warning if a new protected member is declared in a struct. 
760         (Field.Define): catch the error of readonly/volatile.
761
762         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
763
764         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
765         volatile variable is taken
766
767 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
768
769         * statement.cs (Fixed.Resolve): Report an error if we are not in
770         an unsafe context.
771
772 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
773
774         * typemanager.cs: reuse the code that handles type clashes for
775         delegates and enumerations.
776
777         * class.cs (Report28): Always report.
778
779         * expression.cs (EncodeAsAttribute): Allow nulls here.
780
781 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
782
783         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
784         the functionality for testing whether an expression is valid for
785         an attribute here.  Also handle the case of arrays of elements
786         being stored. 
787
788         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
789         encoding a linear array into an array of objects that are suitable
790         to be passed to an CustomAttributeBuilder.
791
792         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
793
794         * ecore.cs: (FieldExpr): Handle field remapping here.
795
796         * iteratators.cs: Pass the instance variable (if the method is an
797         instance method) to the constructors, so we can access the field
798         variables on the class.
799
800         TODO: Test this with structs.  I think the THIS variable on
801         structs might have to be a pointer, and not a refenrece
802
803 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
804
805         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
806         local variables to fields in a proxy class.
807
808         * iterators.cs (PopulateProxy): Rename our internal fields to
809         <XXX>.  
810         Create a <THIS> field if we are an instance method, so we can
811         reference our parent container variables.
812         (MapVariable): Called back from the EmitContext code to enter a
813         new variable to field mapping into the proxy class (we just create
814         a FieldBuilder).
815
816         * expression.cs
817         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
818         for using the remapped locals to fields.
819
820         I placed the code here, because that gives the same semantics to
821         local variables, and only changes the Emit code.
822
823         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
824         statements inside iterators.
825         (VariableInfo): Add a FieldBuilder for the cases when we are
826         remapping local variables to fields in a proxy class
827
828         * ecore.cs (SimpleNameResolve): Avoid testing two times for
829         current_block != null.
830
831         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
832         not cope with strings, as it has been moved to the
833         TableSwitchEmit.  Fixed bug in switch generation.
834
835         * expression.cs (New.DoResolve): Provide more context for the user
836         when reporting an error.
837
838         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
839         pointers. 
840
841         * expression.cs (MemberAccess.DoResolve): When we get a type back,
842         check the permissions for it.  Note than in a type-resolution
843         context the check was already present in DeclSpace.ResolveType,
844         but was missing from the MemberAccess.
845
846         (ArrayCreation.CheckIndices): warn if the user has
847         more nested levels of expressions, but there are no more
848         dimensions specified.  Avoids crash on bug 41906.
849
850 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
851
852         * statement.cs (Block): replace Implicit bool, for a generic
853         flags.   
854         New flag: `Unchecked'.  This is used during the EmitMeta phase
855         (which is out-of-line with the regular Resolve/Emit process for a
856         statement, as this is done ahead of time, but still gets a chance
857         to call constant resolve).
858         
859         (Block.Flags): new enum for adding a new flag.
860
861         (Block.EmitMeta): track the state of unchecked.
862         
863         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
864         to enable constant resolution to work there as well.
865
866 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
867
868         * typemanager.cs (ienumerable_type): Also look up
869         System.Collections.IEnumerable. 
870
871 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
872
873         TODO: Test more than one conditional per method.
874         
875         * class.cs (Indexer.Define): Report the location where the user is
876         referencing the unsupported feature.
877
878         (MethodData): Overload the use of `conditionals' to
879         minimize the creation of needless ArrayLists.   This saves roughly
880         212kb on my machine.
881
882         (Method): Implement the new IIteratorContainer interface.
883         (Method.SetYields): Implement the method by setting the ModFlags
884         to contain METHOD_YIELDS.
885         
886         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
887         which just got set to null.
888
889         * iterators.cs: New file.
890
891         (Yield, YieldBreak): New statements.
892
893         * statement.cs (Return.Resolve): Flag an error if we are used in
894         an iterator method.
895
896         * codegen.cs (InIterator): New flag set if the code is being
897         compiled in an iterator method.
898
899         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
900         internal modifier, and we just use it to avoid adding extra
901         fields, as this is seldom used.  
902
903         * cs-parser.jay: Add yield_statement (yield and yield break).
904
905         * driver.cs: New flag -v2 to turn on version 2 features. 
906
907         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
908         hashtable when v2 is enabled.
909
910 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
911
912         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
913         there is already a namespace defined with this name.
914
915         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
916         people upgraded their corlibs.
917
918         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
919         always use fully qualified types, no need to use the compiler
920         front end.
921
922         (TypeManager.IsNamespace): Use binarysearch.
923         
924         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
925         AddDelegate): I did not quite use the new IsValid API properly: I
926         have to pass the short-name and the fullname.  I was passing only
927         the basename instead of the fullname sometimes. 
928
929         (TypeContainer.DefineType): call NamespaceClash.
930
931         * interface.cs (Interface.DefineType): use NamespaceClash before
932         defining the type.
933
934         * delegate.cs (Delegate.DefineType): use NamespaceClash before
935         defining the type.
936
937         * enum.cs: (Enum.DefineType): use NamespaceClash before
938         defining the type.
939
940         * typemanager.cs (: 3-line patch that gives us some tasty 11%
941         speed increase.  First, use the negative_hits cache when we get a
942         negative.  Second, add the type with its full original name
943         instead of the new . and + encoded name (reflection uses + to
944         separate type from a nested type).  Use LookupTypeReflection
945         directly which bypasses the type->name hashtable (that we already
946         know does not contain the type.
947         
948         * decl.cs (DeclSpace.ResolveTypeExpr): track the
949         location/container type. 
950
951         * driver.cs: When passing utf8, use directly the UTF8Encoding.
952
953 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
954
955         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
956
957         * delegate.cs (NewDelegate.Resolve): Test whether an instance
958         method is being referenced in the method group from a static
959         context, and report error 120 if so.
960
961         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
962         Error118. 
963
964         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
965         is created, we create the A namespace).
966
967         * cs-parser.jay: A namespace also introduces a DeclarationFound.
968         Fixes #41591
969
970 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
971
972         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
973         invocation to ModuleBuilder.GetType with the same values will
974         return a new type instance, so we need to cache its return
975         values. 
976
977         * expression.cs (Binary.ResolveOperator): Only allow the compare
978         operators on enums if they are of the same type.
979
980         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
981         types of ValueType on their own case.  Before we were giving them
982         the same treatment as objects.
983
984         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
985         fullname.  Short name is used to compare against container name.
986         Fullname is used to check against defined namespace names.
987         
988         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
989         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
990
991         (Method.CheckBase): Call parent.
992         (MemberBase.CheckBase): Check for protected members on sealed
993         classes.
994         (PropertyBase.CheckBase): Call parent.
995         (Field.Define): Call parent.
996
997         * report.cs: Negative error codes are now mapped to 8000 - code,
998         so that the display is render more nicely.
999
1000         * typemanager.cs: Do not use try/catch, instead report a regular
1001         error. 
1002
1003         (GetPointerType, GetReferenceType): These methods provide
1004         mechanisms to obtain the T* and T& from a T.  We had the code
1005         previously scattered around the code base, and it also used
1006         TypeManager.LookupType that would go through plenty of caches.
1007         This one goes directly to the type source.
1008
1009         In some places we did the Type.GetType followed by
1010         ModuleBuilder.GetType, but not in others, so this unifies the
1011         processing as well.
1012
1013         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
1014         statements now that we have namespace information.
1015
1016         * typemanager.cs (IsNamespace): New method, returns whether the
1017         string presented is a namespace or not.
1018
1019         (ComputeNamespaces): New public entry point, computes the list of
1020         available namespaces, using the GetNamespaces API call in Mono, or
1021         the slower version in MS.NET.   
1022
1023         Now before we start the semantic analysis phase, we have a
1024         complete list of namespaces including everything that the user has
1025         provided.
1026
1027         Deleted old code to cache namespaces in .nsc files.
1028
1029 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
1030
1031         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
1032         class/struct location definition Location for the implicit
1033         constructor location.
1034
1035         (Operator.Define): Use the location of the operator for the
1036         implicit Method definition.
1037
1038         (Constructor.Emit): use the constructor location for the implicit
1039         base initializer constructor.
1040
1041         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
1042         and the Expression class now contains two new methods:
1043
1044         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
1045         isolate type lookup from the rest of the resolution process.
1046
1047         Since we use Expressions to hold type definitions due to the way
1048         we parse the input we have historically overloaded Resolve to
1049         perform the Type lookups if a special flag is passed.  Now this is
1050         eliminated and two methods take their place. 
1051         
1052         The differences in the two methods between xStep and xTerminal is
1053         that xStep is involved in our current lookup system that uses
1054         SimpleNames to compose a name, while xTerminal is used just to
1055         catch the case where the simplename lookup failed.
1056         
1057 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
1058
1059         * expression.cs (ResolveMemberAccess): Remove redundant code.
1060         TypeExpr expressions are always born fully resolved.
1061
1062         * interface.cs (PopulateMethod): Do not lookup the types twice.
1063         We were doing it once during SemanticAnalysis and once during
1064         PopulateMethod.
1065
1066         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
1067         in local variable type definitions, were being returned as a
1068         SimpleName (we decomposed everything into a string), that is
1069         because primary_expression was being used instead of a type in the
1070         grammar (reduce/reduce conflicts).
1071
1072         The part that was wrong is that we converted the expression into a
1073         string (an oversimplification in one hand, compounded with primary
1074         expressions doing string concatenation).
1075
1076         So things like:
1077
1078         A.B.C [] x;
1079
1080         Would return "A.B.C[]" as a SimpleName.  This stopped things like
1081         using clauses from working on this particular context.  And a type
1082         was being matched directly against "A.B.C[]".
1083
1084         We now use the correct approach, and allow for ComposedCast to be
1085         part of the unary expression.  So the "A.B.C []" become a composed
1086         cast of "A.B.C" (as a nested group of MemberAccess with a
1087         SimpleName at the end) plus the rank composition "[]". 
1088
1089         Also fixes 35567
1090         
1091 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
1092
1093         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
1094         for the access level checking.
1095
1096         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
1097         `TypeContainer container', because I kept getting confused when I
1098         was debugging this code.
1099
1100         * expression.cs (Indexers): Instead of tracking getters/setters,
1101         we now track them in parallel.  We create one arraylist less, but
1102         most importantly it is possible now for the LValue code to find a
1103         matching get for a set.
1104
1105         (IndexerAccess.DoResolveLValue): Update the code.
1106         GetIndexersForType has been modified already to extract all the
1107         indexers from a type.  The code assumed it did not.
1108
1109         Also make the code set the correct return type for the indexer.
1110         This was fixed a long time ago for properties, but was missing for
1111         indexers.  It used to be void_type.
1112
1113         (Binary.Emit): Test first for doubles instead of
1114         floats, as they are more common.
1115
1116         (Binary.EmitBranchable): Use the .un version of the branch opcodes
1117         when dealing with floats and the <=, >= operators.  This fixes bug
1118         #39314 
1119
1120         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
1121         to load the array value by emitting a load on the foreach variable
1122         type.  This was incorrect.  
1123
1124         We now emit the code to load an element using the the array
1125         variable type, and then we emit the conversion operator.
1126
1127         Fixed #40176
1128
1129 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
1130
1131         * attribute.cs: Avoid allocation of ArrayLists in the common case.
1132
1133 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
1134
1135         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
1136         test for protection before we test for signatures. 
1137
1138         (MethodSignature.ToString): implement.
1139
1140         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
1141         to the case where we reduced into a LongConstant.
1142
1143         * decl.cs (CheckAccessLevel): If the type is an array, we can not
1144         depend on whether the information is acurrate, because the
1145         Microsoft runtime will always claim that the array type is public,
1146         regardless of the real state.
1147
1148         If the type is a pointer, another problem happens: the type is
1149         reported as non-public in Microsoft.  
1150
1151         In both cases we have to call CheckAccessLevel recursively with
1152         the underlying type as the argument to be tested.
1153
1154 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
1155
1156         * assign.cs (Assign.Emit): If we are dealing with a compound
1157         assignment expression, we should use the code path that stores the
1158         intermediate result in a temporary value.  This fixes #40903.
1159
1160         *expression.cs (Indirection.ToString): Provide ToString method for
1161         debugging. 
1162         
1163 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
1164
1165         * class.cs: Null out fields holding references to Block objects so
1166         they can be garbage collected.
1167
1168         * expression.cs (OverloadResolve): Remove unused local.
1169
1170 2003-04-07  Martin Baulig  <martin@ximian.com>
1171
1172         * codegen.cs (EmitContext.CurrentFile): New public field.
1173         (EmitContext.Mark): Use the CurrentFile to check whether the
1174         location is in the correct file.
1175         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
1176
1177 2003-04-07  Martin Baulig  <martin@ximian.com>
1178
1179         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
1180
1181         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
1182         location.  [FIXME: The location argument which gets passed to this
1183         method is sometimes wrong!]
1184
1185 2003-04-07  Nick Drochak <ndrochak@gol.com>
1186
1187         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
1188
1189 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
1190
1191         * expression.cs (Indirection.EmitAssign): We were using the
1192         temporary, but returning immediately instead of continuing the
1193         EmitAssing flow.
1194
1195 2003-04-06  Martin Baulig  <martin@ximian.com>
1196
1197         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
1198         if it's a nested child, but also deriving from the outer class.
1199         See test 190.cs.
1200
1201         * typemanager.cs (IsNestedChildOf): Make this work if it's a
1202         nested child, but also deriving from the outer class.  See
1203         test-190.cs.
1204         (FilterWithClosure): We may access private members of the outer
1205         class if we're a nested child and deriving from the outer class.
1206         (RealMemberLookup): Only set `closure_private_ok' if the
1207         `original_bf' contained BindingFlags.NonPublic.
1208
1209 2003-04-05  Martin Baulig  <martin@ximian.com>
1210
1211         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
1212         probe if its a type parameter, and if so, flag an error.
1213
1214         * decl.cs: Move here the SetParameterInfo code from class.cs.
1215         Handle IsGeneric here.
1216
1217         Handle a variety of errors in the parameter info definition.
1218
1219         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
1220         type parameters here.
1221
1222         * cs-parser.jay (class_declaration): report errors for parameters
1223         here as well.
1224
1225 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
1226
1227         * generic.cs: New file, contains support code for generics.
1228
1229         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
1230         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
1231
1232         Update parser for the above removals.
1233
1234         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
1235         now taken care of in the parser.
1236
1237 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
1238
1239         * class.cs (Event.Define): Do not allow abstract events to have
1240         initializers. 
1241
1242 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
1243
1244         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
1245         block in event declarations.
1246
1247         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
1248         value type, get its address.
1249
1250         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
1251         leaving a class on the stack instead of a boolean value (int
1252         0/1).  Change the code so we compare against null, and then the
1253         result against zero.
1254
1255         * class.cs (TypeContainer.GetClassBases): We were checking for the
1256         parent class being sealed too late.
1257
1258         * expression.cs (Binary.Emit): For <= and >= when dealing with
1259         floating point values, use cgt.un and clt.un instead of cgt and
1260         clt alone.
1261
1262 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
1263
1264         * statement.cs: Apply the same optimization as MS: skip the 
1265         GetEnumerator returning an IEnumerator, and use the one returning a 
1266         CharEnumerator instead. This allows us to avoid the try-finally block 
1267         and the boxing.
1268
1269 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
1270
1271         * cs-parser.jay: Attributes cannot be applied to
1272                          namespaces. Fixes #40473
1273
1274 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1275
1276         * class.cs:
1277         (Add*): check if the name is valid using the full name for constants,
1278         fields, properties and events.
1279
1280 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
1281
1282         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
1283         char constants to be part of the enumeration.
1284
1285         * expression.cs (Conditional.DoResolve): Add support for operator
1286         true. Implements the missing functionality from 14.12
1287
1288         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
1289         operator true/false as required by the spec.
1290
1291         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
1292         implicit conversion to boolean.
1293
1294         * statement.cs (Statement.ResolveBoolean): A boolean expression is
1295         also one where the type implements `operator true'. 
1296
1297         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
1298         get an expression that will invoke operator true based on an
1299         expression.  
1300
1301         (GetConversionOperators): Removed the hack that called op_True
1302         here.  
1303
1304         (Expression.ResolveBoolean): Move this from Statement.
1305
1306 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
1307
1308         * ecore.cs (FieldExpr): do not allow initialization of initonly
1309         fields on derived classes
1310
1311 2003-03-13  Martin Baulig  <martin@ximian.com>
1312
1313         * statement.cs (Block.Emit): Call ig.BeginScope() and
1314         ig.EndScope() when compiling with debugging info; call
1315         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
1316
1317 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
1318
1319         * expression.cs (Indexers): Do not construct immediately, allow
1320         for new members to be appended as we go.  Fixes 38143
1321
1322 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1323
1324         * expression.cs: save/restore context when resolving an unchecked
1325         expression.
1326
1327 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
1328
1329         * cfold.cs: Catch division by zero in modulus operator during
1330         constant folding.
1331
1332 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
1333
1334         * interface.cs (Interface.DefineMembers): Avoid defining members
1335         twice. 
1336
1337 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
1338
1339         * driver.cs: handle the +/- options for -noconfig
1340
1341         * statement.cs (Unckeched.Resolve): Also track the state of
1342         unchecked in the Resolve phase.
1343
1344 2003-02-27  Martin Baulig  <martin@ximian.com>
1345
1346         * ecore.cs (Expression.MemberLookup): Don't create a
1347         MethodGroupExpr for something which is not a method.  Fixes #38291.
1348
1349 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
1350
1351         * class.cs (MemberBase.CheckParameters): Also check that the type
1352         is unmanaged if it is a pointer.
1353
1354         * expression.cs (SizeOf.Resolve): Add location information.
1355
1356         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
1357         a managed type is declared.
1358
1359         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
1360         parameter modifiers as well.  Fixes bug 38606
1361
1362         * class.cs: Very sad.  Am backing out the speed up changes
1363         introduced by the ArrayList -> Array in the TypeContainer, as they
1364         were not actually that much faster, and introduced a bug (no error
1365         reports on duplicated methods).
1366
1367         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
1368         source first, this will guarantee that we have a valid expression
1369         before calling in lower levels functions that will require a
1370         resolved object.  Then use this original_source in the
1371         target.ResolveLValue instead of the original source that was
1372         passed to us.
1373
1374         Another change.  Use target.Resolve instead of LValueResolve.
1375         Although we are resolving for LValues, we will let the Assign code
1376         take care of that (it will be called again from Resolve).  This
1377         basically allows code like this:
1378
1379         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
1380         class Y { void A (X x) { x [0] += o; }
1381
1382         The problem was that the indexer was trying to resolve for
1383         set_Item (idx, object o) and never finding one.  The real set_Item
1384         was set_Item (idx, X).  By delaying the process we get the right
1385         semantics. 
1386
1387         Fixes bug 36505
1388         
1389 2003-02-23  Martin Baulig  <martin@ximian.com>
1390
1391         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
1392         while calling DoEmit ().
1393
1394         * codegen.cs (EmitContext.Mark): Don't mark locations in other
1395         source files; if you use the #line directive inside a method, the
1396         compiler stops emitting line numbers for the debugger until it
1397         reaches the end of the method or another #line directive which
1398         restores the original file.
1399
1400 2003-02-23  Martin Baulig  <martin@ximian.com>
1401
1402         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
1403
1404 2003-02-23  Martin Baulig  <martin@ximian.com>
1405
1406         * statement.cs (Block.AddChildVariableNames): We need to call this
1407         recursively, not just for our immediate children.
1408
1409 2003-02-23  Martin Baulig  <martin@ximian.com>
1410
1411         * class.cs (Event.Define): Always make the field private, like csc does.
1412
1413         * typemanager.cs (TypeManager.RealMemberLookup): Make events
1414         actually work, fixes bug #37521.
1415
1416 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
1417
1418         * delegate.cs: When creating the various temporary "Parameters"
1419         classes, make sure that we call the ComputeAndDefineParameterTypes
1420         on those new parameters (just like we do with the formal ones), to
1421         allow them to be resolved in the context of the DeclSpace.
1422
1423         This fixes the bug that Dick observed in Bugzilla #38530.
1424
1425 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
1426
1427         * expression.cs (ResolveMemberAccess): When resolving a constant,
1428         do not attempt to pull a constant if the value was not able to
1429         generate a valid constant.
1430
1431         * const.cs (LookupConstantValue): Do not report more errors than required.
1432
1433 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1434
1435         * expression.cs: fixes bug #38328.
1436
1437 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
1438
1439         * class.cs: Changed all the various members that can be part of a
1440         class from being an ArrayList to be an Array of the right type.
1441         During the DefineType type_list, interface_list, delegate_list and
1442         enum_list are turned into types, interfaces, delegates and enums
1443         arrays.  
1444
1445         And during the member population, indexer_list, event_list,
1446         constant_list, field_list, instance_constructor_list, method_list,
1447         operator_list and property_list are turned into their real arrays.
1448
1449         Although we could probably perform this operation earlier, for
1450         good error reporting we need to keep the lists and remove the
1451         lists for longer than required.
1452
1453         This optimization was triggered by Paolo profiling the compiler
1454         speed on the output of `gen-sample-program.pl' perl script. 
1455
1456         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
1457         not crash in methods like MemberLookupFailed that use this field.  
1458
1459         This problem arises when the compiler fails to resolve a type
1460         during interface type definition for example.
1461
1462 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
1463
1464         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
1465         inherit from System.Object, so we have to stop at null, not only
1466         when reaching System.Object.
1467
1468 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
1469
1470         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
1471         DeclaredOnly because the parent indexer might have had a different
1472         name, but did not loop until the top of the hierarchy was reached.
1473
1474         The problem this one fixes is 35492: when a class implemented an
1475         indexer from an interface, we were getting the interface method
1476         (which was abstract) and we were flagging an error (can not invoke
1477         abstract method).
1478
1479         This also keeps bug 33089 functioning, and test-148 functioning.
1480
1481         * typemanager.cs (IsSpecialMethod): The correct way of figuring
1482         out if a method is special is to see if it is declared in a
1483         property or event, or whether it is one of the predefined operator
1484         names.   This should fix correctly #36804.
1485
1486 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
1487
1488         The goal here is to remove the dependency on EmptyCast.Peel ().
1489         Killing it completely.
1490         
1491         The problem is that currently in a number of places where
1492         constants are expected, we have to "probe" for an EmptyCast, and
1493         Peel, which is not the correct thing to do, as this will be
1494         repetitive and will likely lead to errors. 
1495
1496         The idea is to remove any EmptyCasts that are used in casts that
1497         can be reduced to constants, so we only have to cope with
1498         constants. 
1499
1500         This bug hunt was triggered by Bug 37363 and the desire to remove
1501         the duplicate pattern where we were "peeling" emptycasts to check
1502         whether they were constants.  Now constants will always be
1503         constants.
1504         
1505         * ecore.cs: Use an enumconstant here instead of wrapping with
1506         EmptyCast.  
1507
1508         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
1509         throwing me off.  By handling this we can get rid of a few hacks.
1510         
1511         * statement.cs (Switch): Removed Peel() code.
1512
1513 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
1514
1515         * class.cs: Location information for error 508
1516
1517         * expression.cs (New.DoResolve): Add a guard against double
1518         resolution of an expression.  
1519
1520         The New DoResolve might be called twice when initializing field
1521         expressions (see EmitFieldInitializers, the call to
1522         GetInitializerExpression will perform a resolve on the expression,
1523         and later the assign will trigger another resolution
1524
1525         This leads to bugs (#37014)
1526
1527         * delegate.cs: The signature for EndInvoke should contain any ref
1528         or out parameters as well.  We were not doing this in the past. 
1529
1530         * class.cs (Field.Define): Do not overwrite the type definition
1531         inside the `volatile' group.  Turns out that volatile enumerations
1532         were changing the type here to perform a validity test, which
1533         broke conversions. 
1534
1535 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
1536
1537         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
1538         and structs, we do not want to load the instance variable
1539
1540         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
1541         enum_type has to be handled like an object reference (implicit
1542         conversions exists from this to object), but the regular IsClass
1543         and IsValueType tests will never return true for this one.
1544
1545         Also we use TypeManager.IsValueType instead of type.IsValueType,
1546         just for consistency with the rest of the code (this is only
1547         needed if we ever use the construct exposed by test-180.cs inside
1548         corlib, which we dont today).
1549
1550 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
1551
1552         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
1553         just InternalCall.
1554
1555 2003-02-09  Martin Baulig  <martin@ximian.com>
1556
1557         * namespace.cs (Namespace..ctor): Added SourceFile argument.
1558         (Namespace.DefineNamespaces): New static public method; this is
1559         called when we're compiling with debugging to add all namespaces
1560         to the symbol file.
1561
1562         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
1563         pass it to the Namespace's .ctor.
1564
1565         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
1566         and MethodBase arguments; pass the namespace ID to the symwriter;
1567         pass the MethodBase instead of the token to the symwriter.
1568         (SymbolWriter.DefineNamespace): New method to add a namespace to
1569         the symbol file.
1570
1571 2003-02-09  Martin Baulig  <martin@ximian.com>
1572
1573         * symbolwriter.cs: New file.  This is a wrapper around
1574         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
1575         methods here in near future.
1576
1577 2003-02-09  Martin Baulig  <martin@ximian.com>
1578
1579         * codegen.cs (EmitContext.Mark): Just pass the arguments to
1580         ILGenerator.MarkSequencePoint() which are actually used by the
1581         symbol writer.
1582
1583 2003-02-09  Martin Baulig  <martin@ximian.com>
1584
1585         * location.cs (SourceFile): New public sealed class.  This
1586         contains the name and an index which is used in the location's token.
1587         (Location): Reserve an appropriate number of bits in the token for
1588         the source file instead of walking over that list, this gives us a
1589         really huge performance improvement when compiling with debugging.
1590
1591         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
1592         `SourceFile' argument instead of a string.
1593         (Driver.ProcessFile): Add all the files via Location.AddFile(),
1594         but don't parse/tokenize here, we need to generate the list of all
1595         source files before we do that.
1596         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
1597         the files.
1598
1599         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
1600         instead of a string.
1601
1602         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
1603         of a string.
1604
1605 2003-02-09  Martin Baulig  <martin@ximian.com>
1606
1607         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
1608         filename on `#line default'.
1609
1610 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
1611
1612         * statement.cs: don't clear the pinned var when the fixed statement
1613         returns from the method (fixes bug#37752).
1614
1615 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
1616
1617         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
1618         to IsValueType.
1619
1620 2003-02-07  Martin Baulig  <martin@ximian.com>
1621
1622         * driver.cs: Removed the `--debug-args' command line argument.
1623
1624         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
1625         automatically by the AsssemblyBuilder.
1626         (CodeGen.InitializeSymbolWriter): We don't need to call any
1627         initialization function on the symbol writer anymore.  This method
1628         doesn't take any arguments.
1629
1630 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
1631
1632         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
1633         from referenced assemblies as well.
1634
1635 2003-02-02  Martin Baulig  <martin@ximian.com>
1636
1637         * class.cs (MethodData.Emit): Generate debugging info for external methods.
1638
1639 2003-02-02  Martin Baulig  <martin@ximian.com>
1640
1641         * class.cs (Constructor.Emit): Open the symbol writer before
1642         emitting the constructor initializer.
1643         (ConstructorInitializer.Emit): Call ec.Mark() to allow
1644         single-stepping through constructor initializers.
1645
1646 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
1647
1648         * class.cs: Handle error 549: do not allow virtual methods in
1649         sealed classes. 
1650
1651 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
1652
1653         * decl.cs: Check access levels when resolving types
1654         
1655 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
1656
1657         * statement.cs: Add parameters and locals set in catch blocks that might 
1658         return to set vector
1659
1660 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
1661
1662         * class.cs (Operator): Set the SpecialName flags for operators.
1663         
1664         * expression.cs (Invocation.DoResolve): Only block calls to
1665         accessors and operators on SpecialName methods.
1666
1667         (Cast.TryReduce): Handle conversions from char constants.
1668
1669
1670 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
1671
1672         * statement.cs: small memory and time optimization in FlowBranching.
1673         
1674 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
1675
1676         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
1677         problem that the last fix but in the other sid (Set).
1678
1679         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
1680         access when there is no indexer in the hierarchy.
1681         
1682 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
1683
1684         * class.cs: Combine some if statements.
1685
1686 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1687
1688         * driver.cs: fixed bug #37187.
1689
1690 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
1691
1692         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
1693         any indexer, it's needed to build a list with all the indexers in the
1694         hierarchy (AllGetters), else we have problems. Fixes #35653.
1695
1696 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
1697
1698         * class.cs (MethodData.Define): It is wrong for an interface
1699         implementation to be static in both cases: explicit and implicit.
1700         We were only handling this in one case.
1701
1702         Improve the if situation there to not have negations.
1703         
1704         * class.cs (Field.Define): Turns out that we do not need to check
1705         the unsafe bit on field definition, only on usage.  Remove the test.
1706
1707 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1708
1709         * driver.cs: use assembly.Location instead of Codebase (the latest
1710         patch made mcs fail when using MS assemblies).
1711
1712 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
1713
1714         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
1715         get the path to *corlib.dll.
1716
1717 2003-01-21  Nick Drochak <ndrochak@gol.com>
1718
1719         * cs-tokenizer.cs:
1720         * pending.cs:
1721         * typemanager.cs: Remove compiler warnings
1722
1723 2003-01-20  Duncan Mak  <duncan@ximian.com>
1724
1725         * AssemblyInfo.cs: Bump the version number to 0.19.
1726         
1727 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1728
1729         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
1730
1731 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
1732
1733         * class.cs (Constructor::Emit): Emit debugging info for constructors.
1734
1735 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
1736
1737         * cs-parser.jay: Small fix: we were not comparing the constructor
1738         name correctly.   Thanks to Zoltan for the initial pointer.
1739
1740 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
1741
1742         * cs-tokenizer.cs: Set file name when specified with #line
1743
1744 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
1745
1746         * cs-parser.jay: Only perform the constructor checks here if we
1747         are named like the class;  This will help provider a better
1748         error.  The constructor path is taken when a type definition is
1749         not found, but most likely the user forgot to add the type, so
1750         report that rather than the constructor error.
1751
1752 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
1753
1754         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
1755         allocations.
1756
1757 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
1758
1759         * cs-parser.jay: Add cleanup call.
1760
1761 2003-01-13  Duncan Mak  <duncan@ximian.com>
1762
1763         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
1764         consistent with other methods.
1765
1766 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
1767
1768         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
1769         
1770 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
1771
1772         * attribute.cs: only set GuidAttr to true when we have a
1773         GuidAttribute.
1774
1775 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1776
1777         * ecore.cs:
1778         * expression.cs:
1779         * typemanager.cs: fixes to allow mcs compile corlib with the new
1780         Type.IsSubclassOf fix.
1781
1782 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
1783
1784         * expression.cs (LocalVariableReference.DoResolve): Classify a
1785         constant as a value, not as a variable.   Also, set the type for
1786         the variable.
1787
1788         * cs-parser.jay (fixed_statement): take a type instead of a
1789         pointer_type, so we can produce a better error message later.
1790         
1791         * statement.cs (Fixed.Resolve): Flag types that are not pointers
1792         as an error.  
1793         
1794         (For.DoEmit): Make inifinite loops have a
1795         non-conditional branch back.
1796
1797         (Fixed.DoEmit): First populate the pinned variables, then emit the
1798         statement, then clear the variables.  Before I was emitting the
1799         code once for each fixed piece.
1800
1801
1802 2003-01-08  Martin Baulig  <martin@ximian.com>
1803
1804         * statement.cs (FlowBranching.MergeChild): A break in a
1805         SWITCH_SECTION does not leave a loop.  Fixes #36155.
1806
1807 2003-01-08  Martin Baulig  <martin@ximian.com>
1808
1809         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
1810         lives in the same number space than `param_map'.  Fixes #36154.
1811
1812 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
1813
1814         * cs-parser.jay (constructor_declaration): Set the
1815         Constructor.ModFlags before probing for it.  This makes the
1816         compiler report 514, 515 and 132 (the code was there, but got
1817         broken). 
1818
1819         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
1820         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
1821         (GotoCase.Resolve): Set `Returns' to ALWAYS.
1822
1823 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
1824
1825         * enum.cs: create the enum static fields using the enum type.
1826
1827 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
1828
1829         * class.cs: don't try to create the ParamBuilder for the return
1830         type if it's not needed (and handle it breaking for the ms runtime
1831         anyway).
1832
1833 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
1834
1835         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
1836
1837 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
1838
1839         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
1840         the command.   This showed up while compiling the JANET source
1841         code, which used \r as its only newline separator.
1842
1843 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
1844
1845         * class.cs (Method.Define): If we are an operator (because it
1846         reuses our code), then set the SpecialName and HideBySig.  #36128
1847
1848 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
1849
1850         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
1851         exception, report error 120 `object reference required'.
1852
1853         * driver.cs: Add --pause option, used during to measure the size
1854         of the process as it goes with --timestamp.
1855
1856         * expression.cs (Invocation.DoResolve): Do not allow methods with
1857         SpecialName to be invoked.
1858
1859 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
1860
1861         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
1862         number before adding it.
1863
1864 2002-12-21  Ravi Pratap  <ravi@ximian.com>
1865
1866         * ecore.cs (StandardImplicitConversion): When in an unsafe
1867         context, we allow conversion between void * to any other pointer
1868         type. This fixes bug #35973.
1869
1870 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
1871
1872         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
1873         is not thrown when extensionless outputs are used 
1874
1875 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1876
1877         * rootcontext.cs: fixed compilation of corlib.
1878
1879 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
1880
1881         * attribute.cs (Attributes.Contains): Add new method.
1882
1883         * class.cs (MethodCore.LabelParameters): if the parameter is an
1884         `out' parameter, check that no attribute `[In]' has been passed.
1885
1886         * enum.cs: Handle the `value__' name in an enumeration.
1887
1888 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
1889
1890         * decl.cs: Added special case to allow overrides on "protected
1891         internal" methods
1892         
1893 2002-12-18  Ravi Pratap  <ravi@ximian.com>
1894
1895         * attribute.cs (Attributes.AddAttributeSection): Rename to this
1896         since it makes much more sense.
1897
1898         (Attributes.ctor): Don't require a Location parameter.
1899         
1900         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
1901
1902         * attribute.cs (ApplyAttributes): Remove extra Location parameters
1903         since we already have that information per attribute.
1904
1905         * everywhere : make appropriate changes.
1906
1907         * class.cs (LabelParameters): Write the code which actually
1908         applies attributes to the return type. We can't do this on the MS
1909         .NET runtime so we flag a warning in the case an exception is
1910         thrown.
1911
1912 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
1913
1914         * const.cs: Handle implicit null conversions here too.
1915
1916 2002-12-17  Ravi Pratap  <ravi@ximian.com>
1917
1918         * class.cs (MethodCore.LabelParameters): Remove the extra
1919         Type [] parameter since it is completely unnecessary. Instead
1920         pass in the method's attributes so that we can extract
1921         the "return" attribute.
1922
1923 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
1924
1925         * cs-parser.jay (parse): Use Report.Error to flag errors instead
1926         of ignoring it and letting the compile continue.
1927
1928         * typemanager.cs (ChangeType): use an extra argument to return an
1929         error condition instead of throwing an exception.
1930
1931 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
1932
1933         * expression.cs (Unary.TryReduce): mimic the code for the regular
1934         code path.  Perform an implicit cast in the cases where we can
1935         implicitly convert to one of the integral types, and then reduce
1936         based on that constant.   This fixes bug #35483.
1937
1938 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1939
1940         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
1941
1942 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1943
1944         * namespace.cs: fixed bug #35489.
1945
1946 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
1947
1948         * class.cs: Remove some dead code.
1949
1950         * cs-parser.jay: Estimate the number of methods needed
1951         (RootContext.MethodCount);
1952
1953         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
1954         numbers instead of StringBuilders.
1955
1956         * support.cs (PtrHashtable): Add constructor with initial size;
1957         We can now reduce reallocations of the method table.
1958
1959 2002-12-10  Ravi Pratap  <ravi@ximian.com>
1960
1961         * attribute.cs (ApplyAttributes): Keep track of the emitted
1962         attributes on a per-target basis. This fixes bug #35413.
1963
1964 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
1965
1966         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
1967         default to the Windows 1252 encoding.
1968
1969         (UnixParseOption): Support version, thanks to Alp for the missing
1970         pointer. 
1971
1972         * AssemblyInfo.cs: Add nice assembly information.
1973
1974         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
1975         (bug 35169).
1976
1977         * cs-parser.jay: Allow a trailing comma before the close bracked
1978         in the attribute_section production.
1979
1980         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
1981         address of the instance was being taken, I will take this out,
1982         because we take the address of the object immediately here.
1983
1984 2002-12-09  Ravi Pratap  <ravi@ximian.com>
1985
1986         * typemanager.cs (AreMultipleAllowed): Take care of the most
1987         obvious case where attribute type is not in the current assembly -
1988         stupid me ;-)
1989
1990 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
1991
1992         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
1993         definitions, instead of doing that afterwards.  
1994
1995         Also we use a nice little hack, depending on the constructor, we
1996         know if we are a "composed" name or a simple name.  Hence, we
1997         avoid the IndexOf test, and we avoid 
1998
1999         * codegen.cs: Add code to assist in a bug reporter to track down
2000         the source of a compiler crash. 
2001
2002 2002-12-07  Ravi Pratap  <ravi@ximian.com>
2003
2004         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
2005         types have been emitted for a given element and flag an error
2006         if something which does not have AllowMultiple set is used more
2007         than once.
2008
2009         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
2010         attribute types and their corresponding AllowMultiple properties
2011
2012         (AreMultipleAllowed): Check the property for a given type.
2013
2014         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
2015         property in the case we have a TypeContainer.
2016
2017         (Attributes.AddAttribute): Detect duplicates and just skip on
2018         adding them. This trivial fix catches a pretty gross error in our
2019         attribute emission - global attributes were being emitted twice!
2020
2021         Bugzilla bug #33187 is now fixed.
2022
2023 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
2024
2025         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
2026         instead of pp_and).
2027
2028         * expression.cs (Binary.ResolveOperator): I can only use the
2029         Concat (string, string, string) and Concat (string, string,
2030         string, string) if the child is actually a concatenation of
2031         strings. 
2032
2033 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
2034
2035         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
2036         context where we need a 2-character lookahead.
2037
2038         * pending.cs (PendingImplementation): Rework so we can keep track
2039         of interface types all the time, and flag those which were
2040         implemented by parents as optional.
2041
2042 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
2043
2044         * expression.cs (Binary.ResolveOperator): Use
2045         String.Concat(string,string,string) or
2046         String.Concat(string,string,string,string) when possible. 
2047
2048         * typemanager: More helper methods.
2049
2050
2051 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
2052
2053         * pending.cs: remove the bogus return from GetMissingInterfaces()
2054         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
2055
2056 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2057
2058         * namespace.cs: avoid duplicated 'using xxx' being added to
2059         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
2060         when we get more than one 'using' statement for the same namespace.
2061         Report a CS0105 warning for it.
2062
2063 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
2064
2065         * cs-tokenizer.cs (consume_identifier): use read directly, instead
2066         of calling getChar/putback, uses internal knowledge of it.    
2067
2068         (xtoken): Reorder tokenizer so most common patterns are checked
2069         first.  This reduces the compilation time in another 5% (from 8.11s
2070         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
2071
2072         The parsing time is 22% of the compilation in mcs, and from that
2073         64% is spent on the tokenization process.  
2074
2075         I tried using a binary search for keywords, but this is slower
2076         than the hashtable.  Another option would be to do a couple of
2077         things:
2078
2079                 * Not use a StringBuilder, instead use an array of chars,
2080                   with a set value.  Notice that this way we could catch
2081                   the 645 error without having to do it *afterwards*.
2082
2083                 * We could write a hand-parser to avoid the hashtable
2084                   compares altogether.
2085
2086         The identifier consumption process takes 37% of the tokenization
2087         time.  Another 15% is spent on is_number.  56% of the time spent
2088         on is_number is spent on Int64.Parse:
2089
2090                 * We could probably choose based on the string length to
2091                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
2092                   computations. 
2093
2094         Another 3% is spend on wrapping `xtoken' in the `token' function.
2095
2096         Handle 0xa0 as whitespace (#34752)
2097         
2098 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
2099
2100         * typemanager.cs (IsCLRType): New routine to tell whether a type
2101         is one of the builtin types.  
2102
2103         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
2104         typecode in more places instead of doing pointer comparissions.
2105         We could leverage some knowledge about the way the typecodes are
2106         laid out.
2107
2108         New code to cache namespaces in assemblies, it is currently not
2109         invoked, to be used soon.
2110
2111         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
2112
2113         * expression.cs (Binary.ResolveOperator): specially handle
2114         strings, and do not perform user-defined operator overloading for
2115         built-in types.
2116
2117 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
2118
2119         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
2120         internalcall as it is a pretty simple operation;  Avoid whenever
2121         possible to call Char.IsLetter.
2122
2123         (consume_identifier): Cut by half the number of
2124         hashtable calls by merging the is_keyword and GetKeyword behavior.
2125
2126         Do not short-circuit, because if we do, we
2127         report errors (ie, #if false && true would produce an invalid
2128         directive error);
2129         
2130
2131 2002-11-24  Martin Baulig  <martin@ximian.com>
2132
2133         * expression.cs (Cast.TryReduce): If we're in checked syntax,
2134         check constant ranges and report a CS0221.  Fixes #33186.
2135
2136 2002-11-24  Martin Baulig  <martin@ximian.com>
2137
2138         * cs-parser.jay: Make this work for uninitialized variable
2139         declarations in the `for' initializer.  Fixes #32416.
2140
2141 2002-11-24  Martin Baulig  <martin@ximian.com>
2142
2143         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
2144         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
2145
2146 2002-11-24  Martin Baulig  <martin@ximian.com>
2147
2148         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
2149         argument; if true, we also check for user-defined conversions.
2150         This is only needed if both arguments are of a user-defined type.
2151         Fixes #30443, added test-175.cs.
2152         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
2153
2154         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
2155
2156 2002-11-24  Martin Baulig  <martin@ximian.com>
2157
2158         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
2159         function to get the store opcode.
2160         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
2161         only emit the Ldelema if the store opcode is Stobj.  You must run
2162         both test-34 and test-167 to test this.  Fixes #34529.
2163
2164 2002-11-23  Martin Baulig  <martin@ximian.com>
2165
2166         * ecore.cs (Expression.MemberLookup): Added additional
2167         `qualifier_type' argument which is used when we're being called
2168         from MemberAccess.DoResolve() and null if we're called from a
2169         SimpleName lookup.
2170         (Expression.MemberLookupFailed): New method to report errors; this
2171         does the CS1540 check and reports the correct error message.
2172
2173         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
2174         argument for the CS1540 check and redone the way how we're dealing
2175         with private members.  See the comment in the source code for details.
2176         (FilterWithClosure): Reverted this back to revision 1.197; renamed
2177         `closure_start_type' to `closure_qualifier_type' and check whether
2178         it's not null.  It was not this filter being broken, it was just
2179         being called with the wrong arguments.
2180
2181         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
2182         and pass it the correct `qualifier_type'; this also does the error
2183         handling for us.
2184
2185 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
2186
2187         * expression.cs (Invocation.EmitParams): If the we are dealing
2188         with a non-built-in value type, load its address as well.
2189
2190         (ArrayCreation): Use a a pretty constant instead
2191         of the hardcoded value 2.   Use 6 instead of 2 for the number of
2192         static initializers.  
2193
2194         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
2195         because they are not really value types, just glorified integers. 
2196
2197         * driver.cs: Do not append .exe, the CSC compiler does not do it.
2198
2199         * ecore.cs: Remove redundant code for enumerations, make them use
2200         the same code path as everything else, fixes the casting issue
2201         with enumerations in Windows.Forms.
2202
2203         * attribute.cs: Do only cast to string if it is a string, the
2204         validation happens later.
2205
2206         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
2207         people upgrade their corlibs.
2208
2209         * ecore.cs: Oops, enumerations were not following the entire code path
2210
2211 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
2212
2213         * typemanager.cs (FilterWithClosure): Commented out the test for
2214         1540 in typemanager.cs, as it has problems when accessing
2215         protected methods from a parent class (see test-174.cs). 
2216
2217         * attribute.cs (Attribute.ValidateGuid): new method.
2218         (Attribute.Resolve): Use above.
2219
2220 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
2221
2222         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
2223
2224         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
2225         handling for enumerations, as we only needed the TypeContainer
2226         functionality to begin with (this is required for the fix below to
2227         work for enums that reference constants in a container class for
2228         example). 
2229
2230         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
2231
2232         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
2233         a valid TypeBuilder to perform lookups on.o
2234
2235         * class.cs (InheritableMemberSignatureCompare): Use true in the
2236         call to GetGetMethod and GetSetMethod, because we are comparing
2237         the signature, and we need to get the methods *even* if they are
2238         private. 
2239
2240         (PropertyBase.CheckBase): ditto.
2241
2242         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
2243         GotoCase.Resolve): Use Peel on EmpytCasts.
2244
2245         * ecore.cs (EmptyCast): drop child, add Peel method.
2246
2247 2002-11-17  Martin Baulig  <martin@ximian.com>
2248
2249         * ecore.cs (EmptyCast.Child): New public property.
2250
2251         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
2252         label resolved to an EmptyCast.  Fixes #34162.
2253         (GotoCase.Resolve): Likewise.
2254         (Block.EmitMeta): Likewise.
2255
2256 2002-11-17  Martin Baulig  <martin@ximian.com>
2257
2258         * expression.cs (Invocation.BetterConversion): Prefer int over
2259         uint; short over ushort; long over ulong for integer literals.
2260         Use ImplicitConversionExists instead of StandardConversionExists
2261         since we also need to check for user-defined implicit conversions.
2262         Fixes #34165.  Added test-173.cs.
2263
2264 2002-11-16  Martin Baulig  <martin@ximian.com>
2265
2266         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
2267         with the `true' and `false' literals.  Fixes #33151.
2268
2269 2002-11-16  Martin Baulig  <martin@ximian.com>
2270
2271         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
2272         October 22nd; don't do the cs1540 check for static members.
2273
2274         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
2275         now using our own filter here and doing the cs1540 check again.
2276
2277 2002-11-16  Martin Baulig  <martin@ximian.com>
2278
2279         * support.cs (InternalParameters): Don't crash if we don't have
2280         any fixed parameters.  Fixes #33532.
2281
2282 2002-11-16  Martin Baulig  <martin@ximian.com>
2283
2284         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
2285         when looking up static methods to make this work on Windows.
2286         Fixes #33773.
2287
2288 2002-11-16  Martin Baulig  <martin@ximian.com>
2289
2290         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
2291         a setter rather than using PropertyInfo.CanWrite.
2292
2293 2002-11-15  Nick Drochak  <ndrochak@gol.com>
2294
2295         * class.cs: Allow acces to block member by subclasses. Fixes build
2296         breaker.
2297
2298 2002-11-14  Martin Baulig  <martin@ximian.com>
2299
2300         * class.cs (Constructor.Emit): Added the extern/block check.
2301         Fixes bug #33678.
2302
2303 2002-11-14  Martin Baulig  <martin@ximian.com>
2304
2305         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
2306         iteration while looking for indexers, this is needed because the
2307         indexer may have a different name in our base classes.  Fixed the
2308         error reporting (no indexers at all, not get accessor, no
2309         overloaded match).  Fixes bug #33089.
2310         (IndexerAccess.DoResolveLValue): Likewise.
2311
2312 2002-11-14  Martin Baulig  <martin@ximian.com>
2313
2314         * class.cs (PropertyBase.CheckBase): Make this work for multiple
2315         indexers.  Fixes the first part of bug #33089.
2316         (MethodSignature.InheritableMemberSignatureCompare): Added support
2317         for properties.
2318
2319 2002-11-13  Ravi Pratap  <ravi@ximian.com>
2320
2321         * attribute.cs (Attribute.Resolve): Catch the
2322         NullReferenceException and report it since it isn't supposed to
2323         happen. 
2324         
2325 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
2326
2327         * expression.cs (Binary.EmitBranchable): Also handle the cases for
2328         LogicalOr and LogicalAnd that can benefit from recursively
2329         handling EmitBranchable.  The code now should be nice for Paolo.
2330
2331 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
2332
2333         * typemanager.cs (LookupType): Added a negative-hit hashtable for
2334         the Type lookups, as we perform quite a number of lookups on
2335         non-Types.  This can be removed once we can deterministically tell
2336         whether we have a type or a namespace in advance.
2337
2338         But this might require special hacks from our corlib.
2339
2340         * TODO: updated.
2341
2342         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
2343         and double which avoids a conversion from an integer to a double.
2344
2345         * expression.cs: tiny optimization, avoid calling IsConstant,
2346         because it effectively performs the lookup twice.
2347
2348 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
2349
2350         But a bogus return here to keep the semantics of the old code
2351         until the Mono runtime is fixed.
2352         
2353         * pending.cs (GetMissingInterfaces): New method used to remove all
2354         the interfaces that are already implemented by our parent
2355         classes from the list of pending methods. 
2356
2357         * interface.cs: Add checks for calls after ResolveTypeExpr.
2358
2359 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
2360
2361         * class.cs (Class.Emit): Report warning 67: event not used if the
2362         warning level is beyond 3.
2363
2364         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
2365         being a NullLiteral.
2366
2367         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
2368         specifiers. 
2369
2370         * class.cs (TypeContainer.GetClassBases): Cover a missing code
2371         path that might fail if a type can not be resolved.
2372
2373         * expression.cs (Binary.Emit): Emit unsigned versions of the
2374         operators. 
2375
2376         * driver.cs: use error 5.
2377         
2378 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
2379
2380         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
2381
2382 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
2383
2384         * cs-parser.jay (switch_section): A beautiful patch from Martin
2385         Baulig that fixed 33094.
2386
2387 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
2388
2389         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
2390         Check whether the base is abstract and report an error if so.
2391
2392         * expression.cs (IndexerAccess.DoResolveLValue,
2393         IndexerAccess.DoResolve): ditto. 
2394
2395         (Invocation.DoResolve): ditto.
2396         
2397         (Invocation.FullMethodDesc): Improve the report string.
2398
2399         * statement.cs (Block): Eliminate IsVariableDefined as it is
2400         basically just a wrapper for GetVariableInfo.
2401
2402         * ecore.cs (SimpleName): Use new 
2403
2404         * support.cs (ReflectionParamter.ParameterType): We unwrap the
2405         type, as we return the actual parameter ref/unref state on a
2406         different call.
2407
2408 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
2409
2410         * support.cs: Return proper flags REF/OUT fixing the previous
2411         commit.  
2412
2413         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
2414         not used to mean `ref' but `ref or out' in ParameterReference
2415         
2416         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
2417         full type signature instead of calling TypeManger.CSharpName
2418         ourselves. 
2419
2420         * support.cs (InternalParameters.ParameterDesc): Do not compare
2421         directly to the modflags, because REF/OUT will actually be bitsets
2422         if set. 
2423
2424         * delegate.cs (VerifyMethod): Check also the modifiers.
2425
2426         * cs-tokenizer.cs: Fix bug where floating point values with an
2427         exponent where a sign was missing was ignored.
2428
2429         * driver.cs: Allow multiple assemblies to be specified in a single
2430         /r: argument
2431
2432 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
2433
2434         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
2435         because identifiers after a parenthesis would end up in this kind
2436         of production, and we needed to desamiguate it for having casts
2437         like:
2438
2439                 (UserDefinedType *) xxx
2440
2441 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
2442
2443         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
2444         we should set on the Bindingflags.NonPublic, but not turn on
2445         private_ok.  private_ok controls whether a Private member is
2446         returned (this is chekced on the filter routine), while the
2447         BindingFlags.NonPublic just controls whether private/protected
2448         will be allowed.   This fixes the problem part of the problem of
2449         private properties being allowed to be used in derived classes.
2450
2451         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
2452         so we can call the children DoResolveLValue method (this will
2453         properly signal errors on lvalue assignments to base properties)
2454         
2455         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
2456         getter are null, and we have a property info, we know that this
2457         happened because the lookup failed, so we report an error 122 for
2458         protection level violation.
2459
2460         We also silently return if setter and getter are null in the
2461         resolve functions, this condition only happens if we have flagged
2462         the error before.  This is the other half of the problem. 
2463
2464         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
2465         not have accessibility information, that is why we were returning
2466         true in the filter function in typemanager.cs.
2467
2468         To properly report 122 (property is inaccessible because of its
2469         protection level) correctly, we report this error in ResolveAccess
2470         by failing if both the setter and the getter are lacking (ie, the
2471         lookup failed). 
2472
2473         DoResolve and DoLResolve have been modified to check for both
2474         setter/getter being null and returning silently, the reason being
2475         that I did not want to put the knowledge about this error in upper
2476         layers, like:
2477
2478         int old = Report.Errors;
2479         x = new PropertyExpr (...);
2480         if (old != Report.Errors)
2481                 return null;
2482         else
2483                 return x;
2484
2485         So the property expr is returned, but it is invalid, so the error
2486         will be flagged during the resolve process. 
2487
2488         * class.cs: Remove InheritablePropertySignatureCompare from the
2489         class, as we no longer depend on the property signature to compute
2490         whether it is possible to implement a method or not.
2491
2492         The reason is that calling PropertyInfo.GetGetMethod will return
2493         null (in .NET, in Mono it works, and we should change this), in
2494         cases where the Get Method does not exist in that particular
2495         class.
2496
2497         So this code:
2498
2499         class X { public virtual int A { get { return 1; } } }
2500         class Y : X { }
2501         class Z : Y { public override int A { get { return 2; } } }
2502
2503         Would fail in Z because the parent (Y) would not have the property
2504         defined.  So we avoid this completely now (because the alternative
2505         fix was ugly and slow), and we now depend exclusively on the
2506         method names.
2507
2508         (PropertyBase.CheckBase): Use a method-base mechanism to find our
2509         reference method, instead of using the property.
2510
2511         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
2512         routines are gone now.
2513
2514         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
2515         names, they were incorrectly named.
2516
2517         * cs-tokenizer.cs: Return are more gentle token on failure. 
2518
2519         * pending.cs (PendingImplementation.InterfaceMethod): This routine
2520         had an out-of-sync index variable, which caused it to remove from
2521         the list of pending methods the wrong method sometimes.
2522
2523 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
2524
2525         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
2526         CanWrite, because those refer to this particular instance of the
2527         property, and do not take into account the fact that we can
2528         override single members of a property.
2529
2530         Constructor requires an EmitContext.  The resolution process does
2531         not happen here, but we need to compute the accessors before,
2532         because the resolution does not always happen for properties.
2533         
2534         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
2535         subclass, before we did not update this flag, but we did update
2536         bindingflags. 
2537
2538         (GetAccessors): Drop this routine, as it did not work in the
2539         presence of partially overwritten set/get methods. 
2540
2541         Notice that this broke the cs1540 detection, but that will require
2542         more thinking. 
2543         
2544 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2545
2546         * class.cs:
2547         * codegen.cs:
2548         * driver.cs: issue a warning instead of an error if we don't support
2549         debugging for the platform. Also ignore a couple of errors that may
2550         arise when trying to write the symbols. Undo my previous patch.
2551
2552 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2553
2554         * driver.cs: ignore /debug switch except for Unix platforms.
2555
2556 2002-10-23  Nick Drochak  <ndrochak@gol.com>
2557
2558         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
2559
2560 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
2561
2562         * driver.cs: Do not make mcs-debug conditional, so we do not break
2563         builds that use it.
2564
2565         * statement.cs (UsageVector.MergeChildren): I would like Martin to
2566         review this patch.  But basically after all the children variables
2567         have been merged, the value of "Breaks" was not being set to
2568         new_breaks for Switch blocks.  I think that it should be set after
2569         it has executed.  Currently I set this to the value of new_breaks,
2570         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
2571         conservative, but I do not understand this code very well.
2572
2573         I did not break anything in the build, so that is good ;-)
2574
2575         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
2576
2577 2002-10-20  Mark Crichton  <crichton@gimp.org>
2578
2579         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
2580
2581 2002-10-20  Nick Drochak  <ndrochak@gol.com>
2582
2583         * cfold.cs: Fixed compile blocker.
2584
2585 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
2586
2587         * driver.cs: I was chekcing the key, not the file.
2588
2589 2002-10-19  Ravi Pratap  <ravi@ximian.com>
2590
2591         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
2592         message that we were generating - we just need to silently return
2593         a null.
2594
2595 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
2596
2597         * class.cs (Event.Define): Change my previous commit, as this
2598         breaks the debugger.  This is a temporary hack, as it seems like
2599         the compiler is generating events incorrectly to begin with.
2600
2601         * expression.cs (Binary.ResolveOperator): Added support for 
2602         "U operator - (E x, E y)"
2603
2604         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
2605         y)".
2606
2607         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
2608         init-only variables, but this path did not take into account that
2609         there might be also instance readonly variables.  Correct this
2610         problem. 
2611
2612         This fixes bug 32253
2613
2614         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
2615         delegates as well.
2616
2617         * driver.cs: Change the extension for modules to `netmodule'
2618
2619         * cs-parser.jay: Improved slightly the location tracking for
2620         the debugger symbols.
2621
2622         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
2623         modifiers that were specified instead of the hardcoded value
2624         (FamAndAssem).  This was basically ignoring the static modifier,
2625         and others.  Fixes 32429.
2626
2627         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
2628         fixed a bug in the process (32476)
2629
2630         * expression.cs (ArrayAccess.EmitAssign): Patch from
2631         hwang_rob@yahoo.ca that fixes bug 31834.3
2632
2633 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
2634
2635         * driver.cs: Make the module extension .netmodule.
2636
2637 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
2638
2639         * driver.cs: Report an error if the resource file is not found
2640         instead of crashing.
2641
2642         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
2643         false, like Emit does.
2644
2645 2002-10-16  Nick Drochak  <ndrochak@gol.com>
2646
2647         * typemanager.cs: Remove unused private member.  Also reported mcs
2648         bug to report this as a warning like csc.
2649
2650 2002-10-15  Martin Baulig  <martin@gnome.org>
2651
2652         * statement.cs (Statement.Emit): Made this a virtual method; emits
2653         the line number info and calls DoEmit().
2654         (Statement.DoEmit): New protected abstract method, formerly knows
2655         as Statement.Emit().
2656
2657         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
2658
2659 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
2660
2661         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
2662         have fixed a remaining problem: not every AddXXXX was adding a
2663         fully qualified name.  
2664
2665         Now everyone registers a fully qualified name in the DeclSpace as
2666         being defined instead of the partial name.  
2667
2668         Downsides: we are slower than we need to be due to the excess
2669         copies and the names being registered this way.  
2670
2671         The reason for this is that we currently depend (on the corlib
2672         bootstrap for instance) that types are fully qualified, because
2673         we dump all the types in the namespace, and we should really have
2674         types inserted into the proper namespace, so we can only store the
2675         basenames in the defined_names array.
2676
2677 2002-10-10  Martin Baulig  <martin@gnome.org>
2678
2679         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
2680         from bug #31834, see the bug report for a testcase which is
2681         miscompiled.
2682
2683 2002-10-10  Martin Baulig  <martin@gnome.org>
2684
2685         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
2686         flow analysis code for this.
2687
2688         * statement.cs (Do, While, For): Tell the flow analysis code about
2689         infinite loops.
2690         (FlowBranching.UsageVector): Added support for infinite loops.
2691         (Block.Resolve): Moved the dead code elimination here and use flow
2692         analysis to do it.
2693
2694 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
2695
2696         * class.cs (Field.Define): Catch cycles on struct type
2697         definitions. 
2698
2699         * typemanager.cs (IsUnmanagedtype): Do not recursively check
2700         fields if the fields are static.  We only need to check instance
2701         fields. 
2702
2703         * expression.cs (As.DoResolve): Test for reference type.
2704
2705         * statement.cs (Using.ResolveExpression): Use
2706         ConvertImplicitRequired, not ConvertImplicit which reports an
2707         error on failture
2708         (Using.ResolveLocalVariableDecls): ditto.
2709
2710         * expression.cs (Binary.ResolveOperator): Report errors in a few
2711         places where we had to.
2712
2713         * typemanager.cs (IsUnmanagedtype): Finish implementation.
2714
2715 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
2716
2717         * expression.cs: Use StoreFromPtr instead of extracting the type
2718         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
2719
2720         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
2721         an enumeration value to a System.Enum, but System.Enum is not a
2722         value type, but an class type, so we need to box.
2723
2724         (Expression.ConvertExplicit): One codepath could return
2725         errors but not flag them.  Fix this.  Fixes #31853
2726
2727         * parameter.cs (Resolve): Do not allow void as a parameter type.
2728
2729 2002-10-06  Martin Baulig  <martin@gnome.org>
2730
2731         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
2732         if it's a class type and not a struct.  Fixes #31815.
2733
2734 2002-10-06  Martin Baulig  <martin@gnome.org>
2735
2736         * statement.cs: Reworked the flow analysis code a bit to make it
2737         usable for dead code elimination.
2738
2739 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2740
2741         * cs-parser.jay: allow empty source files. Fixes bug #31781.
2742
2743 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
2744
2745         * expression.cs (ComposedCast.DoResolveType): A quick workaround
2746         to fix the test 165, will investigate deeper.
2747
2748 2002-10-04  Martin Baulig  <martin@gnome.org>
2749
2750         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
2751         finally blocks actually work.
2752         (Try.Resolve): We don't need to create a sibling for `finally' if
2753         there is no finally block.
2754
2755 2002-10-04  Martin Baulig  <martin@gnome.org>
2756
2757         * class.cs (Constructor.Define): The default accessibility for a
2758         non-default constructor is private, not public.
2759
2760 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
2761
2762         * class.cs (Constructor): Make AllowedModifiers public, add
2763         EXTERN.
2764
2765         * cs-parser.jay: Perform the modifiers test here, as the
2766         constructor for the Constructor class usually receives a zero
2767         because of the way we create it (first we create, later we
2768         customize, and we were never checking the modifiers).
2769
2770         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
2771         is a version of LookupTypeReflection that includes the type-name
2772         cache.  This can be used as a fast path for functions that know
2773         the fully qualified name and are only calling into *.GetType() to
2774         obtain a composed type.
2775
2776         This is also used by TypeManager.LookupType during its type
2777         composition.
2778
2779         (LookupType): We now also track the real type name, as sometimes
2780         we can get a quey for the real type name from things like
2781         ComposedCast.  This fixes bug 31422.
2782         
2783         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
2784         complete type fullname, it does not have to go through the type
2785         resolution system to obtain the composed version of the type (for
2786         obtaining arrays or pointers).
2787         
2788         (Conditional.Emit): Use the EmitBoolExpression to
2789         generate nicer code, as requested by Paolo.
2790
2791         (ArrayCreation.CheckIndices): Use the patch from
2792         hwang_rob@yahoo.ca to validate the array initializers. 
2793
2794 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
2795
2796         * class.cs (ConstructorInitializer.Emit): simplify code by using
2797         Invocation.EmitCall, and at the same time, fix the bugs in calling
2798         parent constructors that took variable arguments. 
2799
2800         * ecore.cs (Expression.ConvertNumericExplicit,
2801         Expression.ImplicitNumericConversion): Remove the code that
2802         manually wrapped decimal (InternalTypeConstructor call is now gone
2803         as well).
2804
2805         * expression.cs (Cast.TryReduce): Also handle decimal types when
2806         trying to perform a constant fold on the type.
2807
2808         * typemanager.cs (IsUnmanagedtype): Partially implemented.
2809
2810         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
2811         that only turned off an error report, and did nothing else. 
2812
2813 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
2814
2815         * driver.cs: Handle and ignore /fullpaths
2816
2817 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
2818
2819         * expression.cs (Binary.ResolveOperator): Catch the case where
2820         DoNumericPromotions returns true, 
2821
2822         (Binary.DoNumericPromotions): Simplify the code, and the tests.
2823
2824 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
2825
2826         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
2827         report error 70.
2828
2829 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
2830
2831         * ecore.cs (ConvertNumericExplicit): It is not enough that the
2832         conversion exists, but it is also required that the conversion be
2833         performed.  This manifested in "(Type64Enum) 2".  
2834
2835         * class.cs (TypeManager.AddMethod): The fix is not to change
2836         AddEnum, because that one was using a fully qualified name (every
2837         DeclSpace derivative does), but to change the AddMethod routine
2838         that was using an un-namespaced name.  This now correctly reports
2839         the duplicated name.
2840
2841         Revert patch until I can properly fix it.  The issue
2842         is that we have a shared Type space across all namespaces
2843         currently, which is wrong.
2844
2845         Options include making the Namespace a DeclSpace, and merge
2846         current_namespace/current_container in the parser.
2847
2848 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
2849
2850         * cs-parser.jay: Improve error reporting when we get a different
2851         kind of expression in local_variable_type and
2852         local_variable_pointer_type. 
2853
2854         Propagate this to avoid missleading errors being reported.
2855
2856         * ecore.cs (ImplicitReferenceConversion): treat
2857         TypeManager.value_type as a target just like object_type.   As
2858         code like this:
2859
2860         ValueType v = 1;
2861
2862         Is valid, and needs to result in the int 1 being boxed before it
2863         is assigned to the value type v.
2864
2865         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
2866         to validate the enumeration name.
2867
2868         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
2869         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
2870         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
2871
2872         * ecore.cs (TryImplicitIntConversion): When doing an
2873         implicit-enumeration-conversion, check if the type is 64-bits and
2874         perform a conversion before passing to EnumConstant.
2875
2876 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
2877
2878         * decl.cs (Error_AmbiguousTypeReference); New routine used to
2879         report ambiguous type references.  Unlike the MS version, we
2880         report what the ambiguity is.   Innovation at work ;-)
2881
2882         (DeclSpace.FindType): Require a location argument to
2883         display when we display an ambiguous error.
2884
2885         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
2886
2887         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
2888
2889         * expression.cs (EmitDynamicInitializers): Apply patch from
2890         hwang_rob@yahoo.ca that fixes the order in which we emit our
2891         initializers. 
2892
2893 2002-09-21  Martin Baulig  <martin@gnome.org>
2894
2895         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
2896         delegate takes no arguments.
2897
2898 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
2899
2900         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
2901         from integers.
2902
2903         * expression.cs: Extract the underlying type.
2904
2905         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
2906
2907         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
2908
2909 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
2910
2911         * class.cs (TypeContainer.DefineType): We can not use the nice
2912         PackingSize with the size set to 1 DefineType method, because it
2913         will not allow us to define the interfaces that the struct
2914         implements.
2915
2916         This completes the fixing of bug 27287
2917
2918         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
2919         means also structs.  This fixes part of the problem. 
2920         (Expresion.ImplicitReferenceConversionExists): ditto.
2921
2922         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
2923         error if there were no errors reported during the type lookup
2924         process, to avoid duplicates or redundant errors.  Without this
2925         you would get an ambiguous errors plus a type not found.  We have
2926         beaten the user enough with the first error.  
2927
2928         (DeclSparce.FindType): Emit a warning if we have an ambiguous
2929         reference. 
2930
2931         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
2932         during the resolution process, stop the lookup, this avoids
2933         repeated error reports (same error twice).
2934
2935         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
2936
2937         * typemanager.cs (LookupType): Redo the type lookup code to match
2938         the needs of System.Reflection.  
2939
2940         The issue is that System.Reflection requires references to nested
2941         types to begin with a "+" sign instead of a dot.  So toplevel
2942         types look like: "NameSpace.TopLevelClass", and nested ones look
2943         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
2944         levels. 
2945
2946 2002-09-19  Martin Baulig  <martin@gnome.org>
2947
2948         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
2949         says that a method always returns or always throws an exception,
2950         don't report the CS0161.
2951
2952         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
2953         set `Returns = new_returns'.
2954
2955 2002-09-19  Martin Baulig  <martin@gnome.org>
2956
2957         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
2958         to an enum constant, check for a CS0176.
2959
2960 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
2961
2962         * class.cs (TypeContainer.CheckPairedOperators): Now we check
2963         for operators that must be in pairs and report errors.
2964
2965         * ecore.cs (SimpleName.DoResolveType): During the initial type
2966         resolution process, when we define types recursively, we must
2967         check first for types in our current scope before we perform
2968         lookups in the enclosing scopes.
2969
2970         * expression.cs (MakeByteBlob): Handle Decimal blobs.
2971
2972         (Invocation.VerifyArgumentsCompat): Call
2973         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
2974         I thought we were supposed to always call this, but there are a
2975         few places in the code where we dont do it.
2976
2977 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
2978
2979         * driver.cs: Add support in -linkres and -resource to specify the
2980         name of the identifier.
2981
2982 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
2983
2984         * ecore.cs (StandardConversionExists): Sync with the conversion
2985         code: allow anything-* to void* conversions.
2986
2987         (FindMostSpecificSource): Use an Expression argument
2988         instead of a Type, because we might be handed over a Literal which
2989         gets a few more implicit conversions that plain types do not.  So
2990         this information was being lost.
2991
2992         Also, we drop the temporary type-holder expression when not
2993         required.
2994
2995 2002-09-17  Martin Baulig  <martin@gnome.org>
2996
2997         * class.cs (PropertyBase.CheckBase): Don't check the base class if
2998         this is an explicit interface implementation.
2999
3000 2002-09-17  Martin Baulig  <martin@gnome.org>
3001
3002         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
3003         different `IndexerName' attributes.
3004
3005         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
3006         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
3007         virtual CommonResolve().
3008
3009 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
3010
3011         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
3012         and convert that to the UnderlyingType.
3013
3014         * statement.cs (Foreach.Resolve): Indexers are just like variables
3015         or PropertyAccesses.
3016
3017         * cs-tokenizer.cs (consume_string): Track line numbers and columns
3018         inside quoted strings, we were not doing this before.
3019
3020 2002-09-16  Martin Baulig  <martin@gnome.org>
3021
3022         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
3023         resolve it.  This is needed for the definite assignment check of the
3024         instance expression, fixes bug #29846.
3025         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
3026
3027 2002-09-16  Nick Drochak  <ndrochak@gol.com>
3028
3029         * parameter.cs: Fix compile error.  Cannot reference static member
3030         from an instance object.  Is this an mcs bug?
3031
3032 2002-09-14  Martin Baulig  <martin@gnome.org>
3033
3034         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
3035         multiple times.  Fixes bug #30295, added test-166.cs.
3036
3037 2002-09-14  Martin Baulig  <martin@gnome.org>
3038
3039         * statement.cs (Block.Emit): Don't emit unreachable code.
3040         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
3041         `break' statements.
3042         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
3043
3044 2002-09-14  Martin Baulig  <martin@gnome.org>
3045
3046         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
3047         is set.
3048
3049 2002-09-14  Martin Baulig  <martin@gnome.org>
3050
3051         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
3052         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
3053         be false on the ms runtime.
3054
3055 2002-09-13  Martin Baulig  <martin@gnome.org>
3056
3057         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
3058         the CS0038 error message.
3059
3060 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
3061
3062         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
3063         constant inside, return it.
3064
3065 2002-09-12  Martin Baulig  <martin@gnome.org>
3066
3067         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
3068         implicit conversion can be done between enum types.
3069
3070         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
3071         check whether an implicit conversion to the current enum's UnderlyingType
3072         exists and report an error if not.
3073
3074         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
3075         without debugging support.
3076
3077         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
3078         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
3079
3080 2002-09-12  Martin Baulig  <martin@gnome.org>
3081
3082         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
3083
3084         * ecore.cs (IMemberExpr.DeclaringType): New property.
3085         (SimpleName.SimpleNameResolve): Check whether we're accessing a
3086         nonstatic member of an outer type (CS0038).
3087
3088 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
3089
3090         * driver.cs: Activate the using-error detector at warning level
3091         4 (at least for MS-compatible APIs).
3092
3093         * namespace.cs (VerifyUsing): Small buglett fix.
3094
3095         * pending.cs (PendingImplementation): pass the container pointer. 
3096
3097         * interface.cs (GetMethods): Allow for recursive definition.  Long
3098         term, I would like to move every type to support recursive
3099         definitions, not the current ordering mechanism that we have right
3100         now.
3101
3102         The situation is this: Attributes are handled before interfaces,
3103         so we can apply attributes to interfaces.  But some attributes
3104         implement interfaces, we will now handle the simple cases
3105         (recursive definitions will just get an error).  
3106
3107         * parameter.cs: Only invalidate types at the end if we fail to
3108         lookup all types.  
3109
3110 2002-09-09  Martin Baulig  <martin@gnome.org>
3111
3112         * ecore.cs (PropertyExpr.Emit): Also check for
3113         TypeManager.system_int_array_get_length so this'll also work when
3114         compiling corlib.  Fixes #30003.
3115
3116 2002-09-09  Martin Baulig  <martin@gnome.org>
3117
3118         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
3119         and throw an exception if we can't get the type's size.  Fixed #30040,
3120         added test-165.cs.
3121
3122 2002-09-09  Martin Baulig  <martin@gnome.org>
3123
3124         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
3125
3126         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
3127         context.  Fixes bug #30027.
3128
3129         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
3130         virtual functions.  Fixes bug #30043, added test-164.cs.
3131
3132 2002-09-08  Ravi Pratap  <ravi@ximian.com>
3133
3134         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
3135
3136 2002-09-08  Nick Drochak  <ndrochak@gol.com>
3137
3138         * driver.cs: Use an object to get the windows codepage since it's not a
3139         static property.
3140
3141 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
3142
3143         * statement.cs (For.Emit): for infinite loops (test == null)
3144         return whether there is a break inside, not always "true".
3145
3146         * namespace.cs (UsingEntry): New struct to hold the name of the
3147         using definition, the location where it is defined, and whether it
3148         has been used in a successful type lookup.
3149         
3150         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
3151         strings.
3152
3153         * decl.cs: ditto.
3154
3155 2002-09-06  Ravi Pratap  <ravi@ximian.com>
3156
3157         * attribute.cs : Fix incorrect code which relied on catching
3158         a NullReferenceException to detect a null being passed in
3159         where an object was expected.
3160
3161 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
3162
3163         * statement.cs (Try): flag the catch variable as assigned
3164
3165         * expression.cs (Cast): Simplified by using ResolveType instead of
3166         manually resolving.
3167
3168         * statement.cs (Catch): Fix bug by using ResolveType.
3169
3170 2002-09-06  Ravi Pratap  <ravi@ximian.com>
3171
3172         * expression.cs (BetterConversion): Special case for when we have
3173         a NullLiteral as the argument and we have to choose between string
3174         and object types - we choose string the way csc does.
3175
3176         * attribute.cs (Attribute.Resolve): Catch the
3177         NullReferenceException and report error #182 since the Mono
3178         runtime no more has the bug and having this exception raised means
3179         we tried to select a constructor which takes an object and is
3180         passed a null.
3181
3182 2002-09-05  Ravi Pratap  <ravi@ximian.com>
3183
3184         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
3185         message (1502, 1503) when we can't locate a method after overload
3186         resolution. This is much more informative and closes the bug
3187         Miguel reported.
3188
3189         * interface.cs (PopulateMethod): Return if there are no argument
3190         types. Fixes a NullReferenceException bug.
3191
3192         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
3193         expressions too. Previously we were checking only in one place for
3194         positional arguments leaving out named arguments.
3195
3196         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
3197         type to the enum type is not allowed. Remove code corresponding to
3198         that.
3199
3200         (ConvertNumericExplicit): Allow explicit conversions from
3201         the underlying type to enum type. This precisely follows the spec
3202         and closes a bug filed by Gonzalo.
3203         
3204 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3205
3206         * compiler.csproj:
3207         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
3208
3209 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
3210
3211         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
3212         it was important that we stored the right value after the
3213         reduction in `converted'.
3214
3215 2002-09-04  Martin Baulig  <martin@gnome.org>
3216
3217         * location.cs (Location.SymbolDocument): Use full pathnames for the
3218         source files.
3219
3220 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
3221
3222         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
3223         of the expression resolve mechanism, because that will catch the
3224         SimpleName error failures.
3225
3226         (Conditional): If we can not resolve the
3227         expression, return, do not crash.
3228
3229 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3230
3231         * cs-tokenizer.cs:
3232         (location): display token name instead of its number.
3233
3234 2002-08-28  Martin Baulig  <martin@gnome.org>
3235
3236         * expression.cs (Binary.ResolveOperator): Don't silently return
3237         but return an error if an operator cannot be applied between two
3238         enum types.
3239
3240 2002-08-28  Martin Baulig  <martin@gnome.org>
3241
3242         * class.cs (Constructor.Define): Set the permission attributes
3243         correctly instead of making all constructors public.
3244
3245 2002-08-28  Martin Baulig  <martin@gnome.org>
3246
3247         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
3248         for private members before reporting a CS0103; if we find anything,
3249         it's a CS0122.
3250
3251 2002-08-28  Martin Baulig  <martin@gnome.org>
3252
3253         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
3254         to check whether `closure_start_type == closure_invocation_type',
3255         we also need to check whether `m.DeclaringType == closure_invocation_type'
3256         before bypassing the permission checks.  We might be accessing
3257         protected/private members from the base class.
3258         (TypeManager.RealMemberLookup): Only set private_ok if private
3259         members were requested via BindingFlags.NonPublic.
3260
3261         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
3262
3263         * expression.cs (MemberAccess.ResolveMemberAccess): Set
3264         MethodGroupExpr.IsExplicitImpl if appropriate.
3265         (Invocation.DoResolve): Don't report the CS0120 for explicit
3266         interface implementations.
3267
3268 2002-08-27  Martin Baulig  <martin@gnome.org>
3269
3270         * expression.cs (Invocation.DoResolve): If this is a static
3271         method and we don't have an InstanceExpression, we must report
3272         a CS0120.
3273
3274 2002-08-25  Martin Baulig  <martin@gnome.org>
3275
3276         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
3277         `==' between a valuetype and an object.
3278
3279 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
3280
3281         * ecore.cs (TypeExpr): Provide a ToString method.
3282
3283 2002-08-24  Martin Baulig  <martin@gnome.org>
3284
3285         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
3286         now called proggie.dbg and it's a binary file.
3287
3288 2002-08-23  Martin Baulig  <martin@gnome.org>
3289
3290         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
3291
3292 2002-08-23  Martin Baulig  <martin@gnome.org>
3293
3294         * struct.cs (MyStructInfo.ctor): Make this work with empty
3295         structs; it's not allowed to use foreach() on null.
3296
3297 2002-08-23  Martin Baulig  <martin@gnome.org>
3298
3299         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
3300         writer the full pathname of the generated assembly.
3301
3302 2002-08-23  Martin Baulig  <martin@gnome.org>
3303
3304         * statements.cs (FlowBranching.UsageVector.MergeChildren):
3305         A `finally' block never returns or breaks; improved handling of
3306         unreachable code.
3307
3308 2002-08-23  Martin Baulig  <martin@gnome.org>
3309
3310         * statement.cs (Throw.Resolve): Allow `throw null'.
3311
3312 2002-08-23  Martin Baulig  <martin@gnome.org>
3313
3314         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
3315         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
3316         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
3317         MemberLookup would return a wrong event if this is an explicit
3318         interface implementation and the class has an event with the same
3319         name.
3320
3321 2002-08-23  Martin Baulig  <martin@gnome.org>
3322
3323         * statement.cs (Block.AddChildVariableNames): New public method.
3324         (Block.AddChildVariableName): Likewise.
3325         (Block.IsVariableNameUsedInChildBlock): Likewise.
3326         (Block.AddVariable): Check whether a variable name has already
3327         been used in a child block.
3328
3329         * cs-parser.jay (declare_local_variables): Mark all variable names
3330         from the current block as being used in a child block in the
3331         implicit block.
3332
3333 2002-08-23  Martin Baulig  <martin@gnome.org>
3334
3335         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
3336         find the symbol writer.
3337
3338         * driver.cs: csc also allows the arguments to /define being
3339         separated by commas, not only by semicolons.
3340
3341 2002-08-23  Martin Baulig  <martin@gnome.org>
3342
3343         * interface.cs (Interface.GetMembers): Added static check for events.
3344
3345 2002-08-15  Martin Baulig  <martin@gnome.org>
3346
3347         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
3348         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
3349
3350         * ecore.cs (Expression.MemberLookup): Added documentation and explained
3351         why the MethodData.EmitDestructor() change was necessary.
3352
3353 2002-08-20  Martin Baulig  <martin@gnome.org>
3354
3355         * class.cs (TypeContainer.FindMembers): Added static check for events.
3356
3357         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
3358
3359         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
3360         use Type.GetEvents(), not Type.FindMembers().
3361
3362 2002-08-20  Martin Baulig  <martin@gnome.org>
3363
3364         * decl.cs (MemberCache): Added a special method cache which will
3365         be used for method-only searched.  This ensures that a method
3366         search will return a MethodInfo with the correct ReflectedType for
3367         inherited methods.      
3368
3369 2002-08-20  Martin Baulig  <martin@gnome.org>
3370
3371         * decl.cs (DeclSpace.FindMembers): Made this public.
3372
3373 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3374
3375         * delegate.cs: fixed build on windows.
3376         [FIXME:  Filed as bug #29150: MCS must report these errors.]
3377
3378 2002-08-19  Ravi Pratap  <ravi@ximian.com>
3379
3380         * ecore.cs (StandardConversionExists): Return a false
3381         if we are trying to convert the void type to anything else
3382         since that is not allowed.
3383
3384         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
3385         we flag error 70 in the event an event is trying to be accessed
3386         directly from outside the declaring type.
3387
3388 2002-08-20  Martin Baulig  <martin@gnome.org>
3389
3390         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
3391         MemberCache from typemanager.cs to decl.cs.
3392
3393 2002-08-19  Martin Baulig  <martin@gnome.org>
3394
3395         * class.cs (TypeContainer): Implement IMemberContainer.
3396         (TypeContainer.DefineMembers): Create the MemberCache.
3397         (TypeContainer.FindMembers): Do better BindingFlags checking; only
3398         return public members if BindingFlags.Public was given, check
3399         whether members are static.
3400
3401 2002-08-16  Martin Baulig  <martin@gnome.org>
3402
3403         * decl.cs (DeclSpace.Define): Splitted this in Define and
3404         DefineMembers.  DefineMembers is called first and initializes the
3405         MemberCache.
3406
3407         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
3408         DefineMembers() on all our DeclSpaces.
3409
3410         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
3411         but call DefineMembers() on all nested interfaces.  We call their
3412         Define() in our new Define() function.
3413
3414         * interface.cs (Interface): Implement IMemberContainer.
3415         (Interface.Define): Moved all code except the attribute stuf to
3416         DefineMembers().
3417         (Interface.DefineMembers): Initialize the member cache.
3418
3419         * typemanager.cs (IMemberFinder): Removed this interface, we don't
3420         need this anymore since we can use MemberCache.FindMembers directly.
3421
3422 2002-08-19  Martin Baulig  <martin@gnome.org>
3423
3424         * typemanager.cs (MemberCache): When creating the cache for an
3425         interface type, add all inherited members.
3426         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
3427         to `out bool used_cache' and documented it.
3428         (TypeManager.MemberLookup): If we already used the cache in the first
3429         iteration, we don't need to do the interfaces check.
3430
3431 2002-08-19  Martin Baulig  <martin@gnome.org>
3432
3433         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
3434         here from IMemberFinder and don't implement this interface anymore.
3435         (DeclSpace.MemberCache): Moved here from IMemberFinder.
3436
3437         * typemanager.cs (IMemberFinder): This interface is now only used by
3438         classes which actually support the member cache.
3439         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
3440         since we only put DeclSpaces into this Hashtable.
3441         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
3442         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
3443
3444 2002-08-16  Martin Baulig  <martin@gnome.org>
3445
3446         * typemanager.cs (ICachingMemberFinder): Removed.
3447         (IMemberFinder.MemberCache): New property.
3448         (TypeManager.FindMembers): Merged this with RealFindMembers().
3449         This function will never be called from TypeManager.MemberLookup()
3450         so we can't use the cache here, just the IMemberFinder.
3451         (TypeManager.MemberLookup_FindMembers): Check whether the
3452         IMemberFinder has a MemberCache and call the cache's FindMembers
3453         function.
3454         (MemberCache): Rewrote larger parts of this yet another time and
3455         cleaned it up a bit.
3456
3457 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
3458
3459         * driver.cs (LoadArgs): Support quoting.
3460
3461         (Usage): Show the CSC-like command line arguments.
3462
3463         Improved a few error messages.
3464
3465 2002-08-15  Martin Baulig  <martin@gnome.org>
3466
3467         * typemanager.cs (IMemberContainer.Type): New property.
3468         (IMemberContainer.IsInterface): New property.
3469
3470         The following changes are conditional to BROKEN_RUNTIME, which is
3471         defined at the top of the file.
3472
3473         * typemanager.cs (MemberCache.MemberCache): Don't add the base
3474         class'es members, but add all members from TypeHandle.ObjectType
3475         if we're an interface.
3476         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
3477         is the current type.
3478         (MemberCache.CacheEntry.Container): Removed this field.
3479         (TypeHandle.GetMembers): Include inherited members.
3480
3481 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3482
3483         * typemanager.cs: fixed compilation and added a comment on a field that
3484         is never used.
3485
3486 2002-08-15  Martin Baulig  <martin@gnome.org>
3487
3488         * class.cs (ConstructorInitializer.Resolve): In the
3489         Expression.MemberLookup call, use the queried_type as
3490         invocation_type.
3491
3492         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
3493         declared' attribute, it's always true.
3494         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
3495         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
3496         temporary wrapper for FindMembers which tells MemberLookup whether
3497         members from the base classes are included in the return value.
3498         This will go away soon.
3499         (TypeManager.MemberLookup): Use this temporary hack here; once the
3500         new MemberCache is completed, we don't need to do the DeclaredOnly
3501         looping here anymore since the MemberCache will take care of this.
3502         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
3503         (MemberCache): When creating the MemberCache for a class, get
3504         members from the current class and all its base classes.
3505         (MemberCache.CacheEntry.Container): New field.  This is a
3506         temporary hack until the Mono runtime is fixed to distinguish
3507         between ReflectedType and DeclaringType.  It allows us to use MCS
3508         with both the MS runtime and the unfixed Mono runtime without
3509         problems and without accecting performance.
3510         (MemberCache.SearchMembers): The DeclaredOnly looping from
3511         TypeManager.MemberLookup is now done here.      
3512
3513 2002-08-14  Martin Baulig  <martin@gnome.org>
3514
3515         * statement.cs (MyStructInfo.MyStructInfo): Don't call
3516         Type.GetFields on dynamic types but get the fields from the
3517         corresponding TypeContainer.
3518         (MyStructInfo.GetStructInfo): Added check for enum types.
3519
3520         * typemanager.cs (MemberList.IsSynchronized): Implemented.
3521         (MemberList.SyncRoot): Implemented.
3522         (TypeManager.FilterWithClosure): No need to check permissions if
3523         closure_start_type == closure_invocation_type, don't crash if
3524         closure_invocation_type is null.
3525
3526 2002-08-13  Martin Baulig  <martin@gnome.org>
3527
3528         Rewrote TypeContainer.FindMembers to use a member cache.  This
3529         gives us a speed increase of about 35% for the self-hosting MCS
3530         build and of about 15-20% for the class libs (both on GNU/Linux).
3531
3532         * report.cs (Timer): New class to get enhanced profiling.  This
3533         whole class is "TIMER" conditional since it remarkably slows down
3534         compilation speed.
3535
3536         * class.cs (MemberList): New class.  This is an IList wrapper
3537         which we're now using instead of passing MemberInfo[]'s around to
3538         avoid copying this array unnecessarily.
3539         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
3540         (ICachingMemberFinder, IMemberContainer): New interface.
3541         (TypeManager.FilterWithClosure): If `criteria' is null, the name
3542         has already been checked, otherwise use it for the name comparision.
3543         (TypeManager.FindMembers): Renamed to RealMemberFinder and
3544         provided wrapper which tries to use ICachingMemberFinder.FindMembers
3545         if possible.  Returns a MemberList, not a MemberInfo [].
3546         (TypeHandle): New class, implements IMemberContainer.  We create
3547         one instance of this class per type, it contains a MemberCache
3548         which is used to do the member lookups.
3549         (MemberCache): New class.  Each instance of this class contains
3550         all members of a type and a name-based hash table.
3551         (MemberCache.FindMembers): This is our new member lookup
3552         function.  First, it looks up all members of the requested name in
3553         the hash table.  Then, it walks this list and sorts out all
3554         applicable members and returns them.
3555
3556 2002-08-13  Martin Baulig  <martin@gnome.org>
3557
3558         In addition to a nice code cleanup, this gives us a performance
3559         increase of about 1.4% on GNU/Linux - not much, but it's already
3560         half a second for the self-hosting MCS compilation.
3561
3562         * typemanager.cs (IMemberFinder): New interface.  It is used by
3563         TypeManager.FindMembers to call FindMembers on a TypeContainer,
3564         Enum, Delegate or Interface.
3565         (TypeManager.finder_to_member_finder): New PtrHashtable.
3566         (TypeManager.finder_to_container): Removed.
3567         (TypeManager.finder_to_delegate): Removed.
3568         (TypeManager.finder_to_interface): Removed.
3569         (TypeManager.finder_to_enum): Removed.
3570
3571         * interface.cs (Interface): Implement IMemberFinder.
3572
3573         * delegate.cs (Delegate): Implement IMemberFinder.
3574
3575         * enum.cs (Enum): Implement IMemberFinder.
3576
3577         * class.cs (TypeContainer): Implement IMemberFinder.
3578
3579 2002-08-12  Martin Baulig  <martin@gnome.org>
3580
3581         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
3582
3583 2002-08-12  Martin Baulig  <martin@gnome.org>
3584
3585         * ecore.cs (ITypeExpression): New interface for expressions which
3586         resolve to a type.
3587         (TypeExpression): Renamed to TypeLookupExpression.
3588         (Expression.DoResolve): If we're doing a types-only lookup, the
3589         expression must implement the ITypeExpression interface and we
3590         call DoResolveType() on it.
3591         (SimpleName): Implement the new ITypeExpression interface.
3592         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
3593         hack, the situation that we're only looking up types can't happen
3594         anymore when this method is called.  Moved the type lookup code to
3595         DoResolveType() and call it.
3596         (SimpleName.DoResolveType): This ITypeExpression interface method
3597         is now doing the types-only lookup.
3598         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
3599         (ResolveFlags): Added MaskExprClass.
3600
3601         * expression.cs (MemberAccess): Implement the ITypeExpression
3602         interface.
3603         (MemberAccess.DoResolve): Added support for a types-only lookup
3604         when we're called via ITypeExpression.DoResolveType().
3605         (ComposedCast): Implement the ITypeExpression interface.
3606
3607         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
3608         Expression.Resolve() with ResolveFlags.Type instead.
3609
3610 2002-08-12  Martin Baulig  <martin@gnome.org>
3611
3612         * interface.cs (Interface.Define): Apply attributes.
3613
3614         * attribute.cs (Attribute.ApplyAttributes): Added support for
3615         interface attributes.
3616
3617 2002-08-11  Martin Baulig  <martin@gnome.org>
3618
3619         * statement.cs (Block.Emit): Only check the "this" variable if we
3620         do not always throw an exception.
3621
3622         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
3623         whether the property has a set accessor.
3624
3625 2002-08-11  Martin Baulig  <martin@gnome.org>
3626
3627         Added control flow analysis support for structs.
3628
3629         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
3630         with control flow analysis turned off.
3631         (IVariable): New interface.
3632         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
3633         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
3634         (FieldExpr.DoResolve): Resolve the instance expression with flow
3635         analysis turned off and do the definite assignment check after the
3636         resolving when we know what the expression will resolve to.
3637
3638         * expression.cs (LocalVariableReference, ParameterReference):
3639         Implement the new IVariable interface, only call the flow analysis
3640         code if ec.DoFlowAnalysis is true.
3641         (This): Added constructor which takes a Block argument.  Implement
3642         the new IVariable interface.
3643         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
3644         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
3645         This does the definite assignment checks for struct members.
3646
3647         * class.cs (Constructor.Emit): If this is a non-static `struct'
3648         constructor which doesn't have any initializer, call
3649         Block.AddThisVariable() to tell the flow analysis code that all
3650         struct elements must be initialized before control returns from
3651         the constructor.
3652
3653         * statement.cs (MyStructInfo): New public class.
3654         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
3655         argument to this indexer.  If non-zero, check an individual struct
3656         member, not the whole struct.
3657         (FlowBranching.CheckOutParameters): Check struct members.
3658         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
3659         overloaded versions of these methods which take an additional
3660         `int field_idx' argument to check struct members.
3661         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
3662         overloaded versions of these methods which take an additional
3663         `string field_name' argument to check struct member.s
3664         (VariableInfo): Implement the IVariable interface.
3665         (VariableInfo.StructInfo): New public property.  Returns the
3666         MyStructInfo instance of the variable if it's a struct or null.
3667         (Block.AddThisVariable): New public method.  This is called from
3668         Constructor.Emit() for non-static `struct' constructor which do
3669         not have any initializer.  It creates a special variable for the
3670         "this" instance variable which will be checked by the flow
3671         analysis code to ensure that all of the struct's fields are
3672         initialized before control returns from the constructor.
3673         (UsageVector): Added support for struct members.  If a
3674         variable/parameter is a struct with N members, we reserve a slot
3675         in the usage vector for each member.  A struct is considered fully
3676         initialized if either the struct itself (slot 0) or all its
3677         members are initialized.
3678
3679 2002-08-08  Martin Baulig  <martin@gnome.org>
3680
3681         * driver.cs (Driver.MainDriver): Only report an error CS5001
3682         if there were no compilation errors.
3683
3684         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
3685         `UnsafeContext' property to determine whether the parent is in
3686         unsafe context rather than checking the parent's ModFlags:
3687         classes nested in an unsafe class are unsafe as well.
3688
3689 2002-08-08  Martin Baulig  <martin@gnome.org>
3690
3691         * statement.cs (UsageVector.MergeChildren): Distinguish between
3692         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
3693         we return.  Added test17() and test18() to test-154.cs.
3694
3695 2002-08-08  Martin Baulig  <martin@gnome.org>
3696
3697         * typemanager.cs (TypeManager.FilterWithClosure): If we have
3698         Family access, make sure the invoking type isn't a subclass of the
3699         queried type (that'd be a CS1540).
3700
3701         * ecore.cs (Expression.MemberLookup): Added overloaded version of
3702         this method which takes an additional `Type invocation_type'.
3703
3704         * expression.cs (BaseAccess.DoResolve): Use the base type as
3705         invocation and query type.
3706         (MemberAccess.DoResolve): If the lookup failed and we're about to
3707         report a CS0122, try a lookup with the ec.ContainerType - if this
3708         succeeds, we must report a CS1540.
3709
3710 2002-08-08  Martin Baulig  <martin@gnome.org>
3711
3712         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
3713         (MethodGroupExpr): Implement the IMemberExpr interface.
3714
3715         * expression (MemberAccess.ResolveMemberAccess): No need to have
3716         any special code for MethodGroupExprs anymore, they're now
3717         IMemberExprs.   
3718
3719 2002-08-08  Martin Baulig  <martin@gnome.org>
3720
3721         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
3722         Family, FamANDAssem and FamORAssem permissions.
3723         (TypeManager.IsSubclassOrNestedChildOf): New public method.
3724
3725 2002-08-08  Martin Baulig  <martin@gnome.org>
3726
3727         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
3728         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
3729         or loop block.
3730
3731 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
3732
3733         * driver.cs: implemented /resource option to embed managed resources.
3734
3735 2002-08-07  Martin Baulig  <martin@gnome.org>
3736
3737         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
3738         (FieldBase.HasFieldInitializer): New public property.
3739         (FieldBase.GetInitializerExpression): New public method.  Resolves and
3740         returns the field initializer and makes sure it is only resolved once.
3741         (TypeContainer.EmitFieldInitializers): Call
3742         FieldBase.GetInitializerExpression to get the initializer, this ensures
3743         that it isn't resolved multiple times.
3744
3745         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
3746         the resolving process (SimpleName/MemberLookup) that we're currently
3747         emitting a field initializer (which must not access any instance members,
3748         this is an error CS0236).
3749
3750         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
3751         argument, if the `IsFieldInitializer' flag is set, we must report and
3752         error CS0236 and not an error CS0120.   
3753
3754 2002-08-07  Martin Baulig  <martin@gnome.org>
3755
3756         * ecore.cs (IMemberExpr): New public interface.
3757         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
3758         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
3759         if the expression is an IMemberExpr.
3760
3761         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
3762         to be null, implicitly default to `this' if we're non-static in
3763         this case.  Simplified the code a lot by using the new IMemberExpr
3764         interface.  Also fixed bug #28176 here.
3765
3766 2002-08-06  Martin Baulig  <martin@gnome.org>
3767
3768         * cs-parser.jay (SimpleLookup): Removed.  We need to create
3769         ParameterReferences during semantic analysis so that we can do a
3770         type-only search when resolving Cast, TypeOf and SizeOf.
3771         (block): Pass the `current_local_parameters' to the Block's
3772         constructor.
3773
3774         * class.cs (ConstructorInitializer): Added `Parameters parameters'
3775         argument to the constructor.
3776         (ConstructorInitializer.Resolve): Create a temporary implicit
3777         block with the parameters.
3778
3779         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
3780         references here if we aren't doing a type-only search.
3781
3782         * statement.cs (Block): Added constructor which takes a
3783         `Parameters parameters' argument.
3784         (Block.Parameters): New public property.
3785
3786         * support.cs (InternalParameters.Parameters): Renamed `parameters'
3787         to `Parameters' and made it public readonly.
3788
3789 2002-08-06  Martin Baulig  <martin@gnome.org>
3790
3791         * ecore.cs (Expression.Warning): Made this public as well.
3792
3793         * report.cs (Report.Debug): Print the contents of collections.
3794
3795 2002-08-06  Martin Baulig  <martin@gnome.org>
3796
3797         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
3798         used to tell Resolve() which kinds of expressions it may return.
3799         (Expression.Resolve): Added overloaded version of this method which
3800         takes a `ResolveFlags flags' argument.  This can be used to tell
3801         Resolve() which kinds of expressions it may return.  Reports a
3802         CS0118 on error.
3803         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
3804         ResolveFlags.SimpleName.
3805         (Expression.Error118): Added overloaded version of this method which
3806         takes a `ResolveFlags flags' argument.  It uses the flags to determine
3807         which kinds of expressions are allowed.
3808
3809         * expression.cs (Argument.ResolveMethodGroup): New public method.
3810         Resolves an argument, but allows a MethodGroup to be returned.
3811         This is used when invoking a delegate.
3812
3813         * TODO: Updated a bit.
3814
3815 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3816
3817         Fixed compilation with csc.
3818
3819         * ecore.cs: Expression.Error made public. Is this correct? Should
3820         Warning be made public too?
3821
3822         * expression.cs: use ea.Location instead of ea.loc.
3823         [FIXME:  Filed as bug #28607: MCS must report these errors.]
3824
3825 2002-08-06  Martin Baulig  <martin@gnome.org>
3826
3827         * ecore.cs (Expression.loc): Moved the location here instead of
3828         duplicating it in all derived classes.
3829         (Expression.Location): New public property.
3830         (Expression.Error, Expression.Warning): Made them non-static and
3831         removed the location argument.
3832         (Expression.Warning): Added overloaded version which takes an
3833         `int level' argument.
3834         (Expression.Error118): Make this non-static and removed the
3835         expression and location arguments.
3836         (TypeExpr): Added location argument to the constructor.
3837
3838         * expression.cs (StaticCallExpr): Added location argument to
3839         the constructor.
3840         (Indirection, PointerArithmetic): Likewise.
3841         (CheckedExpr, UnCheckedExpr): Likewise.
3842         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
3843         (StringPtr): Likewise.
3844
3845
3846 2002-08-05  Martin Baulig  <martin@gnome.org>
3847
3848         * expression.cs (BaseAccess.DoResolve): Actually report errors.
3849
3850         * assign.cs (Assign.DoResolve): Check whether the source
3851         expression is a value or variable.
3852
3853         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
3854         while resolving the corresponding blocks.
3855
3856         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
3857         an error, don't silently return null.
3858
3859         * statement.cs (Block.AddVariable): Do the error reporting here
3860         and distinguish between CS0128 and CS0136.
3861         (Block.DoResolve): Report all unused labels (warning CS0164).
3862         (LabeledStatement): Pass the location to the constructor.
3863         (LabeledStatement.HasBeenReferenced): New property.
3864         (LabeledStatement.Resolve): Set it to true here.
3865
3866         * statement.cs (Return.Emit): Return success even after reporting
3867         a type mismatch error (CS0126 or CS0127), this is what csc does and
3868         it avoids confusing the users with any consecutive errors.
3869
3870 2002-08-05  Martin Baulig  <martin@gnome.org>
3871
3872         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
3873
3874         * const.cs (Const.LookupConstantValue): Catch circular definitions.
3875
3876         * expression.cs (MemberAccess.DoResolve): Silently return if an
3877         error has already been reported.
3878
3879         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
3880         error has already been reported.
3881
3882 2002-08-05  Martin Baulig  <martin@gnome.org>
3883
3884         * statement.cs (UsageVector): Only initialize the `parameters'
3885         vector if we actually have any "out" parameters.
3886
3887 2002-08-05  Martin Baulig  <martin@gnome.org>
3888
3889         * expression.cs (Binary.ResolveOperator): When combining delegates,
3890         they must have the same type.
3891
3892 2002-08-05  Martin Baulig  <martin@gnome.org>
3893
3894         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
3895         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
3896         work with the ms runtime and we also don't need it: if we're a
3897         PropertyBuilder and not in the `indexer_arguments' hash, then we
3898         are a property and not an indexer.
3899
3900         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
3901         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
3902         since the latter one doesn't work with the ms runtime.
3903
3904 2002-08-03  Martin Baulig  <martin@gnome.org>
3905
3906         Fixed bugs #27998 and #22735.
3907
3908         * class.cs (Method.IsOperator): New public field.
3909         (Method.CheckBase): Report CS0111 if there's already a method
3910         with the same parameters in the current class.  Report CS0508 when
3911         attempting to change the return type of an inherited method.
3912         (MethodData.Emit): Report CS0179 if a method doesn't have a body
3913         and it's not marked abstract or extern.
3914         (PropertyBase): New abstract base class for Property and Indexer.
3915         (PropertyBase.CheckBase): Moved here from Property and made it work
3916         for indexers.
3917         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
3918         the same so we can reuse it there.
3919         (Property, Indexer): Derive from PropertyBase.
3920         (MethodSignature.inheritable_property_signature_filter): New delegate
3921         to find properties and indexers.
3922
3923         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
3924         argument and improved error reporting.
3925
3926         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
3927         EmptyReadOnlyParameters and made it a property.
3928
3929         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
3930         version of this method which takes a `PropertyInfo indexer'.
3931         (TypeManager.RegisterIndexer): New method.
3932
3933         * class.cs: Added myself as author of this file :-)
3934
3935 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3936
3937         * class.cs: fixed compilation on windoze.
3938
3939 2002-08-03  Martin Baulig  <martin@gnome.org>
3940
3941         * interface.cs (Interface.GetInterfaceBases): Check whether all
3942         base interfaces are at least as accessible than the current one.
3943
3944         * class.cs (TypeContainer.GetClassBases): Check whether base types
3945         are at least as accessible than the current type.
3946         (TypeContainer.AsAccessible): Implemented and made non-static.
3947         (MemberBase.CheckParameters): Report errors if the accessibility
3948         checks fail.
3949
3950         * delegate.cs (Delegate.Delegate): The default visibility is
3951         internal for top-level types and private for nested types.
3952         (Delegate.Define): Report errors if the accessibility checks fail.
3953
3954         * enum.cs (Enum.Enum): The default visibility is internal for
3955         top-level types and private for nested types.
3956         (Enum.DefineType): Compute the correct visibility.
3957
3958         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
3959         function which takes a `bool is_toplevel' instead of a TypeContainer.
3960
3961         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
3962         builtin type.
3963
3964 2002-08-02  Martin Baulig  <martin@gnome.org>
3965
3966         * expression.cs (LocalVariableReferenc): Added constructor which
3967         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
3968         (LocalVariableReference.IsReadOnly): New property.
3969         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
3970         variable is readonly, use our own readonly flag to do this; you can
3971         use the new constructor to get a writable reference to a read-only
3972         variable.
3973
3974         * cs-parser.jay (foreach_statement, using_statement): Get a writable
3975         reference to the local variable.
3976
3977 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
3978
3979         * rootcontext.cs (ResolveCore): Also include System.Exception
3980
3981         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
3982         we reach an EmptyStatement.
3983
3984         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
3985         is also fine.
3986
3987         * expression.cs (Binary.ResolveOperator): Check error result in
3988         two places.
3989
3990         use brtrue/brfalse directly and avoid compares to null.
3991
3992 2002-08-02  Martin Baulig  <martin@gnome.org>
3993
3994         * class.cs (TypeContainer.Define): Define all nested interfaces here.
3995         Fixes bug #28407, added test-155.cs.
3996
3997 2002-08-01  Martin Baulig  <martin@gnome.org>
3998
3999         * class.cs (Event.EmitDefaultMethod): Make this work with static
4000         events.  Fixes #28311, added verify-3.cs.
4001
4002 2002-08-01  Martin Baulig  <martin@gnome.org>
4003
4004         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
4005         `is_disposable' fields.
4006         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
4007         `hm.is_disposable' if we're using the collection pattern.
4008         (Foreach.EmitCollectionForeach): Use the correct type for the
4009         enumerator's local variable, only emit the try/finally block if
4010         necessary (fixes #27713).
4011
4012 2002-08-01  Martin Baulig  <martin@gnome.org>
4013
4014         * ecore.cs (Expression.report118): Renamed to Error118 and made
4015         it public static.
4016
4017         * statement.cs (Throw.Resolve): Check whether the expression is of
4018         the correct type (CS0118) and whether the type derives from
4019         System.Exception (CS0155).
4020         (Catch.Resolve): New method.  Do the type lookup here and check
4021         whether it derives from System.Exception (CS0155).
4022         (Catch.CatchType, Catch.IsGeneral): New public properties.
4023
4024         * typemanager.cs (TypeManager.exception_type): Added.
4025
4026 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
4027
4028         * driver.cs: Updated About function.
4029
4030 2002-07-31  Martin Baulig  <martin@gnome.org>
4031
4032         Implemented Control Flow Analysis.
4033
4034         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
4035         (EmitContext.CurrentBranching): Added.
4036         (EmitContext.StartFlowBranching): Added.
4037         (EmitContext.EndFlowBranching): Added.
4038         (EmitContext.KillFlowBranching): Added.
4039         (EmitContext.IsVariableAssigned): Added.
4040         (EmitContext.SetVariableAssigned): Added.
4041         (EmitContext.IsParameterAssigned): Added.
4042         (EmitContext.SetParameterAssigned): Added.
4043         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
4044         Added control flow analysis stuff here.
4045
4046         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
4047         resolve the expression as lvalue.
4048         (LocalVariableReference.DoResolve): Check whether the variable has
4049         already been assigned.
4050         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
4051         the parameter as assigned here.
4052         (ParameterReference.DoResolve): Check whether the parameter has already
4053         been assigned.
4054         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
4055         expression as lvalue.
4056
4057         * statement.cs (FlowBranching): New class for the flow analysis code.
4058         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
4059         (LabeledStatement.IsDefined): New public property.
4060         (LabeledStatement.AddUsageVector): New public method to tell flow
4061         analyis that the label may be reached via a forward jump.
4062         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
4063         flow analysis.
4064         (VariableInfo.Number): New public field.  This is used by flow analysis
4065         to number all locals of a block.
4066         (Block.CountVariables): New public property.  This is the number of
4067         local variables in this block (including the locals from all parent
4068         blocks).
4069         (Block.EmitMeta): Number all the variables.
4070
4071         * statement.cs: Added flow analysis support to all classes.
4072
4073 2002-07-31  Martin Baulig  <martin@gnome.org>
4074
4075         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
4076         To get debugging messages, compile mcs with /define:MCS_DEBUG and
4077         then use this argument.
4078
4079         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
4080
4081         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
4082         use this to specify /define options.
4083
4084 2002-07-29  Martin Baulig  <martin@gnome.org>
4085
4086         * statement.cs (Fixed): Moved all code that does variable lookups
4087         and resolvings from Emit to Resolve.
4088
4089         * statement.cs (For): Moved all code that does variable lookups
4090         and resolvings from Emit to Resolve.
4091
4092         * statement.cs (Using): Moved all code that does variable lookups
4093         and resolvings from Emit to Resolve.
4094
4095 2002-07-29  Martin Baulig  <martin@gnome.org>
4096
4097         * attribute.cs (Attribute.Resolve): Explicitly catch a
4098         System.NullReferenceException when creating the
4099         CustromAttributeBuilder and report a different warning message.
4100
4101 2002-07-29  Martin Baulig  <martin@gnome.org>
4102
4103         * support.cs (ParameterData.ParameterName): Added method to
4104         get the name of a parameter.
4105
4106         * typemanager.cs (TypeManager.IsValueType): New public method.
4107
4108 2002-07-29  Martin Baulig  <martin@gnome.org>
4109
4110         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
4111         is a flag which specifies that it's either ref or out.
4112         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
4113         the out parameter to `out Parameter.Modifier mod', also set the
4114         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
4115
4116         * support.cs (InternalParameters.ParameterModifier): Distinguish
4117         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
4118         Parameter.Modifier.ISBYREF flag if it's either ref or out.
4119
4120         * expression.cs (Argument.GetParameterModifier): Distinguish
4121         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
4122         Parameter.Modifier.ISBYREF flag if it's either ref or out.
4123
4124 2002-07-29  Martin Baulig  <martin@gnome.org>
4125
4126         * expression.cs (ParameterReference.ParameterReference): Added
4127         `Location loc' argument to the constructor.
4128
4129         * cs-parser.jay: Pass location to ParameterReference.
4130
4131 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
4132
4133         * statement.cs (Try): Initialize the location.
4134
4135         * cs-parser.jay: pass location to Try.
4136
4137         * expression.cs (Unary.Reduce): Change the prototype to return
4138         whether a constant fold could be performed or not.  The result is
4139         returned in an out parameters.  In the case of Indirection and
4140         AddressOf, we want to perform the full tests.
4141
4142 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
4143
4144         * statement.cs (Statement.Emit): Flag dead code.
4145
4146 2002-07-27  Andrew Birkett  <andy@nobugs.org>
4147
4148         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
4149
4150 2002-07-27  Martin Baulig  <martin@gnome.org>
4151
4152         * class.cs (MethodData.Define): Put back call to
4153         TypeManager.AddMethod(), accidentally commented this out.
4154
4155         * report.cs (Debug): New public method to print debugging information,
4156         this is `[Conditional ("DEBUG")]'.
4157
4158 2002-07-26  Martin Baulig  <martin@gnome.org>
4159
4160         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
4161         (switch_statement): Push the current_block to the switch_stack and
4162         pop it again when we're done with the switch.
4163         (switch_section): The new block is a child of the current_block.
4164         Fixes bug #24007, added test-152.cs.
4165
4166 2002-07-27  Martin Baulig  <martin@gnome.org>
4167
4168         * expression.cs (Invocation.EmitArguments): When calling a varargs
4169         function with only its fixed arguments, we need to pass an empty
4170         array.
4171
4172 2002-07-27  Martin Baulig  <martin@gnome.org>
4173
4174         Mono 0.13 has been released.
4175
4176 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
4177
4178         * driver.cs: Rename --resource to --linkres, because that is what
4179         we do currently, we dont support --resource yet.
4180
4181         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
4182
4183 2002-07-25  Martin Baulig  <martin@gnome.org>
4184
4185         * class.cs (MethodData): New public class.  This is a `method builder'
4186         class for a method or one accessor of a Property/Indexer/Event.
4187         (MethodData.GetMethodFlags): Moved here from MemberBase.
4188         (MethodData.ApplyAttributes): Likewise.
4189         (MethodData.ApplyObsoleteAttribute): Likewise.
4190         (MethodData.ApplyConditionalAttribute): Likewise.
4191         (MethodData.ApplyDllImportAttribute): Likewise.
4192         (MethodData.CheckAbstractAndExternal): Likewise.
4193         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
4194         (MethodData.Emit): Formerly known as Method.Emit().
4195         (MemberBase): Moved everything which was specific to a single
4196         accessor/method to MethodData.
4197         (Method): Create a new MethodData and call Define() and Emit() on it.
4198         (Property, Indexer, Event): Create a new MethodData objects for each
4199         accessor and call Define() and Emit() on them.
4200
4201 2002-07-25  Martin Baulig  <martin@gnome.org>
4202
4203         Made MethodCore derive from MemberBase to reuse the code from there.
4204         MemberBase now also checks for attributes.
4205
4206         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
4207         (MemberBase.GetMethodFlags): Moved here from class Method and marked
4208         as virtual.
4209         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
4210         `CallingConventions cc' and `Attributes opt_attrs' arguments.
4211         (MemberBase.ApplyAttributes): New virtual method; applies the
4212         attributes to a method or accessor.
4213         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
4214         (MemberBase.ApplyConditionalAttribute): Likewise.
4215         (MemberBase.ApplyDllImportAttribute): Likewise.
4216         (MemberBase.CheckAbstractAndExternal): Likewise.
4217         (MethodCore.ParameterTypes): This is now a property instead of a
4218         method, it's initialized from DoDefineParameters().
4219         (MethodCore.ParameterInfo): Removed the set accessor.
4220         (MethodCore.DoDefineParameters): New protected virtual method to
4221         initialize ParameterTypes and ParameterInfo.
4222         (Method.GetReturnType): We can now simply return the MemberType.
4223         (Method.GetMethodFlags): Override the MemberBase version and add
4224         the conditional flags.
4225         (Method.CheckBase): Moved some code from Define() here, call
4226         DoDefineParameters() here.
4227         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
4228         here to avoid some larger code duplication.
4229         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
4230         ensure that abstract and external accessors don't declare a body.
4231
4232         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
4233         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
4234         lookup in the attribute's parent classes, so we need to abort as soon
4235         as we found the first match.
4236         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
4237         the attribute has no arguments.
4238
4239         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
4240         of a Method.
4241
4242 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4243
4244         * cs-parser.jay: reverted previous patch.
4245
4246 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4247
4248         * cs-parser.jay: fixed bug #22119.
4249
4250 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4251
4252         * attribute.cs: fixed compilation. The error was:
4253         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
4254         be assigned to before control leaves the current method."
4255         [FIXME:  Filed as bug #28186: MCS must report this error.]
4256
4257 2002-07-25  Martin Baulig  <martin@gnome.org>
4258
4259         * attribute.cs (Attribute.Conditional_GetConditionName): New static
4260         method to pull the condition name ouf of a Conditional attribute.
4261         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
4262         the obsolete message and error flag out of an Obsolete attribute.
4263
4264         * class.cs (Method.GetMethodFlags): New public method to get the
4265         TypeManager.MethodFlags for this method.
4266         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
4267         private methods.
4268         (Method.Define): Get and apply the Obsolete and Conditional attributes;
4269         if we're overriding a virtual function, set the new private variable
4270         `parent_method'; call the new TypeManager.AddMethod().
4271
4272         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
4273         the MethodBuilder and the Method in a PtrHashtable.
4274         (TypeManager.builder_to_method): Added for this purpose.
4275         (TypeManager.MethodFlags): Added IsObsoleteError.
4276         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
4277         Obsolete and Conditional arguments in MethodBuilders.  If we discover
4278         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
4279         the message from the attribute.
4280
4281 2002-07-24  Martin Baulig  <martin@gnome.org>
4282
4283         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
4284         preprocessor directives, ensure that the argument to #define/#undef is
4285         exactly one identifier and that it's actually an identifier.
4286
4287         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
4288         did not work ....
4289
4290 2002-07-24  Martin Baulig  <martin@gnome.org>
4291
4292         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
4293         initialize it to TypeManager.object_type in the constructor.
4294         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
4295         of the `hm.get_current' method if we're using the collection pattern.
4296         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
4297         for the explicit conversion to make it work when we're using the collection
4298         pattern and the `Current' property has a different return type than `object'.
4299         Fixes #27713.
4300
4301 2002-07-24  Martin Baulig  <martin@gnome.org>
4302
4303         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
4304         does not match, but don't report any errors.  This method is called in
4305         order for all methods in a MethodGroupExpr until a matching method is
4306         found, so we don't want to bail out if the first method doesn't match.
4307         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
4308         matches, report the 123.  Fixes #28070.
4309
4310 2002-07-24  Martin Baulig  <martin@gnome.org>
4311
4312         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
4313         TypeManager.TypeToCoreType() to the top of the method so the
4314         following equality checks will work.  Fixes #28107.
4315
4316 2002-07-24  Martin Baulig  <martin@gnome.org>
4317
4318         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
4319         operand is of type uint, and the other operand is of type sbyte,
4320         short or int, the operands are converted to type long." -
4321         Actually do what this comment already told us.  Fixes bug #28106,
4322         added test-150.cs.
4323
4324 2002-07-24  Martin Baulig  <martin@gnome.org>
4325
4326         * class.cs (MethodBase): New abstract class.  This is now a base
4327         class for Property, Indexer and Event to avoid some code duplication
4328         in their Define() and DefineMethods() methods.
4329         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
4330         generic methods for Define() and DefineMethods().
4331         (FieldBase): Derive from MemberBase, not MemberCore.
4332         (Property): Derive from MemberBase, not MemberCore.
4333         (Property.DefineMethod): Moved all the code from this method to the
4334         new MethodBase.DefineAccessor(), just call it with appropriate
4335         argumetnts.
4336         (Property.Define): Call the new Property.DoDefine(), this does some
4337         sanity checks and we don't need to duplicate the code everywhere.
4338         (Event): Derive from MemberBase, not MemberCore.
4339         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
4340         accessors, this will also make them work with interface events.
4341         (Indexer): Derive from MemberBase, not MemberCore.
4342         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
4343         (Indexer.Define): Use the new MethodBase functions.
4344
4345         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
4346         argument to the constructor.
4347         (Interface.FindMembers): Added support for interface events.
4348         (Interface.PopluateEvent): Implemented.
4349
4350         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
4351
4352 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
4353
4354         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
4355         but this is required to check for a method name being the same as
4356         the containing class.  
4357
4358         Handle this now.
4359
4360 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4361
4362         * interface.cs: initialize variable.
4363
4364 2002-07-23  Martin Baulig  <martin@gnome.org>
4365
4366         Implemented the IndexerName attribute in interfaces.
4367
4368         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
4369         name if this is an explicit interface implementation.
4370         (Indexer.InterfaceIndexerName): New public variable.  If we're
4371         implementing an interface indexer, this is the IndexerName in that
4372         interface.  Otherwise, it's the IndexerName.
4373         (Indexer.DefineMethod): If we're implementing interface indexer,
4374         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
4375         and Pending.ImplementIndexer methods.
4376         (Indexer.Define): Also define the PropertyBuilder if we're
4377         implementing an interface indexer and this is neither an explicit
4378         interface implementation nor do the IndexerName match the one in
4379         the interface.
4380
4381         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
4382         If a method is defined here, then we always need to create a proxy
4383         for it.  This is used when implementing interface indexers.
4384         (Pending.IsInterfaceIndexer): New public method.
4385         (Pending.ImplementIndexer): New public method.
4386         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
4387         This is used when implementing interface indexers to define a proxy
4388         if necessary.
4389         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
4390         define a proxy if necessary.
4391
4392         * interface.cs (Interface.IndexerName): New public variable.
4393         (Interface.PopulateIndexer): Set the IndexerName.
4394         (Interface.DefineIndexers): New private method.  Populate all the
4395         indexers and make sure their IndexerNames match.
4396
4397         * typemanager.cs (IndexerPropertyName): Added support for interface
4398         indexers.
4399
4400 2002-07-22  Martin Baulig  <martin@gnome.org>
4401
4402         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
4403         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
4404         ret if HasReturnLabel.
4405         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
4406         variables.
4407
4408         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
4409         and set the ec.LoopBeginTryCatchLevel.
4410         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
4411         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
4412         the current ec.TryCatchLevel, the branch goes out of an exception
4413         block.  In this case, we need to use Leave and not Br.
4414
4415 2002-07-22  Martin Baulig  <martin@gnome.org>
4416
4417         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
4418         block unless the block does not always return or it is contained in
4419         another try { ... } catch { ... } block.  Fixes bug #26506.
4420         Added verify-1.cs to the test suite.
4421
4422 2002-07-22  Martin Baulig  <martin@gnome.org>
4423
4424         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
4425         then we do not always return.  Fixes bug #24985.
4426
4427 2002-07-22  Martin Baulig  <martin@gnome.org>
4428
4429         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
4430         lookup on a per-class level; ie. walk up the class hierarchy until we
4431         found at least one applicable method, then choose the best among them.
4432         Fixes bug #24463 and test-29.cs.
4433
4434 2002-07-22  Martin Baulig  <martin@gnome.org>
4435
4436         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
4437         return types of the methods.  The return type is not part of the
4438         signature and we must not check it to make the `new' modifier work.
4439         Fixes bug #27999, also added test-147.cs.
4440         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
4441
4442         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
4443         on the method's return type.
4444
4445 2002-07-21  Martin Baulig  <martin@gnome.org>
4446
4447         * assign.cs: Make this work if the rightmost source is a constant and
4448         we need to do an implicit type conversion.  Also adding a few more tests
4449         to test-38.cs which should have caught this.
4450
4451         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
4452         target in the makefile for this.  The makefile.gnu is primarily intended
4453         for end-users who don't want to debug the compiler.
4454
4455 2002-07-21  Martin Baulig  <martin@gnome.org>
4456
4457         * assign.cs: Improved the Assign class so it can now handle embedded
4458         assignments (X = Y = Z = something).  As a side-effect this'll now also
4459         consume less local variables.  test-38.cs now passes with MCS, added
4460         a few new test cases to that test.
4461
4462 2002-07-20  Martin Baulig  <martin@gnome.org>
4463
4464         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
4465         instructions.  Fixes bug #27977, also added test-146.cs.
4466
4467 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4468
4469         * cs-tokenizer.cs: fixed getHex ().
4470
4471 2002-07-19  Martin Baulig  <martin@gnome.org>
4472
4473         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
4474         not Type.GetType() to lookup the array type.  This is needed when
4475         we're constructing an array of a user-defined type.
4476         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
4477         single-dimensional arrays, but also for single-dimensial arrays of
4478         type decimal.
4479
4480 2002-07-19  Martin Baulig  <martin@gnome.org>
4481
4482         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
4483         this function is called, it's not allowed to share LocalBuilders
4484         among ILGenerators.
4485
4486 2002-07-19  Martin Baulig  <martin@gnome.org>
4487
4488         * expression.cs (Argument.Resolve): Report an error 118 when trying
4489         to pass a type as argument.
4490
4491 2002-07-18  Martin Baulig  <martin@gnome.org>
4492
4493         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
4494         Conv_R_Un for the signed `long' type.
4495
4496 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
4497
4498         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
4499         `expr' for the temporary result, as that will fail if we do
4500         multiple resolves on the same expression.
4501
4502 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
4503
4504         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
4505         ec.TypeContainer for looking up aliases. 
4506
4507         * class.cs (TypeContainer): Remove LookupAlias from here.
4508
4509         * decl.cs (DeclSpace); Move here.
4510
4511 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
4512
4513         * class.cs (FindMembers): Only call filter if the constructor
4514         bulider is not null.
4515
4516         Also handle delegates in `NestedTypes' now.  Now we will perform
4517         type lookups using the standard resolution process.  This also
4518         fixes a bug.
4519
4520         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
4521         This uses Expressions (the limited kind that can be parsed by the
4522         tree) instead of strings.
4523
4524         * expression.cs (ComposedCast.ToString): Implement, used to flag
4525         errors since now we have to render expressions.
4526
4527         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
4528         FormArrayType. 
4529
4530         * ecore.cs (SimpleName.ToString): ditto.
4531
4532         * cs-parser.jay: Instead of using strings to assemble types, use
4533         Expressions to assemble the type (using SimpleName, ComposedCast,
4534         MemberAccess).  This should fix the type lookups in declarations,
4535         because we were using a different code path for this.
4536
4537         * statement.cs (Block.Resolve): Continue processing statements
4538         even when there is an error.
4539
4540 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
4541
4542         * class.cs (Event.Define): Also remove the `remove' method from
4543         the list of pending items.
4544
4545         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
4546         generate more compact code. 
4547
4548 2002-07-17  Martin Baulig  <martin@gnome.org>
4549
4550         * const.cs (Const.LookupConstantValue): Add support for constant
4551         `unchecked' and `checked' expressions.
4552         Also adding test case test-140.cs for this.
4553
4554 2002-07-17  Martin Baulig  <martin@gnome.org>
4555
4556         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
4557         check whether mi.ReturnType implements the IEnumerator interface; the
4558         `==' and the IsAssignableFrom() will fail in this situation.
4559
4560 2002-07-16  Ravi Pratap  <ravi@ximian.com>
4561
4562         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
4563         here too.
4564
4565 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4566
4567         * expression.cs: fixed bug #27811.
4568
4569 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
4570
4571         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
4572         Molaro: when we are a ref, the value already contains a pointer
4573         value, do not take the address of it.
4574
4575 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
4576         * removed mb-parser.jay and mb-tokenizer.cs
4577
4578 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
4579
4580         * expression.cs: check against the building corlib void type.
4581
4582 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
4583
4584         * ecore.cs: fix for valuetype static readonly fields: when 
4585         initializing them, we need their address, not the address of a copy.
4586
4587 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
4588
4589         * typemanager.cs: register also enum_type in corlib.
4590
4591 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
4592
4593         * class.cs: allow calling this (but not base) initializers in structs.
4594
4595 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
4596
4597         * ecore.cs: make sure we compare against the building base types
4598         in GetTypeSize ().
4599
4600 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
4601
4602         * typemanager.cs: fix TypeToCoreType() to handle void and object
4603         (corlib gets no more typerefs after this change).
4604
4605 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
4606
4607         * expression.cs (ArrayCreation.EmitArrayArguments): use
4608         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
4609
4610         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
4611         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
4612         array indexes, the runtime actually forbids them.
4613
4614         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
4615         for array arguments here.
4616
4617         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
4618         instead of the default for ValueTypes.
4619
4620         (New.DoEmit): Use IsValueType instead of
4621         IsSubclassOf (value_type)
4622         (New.DoResolve): ditto.
4623         (Invocation.EmitCall): ditto.
4624
4625         * assign.cs (Assign): ditto.
4626
4627         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
4628         Statements *are* currently doing part of their resolution during
4629         Emit.  
4630
4631         Expressions do always resolve during resolve, but statements are
4632         only required to propagate resolution to their children.
4633
4634 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
4635
4636         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
4637
4638         (LoadAssembly): Do not add the dll if it is already specified
4639         
4640         (MainDriver): Add the System directory to the link path at the end,
4641         after all the other -L arguments. 
4642
4643         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
4644         wrong opcode for loading bytes and bools (ldelem.i1 instead of
4645         ldelem.u1) and using the opposite for sbytes.
4646
4647         This fixes Digger, and we can finally run it.
4648
4649         * driver.cs (UnixParseOption): Move the option parsing here.  
4650         (CSCParseOption): Implement CSC-like parsing of options.
4651
4652         We now support both modes of operation, the old Unix way, and the
4653         new CSC-like way.  This should help those who wanted to make cross
4654         platform makefiles.
4655
4656         The only thing broken is that /r:, /reference: and /lib: are not
4657         implemented, because I want to make those have the same semantics
4658         as the CSC compiler has, and kill once and for all the confussion
4659         around this.   Will be doing this tomorrow.
4660
4661         * statement.cs (Unsafe.Resolve): The state is checked during
4662         resolve, not emit, so we have to set the flags for IsUnsfe here.
4663
4664 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
4665
4666         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
4667         not catch the Error_ObjectRefRequired in SimpleName (as it is
4668         possible to have a class/instance variable name that later gets
4669         deambiguated), we have to check this here.      
4670
4671 2002-07-10  Ravi Pratap  <ravi@ximian.com>
4672
4673         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
4674         make static and put into Expression.
4675
4676         (Event.Define): Register the private field of the event with the 
4677         TypeManager so that GetFieldFromEvent can get at it.
4678
4679         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
4680         keep track of the private field associated with an event which
4681         has no accessors.
4682
4683         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
4684         private field.
4685
4686         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
4687         
4688 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
4689
4690         * expression.cs (Binary.EmitBranchable): this routine emits the
4691         Binary expression in a branchable context.  This basically means:
4692         we need to branch somewhere, not just get the value on the stack.
4693
4694         This works together with Statement.EmitBoolExpression.
4695
4696         * statement.cs (Statement.EmitBoolExpression): Use
4697         EmitBranchable. 
4698
4699 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
4700
4701         * statement.cs (For): Reduce the number of jumps in loops.
4702
4703         (For): Implement loop inversion for the For statement.
4704
4705         (Break): We can be breaking out of a Try/Catch controlled section
4706         (foreach might have an implicit try/catch clause), so we need to
4707         use Leave instead of Br.
4708
4709         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
4710         now).  If the instace expression supports IMemoryLocation, we use
4711         the AddressOf method from the IMemoryLocation to extract the
4712         address instead of emitting the instance.
4713
4714         This showed up with `This', as we were emitting the instance
4715         always (Emit) instead of the Address of This.  Particularly
4716         interesting when This is a value type, as we dont want the Emit
4717         effect (which was to load the object).
4718         
4719 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
4720
4721         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
4722
4723         * statement.cs (Checked): Set the CheckedState during the resolve
4724         process too, as the ConvCast operations track the checked state on
4725         the resolve process, and not emit.
4726
4727         * cs-parser.jay (namespace_member_declaration): Flag that we have
4728         found a declaration when we do.  This is used to flag error 1529
4729
4730         * driver.cs: Report ok when we display the help only.
4731
4732 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
4733
4734         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
4735
4736 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
4737
4738         * cs-tokenizer.cs (define): We also have to track locally the
4739         defines.  AllDefines is just used for the Conditional Attribute,
4740         but we also need the local defines for the current source code. 
4741
4742 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
4743
4744         * statement.cs (While, For, Do): These loops can exit through a
4745         Break statement, use this information to tell whether the
4746         statement is the last piece of code.
4747
4748         (Break): Flag that we break.
4749
4750         * codegen.cs (EmitContexts): New `Breaks' state variable.
4751
4752 2002-07-03  Martin Baulig  <martin@gnome.org>
4753
4754         * class.cs (TypeContainer.MethodModifiersValid): Allow override
4755         modifiers in method declarations in structs.  Otherwise, you won't
4756         be able to override things like Object.Equals().
4757
4758 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
4759
4760         * class.cs (Method, Property, Indexer): Do not allow the public
4761         modifier to be used in explicit interface implementations.
4762
4763         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
4764         override modifiers in method declarations in structs
4765
4766 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
4767
4768         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
4769         integer or real overflow, report an error
4770
4771 2002-07-02  Martin Baulig  <martin@gnome.org>
4772
4773         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
4774         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
4775         to tell the runtime about our newly created System.Object and
4776         System.ValueType types.
4777
4778 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
4779
4780         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
4781         struct instead of Ldarg/Starg.
4782
4783 2002-07-02  Martin Baulig  <martin@gnome.org>
4784
4785         * expression.cs (Indirection.Indirection): Call
4786         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
4787
4788 2002-07-02  Martin Baulig  <martin@gnome.org>
4789
4790         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
4791         ValueType, call TypeManager.TypeToCoreType() on it.
4792         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
4793         the OpCodes.Newarr argument.
4794
4795 2002-07-02  Martin Baulig  <martin@gnome.org>
4796
4797         * expression.cs (Invocation.EmitCall): When compiling corlib,
4798         replace all calls to the system's System.Array type to calls to
4799         the newly created one.
4800
4801         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
4802         System.Array methods.
4803         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
4804         from the system's System.Array type which must be replaced.
4805
4806 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
4807
4808         * typemanager.cs: load unverifiable_code_ctor so we can build
4809         corlib using the correct type. Avoid using GetTypeCode() with
4810         TypeBuilders.
4811         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
4812         TypeManager.object_type to allow building corlib.
4813
4814 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
4815
4816         * ecore.cs: handle System.Enum separately in LoadFromPtr().
4817
4818 2002-07-01  Martin Baulig  <martin@gnome.org>
4819
4820         * class.cs: Make the last change actually work, we need to check
4821         whether `ifaces != null' to avoid a crash.
4822
4823 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
4824
4825         * class.cs: when we build structs without fields that implement
4826         interfaces, we need to add the interfaces separately, since there is
4827         no API to both set the size and add the interfaces at type creation
4828         time.
4829
4830 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
4831
4832         * expression.cs: the dimension arguments to the array constructors
4833         need to be converted if they are a long.
4834
4835 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
4836
4837         * class.cs: don't emit ldarg.0 if there is no parent constructor
4838         (fixes showstopper for corlib).
4839
4840 2002-06-29  Martin Baulig  <martin@gnome.org>
4841
4842         MCS now compiles corlib on GNU/Linux :-)
4843
4844         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
4845         ie. check for MethodImplOptions.InternalCall.
4846
4847         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
4848         and TypeManager.attribute_type are null, so we must explicitly check
4849         whether parent is not null to find out whether it's an attribute type.
4850         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
4851         and SetBuilder, not only if the property is neither abstract nor external.
4852         This is necessary to set the MethodImplOptions on the accessor methods.
4853         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
4854         SetBuilder, see Property.Emit().
4855
4856         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
4857         populate "System.Object", "System.ValueType" and "System.Attribute" since
4858         they've already been populated from BootCorlib_PopulateCoreTypes().
4859
4860 2002-06-29  Martin Baulig  <martin@gnome.org>
4861
4862         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
4863         is the NullLiteral, we also need to make sure that target_type is not
4864         an enum type.   
4865
4866 2002-06-29  Martin Baulig  <martin@gnome.org>
4867
4868         * rootcontext.cs (RootContext.ResolveCore): We must initialize
4869         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
4870         before calling BootstrapCorlib_ResolveDelegate ().
4871
4872 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4873
4874         * statement.cs: fixed build-breaker. All tests passed ok.
4875
4876 2002-06-27  Martin Baulig  <martin@gnome.org>
4877
4878         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
4879         for System.Decimal when compiling corlib.
4880
4881 2002-06-27  Martin Baulig  <martin@gnome.org>
4882
4883         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
4884         switch blocks which contain nothing but a default clause.
4885
4886 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
4887
4888        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
4889
4890 2002-06-27  Martin Baulig  <martin@gnome.org>
4891
4892         * ecore.cs (PropertyExpr.PropertyExpr): Call
4893         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
4894
4895         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
4896         is already a TypeBuilder.
4897
4898 2002-06-27  Martin Baulig  <martin@gnome.org>
4899
4900         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
4901         `target_type == TypeManager.array_type', not IsAssignableFrom() in
4902         the "from an array-type to System.Array" case.  This makes it work
4903         when compiling corlib.
4904
4905 2002-06-27  Martin Baulig  <martin@gnome.org>
4906
4907         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
4908         non-static PropertyExpr, set its InstanceExpression.  This makes
4909         the `ICollection.Count' property work in System/Array.cs.
4910
4911 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
4912
4913         * driver.cs: Made error handling more consistent.  Errors now
4914         tracked by Report class, so many methods which used to return int
4915         now return void.  Main() now prints success/failure and 
4916         errors/warnings message.
4917
4918         Renamed '--probe' compiler argument to '--expect-error'.  Removed
4919         the magic number return values (123 and 124).  Now, if the
4920         expected error occurs, the compiler exits with success (exit value
4921         0).  If the compilation completes without seeing that particular
4922         error, the compiler exits with failure (exit value 1).  The
4923         makefile in mcs/errors has been changed to handle the new behaviour.
4924
4925         * report.cs: Made 'expected error' number a property and renamed
4926         it from 'Probe' to 'ExpectedError'.
4927
4928         * genericparser.cs: Removed error handling support, since it is
4929         now all done by Report class.
4930
4931         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
4932         class, so parse() no longer returns an int.
4933
4934         * namespace.cs: Use Report.Error instead of GenericParser.error
4935
4936 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
4937
4938         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
4939         TypeContainer.AddOperator): At the front of the list put the
4940         explicit implementations, so they get resolved/defined first. 
4941
4942 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
4943
4944         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
4945         interface type is implemented by this TypeContainer.  Used during
4946         explicit interface implementation.
4947
4948         (Property.Define, Indexer.Define, Method.Define): Validate that
4949         the given interface in the explicit implementation is one of the
4950         base classes for the containing type.
4951
4952         Also if we are explicitly implementing an interface, but there is
4953         no match in the pending implementation table, report an error.
4954
4955         (Property.Define): Only define the property if we are
4956         not explicitly implementing a property from an interface.  Use the
4957         correct name also for those properties (the same CSC uses,
4958         although that is really not needed).
4959         
4960         (Property.Emit): Do not emit attributes for explicitly implemented
4961         properties, as there is no TypeBuilder.
4962
4963         (Indexer.Emit): ditto.
4964
4965         Hiding then means that we do not really *implement* a pending
4966         implementation, which makes code fail.
4967
4968 2002-06-22  Martin Baulig  <martin@gnome.org>
4969
4970         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
4971         the return value of Object.GetType().  [FIXME: we need to do this whenever
4972         we get a type back from the reflection library].
4973
4974 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
4975
4976         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
4977
4978 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
4979
4980         * attribute.cs: Return null if we can not look up the type.
4981
4982         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
4983         the interface types found.
4984
4985         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
4986         interface types found.
4987
4988         * typemanager.cs (GetInterfaces): Make this routine returns alll
4989         the interfaces and work around the lame differences between
4990         System.Type and System.Reflection.Emit.TypeBuilder in the results
4991         result for GetInterfaces.
4992         
4993         (ExpandInterfaces): Given an array of interface types, expand and
4994         eliminate repeated ocurrences of an interface.  This expands in
4995         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
4996         be IA, IB, IC.
4997         
4998 2002-06-21  Martin Baulig  <martin@gnome.org>
4999
5000         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
5001         on System.Enum.
5002
5003 2002-06-21  Martin Baulig  <martin@gnome.org>
5004
5005         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
5006         and called with one of the core types, return the corresponding typebuilder for
5007         that type.
5008
5009         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
5010         element type.
5011
5012 2002-06-21  Martin Baulig  <martin@gnome.org>
5013
5014         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
5015         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
5016         (Expression.ConvertReferenceExplicit): Likewise.
5017
5018         * expression.cs (ElementAccess.DoResolve): Likewise.
5019         (ElementAccess.DoResolveLValue): Likewise.
5020
5021 2002-06-10  Martin Baulig  <martin@gnome.org>
5022
5023         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
5024         add the "value" parameter to the parameter list.
5025
5026         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
5027         to our caller.
5028
5029 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
5030
5031         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
5032         the argument to an int, uint, long or ulong, per the spec.  Also
5033         catch negative constants in array creation.
5034
5035 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
5036
5037         * class.cs: do not allow the same interface to appear twice in
5038         the definition list.
5039
5040 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
5041
5042         * ecore.cs: don't use ldlen with System.Array.
5043
5044 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
5045
5046         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
5047
5048 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
5049
5050         * modifiers.cs: produce correct field attributes for protected
5051         internal. Easy fix so miguel can work on ther harder stuff:-)
5052
5053 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
5054
5055         * pending.cs: New file.  Move the code from class.cs here.
5056         Support clearning the pending flag for all methods (when not doing
5057         explicit interface implementation).
5058
5059 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
5060
5061         * rootcontext.cs: added a couple more types needed to bootstrap.
5062
5063 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
5064
5065         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
5066         constructor in the type, instead of any constructor in the type
5067         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
5068         a bug in the Mono runtime when applying the params attribute). 
5069
5070 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
5071         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
5072
5073 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
5074
5075         * expression.cs (Unary.ResolveOperator): Use TypeManager
5076         to resolve the type.
5077         
5078 2002-06-13  Ravi Pratap  <ravi@ximian.com>
5079
5080         * cs-parser.jay (enum_member_declaration): Pass in the attributes
5081         attached.
5082
5083         * enum.cs (AddEnumMember): Add support to store the attributes associated 
5084         with each member too.
5085
5086         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
5087         field builders too - this takes care of the enum member case.
5088
5089 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
5090
5091         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
5092         address-of operator on both value types and pointers.
5093         
5094 2002-06-10  Martin Baulig  <martin@gnome.org>
5095
5096         * interface.cs (Interface.PopulateIndexer): Add the indexer's
5097         PropertyBuilder to the `property_builders' list.
5098
5099         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
5100         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
5101         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
5102         find any indexers which are inherited from an interface.
5103
5104 2002-06-09  Martin Baulig  <martin@gnome.org>
5105
5106         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
5107         the same type as the constant if necessary.  There's also a test-130.cs
5108         for this.
5109
5110         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
5111
5112         * typemanager.cs (TypeManager.ChangeType): Previously known as
5113         Enum.ChangeEnumType().
5114
5115 2002-06-09  Martin Baulig  <martin@gnome.org>
5116
5117         * expression.cs (Cast.TryReduce): Added support for consts.
5118
5119 2002-06-08  Ravi Pratap  <ravi@ximian.com>
5120
5121         * class.cs (Accessor): Hold attributes information so we can pass
5122         it along.
5123
5124         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
5125         Modify to pass in attributes attached to the methods.
5126
5127         (add_accessor_declaration, remove_accessor_declaration): Ditto.
5128
5129         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
5130         to handle the Accessor kind :-)
5131
5132         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
5133         
5134 2002-06-08  Martin Baulig  <martin@gnome.org>
5135
5136         * expression.cs (Unary.TryReduceNegative): Added support for
5137         ULongConstants.
5138
5139 2002-06-08  Martin Baulig  <martin@gnome.org>
5140
5141         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
5142         name can't be found in the `defined_names' - the caller will do a
5143         MemberLookup in this case and thus find methods in System.Enum
5144         such as Enum.IsDefined().
5145
5146 2002-06-08  Martin Baulig  <martin@gnome.org>
5147
5148         * enum.cs (Enum.ChangeEnumType): This is a custom version of
5149         Convert.ChangeType() which works with TypeBuilder created types.
5150         (Enum.LookupEnumValue, Enum.Define): Use it here.
5151
5152         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
5153         `TypeBuilder.BaseType != null' check.
5154         (TypeContainer.FindMembers): Only lookup parent members if we
5155         actually have a parent.
5156         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
5157         (ConstructorInitializer.Resolve): Likewise.
5158
5159         * interface.cs (Interface.FindMembers): Added
5160         `TypeBuilder.BaseType != null' check.
5161
5162         * rootcontext.cs (RootContext.ResolveCore): Added
5163         "System.Runtime.CompilerServices.IndexerNameAttribute" to
5164         classes_second_stage.
5165
5166         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
5167         debug_type and trace_type when compiling with --nostdlib.       
5168
5169 2002-06-07  Martin Baulig  <martin@gnome.org>
5170
5171         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
5172         (AddField): Set it to true when adding a non-static field.
5173         (DefineType): Use `have_nonstatic_fields' to find out whether we
5174         have non-static fields, not `Fields != null'.
5175
5176 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
5177
5178         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
5179         dereferencing a null on the static-field code path)
5180
5181 2002-05-30  Martin Baulig  <martin@gnome.org>
5182
5183         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
5184         to take command line arguments.  Use reflection to call the new
5185         custom `Initialize' function on the symbol writer and pass it the
5186         command line arguments.
5187
5188         * driver.cs (--debug-args): New command line argument to pass command
5189         line arguments to the symbol writer.
5190
5191 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
5192
5193         * assign.cs (DoResolve): Forgot to do the implicit conversion to
5194         the target type for indexers and properties.  Thanks to Joe for
5195         catching this.
5196
5197 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
5198
5199         * typemanager.cs (MethodFlags): returns the method flags
5200         (Obsolete/ShouldIgnore) that control warning emission and whether
5201         the invocation should be made, or ignored. 
5202
5203         * expression.cs (Invocation.Emit): Remove previous hack, we should
5204         not do this on matching a base type, we should do this based on an attribute
5205
5206         Only emit calls to System.Diagnostics.Debug and
5207         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
5208         on the command line.
5209
5210         * rootcontext.cs: Global settings for tracing and debugging.
5211
5212         * cs-tokenizer.cs (define): New utility function to track
5213         defines.   Set the global settings for TRACE and DEBUG if found.
5214
5215 2002-05-25  Ravi Pratap  <ravi@ximian.com>
5216
5217         * interface.cs (Populate*): Pass in the TypeContainer as well as
5218         the DeclSpace as parameters so that we can create EmitContexts and
5219         then use that to apply attributes etc.
5220
5221         (PopulateMethod, PopulateEvent, PopulateProperty)
5222         (PopulateIndexer): Apply attributes everywhere.
5223
5224         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
5225         etc.
5226
5227         (ApplyAttributes): Update accordingly.
5228
5229         We now apply interface attributes for all members too.
5230
5231 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
5232
5233         * class.cs (Indexer.Define); Correctly check if we are explicit
5234         implementation (instead of checking the Name for a ".", we
5235         directly look up if the InterfaceType was specified).
5236
5237         Delay the creation of the PropertyBuilder.
5238
5239         Only create the PropertyBuilder if we are not an explicit
5240         interface implementation.   This means that explicit interface
5241         implementation members do not participate in regular function
5242         lookups, and hence fixes another major ambiguity problem in
5243         overload resolution (that was the visible effect).
5244
5245         (DefineMethod): Return whether we are doing an interface
5246         implementation. 
5247         
5248         * typemanager.cs: Temporary hack until we get attributes in
5249         interfaces (Ravi is working on that) and we get IndexerName
5250         support in interfaces.
5251
5252         * interface.cs: Register the indexers as properties.
5253
5254         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
5255         warning, I have verified that this is a bug in the .NET runtime
5256         (JavaScript suffers of the same problem).
5257
5258         * typemanager.cs (MemberLookup): When looking up members for
5259         interfaces, the parent of an interface is the implicit
5260         System.Object (so we succeed in searches of Object methods in an
5261         interface method invocation.  Example:  IEnumerable x;  x.ToString
5262         ()) 
5263
5264 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
5265
5266         * class.cs (Event): Events should also register if they do
5267         implement the methods that an interface requires.
5268
5269         * typemanager.cs (MemberLookup); use the new GetInterfaces
5270         method. 
5271
5272         (GetInterfaces): The code used to lookup interfaces for a type is
5273         used in more than one place, factor it here. 
5274
5275         * driver.cs: Track the errors at the bottom of the file, we kept
5276         on going.
5277
5278         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
5279         instance if the method we are calling is static!
5280
5281 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
5282
5283         * attribute.cs (ApplyAttributes): Make this function filter out
5284         the IndexerName attribute (as that attribute in reality is never
5285         applied) and return the string constant for the IndexerName
5286         attribute. 
5287
5288         * class.cs (TypeContainer.Emit): Validate that all the indexers
5289         have the same IndexerName attribute, and if so, set the
5290         DefaultName attribute on the class. 
5291
5292         * typemanager.cs: The return value might contain other stuff (not
5293         only methods).  For instance, consider a method with an "Item"
5294         property and an Item method.
5295
5296         * class.cs: If there is a problem with the parameter types,
5297         return. 
5298
5299 2002-05-24  Ravi Pratap  <ravi@ximian.com>
5300
5301         * ecore.cs (ImplicitConversionExists): Wrapper function which also
5302         looks at user defined conversion after making a call to 
5303         StandardConversionExists - we need this for overload resolution.
5304
5305         * expression.cs : Update accordingly the various method calls.
5306
5307         This fixes 2 bugs filed against implicit user defined conversions 
5308
5309 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
5310
5311         * statement.cs: Track the result of the assignment.
5312
5313 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
5314
5315         * expression.cs (MemberAccess): Improved error reporting for
5316         inaccessible members.
5317
5318 2002-05-22  Martin Baulig  <martin@gnome.org>
5319
5320         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
5321         itself with debugging support.
5322
5323 2002-05-22  Martin Baulig  <martin@gnome.org>
5324
5325         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
5326         Removed, this isn't needed anymore.
5327
5328 2002-05-20  Martin Baulig  <martin@gnome.org>
5329
5330         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
5331         be underlying type for an enum.
5332
5333 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
5334
5335         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
5336         that splits out the loading of just the core types.
5337
5338         * rootcontext.cs (ResolveCore): Split the struct resolution in
5339         two, so we can load the enumeration underlying types before any
5340         enums are used.
5341
5342         * expression.cs (Is): Bandaid until we fix properly Switch (see
5343         bug #24985 for details).
5344
5345         * typemanager.cs (ImplementsInterface): The hashtable will contain
5346         a null if there are no interfaces implemented.
5347
5348 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
5349
5350         * cs-parser.jay (indexer_declarator): It is fine to have array
5351         parameters
5352
5353 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
5354
5355         * typemanager.cs: (RegisterBuilder): New function used to register
5356         TypeBuilders that implement interfaces.  Since
5357         TypeBuilder.GetInterfaces (as usual) does not work with lame
5358         Reflection.Emit. 
5359         (AddUserType): register interfaces.
5360
5361         (ImplementsInterface): Use the builder_to_ifaces hash if we are
5362         dealing with TypeBuilder.  Also, arrays are showing up as
5363         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
5364         methods can not be invoked on them!
5365
5366         * ecore.cs (ExplicitReferenceConversionExists): Made public.
5367         (ImplicitReferenceConversionExists): Split out from
5368         StandardConversionExists. 
5369
5370         * expression.cs (As): We were only implementing one of the three
5371         cases for the as operator.  We now implement them all.
5372         (Is): Implement the various other cases for Is as well.
5373
5374         * typemanager.cs (CACHE): New define used to control if we want or
5375         not the FindMembers cache.  Seems to have a negative impact on
5376         performance currently
5377
5378         (MemberLookup): Nested types have full acess to
5379         enclosing type members
5380
5381         Remove code that coped with instance/static returns for events, we
5382         now catch this in RealFindMembers.
5383
5384         (RealFindMembers): only perform static lookup if the instance
5385         lookup did not return a type or an event.  
5386
5387 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
5388
5389         * assign.cs (CompoundAssign): We pass more semantic information
5390         now to Compound Assignments than we did before: now we have all
5391         the information at hand, and now we resolve the target *before* we
5392         do the expression expansion, which allows the "CacheValue" method
5393         to have the effect we intended (before, a [x] += 1 would generate
5394         two differen ArrayAccess expressions from the ElementAccess,
5395         during the resolution process).
5396
5397         (CompoundAssign.DoResolve): Resolve target and original_source here.
5398
5399 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
5400
5401         * expression.cs (ArrayAccess): dropped debugging information. 
5402
5403         * typemanager.cs: Small bug fix: I was always returning i_members,
5404         instead of one of i_members or s_members (depending on which had
5405         the content).
5406
5407         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
5408         method is invoked before any code generation takes place, and it
5409         is a mechanism to inform that the expression will be invoked more
5410         than once, and that the method should use temporary values to
5411         avoid having side effects
5412
5413         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
5414         
5415         * ecore.cs (Expression.CacheTemporaries): Provide empty default
5416         implementation.
5417
5418         * expression.cs (Indirection, ArrayAccess): Add support for
5419         CacheTemporaries in these two bad boys. 
5420
5421         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
5422         ldobj or ldind_ref.  
5423         (StoreFromPtr): Handle stobj as well.
5424
5425         * expression.cs (UnaryMutator): Share more code.
5426         
5427         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
5428         down: I was not tracking the Filter function as well, which
5429         was affecting the results of the cache.
5430
5431 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
5432
5433         * attribute.cs: Remove the hack to handle the CharSet property on
5434         StructLayouts. 
5435
5436 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
5437
5438         * attribute.cs (DoResolve): More uglyness, we now only try to
5439         resolve the attribute partially, to extract the CharSet
5440         information (only if we are a StructLayout attribute).  Otherwise 
5441
5442         (GetExtraTypeInfo): Add some code to conditionally kill in the
5443         future this.   I am more and more convinced that the .NET
5444         framework has special code to handle the attribute setting on
5445         certain elements.
5446
5447         * expression.cs (IsParamsMethodApplicable): Revert my previous
5448         foreach change here, it was wrong.
5449
5450 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
5451
5452         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
5453         (pp_expr): do not abort on unknown input, just return.
5454         (eval): abort if there are pending chars.
5455
5456         * attribute.cs (Attribute.Resolve): Positional parameters are
5457         optional.  Deal with that case.
5458
5459         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
5460         the Ansi/Unicode/Auto information for the type.
5461
5462         (TypeContainer.DefineType): instantiate the EmitContext here, as
5463         we will be using it during the type definition (to resolve
5464         attributes) and during the emit phase.
5465
5466         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
5467         to pull type information out of the attributes
5468
5469         (Attribute.Resolve): track the constructor builder, and allow for
5470         multiple invocations (structs and classes will use this).
5471
5472         * ecore.cs (MemberLookupFinal): new version with all the
5473         parameters customizable.
5474
5475         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
5476         constructors.  Return if the result value is null (as the error
5477         would have been flagged already by MemberLookupFinal)
5478
5479         Do not allow instances of abstract classes or interfaces to be
5480         created.
5481         
5482         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
5483         We have to compare the assembly property here when dealing with
5484         FamANDAssem and Assembly access modifiers, because we might be
5485         creating an assembly from *modules* (that means that we are not
5486         getting TypeBuilders for types defined in other modules that are
5487         part of this assembly).
5488
5489         (Method.Emit): If the method is marked abstract and has a body,
5490         emit an error. 
5491
5492         (TypeContainer.DefineMembers): If both the defined member and the
5493         parent name match are methods, then do not emit any warnings: let
5494         the Method.Define routine take care of flagging warnings.  But if
5495         there is a mismatch (method overrides something else, or method is
5496         overriwritten by something, then emit warning).
5497
5498         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
5499         set to null, this means `do not check for the return type on the
5500         signature'. 
5501
5502         (Method.Define): set the return type for the method signature to
5503         null, so that we get methods with the same name and parameters and
5504         different return types.  This is used to flag warning 114 (you are
5505         hiding a method, and you probably want to use the new/override
5506         keywords instead).
5507
5508         * typemanager.cs (MemberLookup): Implemented proper access
5509         control, closing a long standing set of bug reports.  The problem
5510         was that the Framework only has two bits: Public and NonPublic,
5511         and NonPublic includes private and protected methods, but we need
5512         to enforce the FamANDAssem, FamOrAssem and Family. 
5513
5514 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
5515
5516         * statement.cs (GotoCase): Return true: Ammounts to giving up
5517         knowledge on whether we return or not, and letting the other case
5518         be responsible for it.
5519
5520 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
5521
5522         * driver.cs: Do not load directories for each file processed, only
5523         do it if there is a pattern.
5524
5525         * ecore.cs: Report readonly assigns here as well, as we might have
5526         been resolved only by MemberAccess.
5527
5528         (SimpleName.SimpleNameResolve): Also be useful for LValue
5529         resolution.   We need this to propagate assign to local readonly variables
5530
5531         * typemanager.cs: Use a ptrhashtable for the criteria, because we
5532         do not want to reuse potential criteria memory.
5533
5534         * class.cs (MyEventBuilder): Set reflected_type;
5535
5536         * ecore.cs (Constantify): Added support for constifying bools.
5537
5538         (RootContext.LookupType): Added a cache for values looked up in
5539         the declaration space.
5540
5541         * typemanager.cs (FindMembers): Now is a front-end to
5542         RealFindMembers, and provides a two-level hashtable-based cache to
5543         the request.  
5544
5545         15% performance improvement: from 22.5 to 19.2 seconds.
5546
5547         * expression.cs (IsParamsMethodApplicable): use foreach.
5548         (Invocation.DoResolve): ditto.
5549         (New.DoResolve): ditto.
5550         (ArrayCreation.DoResolve): ditto.
5551
5552         * ecore.cs (FindMostEncompassingType): use foreach.
5553
5554         * delegate.cs (NewDelegate.DoResolve): Use foreach
5555
5556         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
5557         (RemoveMethods): use foreach.
5558
5559         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
5560         nested foreach statements instead of for, and also break out of
5561         the inner loop once a match is found.
5562         
5563         (Invocation.OverloadResolve): Use foreach, simplify the code. 
5564
5565 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
5566
5567         * cfold.cs (BinaryFold): During an enumeration evaluation context,
5568         we actually unwrap the expression to allow for extra information
5569         to be extracted. 
5570
5571         * expression.cs: Use Shr_Un on unsigned operations. 
5572
5573 2002-05-08  Ravi Pratap  <ravi@ximian.com>
5574
5575         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
5576         applicable operators was not being considered correctly. This closes
5577         the bug Miguel reported.
5578
5579 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
5580
5581         * attribute.cs: check that the type derives from System.Attribute
5582         and report the correct error in that case (moved the duplicate code to
5583         its own method, too).
5584
5585 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
5586
5587         * attribute.cs: lookup attribute type name as the spec says: first the
5588         bare attribute name and then name + "Attribute" (nant compiles with
5589         mcs after this fix).
5590
5591 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
5592
5593         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
5594         Because of the way we parse things, we should try to see if a
5595         UIntConstant can fit in an integer.
5596
5597 2002-05-07  Ravi Pratap  <ravi@ximian.com>
5598
5599         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
5600         when we are in an explicit context.
5601
5602         (ConvertReferenceExplicit): When converting from Iface type S to Class
5603         T make sure the rules are implemented as an OR.
5604
5605         * parameter.cs (ParameterType): Make it a property for now although the
5606         purpose really isn't anything immediate.
5607         
5608         * expression.cs (Is*Applicable): Do better checking on the parameter type
5609         of a ref/out parameter. The ones from the system assemblies are already 
5610         marked with the correct type so we don't need to do any correction.
5611
5612         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
5613         the object type is standard too so include that.
5614
5615 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
5616
5617         * ecore.cs (StandardConversionExists): Augment with missing code:
5618         deal with IntConstant, LongConstants and Enumerations.
5619
5620         * assign.cs: Report the error, instead of failing silently
5621
5622         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
5623         typecontainer that they are declared, because the
5624         typecontainer/namespace will have the list of using clauses that
5625         need to be applied.
5626
5627         Assembly Attributes were escaping the normal registration
5628         mechanism. 
5629
5630         (EmitCode): Apply attributes within an EmitContext that represents
5631         the container they were declared on.
5632         
5633         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
5634
5635 2002-05-06  Ravi Pratap  <ravi@ximian.com>
5636
5637         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
5638         Revamp completely - make much cleaner as we now operate only
5639         on a set of Types.
5640
5641         (FindMostSpecificSource, FindMostSpecificTarget): New methods
5642         to implement the logic detailed in the spec more correctly.
5643
5644         (UserDefinedConversion): Update accordingly.
5645
5646 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
5647
5648         * statement.cs: Return flow analysis information up.
5649
5650         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
5651         and the default.
5652
5653         (token): Do not consume an extra character before calling
5654         decimal_digits.
5655
5656 2002-05-06  Piers Haken <piersh@friskit.com>
5657
5658         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
5659
5660 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
5661
5662         * class.cs (Constructor.Emit): Set the IsStatic flag in the
5663         EmitContext during the instance constructor initializer
5664         resolution, to stop access to instance variables.
5665
5666         This is mandated by the spec, last paragraph of the `constructor
5667         initializers' section. 
5668
5669 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
5670
5671         * cs-parser.jay, class.cs (Accessor): new class used to represent
5672         an accessor (get or set).  In the past we used `null' to represent
5673         a missing accessor.  But this is ambiguous because there was no
5674         way to tell in abstract indexers/properties if one of them was
5675         specified.
5676
5677         Now there is a way of addressing that.
5678
5679         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
5680         instead of FindMembers.
5681
5682         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
5683         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
5684
5685         * attribute.cs: Treat indexers and properties as the same in terms
5686         of applying attributes
5687
5688         * ecore.cs (FindMostEncompassedType): Use statically initialized
5689         EmptyExpressions()s like we do elsewhere to avoid creating useless
5690         objects (and we take this out of the tight loop).
5691
5692         (GetConversionOperators): Move the code to extract the actual
5693         operators to a separate routine to clean things up.
5694
5695 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
5696
5697         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
5698         events are always registered FieldBuilders.
5699         
5700         * class.cs (FieldBase): New class shared by Fields 
5701
5702         * delegate.cs: If we are a toplevel delegate, use our full name.
5703         If we are a nested delegate, then only use our tail name.
5704
5705 2002-05-02  Ravi Pratap  <ravi@ximian.com>
5706
5707         * expression.cs (IsApplicable): Ensure that we add the "&" to
5708         ref/out types before comparing it with the type of the argument.
5709
5710         (IsParamsMethodApplicable): Ditto.
5711
5712         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
5713         silly me ;-)
5714
5715         * delegate.cs : Handle the case when we have more than one applicable
5716         method. Flag an error only when we finish checking all.
5717
5718 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
5719
5720         * expression.cs: Add support for boolean static initializers.
5721
5722 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
5723
5724         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
5725
5726         * parameter.cs (ComputeParameterTypes,
5727         ComputeAndDefineParameterTypes): Better error handling: now we
5728         clear the `types' cache if we fail during any of the type lookups.
5729         We also return the status code correctly to our caller
5730
5731         * delegate.cs: If we fail to define a delegate, abort the extra
5732         steps. 
5733
5734         * expression.cs (Binary.ResolveOperator): for
5735         operator==(object,object) and operator !=(object, object) we also
5736         have to verify that there is an implicit conversion from one to
5737         the other.
5738
5739         (ArrayAccess.DoResolve): Array Access can operate on
5740         non-variables. 
5741
5742 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
5743
5744         * assign.cs (CompoundAssign): A new class used as a "flag" that
5745         the assignment actually is happening as part of a compound
5746         assignment operator.
5747
5748         During compound assignment, a few new rules exist to enable things
5749         like:
5750
5751         byte b |= 1 + 2
5752
5753         From the spec:
5754         
5755         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
5756         to the type of x) if y is implicitly convertible to the type of x,
5757         and the operator is a builtin operator and the return type of the
5758         operator is explicitly convertible to the type of x. 
5759
5760         * rootcontext.cs: Reset warning level to 2.  4 catches various
5761         "interesting" features in mcs, we must clean this up at some
5762         point, but currently am trying to kill other bugs ;-)
5763
5764         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
5765         in container classes as well.  
5766
5767         * expression.cs (Binary.ResolveOperator): Handle string case
5768         before anything else (as operator overloading does emit an error
5769         before doing anything else).
5770
5771         This code could go away when we move to a table driven model, but
5772         i could not come up with a good plan last night.
5773         
5774 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
5775
5776         * typemanager.cs (CSharpName): reimplementation using regex.
5777         * class.cs: added null check for fields in Emit
5778         * rootcontext.cs: set warninglevel to 4
5779
5780 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
5781
5782         * typemanager.cs (CSharpName): reimplemented with Lupus
5783         suggestion.
5784
5785 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
5786
5787         * statement.cs (If): correclty implement Resolve, because we were
5788         not catching sem errors in there.  The same process is needed
5789         everywhere else. 
5790         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
5791         
5792
5793         (Statement.Warning_DeadCodeFound): Factorize code.
5794         (While): Report dead code here too.
5795
5796         (Statement): Added Resolve virtual method to allow
5797         for resolution split from the emit code.
5798
5799 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
5800
5801         * statement.cs (EmitBoolExpression): No longer try to resolve the
5802         expression here.    
5803         (MakeBoolean): New utility function that resolve, implicitly
5804         converts to boolean and tags the expression. 
5805         
5806
5807         (If, Do): Implement dead code elimination.
5808         (While): Implement loop inversion
5809
5810         (Do, While, For, If): Resolve the expression prior to calling our
5811         code generation.
5812
5813 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
5814
5815         * class.cs:
5816           - added method Report28 (warning: program has more than one entry point)
5817           - added method IsEntryPoint, implements paragraph 10.1 of the spec
5818           - modified method Method.Define, the part at the end of the method
5819
5820         * rootcontext.cs: added static public Location EntryPointLocation;
5821           
5822         * ../errors/cs0028.cs : Add test case for the above warning.              
5823
5824         * typemanager.cs:
5825           - modified method CSharpName to allow arrays of primitive type to
5826             be printed nicely (e.g. instead of System.Int32[][] it now prints
5827             int[][])
5828           - added method CSharpSignature: returns the signature of a method
5829             in string format to be used in reporting errors, warnings, etc.
5830
5831         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
5832         with String.Empty.
5833         
5834 2002-04-26  Ravi Pratap  <ravi@ximian.com>
5835
5836         * delegate.cs (Define): Fix extremely silly bug where I was
5837         setting the type of the 'object' parameter of the BeginInvoke
5838         method to System.IAsyncResult instead of System.Object ;-)
5839
5840 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
5841
5842         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
5843         here. 
5844
5845         (Constructor.Emit): return if we fail to initialize the
5846         constructor.  Another door closed!  
5847
5848         * expression.cs (New.DoResolve): Improve error message (from -6 to
5849         1501).  Use DeclaredOnly lookup to find the exact constructor.
5850
5851         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
5852         loop.  This is useful.
5853
5854         * cs-parser.jay: Adjust the default parameters so that destructors
5855         have the proper signature.
5856
5857 2002-04-26  Martin Baulig  <martin@gnome.org>
5858
5859         * driver.cs (LoadAssembly): If `assembly' contains any characters
5860         which are only valid in path names and not in assembly names
5861         (currently slash, backslash and point), use Assembly.LoadFrom ()
5862         instead of Assembly.Load () on the `assembly' (before iteration
5863         over the link_paths).
5864
5865 2002-04-26  Martin Baulig  <martin@gnome.org>
5866
5867         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
5868
5869 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
5870
5871         * class.cs (Property): use the new typemanager.MemberLookup
5872
5873         (TypeContainer.MemberLookup): Implement using the
5874         TypeManager.MemberLookup now. 
5875         
5876         * typemanager.cs: Make MemberLookup a function of the TypeManager,
5877         and return MemberInfos, so that these can be used without an
5878         EmitContext (what we had before).
5879
5880 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
5881
5882         * expression.cs: Fix the case where the argument to params if the
5883         type of the params.  I omitted handling this before.   Fixed
5884
5885 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
5886
5887         * driver.cs: Call BootCorlib_PopulateCoreType
5888
5889         * class.cs (Property.CheckBase): Check for properties only, not
5890         for all members. 
5891
5892         * interface.cs: Temporary hack: try/catch around the
5893         CustomAttributeBuilder, because I am getting an exception that I
5894         do not understand.
5895
5896         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
5897         types whose definitions are required to be there (attributes are
5898         defined before standard types).
5899
5900         Compute definitions as we boot the various types, as they are used
5901         immediately (value_type class will need object_type, but if we do
5902         not initialize object_type, we will pass a null, which will let
5903         the runtime pick the System.Object from the existing corlib, which
5904         is not what we want).
5905
5906 2002-04-22  Patrik Torstensson <totte@labs2.com>
5907
5908         * cs-tokenizer.cs: fixed a number of trim() issues.
5909
5910 2002-04-22  Ravi Pratap  <ravi@ximian.com>
5911
5912         * expression.cs (Argument.Type): Ensure that we return the correct
5913         type when we have out or ref parameters [in which case we 
5914         append a "&"].
5915         
5916 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
5917
5918         * class.cs (Property, Indexer): Allow extern modifier in there. 
5919
5920         * typemanager.cs (InitBaseTypes): Initializes object_type and
5921         value_type, since those will be used early on during the bootstrap
5922         process to compile corlib.
5923
5924         (InitCoreTypes): Move code from here to InitBaseTypes.
5925
5926 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
5927
5928         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
5929         single-dimension arrays as using the ldlen opcode.  
5930
5931         Daniel Lewis discovered this optimization.  
5932
5933         * typemanager.cs: Add signature for System.Array::get_Length
5934
5935 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5936
5937         * statement.cs: report the error when the foreach does not apply to an
5938         array nor a collection.
5939
5940 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
5941
5942         * expression.cs: Add implicit conversions to the operator ~.
5943
5944         * constant.cs (DecimalConstant.Emit): Emit decimal value.
5945
5946         * typemanager.cs: Locate the decimal constructor.
5947
5948 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5949
5950         * attribute.cs: use the new property of TypeOf.
5951         * expression.cs: added 'get' property around typearg.
5952
5953         These changes fix a build breaker reported by NickD. Is this the
5954         correct way to fix?  If not, please, revert my changes and make it
5955         work :-).
5956
5957 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
5958
5959         * attribute.cs: Add support for typeof in attribute invocations.
5960         I am not sure that this is right though.
5961
5962 2002-04-14  Duncan Mak  <duncan@ximian.com>
5963
5964         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
5965         Binary.Operator.Division case.
5966
5967 2002-04-13  Ravi Pratap  <ravi@ximian.com>
5968
5969         * class.cs (DefineType): Ensure that we do a proper check on
5970         attribute types and also register it with the TypeManager.
5971
5972         (TypeContainer.Targets): The default for attribute types is
5973         AttributeTargets.All.
5974         
5975         * attribute.cs (ApplyAttributes): Registering the attribute type
5976         is done elsewhere, not when we discover we have a Usage attribute.
5977
5978 2002-04-12  Ravi Pratap  <ravi@ximian.com>
5979
5980         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
5981         and get rid of is_delegate parameter.
5982
5983         * everywhere : update.
5984         
5985 2002-04-12  Ravi Pratap  <ravi@ximian.com>
5986
5987         * cs-parser.jay (compilation_unit): Revamp completely to use
5988         some new ideas that I got from Rhys' grammar to solve the problems
5989         with assembly level attributes.
5990
5991         (outer_declaration): New grammar production.
5992
5993         (attribute_sections): Add.
5994
5995         (opt_attributes): Base on attribute_sections
5996
5997         (namespace_declaration): Allow opt_attributes to tackle the case
5998         when we have assembly level attributes - we are clever in this
5999         regard now ;-)
6000
6001         * attribute.cs (ApplyAttributes): Do not worry about assembly 
6002         attributes in the non-global context.
6003
6004         * rootcontext.cs (AddGlobalAttributes): Go back to using this
6005         instead of SetGlobalAttributes.
6006
6007         * class.cs, rootcontext.cs : Ensure we define and generate 
6008         attribute types before anything else.
6009
6010         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
6011         and flag the new error -20 for the case when the attribute type
6012         does not have valid targets specified. csc does not catch this.
6013
6014         * ../errors/errors.txt : update for error # -20
6015
6016 2002-04-11  Ravi Pratap  <ravi@ximian.com>
6017
6018         * support.cs (InternalParameters.ParameterModifier): Do some null
6019         checking and return sane values.
6020
6021         * class.cs (Method.Define): If we are a PInvoke method, ensure
6022         that we are static and extern. Report error # 601
6023
6024         * ../errors/cs0601.cs : Add test case for the above error.
6025
6026 2002-04-07  Ravi Pratap  <ravi@ximian.com>
6027
6028         * rootcontext.cs (attribute_types): We need to keep type of
6029         all attribute types separately and emit code for them first.
6030
6031         (RegisterAttribute) : Implement.
6032
6033         * class.cs (DefineType): Check if the current Type is a custom
6034         attribute type and register it accordingly.
6035
6036         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
6037         adding the first attribute twice and rename to
6038
6039         (SetGlobalAttributes): this.
6040
6041         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
6042         lookups.
6043
6044         * attribute.cs (ApplyAttributes): Take an additional argument telling us
6045         if we are processing global arguments. Hmm, I am unsure of this.
6046
6047 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6048
6049         * expression.cs: added static array of strings to avoid calling
6050         Enum.ToString () for Operator in Binary. Significant recover of
6051         performance.
6052
6053 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
6054
6055         * class.cs (FindMembers): Allow the Builders of the various
6056         members to be null.  If they are skip them.  This only happens
6057         during the PInvoke declaration.
6058
6059 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
6060
6061         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
6062         failure, so we do not keep going afterwards.
6063
6064         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
6065         wanted to pass `false' as the `is_delegate' argument.  If this is
6066         the case, why not use delegate_type == null to mean `is_delegate =
6067         false' and anything else as is_delegate = true.
6068
6069 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
6070
6071         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
6072         code for the section, not the beginning of the tests.
6073
6074 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
6075
6076         * cfold.cs: Handle operator + (Enum x, Underlying x) 
6077
6078         * expression.cs (Binary): same.  Warn about errors where we have
6079         Enum/Enum in operator + as well.
6080
6081 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
6082
6083         * statement.cs:
6084                 - added support for switch(bool)
6085                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
6086                 - add TableSwitchEmit() to handle table-based switch statements
6087
6088 2002-04-05  Ravi Pratap  <ravi@ximian.com>
6089
6090         * expression.cs (Invocation.OverloadResolve): Factor out code which
6091         does parameter compatibility checking with arguments so that we can 
6092         re-use the code even from Delegate.VerifyApplicability
6093
6094         (VerifyArgumentsCompat): Move above code here.
6095
6096         * delegate.cs (VerifyApplicability): Get rid of duplicate code
6097         and instead make a call to the above method.
6098
6099 2002-03-31  Ravi Pratap  <ravi@ximian.com>
6100
6101         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
6102         We use it to keep track of classes which are attribute types.
6103
6104 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
6105
6106         * delegate.cs (Delegate.Define): Correctly define the types in the
6107         presence of fixed and array parameters.
6108
6109         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
6110         doing FindMembers.
6111
6112         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
6113         include NonPublic after the first iteration.
6114
6115         * class.cs (Indexer.CheckBase): Only check if both parents are
6116         non-null. 
6117         
6118         * cs-parser.jay (accessor_body): If empty, set to null.
6119
6120         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
6121         same code path here to resolve constants names that we did have in
6122         MemberAccess.DoResolve.  There is too much code duplicated here.
6123
6124 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
6125
6126         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
6127
6128         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
6129         to MakeUnionSet.
6130
6131         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
6132         tokens, numbers and strings.
6133
6134         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
6135         parenthesis.
6136
6137         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
6138         asyncronous parameters and the regular parameters.  
6139
6140         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
6141         specify the target directory.
6142
6143         * expression.cs: (This.DoResolve): Simplify
6144         (As.Emit): Optimize, do not generate IsInst if the expression is
6145         always of the given type.
6146
6147         (Is.DoResolve): Bug fix, we were reporting both always/never for
6148         the is expression.
6149
6150         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
6151         creating too many unnecessary arrays.
6152
6153 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
6154
6155         * class.cs (EmitFieldInitializer): Use Assign expression to assign
6156         fields instead of rolling our own initializer.   Takes care of all
6157         implicit conversions, and drops unnecessary static checks/argument.
6158
6159 2002-03-31  Dick Porter  <dick@ximian.com>
6160
6161         * driver.cs: use the GetDirectories() return values properly, and
6162         use "/" as path separator.
6163
6164 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
6165
6166         * expression.cs (Unary): Optimize - - expr into expr.
6167         (Binary): Optimize a + (-b) into a -b.
6168
6169         * codegen.cs (CodeGen): Made all methods static.
6170
6171 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
6172
6173         * rootcontext.cs: 
6174
6175         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
6176         TypeBuilder property.
6177
6178         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
6179         instead. 
6180
6181         * tree.cs: Removed the various RecordXXXX, and replaced with a
6182         single RecordDecl.  Removed all the accessor methods, and just
6183         left a single access point Type 
6184
6185         * enum.cs: Rename DefineEnum to DefineType.
6186
6187         * decl.cs: New abstract method `DefineType' used to unify the
6188         Defines for Enumerations, Interfaces, TypeContainers and
6189         Delegates.
6190
6191         (FindType): Moved LookupInterfaceOrClass here.  Moved the
6192         LookupBaseClasses method that used to live in class.cs and
6193         interface.cs here, and renamed to FindType.
6194         
6195         * delegate.cs: Implement DefineType.  Take advantage of the
6196         refactored pattern for locating the parent builder without taking
6197         the parent_builder argument (which we know does not work if we are
6198         nested, and triggering a toplevel definition).
6199
6200 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6201
6202         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
6203         accessibility of a member has changed during override and report
6204         an error if so.
6205
6206         * class.cs (Method.Define, Property.Define): Only complain on
6207         overrides if the method is private, any other accessibility is
6208         fine (and since we just checked the permission is the same, we are
6209         good to go).
6210
6211         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
6212         and elif are processed always.  The other pre-processing
6213         directives are only processed if we are "taking" the path
6214
6215 2002-03-29  Martin Baulig  <martin@gnome.org>
6216
6217         * class.cs (Method.Emit): Only emit symbolic debugging info if the
6218         current location is not Null.
6219
6220         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
6221         a separate method so we can profile it.
6222
6223         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
6224         `span.Seconds' are just seconds, but no minutes or hours.
6225         (MainDriver): Profile the CodeGen.SaveSymbols calls.
6226
6227 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6228
6229         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
6230         Remove the gratuitous set of Final:
6231
6232                                 // If an interface implementation, then we can set Final.
6233                                 if (((flags & MethodAttributes.Abstract) == 0) &&
6234                                     implementing.DeclaringType.IsInterface)
6235                                         flags |= MethodAttributes.Final;
6236
6237         I do not know what I was smoking when I used that.
6238         
6239
6240         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
6241         step into fixing the name resolution issues for delegates and
6242         unifying the toplevel name resolution.
6243
6244 2002-03-28  Martin Baulig  <martin@gnome.org>
6245
6246         * class.cs (Method.Emit): If we have a symbol writer, call its
6247         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
6248         tell it about the current method.
6249
6250         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
6251         writer that we're going to emit the first byte of IL code for a new
6252         statement (a new source line).
6253         (EmitContext.EmitTopBlock): If we have a symbol writer, call
6254         EmitContext.Mark() before emitting any code.
6255
6256         * location.cs (SymbolDocument): Return null when we're Null.
6257
6258         * statement.cs (Statement): Moved the `Location loc' variable here.
6259         (Statement.EmitBoolExpression): If we have a symbol writer, call
6260         ec.Mark() before emitting any code to tell it that we're at the
6261         beginning of a new statement.
6262         (StatementExpression): Added `Location' argument to the constructor.
6263         (Block): Added public readonly variable `StartLocation' and public
6264         variable `EndLocation'.  The latter is to be set using SetEndLocation().
6265         (Block): Added constructor which takes a start and end location.
6266         (Block.SetEndLocation): New method. This sets the end location.
6267         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
6268         local variables we create.
6269         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
6270         each statement and do also mark the begin and end of the block.
6271
6272         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
6273         tell it the current lexer.Location, use Location.Null for the end of the
6274         block.
6275         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
6276         current block, set its end location using SetEndLocation().
6277         (statement_expression): StatementExpression constructor now takes the
6278         lexer.Location as additional argument.
6279         (for_statement, declare_local_variables): Likewise.
6280         (declare_local_variables): When creating a new implicit block, use the
6281         new Block constructor and pass it the lexer.Location.
6282
6283 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6284
6285         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
6286         members also on the parent interfaces recursively.
6287
6288 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
6289
6290         * report.cs: Use new formats, since Gonzalo finished the missing
6291         bits. 
6292
6293         * expression.cs (Binary.ResolveOperator): added missing operator|
6294         operator& and operator^ for bool/bool.
6295
6296         * cs-parser.jay: CheckDef now takes a Location argument that is
6297         used to report errors more precisly (instead of reporting the end
6298         of a definition, we try to track something which is a lot closer
6299         to the source of the problem).
6300
6301         * cs-tokenizer.cs: Track global token use, so we can properly flag
6302         the use of #define/#undef after the first token has been seen.
6303
6304         Also, rename the reportXXXX to Error_DescriptiveName
6305
6306         * decl.cs (DeclSpace.IsTopLevel): Move property here from
6307         TypeContainer, so that Enum and Interface can use this too.
6308
6309         * class.cs (TypeContainer.LookupInterfaceOrClass,
6310         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
6311         `builder' argument.  Typically this was used to pass the parent
6312         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
6313         the definition).  
6314
6315         The problem is that a nested class could trigger the definition of
6316         a toplevel class, and the builder would be obviously wrong in that
6317         case. 
6318
6319         So we drop this argument, and we compute dynamically the
6320         TypeBuilder/ModuleBuilder (the correct information was available
6321         to us anyways from DeclSpace.Parent)
6322
6323         * interface.cs (Interface.DefineInterface): Drop builder
6324         parameter cleanup like class.cs
6325
6326         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
6327         like class.cs
6328
6329         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
6330         values. 
6331
6332         (Try.Emit): Propagate the returns value from the statement.
6333
6334         (Return.Emit): Even if we are leavning 
6335
6336         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
6337
6338         * modifiers.cs: Fix the computation of MethodAttributes flags.
6339
6340 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
6341
6342         * driver.cs: allow compilation of files that start with '/'.
6343         Add a default case when checking the argument of --target.
6344
6345 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
6346
6347         * interface.cs: Implement the same search algorithm for types in
6348         the interface code.
6349
6350         * delegate.cs: Do not allow multiple definition.
6351
6352         * Recovered ChangeLog that got accidentally amputated
6353
6354         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
6355
6356         * rootcontext.cs: Load manually enum to allow core classes to
6357         contain enumerations.
6358
6359         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
6360         Update to new static methods in TypeManager.
6361
6362         * typemanager.cs (GetMethod, GetConstructor): Use our
6363         implementation of FindMembers to find the members, since during
6364         corlib compilation, the types are TypeBuilders and GetMethod and
6365         GetConstructor do not work.
6366
6367         Make all methods in TypeManager static.
6368
6369         (InitCodeHelpers): Split the functionality from
6370         the InitCodeTypes function.
6371
6372         * driver.cs: Call InitCodeHelpers after we have populated the
6373         types. 
6374
6375         * cs-parser.jay (delegate_declaration): we did not used to compute
6376         the delegate name correctly for void delegates.
6377
6378 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
6379
6380         * rootcontext.cs (RootContext): Init the interface_resolve_order
6381         and type_container_resolve_order always.
6382
6383         (ResolveCore, BootstrapCorlib_ResolveClass,
6384         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
6385         compiler when compiling with --nostdlib
6386
6387         * class.cs (TypeContainer.DefineType): Check that our parent is
6388         not null.  This test is most important when we are bootstraping
6389         the core types.
6390
6391         * codegen.cs: Split out the symbol writing code.
6392
6393 2002-03-25  Martin Baulig  <martin@gnome.org>
6394
6395         * driver.cs (-g): Made -g an alias for --debug.
6396
6397 2002-03-24  Martin Baulig  <martin@gnome.org>
6398
6399         * codegen.cs (SymbolWriter): New public variable. Returns the
6400         current symbol writer.
6401         (CodeGen): Added `bool want_debugging_support' argument to the
6402          constructor. If true, tell the ModuleBuild that we want debugging
6403         support and ask it for the ISymbolWriter.
6404         (Save): If we have a symbol writer, call it's Close() method after
6405         saving the assembly.
6406
6407         * driver.c (--debug): New command line argument to create a
6408         debugger information file.
6409
6410         * location.cs (SymbolDocument): New public property. Returns an
6411         ISymbolDocumentWriter object for the current source file or null
6412         if we don't have a symbol writer.
6413
6414 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
6415
6416         * driver.cs (LoadAssembly): Correctly return when all the paths
6417         have been tried and not before.
6418
6419         * statement.cs (Switch.Emit): return the actual coverage for this
6420         statement (returns/not-returns)
6421
6422         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
6423         switch of the statement if we are the last switch section.  That
6424         kills two problems: try/catch problems (we used to emit an empty
6425         nop at the end) and switch statements where all branches would
6426         return. 
6427
6428 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
6429
6430         * driver.cs: Add default assemblies (the equivalent to the
6431         Microsoft CSC.RSP file)
6432
6433         * cs-tokenizer.cs: When updating `cols and setting it to zero,
6434         also update tokens_seen and set it to false.
6435
6436         * driver.cs: Implement --recurse for Mike.
6437
6438         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
6439         correctly splitting out the paths.
6440
6441 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
6442
6443         * interface.cs (Interface.PopulateProperty): Instead of using
6444         `parent' as the declaration space for the set parameters, use
6445         `this' 
6446
6447         * support.cs (InternalParameters): InternalParameters constructor
6448         takes a DeclSpace instead of a TypeContainer.
6449
6450         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
6451         types are being initialized, load the address of it before calling
6452         the function.  
6453
6454         (New): Provide a mechanism to disable the generation of local
6455         value type temporaries when the caller will be providing us with
6456         an address to store it.
6457
6458         (ArrayCreation.EmitDynamicInitializers): Use it.
6459
6460 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
6461
6462         * expression.cs (Invocation.EmitArguments): Only probe for array
6463         property if there is more than one argument.  Sorry about that.
6464
6465         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
6466         empty param arrays.
6467         
6468         * class.cs (Method.LabelParameters): Fix incorrect code path that
6469         prevented the `ParamArrayAttribute' from being applied to the
6470         params attribute.
6471
6472 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
6473
6474         * support.cs (ReflectionParameters): Correctly compute whether the
6475         last argument is a params array.  Fixes the problem with
6476         string.Split ('a')
6477
6478         * typemanager.cs: Make the assemblies array always be non-null
6479         (empty, but non-null)
6480
6481         * tree.cs (RecordDecl): New function that abstracts the recording
6482         of names.  This reports error 101, and provides a pointer to the
6483         previous declaration.  Fixes a crash in the compiler.
6484
6485         * cs-parser.jay (constructor_declaration): Update to new grammar,
6486         and provide a constructor_body that can be empty.
6487
6488 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
6489
6490         * driver.cs: Add support for --resources.
6491
6492         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
6493         Make all types for the various array helper methods be integer.
6494
6495         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
6496         CheckState to ConvCast.
6497
6498         (ConvCast): Now it takes a `checked' state argument, to avoid
6499         depending on the emit context for the conversion, and just using
6500         the resolve time setting.
6501
6502         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
6503         instead of Invocation.EmitArguments.  We do not emit the original
6504         arguments, instead we emit those which have been converted to
6505         unsigned int expressions.
6506
6507         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
6508
6509         * codegen.cs: ditto.
6510
6511         * expression.cs (LocalVariableReference): Drop the use of the
6512         Store function that depended on the variable index.
6513
6514         * statement.cs (VariableInfo): Drop the `Idx' property from this
6515         class, as this is not taking into account the indexes for
6516         temporaries tat we generate during the execution, getting the
6517         indexes wrong.
6518
6519         * class.cs: First emit class initializers, then call the parent
6520         constructor. 
6521
6522         * expression.cs (Binary): Fix opcode emision.
6523         (UnaryMutator.EmitCode): Support checked code generation
6524
6525         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
6526         matches for events for both the Static and Instance scans,
6527         pointing to the same element.   Fix that.
6528
6529 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
6530
6531         * rootcontext.cs (ResolveTree): Always set the
6532         interface_resolve_order, because nested interfaces will be calling
6533         into us.
6534
6535         * class.cs (GetInterfaceOrClass): Track the same resolution
6536         process used by TypeManager.LookupType.  This fixes the nested
6537         type lookups in class declarations (separate path from
6538         LookupType). 
6539
6540         (TypeContainer.DefineType): Also define nested interfaces.
6541         (TypeContainer.RegisterOrder): New public function used to
6542         register the order in which child interfaces need to be closed.
6543
6544         Nested interfaces need to be closed after their parents have been
6545         created. 
6546         
6547         * interface.cs (InterfaceAttr): Put all the logic for computing
6548         the interface attribute here. 
6549
6550         (DefineInterface): Register our interface order with the
6551         RootContext or with the TypeContainer depending on the case.
6552
6553 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
6554
6555         * cs-parser.jay: rework foreach statement to work with the new
6556         changes to the policy on SimpleNames.
6557         
6558         * report.cs: support Stacktrace on warnings as well.
6559
6560         * makefile: drop --unsafe and /unsafe from the compile.
6561
6562 2002-03-13  Ravi Pratap  <ravi@ximian.com>
6563
6564         * ecore.cs (StandardConversionExists): Modify to take an Expression
6565         as the first parameter. Ensure we do null -> reference type conversion
6566         checking.
6567
6568         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
6569         temporary Expression objects.
6570
6571 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
6572
6573         * interface.cs: workaround bug in method overloading resolution
6574         (there is already a bugzilla bug for it).
6575
6576 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
6577
6578         We could also solve this problem by having a separate path for
6579         performing type lookups, instead of DoResolve, we could have a
6580         ResolveType entry point, and only participating pieces of the
6581         production (simplename, deref, array) would implement this. 
6582         
6583         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
6584         signal SimpleName to only resolve type names and not attempt to
6585         resolve anything else.
6586
6587         * expression.cs (Cast): Set the flag.
6588
6589         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
6590
6591         * class.cs: Only report 108 if there is no `new' modifier.
6592
6593         * cs-parser.jay: rework foreach statement to work with the new
6594         changes to the policy on SimpleNames.
6595         
6596         * report.cs: support Stacktrace on warnings as well.
6597
6598         * makefile: drop --unsafe and /unsafe from the compile.
6599
6600 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
6601
6602         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
6603         lookups here, instead of doing that at parse time.  This means
6604         that our grammar will not introduce `LocalVariableReferences' as
6605         expressions at this point.  That solves the problem of code like
6606         this:
6607
6608         class X {
6609            static void Main ()
6610            { int X = 1;
6611             { X x = null }}}
6612
6613         This is only half the fix.  The full fix requires parameters to
6614         also be handled in this way.
6615
6616         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
6617         makes the use more obvious of the DeclSpace.  The
6618         ec.TypeContainer.TypeBuilder is now only used to pull the
6619         TypeBuilder for it.
6620
6621         My theory is that I can get rid of the TypeBuilder completely from
6622         the EmitContext, and have typecasts where it is used (from
6623         DeclSpace to where it matters).  
6624
6625         The only pending problem is that the code that implements Aliases
6626         is on TypeContainer, and probably should go in DeclSpace.
6627
6628         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
6629         lookups here, instead of doing that at parse time.  This means
6630         that our grammar will not introduce `LocalVariableReferences' as
6631         expressions at this point.  That solves the problem of code like
6632         this:
6633
6634         class X {
6635            static void Main ()
6636            { int X = 1;
6637             { X x = null }}}
6638
6639         This is only half the fix.  The full fix requires parameters to
6640         also be handled in this way.
6641
6642         * class.cs (Property.DefineMethod): When implementing an interface
6643         method, set newslot, when implementing an abstract method, do not
6644         set the flag (before we tried never setting it, or always setting
6645         it, which is the difference).
6646         (Indexer.DefineMethod): same.
6647         (Method.DefineMethod): same.
6648
6649         * ecore.cs: Only set the status used flag if we get back a Field.
6650
6651         * attribute.cs: Temporary hack, so Paolo can keep working.
6652
6653 2002-03-08  Ravi Pratap  <ravi@ximian.com>
6654
6655         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
6656         the unmanaged type in the case we have a MarshalAs attribute.
6657
6658         (Resolve): Handle the case when we are parsing the special MarshalAs
6659         attribute [we need to store the unmanaged type to use later]
6660         
6661         * typemanager.cs (marshal_as_attr_type): Built in type for the 
6662         MarshalAs Attribute.
6663
6664         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
6665         on parameters and accordingly set the marshalling info.
6666         
6667 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
6668
6669         * class.cs: Optimizing slightly by removing redundant code after
6670         we switched to the `NoTypes' return value.
6671         (Property.DefineMethod): use NoTypes here too.
6672
6673         This fixes the bug I introduced in my last batch of changes.
6674
6675 2002-03-05  Ravi Pratap  <ravi@ximian.com>
6676
6677         * tree.cs (RecordEnum): Add. We now keep track of enums too.
6678
6679         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
6680         Enums since those are types too. 
6681
6682         * cs-parser.jay (enum_declaration): Record enums as we parse them.
6683         
6684         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
6685         thanks to a call during the lookup process.
6686
6687 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
6688
6689         * statement.cs (Foreach): Lots of work to accomodate a particular
6690         kind of foreach statement that I had not kept in mind.  It is
6691         possible to have foreachs on classes that provide a GetEnumerator
6692         method that return objects that implement the "pattern" for using
6693         a foreach, there is no need to support GetEnumerator
6694         specifically. 
6695
6696         This is needed to compile nant.
6697
6698         * decl.cs: Only report 114 if the member is not `Finalize' and if
6699         the warning level is at least 2.
6700
6701         * class.cs: Moved the compare function from Method to
6702         MethodSignature. 
6703
6704         (MethodSignature.InheritableMemberSignatureCompare): Add new
6705         filter function that is used to extract inheritable methods from a
6706         class. 
6707
6708         (Method.Define): Use the new `inheritable_method_signature_filter'
6709         delegate
6710
6711         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
6712         command. 
6713
6714 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
6715
6716         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
6717
6718         * cs-parser.jay: Add opt_semicolon to the interface declaration.
6719
6720         * expression.cs: Pass location information to
6721         ConvertImplicitStandard. 
6722
6723         * class.cs: Added debugging code to track return values from
6724         interfaces. 
6725
6726 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
6727
6728         * expression.cs (Is.DoResolve): If either side of the `is' is an
6729         interface, do not flag the warning.
6730
6731         * ecore.cs (ImplicitReferenceConversion): We need a separate test
6732         for interfaces
6733
6734         * report.cs: Allow for --fatal to be used with --probe.
6735         
6736         * typemanager.cs (NoTypes): Move the definition for the empty Type
6737         array here. 
6738
6739         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
6740         properties. 
6741         (TypeContainer.DefineProxy): New function used to proxy to parent
6742         implementations when implementing interfaces.
6743         (TypeContainer.ParentImplements): used to lookup if our parent
6744         implements a public function that is required by an interface.
6745         (TypeContainer.VerifyPendingMethods): Hook this up.
6746
6747         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
6748         `modules' and `assemblies' arraylists into arrays.  We only grow
6749         these are the very early start up of the program, so this improves
6750         the speedof LookupType (nicely measured).
6751
6752         * expression.cs (MakeByteBlob): Replaced unsafe code with
6753         BitConverter, as suggested by Paolo.
6754
6755         * cfold.cs (ConstantFold.Binary): Special case: perform constant
6756         folding of string concatenation, but if either side is a string,
6757         and the other is not, then return null, and let the runtime use
6758         the concatenation on the string plus the object (using
6759         `Object.ToString'). 
6760
6761 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
6762
6763         Constant Folding has been implemented now.
6764         
6765         * expression.cs (Unary.Reduce): Do not throw an exception, catch
6766         the error instead on types that are not supported in one's
6767         complement. 
6768
6769         * constant.cs (Constant and all children): New set of functions to
6770         perform implict and explicit conversions.
6771         
6772         * ecore.cs (EnumConstant): Implement the new functions to perform
6773         conversion by proxying to the child expression.
6774
6775         * codegen.cs: (ConstantCheckState): Constant evaluation has its
6776         own separate setting that can not be turned off from the command
6777         line using --unchecked or --checked and is only controlled using
6778         the checked/unchecked statements and expressions.  This setting is
6779         used by the constant folder to flag errors.
6780
6781         * expression.cs (CheckedExpr, UncheckedExpr): Set the
6782         ConstantCheckState as well.   
6783
6784         During Resolve, they also have to flag the state, because the
6785         constant folder runs completely in the Resolve phase.
6786
6787         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
6788         well.
6789
6790 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
6791
6792         * cfold.cs: New file, this file contains the constant folder.
6793         
6794         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
6795         argument to track whether we are using the resulting address to
6796         load or store a value and provide better error messages. 
6797
6798         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
6799         new AddressOf arguments.
6800
6801         * statement.cs (Foreach.EmitCollectionForeach): Update
6802
6803         * expression.cs (Argument.Emit): Call AddressOf with proper
6804         arguments to track usage.
6805
6806         (New.DoEmit): Call AddressOf with new arguments.
6807
6808         (Unary.Emit): Adjust AddressOf call.
6809
6810 2002-03-01  Ravi Pratap  <ravi@ximian.com>
6811
6812         * cs-parser.jay (member_access): Change the case for pre-defined types
6813         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
6814         this suggestion.
6815
6816         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
6817         a method body.
6818
6819         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
6820         essentially like methods and apply attributes like MethodImplOptions to them too.
6821
6822         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
6823         not being null.
6824
6825         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
6826         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
6827         is the DeclSpace.
6828
6829         * Update code everywhere accordingly.
6830
6831         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
6832
6833         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
6834
6835 2002-02-28  Ravi Pratap  <ravi@ximian.com>
6836
6837         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
6838         try performing lookups against those instead of jumping straight into using
6839         the 'using' clauses.
6840
6841         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
6842
6843         (LookupType): Perform lookups in implicit parents too.
6844
6845         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
6846         sequence as RootContext.LookupType. 
6847
6848         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
6849         the various cases of namespace lookups into this method.
6850
6851 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
6852
6853         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
6854         in positional arguments)
6855
6856         * class.cs (Operator): Update the AllowedModifiers to contain
6857         extern. 
6858
6859         * cs-parser.jay: Update operator declaration to allow for the
6860         operator body to be empty.
6861
6862         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
6863         values. 
6864
6865 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
6866
6867         * class.cs (Method.Emit): Label parameters.
6868
6869         * driver.cs: Return 1 or 0 as the program exit code.
6870
6871 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
6872
6873         * expression.cs: Special case the `null' object when trying to
6874         auto-compute the type, as anything can be explicitly converted to
6875         that. 
6876
6877         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
6878         spotting this Paolo.
6879
6880         (Expression.ImplicitNumericConversion): Perform comparissions of
6881         the type using the underlying type in the case of an enumeration
6882         rather than using the enumeration type for the compare.
6883
6884         Cope with the underlying == type case, which is not possible to
6885         catch before. 
6886
6887         (Expression.ConvertNumericExplicit): Perform comparissions of
6888         the type using the underlying type in the case of an enumeration
6889         rather than using the enumeration type for the compare.
6890
6891         * driver.cs: If the user does not supply an extension, assume .exe
6892
6893         * cs-parser.jay (if_statement): Rewrote so that we can track the
6894         location for the if statement.
6895
6896         * expression.cs (Binary.ConstantFold): Only concat strings when
6897         the operation is "+", not everything ;-)
6898
6899         * statement.cs (Statement.EmitBoolExpression): Take a location
6900         argument. 
6901         (If, While, Do): Track location.
6902
6903         * expression.cs (Binary.ResolveOperator): In the object + string
6904         case, I was missing a call to ConvertImplicit
6905
6906 2002-02-25  Ravi Pratap  <ravi@ximian.com>
6907
6908         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
6909         Location arguments. Ensure we use RootContext.LookupType to do our work
6910         and not try to do a direct Type.GetType and ModuleBuilder.GetType
6911
6912         * interface.cs (PopulateMethod): Handle the type of the parameter being
6913         null gracefully.
6914
6915         * expression.cs (Invocation.BetterFunction): Handle the case when we 
6916         have a params method with no fixed arguments and a call is made with no
6917         arguments.
6918
6919 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
6920
6921         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
6922         the verbatim-string-literal
6923
6924         * support.cs (InternalParameters.ParameterModifier): handle null
6925         fixed parameters.
6926         (InternalParameters.ParameterType): ditto.
6927
6928         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
6929         duplicating the name of the variable parameter.
6930         (GetParameterByName): Fix bug where we were not looking up array
6931         paramters if they were the only present (thanks Paolo!).
6932         (GetParameterInfo): We only have an empty set of types if both
6933         fixed and array are set to null.
6934         (GetParameterInfo-idx): Handle FixedParameter == null
6935
6936         * cs-parser.jay: Handle the case where there is no catch
6937         statements (missing null test).
6938
6939 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
6940
6941         * driver.cs (MainDriver): Be conservative on our command line
6942         handling.
6943
6944         Catch DirectoryNotFoundException when calling GetFiles.
6945         
6946         (SplitPathAndPattern): Used to split the input specification into
6947         a path and a pattern that we can feed to Directory.GetFiles.
6948
6949 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
6950
6951         * statement.cs (Fixed): Implement the last case of the Fixed
6952         statement (string handling).
6953
6954         * expression.cs (StringPtr): New class used to return a char * to
6955         a string;  Used by the Fixed statement.
6956
6957         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
6958
6959         * expression.cs (Binary.ResolveOperator): Remove redundant
6960         MemberLookup pn parent type.
6961         Optimize union call, we do not need a union if the types are the same.
6962         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
6963         type.
6964
6965         Specialize the use of MemberLookup everywhere, instead of using
6966         the default settings. 
6967
6968         (StackAlloc): Implement stackalloc keyword.
6969
6970         * cs-parser.jay: Add rule to parse stackalloc.
6971         
6972         * driver.cs: Handle /h, /help, /?
6973
6974         * expression.cs (MakeByteBlob): Removed the hacks we had in place
6975         before we supported unsafe code.
6976         
6977         * makefile: add --unsafe to the self compilation of mcs.
6978
6979 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
6980
6981         * expression.cs (PointerArithmetic): New class that is used to
6982         perform pointer arithmetic.
6983         (Binary.Resolve): Handle pointer arithmetic
6984         Handle pointer comparission.
6985         (ArrayPtr): Utility expression class that is used to take the
6986         address of an array.
6987
6988         (ElementAccess): Implement array access for pointers
6989         
6990         * statement.cs (Fixed): Implement fixed statement for arrays, we
6991         are missing one more case before we are done.
6992
6993         * expression.cs (Indirection): Implement EmitAssign and set the
6994         ExprClass to Variable.  This allows pointer dereferences to be
6995         treated as variables, and to have values assigned to them.
6996         
6997         * ecore.cs (Expression.StoreFromPtr): New utility function to
6998         store values dereferencing.
6999
7000 2002-02-20  Ravi Pratap  <ravi@ximian.com>
7001
7002         * expression.cs (Binary.ResolveOperator): Ensure that we are
7003         not trying to operate on a void type - this fixes the reported
7004         bug.
7005
7006         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
7007         the parent implementation is sealed.
7008
7009         * ../errors/cs0239.cs : Add.
7010
7011         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
7012
7013         * typemanager.cs (unverifiable_code_type): Corresponds to 
7014         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
7015         which have unsafe code in them.
7016
7017         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
7018         unsafe context.
7019
7020 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
7021
7022         * cs-tokenizer.cs: Add support for @"litreal strings"
7023
7024         Make tokenizer accept pre-processor directives
7025         on any column (remove the old C-like limitation). 
7026
7027         * rootcontext.cs (EmitCode): Emit any global attributes.
7028         (AddGlobalAttributes): Used to keep track of assembly attributes. 
7029
7030         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
7031
7032         * cs-parser.jay: Add support for global attributes.  
7033
7034 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
7035
7036         * expression.cs (Indirection): New helper class.  Unary will
7037         create Indirection classes to be able to implement the
7038         IMemoryLocation interface on it.
7039
7040 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
7041
7042         * cs-parser.jay (fixed_statement): reference the right statement.
7043
7044         * statement.cs (Fixed.Emit): Finish implementing the fixed
7045         statement for the &x case.
7046
7047 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
7048
7049         * class.cs (Property.Define, Method.Define): Remove newslot when
7050         `implementing'.  
7051
7052         * modifiers.cs: My use of NewSlot when `Abstract' was set was
7053         wrong.  NewSlot should only be used if the `new' keyword is present.
7054
7055         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
7056         locating our system dir.  Sorry about this.
7057
7058 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
7059
7060         * driver.cs (GetSystemDir): Compute correctly the location of our
7061         system assemblies.  I was using the compiler directory instead of
7062         the library directory.
7063
7064 2002-02-13  Ravi Pratap  <ravi@ximian.com>
7065
7066         * expression.cs (BetterFunction): Put back in what Miguel commented out
7067         since it is the correct fix. The problem is elsewhere ;-)
7068
7069         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
7070         parameters of the parms method are themselves compatible or not !
7071
7072         (StandardConversionExists): Fix very dangerous bug where we were forgetting
7073         to check that a class implements an interface before saying that an implicit
7074         conversion was allowed. Use ImplementsInterface to do the checking.
7075
7076 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
7077
7078         * class.cs (Method.Define): Track whether we are an explicit
7079         implementation or not.  And only call DefineMethodOverride if we
7080         are an explicit implementation.
7081
7082         (Property.DefineMethod): Ditto.
7083
7084 2002-02-11  Ravi Pratap  <ravi@ximian.com>
7085
7086         * expression.cs (BetterFunction): Catch hideous bug which was
7087          preventing us from detecting ambiguous calls due to implicit casts i.e
7088         cs0121.
7089
7090 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
7091
7092         * support.cs (Pair): Remove un-needed method.  I figured why I was
7093         getting the error in cs-parser.jay, the variable in a foreach loop
7094         is readonly, and the compiler does not really treat this as a variable.
7095
7096         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
7097         instead of EQUALS in grammar.  
7098
7099         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
7100
7101         * expression.cs (Unary.DoResolve): Check whether the argument is
7102         managed or not.
7103
7104 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
7105
7106         * support.cs: Api for Pair to set a value.  Despite the fact that
7107         the variables are public the MS C# compiler refuses to compile
7108         code that accesses the field if the variable is part of a foreach
7109         statement. 
7110
7111         * statement.cs (Fixed): Begin implementation of the fixed
7112         statement.
7113
7114         (Block.AddVariable): Return the VariableInfo on success and null
7115         on failure instead of true/false. 
7116
7117         * cs-parser.jay (foreach): Catch errors on variables already
7118         defined (we were ignoring this value before) and properly unwind
7119         the block hierarchy
7120
7121         (fixed_statement): grammar for the fixed statement.
7122
7123 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
7124
7125         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
7126         pointer types to be incretemented.
7127
7128         (SizeOf): Implement.
7129
7130         * cs-parser.jay (pointer_member_access): Implement
7131         expr->IDENTIFIER production.
7132
7133         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
7134         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
7135         on safe contexts.
7136
7137         (Unary): Implement indirection.
7138
7139         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
7140         use in non-unsafe context).
7141
7142         (SimpleName.DoResolve): Check for pointers in field access on safe
7143         contexts. 
7144
7145         (Expression.LoadFromPtr): Factor the load-indirect code in this
7146         function.  This was duplicated in UnboxCast and ParameterReference
7147
7148 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
7149
7150         * expression.cs (ComposedCast): report an error if a pointer cast
7151         is used in a safe region.
7152
7153         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
7154         pointer type casts in unsafe context.
7155
7156         * codegen.cs (EmitContext): Set up IsUnsafe.
7157
7158         * cs-parser.jay (non_expression_type): Add productions for pointer
7159         casts. 
7160
7161         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
7162         code.  We should not use force into static mode if the method is
7163         not virtual.  Fixes bug in MIS
7164
7165         * statement.cs (Do.Emit, While.Emit, For.Emit,
7166         Statement.EmitBoolExpression): Add support to Do and While to
7167         propagate infinite loop as `I do return' semantics.
7168
7169         Improve the For case to also test for boolean constants.
7170
7171         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
7172         to the list of attributes we can add.
7173
7174         Remove `EmitContext' argument.
7175
7176         * class.cs (Method.Define): Apply parameter attributes.
7177         (Constructor.Define): Apply parameter attributes.
7178         (MethodCore.LabelParameters): Move here the core of labeling
7179         parameters. 
7180
7181         * support.cs (ReflectionParameters.ParameterModifier,
7182         InternalParameters.ParameterModifier): Use IsByRef on the type and
7183         only return the OUT bit for these parameters instead of in/out/ref
7184         flags.
7185
7186         This is because I miss-understood things.  The ParameterInfo.IsIn
7187         and IsOut represent whether the parameter has the [In] and [Out]
7188         attributes set.  
7189
7190 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
7191
7192         * ecore.cs (FieldExpr.Emit): Release temporaries.
7193
7194         * assign.cs (LocalTemporary.Release): new function.
7195
7196         * codegen.cs (EmitContext.GetTemporaryStorage,
7197         EmitContext.FreeTemporaryStorage): Rework the way we deal with
7198         temporary storage.  Now we can "put back" localbuilders when we
7199         are done with them
7200
7201 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
7202
7203         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
7204         need to make a copy of the variable to generate verifiable code.
7205
7206 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
7207
7208         * driver.cs: Compute dynamically the system directory.
7209
7210         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
7211         Slower, but more generally useful.  Used by the abstract
7212         registering implementation. 
7213
7214         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
7215         the rules for the special rule on Type/instances.  First check if
7216         we have the same name, and if so, try that special static path
7217         rather than the instance path.
7218         
7219 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
7220
7221         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
7222         for, while and if.
7223
7224         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
7225         Enum, ValueType, Delegate or Array for non-corlib compiles.
7226
7227         * cs-tokenizer.cs: Catch long identifiers (645)
7228
7229         * typemanager.cs (IndexerPropetyName): Ravi never tested this
7230         piece of code.
7231
7232         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
7233         fix, we were returning too early, so we were not registering
7234         pending methods from abstract classes.
7235
7236         Do not register pending methods if the class is abstract.
7237
7238         * expression.cs (Conditional.DoResolve): Report circular implicit
7239         conversions when we neecd to compute it for conditional
7240         expressions. 
7241
7242         (Is.DoResolve): If the expression is always of the provided type,
7243         flag warning 183.  If the expression can not ever be of the
7244         provided type flag warning 184.
7245
7246         * class.cs: Catch 169 as well.
7247
7248         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
7249         read. 
7250
7251 2002-01-18  Nick Drochak  <ndrochak@gol.com>
7252
7253         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
7254
7255 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
7256
7257         * interface.cs: (PopulateMethod): Check for pointers being defined
7258         only if the unsafe context is active.
7259         (PopulateProperty): ditto.
7260         (PopulateIndexer): ditto.
7261
7262         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
7263         specified.  If pointers are present, make sure that they are
7264         present in an unsafe context.
7265         (Constructor, Constructor.Define): ditto.
7266         (Field, Field.Define): ditto.
7267         (Property, Property.Define): ditto.
7268         (Event, Event.Define): ditto.
7269
7270         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
7271         hashtable if there are classes or structs defined.
7272
7273         * expression.cs (LocalVariableReference.DoResolve): Simplify this
7274         code, as the constant resolution moved.
7275
7276         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
7277         the metadata, so we can flag error 133. 
7278
7279         * decl.cs (MemberCore.UnsafeOK): New function to test that a
7280         pointer is being declared in an unsafe context.
7281
7282 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
7283
7284         * modifiers.cs (Modifiers.Check): Require a Location argument.
7285         Report error 227 for Unsafe use.
7286
7287         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
7288
7289         * statement.cs (For.Emit): If the test is null, then report that
7290         we do `return', as we wont reach anything afterwards.
7291
7292         (Switch.SwitchGoverningType): Track the expression that matched
7293         the conversion.
7294
7295         * driver.cs: Allow negative numbers as an error code to flag.
7296
7297         * cs-parser.jay: Handle 1551.
7298
7299         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
7300
7301 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
7302
7303         * cs-parser.jay: Report 1518 (type declaration can only contain
7304         class, struct, interface, enum or delegate)
7305
7306         (switch_label): Report 1523 (keywords `case' or `default' must
7307         preced code)
7308
7309         (opt_switch_sections): Report 1522 (empty switch)
7310
7311         * driver.cs: Report 1515 (response file specified multiple times)
7312         Report 1516 (Source file specified multiple times).
7313
7314         * expression.cs (Argument.Resolve): Signal 1510
7315
7316         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
7317         access not allowed in static code)
7318
7319 2002-01-11  Ravi Pratap  <ravi@ximian.com>
7320
7321         * typemanager.cs (IsPointerType): Utility method which we are going
7322         to need a lot.
7323
7324         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
7325         the object type, so we take care of that.
7326
7327         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
7328         
7329         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
7330         added to non-params parameters :-)
7331
7332         * typemanager.cs (CSharpName): Include 'void' type too. 
7333
7334         (void_ptr_type): Include in the set of core types.
7335
7336         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
7337         duplicating code.
7338
7339         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
7340         an unsafe context.
7341
7342         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
7343         completely forgotten about it.
7344
7345 2002-01-10  Ravi Pratap  <ravi@ximian.com>
7346
7347         * cs-parser.jay (pointer_type): Add. This begins our implementation
7348         of parsing rules for unsafe code.
7349
7350         (unsafe_statement): Implement.
7351
7352         (embedded_statement): Modify to include the above.
7353
7354         * statement.cs (Unsafe): Implement new class for unsafe blocks.
7355
7356         * codegen.cs (EmitContext.InUnsafe): Add. This determines
7357         if the current context is an unsafe one.
7358
7359         * cs-parser.jay (local_variable_pointer_type): Since local variable types
7360         are handled differently, we need separate rules for them.
7361
7362         (local_variable_declaration): Update to use local_variable_pointer_type
7363         to allow variable declarations of unmanaged pointer types.
7364
7365         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
7366         in unsafe contexts.
7367
7368         * ../errors/cs0214.cs : Add.
7369
7370 2002-01-16  Nick Drochak  <ndrochak@gol.com>
7371
7372         * makefile: remove 'response' file when cleaning.
7373
7374 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
7375
7376         * cs-parser.jay: Report 1524.
7377
7378 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
7379
7380         * typemanager.cs (RegisterMethod): drop checking if we have
7381         registered this from here
7382
7383 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
7384
7385         * class.cs (Method.EmitDestructor): Implement calling our base
7386         destructor. 
7387
7388         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
7389         value of InFinally.
7390
7391         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
7392         this routine and will wrap the call in a try/catch block.  Deal
7393         with the case.
7394
7395 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
7396
7397         * ecore.cs (Expression.MemberLookup): instead of taking a
7398         parameter `same_type' that was used to tell whether we could
7399         access private members we compute our containing type from the
7400         EmitContext.
7401
7402         (FieldExpr): Added partial support for volatile fields.  This does
7403         not work for volatile fields exposed from assemblies, as I can not
7404         figure out how to extract the modreq from it.
7405
7406         Updated all the source files to use this.
7407
7408         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
7409         because it is referenced by MemberLookup very often. 
7410
7411 2002-01-09  Ravi Pratap  <ravi@ximian.com>
7412
7413         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
7414         TypeBuilder.GetCustomAttributes to retrieve what we need.
7415
7416         Get rid of redundant default_member_attr_type as this is the same as
7417         default_member_type which already exists.
7418
7419         * interface.cs, attribute.cs : Update accordingly.
7420         
7421 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
7422
7423         * typemanager.cs: Enable IndexerPropertyName again.  It does not
7424         work for TYpeBuilders though.  Ravi, can you please fix this?
7425
7426         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
7427
7428         * expression.cs (Argument.Emit): Handle the case of ref objects
7429         being passed to ref functions;  
7430
7431         (ParameterReference.EmitLoad): Loads the content of the pointer
7432         without dereferencing.
7433
7434 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
7435
7436         * cs-tokenizer.cs: Implemented the pre-processing expressions.
7437
7438 2002-01-08  Ravi Pratap  <ravi@ximian.com>
7439
7440         * class.cs (Indexer.DefineMethod): Incorporate the interface
7441         type in the name of the method if we are doing explicit interface
7442         implementation.
7443
7444         * expression.cs (ConversionExists): Remove as it is completely obsolete.
7445
7446         (BetterConversion): Fix extremely trivial bug where we were referring to
7447         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
7448         again !
7449
7450         * ../errors/bug16.cs : Add although we have fixed it.
7451
7452 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
7453
7454         * expression.cs (BaseIndexer): Begin implementation.
7455
7456         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
7457
7458         * cs-parser.jay (indexer_declarator): Use qualified_identifier
7459         production directly to remove a shift/reduce, and implement
7460         explicit interface implementation.
7461
7462         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
7463         after a floating point suffix.
7464
7465         * expression.cs (DoNumericPromotions): Improved the conversion for
7466         uint/uint.  If we have a constant, we avoid doing a typecast to a
7467         larger type.
7468
7469         * class.cs (Indexer): Implement explicit interface implementation
7470         for indexers.
7471         
7472 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
7473
7474         * class.cs: make the default instance constructor public and hidebysig.
7475
7476 2001-01-03  Ravi Pratap  <ravi@ximian.com>
7477
7478         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
7479         so we can call it from elsewhere.
7480
7481         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
7482         we emit it internally if the class has a defined indexer; otherwise the user
7483         emits it by decorating the class definition with the DefaultMemberAttribute.
7484
7485         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
7486         attribute is not used on a type which defines an indexer.
7487
7488         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
7489         character when we skip whitespace.
7490
7491         * ../errors/cs0646.cs : Add.
7492
7493 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
7494
7495         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
7496         again. 
7497
7498         * makefile: Add practical target `mcs3.exe' which builds the third
7499         generation compiler. 
7500
7501         * expression.cs (New): Fix structures constructor calling.
7502
7503         * class.cs (Property, Method, Indexer): Emit Final flag on the
7504         method if we are an interface implementation and we are not
7505         abstract. 
7506
7507         * ecore.cs (PropertyExpr): New public field `IsBase', tells
7508         whether this property is referencing a `base' method.
7509
7510         * expression.cs (Invocation.EmitCall): take an extra argument:
7511         is_base, this is used to determine whether the `call' or
7512         `callvirt' opcode should be used.
7513
7514         
7515         * delegate.cs: update EmitCall.
7516
7517         * class.cs (Method.Define): Set NewSlot for the cases where we are
7518         not implementing an interface method.
7519
7520         (Property.Define): ditto.
7521
7522 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
7523
7524         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
7525         'r'.  Allows mcs to parse itself fully.
7526
7527 2002-01-02  Ravi Pratap  <ravi@ximian.com>
7528
7529         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
7530         of the number of initializers that require the InitializeArray method.
7531
7532         (CheckIndices): Store the Expression in all cases - not the plain value. Also
7533         update the above field where necessary.
7534
7535         (MakeByteBlob): Update accordingly.
7536
7537         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
7538         greater than 2.
7539
7540         (EmitDynamicInitializers): Update in accordance with the new optimization.
7541
7542         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
7543         same OpCode applies.
7544
7545         * cs-parser.jay : Fix some glaring errors I introduced.
7546
7547 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
7548
7549         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
7550         so that we can check for name clashes there too.
7551
7552         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
7553         for interface indexers.
7554
7555         * interfaces.cs (Define): Emit the default member attribute.
7556
7557         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
7558         variable was being referred to while setting the value ;-)
7559
7560 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
7561
7562         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
7563         byte-by-byte information when we know the data is zero.
7564
7565         Make the block always a multiple of 4, because
7566         DefineInitializedData has a bug.
7567
7568         * assign.cs: Fix, we should assign from the temporary, not from
7569         the source. 
7570
7571         * expression.cs (MakeByteBlob): Fix my incorrect code.
7572
7573 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
7574
7575         * typemanager.cs (EnumToUnderlying): This function is used to get
7576         the underlying type from an enumeration, because it does not
7577         always work. 
7578
7579         * constant.cs: Use the I4_S form for values between -128 and 127.
7580
7581         * statement.cs (Block.LookupLabel): Looks up a label.
7582         (Block): Drop support for labeled blocks.
7583
7584         (LabeledStatement): New kind of statement that represents a label
7585         only.
7586
7587         (Goto): Finally implement this bad boy.
7588         
7589         * cs-parser.jay: Update to reflect new mechanism to implement
7590         labels.
7591
7592 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
7593
7594         * codegen.cs (EmitContext.This): a codegen property that keeps the
7595         a single instance of this instead of creating many different this
7596         instances. 
7597
7598         * delegate.cs (Delegate.DoResolve): Update to use the property;
7599
7600         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
7601
7602         * expression.cs (BaseAccess.DoResolve): Ditto.
7603
7604 2001-12-29  Ravi Pratap  <ravi@ximian.com>
7605
7606         * typemanager.cs (methodimpl_attr_type): Add to hold the type
7607         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
7608
7609         (InitCoreTypes): Update accordingly.
7610
7611         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
7612         so we can quickly store the state.
7613
7614         (ApplyAttributes): Set the correct implementation flags
7615         for InternalCall methods.
7616
7617 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
7618
7619         * expression.cs (EmitCall): if a method is not virtual, then do
7620         not use callvirt on it.
7621
7622         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
7623         user defined stuff) requires the use of stobj, which takes an
7624         address on the stack instead of an array and an index.  So emit
7625         the Ldelema operation for it.
7626
7627         (EmitStoreOpcode): Use stobj for valuetypes.
7628
7629         (UnaryMutator.EmitCode): Use the right 1 value depending on
7630         whether we are dealing with int64/uint64, float or doubles.
7631
7632         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
7633         constructors that I implemented last night.
7634
7635         (Constructor.IsDefault): Fix to work properly for static
7636         constructors.
7637
7638         * cs-parser.jay (CheckDef): report method signature errors.
7639         Update error number 103 to be 132.
7640
7641         * decl.cs: New AdditionResult enumeration value: MethodExists.
7642         Although we do this check for methods later on in the semantic
7643         analysis, catching repeated default constructors is so easy that
7644         we catch these here. 
7645         
7646         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
7647         promotions code.
7648
7649         (ParameterReference.EmitAssign, Emit): handle
7650         bools as bytes.
7651
7652         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
7653         (ArrayAccess.EmitStoreOpcode): ditto.
7654
7655         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
7656
7657         * expression.cs (MakeByteBlob): Complete all the missing types
7658         (uint, short, ushort, byte, sbyte)
7659
7660         * class.cs: Only init instance field initializers on instance
7661         constructors. 
7662
7663         Rename `constructors' to instance_constructors. 
7664
7665         (TypeContainer.AddConstructor): Only add constructors to the list
7666         if it is not static.
7667
7668         Make sure that we handle default_static_constructor independently
7669         everywhere where we handle instance_constructors
7670
7671 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
7672
7673         * class.cs: Do not lookup or create a base initializer for a
7674         static constructor.
7675
7676         (ConstructorInitializer.Resolve): use the proper type to lookup
7677         for constructors.
7678
7679         * cs-parser.jay: Report error 1585 (modifiers between type and name).
7680
7681         * enum.cs, interface.cs: Remove CloseType, this is taken care by
7682         in DeclSpace. 
7683
7684         * decl.cs: CloseType is now an virtual method, the default
7685         implementation just closes this type.
7686         
7687 2001-12-28  Ravi Pratap  <ravi@ximian.com>
7688
7689         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
7690         to PreserveSig by default. Also emit HideBySig on such methods.
7691
7692         Basically, set the defaults to standard values.
7693
7694         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
7695         argument, if candidate is better, it can't be worse than the best !
7696
7697         (Invocation): Re-write bits to differentiate between methods being
7698         applicable in their expanded form and their normal form - for params
7699         methods of course.
7700
7701         Get rid of use_standard everywhere as only standard conversions are allowed
7702         in overload resolution. 
7703
7704         More spec conformance.
7705         
7706 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
7707
7708         * driver.cs: Add --timestamp, to see where the compiler spends
7709         most of its time.
7710
7711         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
7712         `this' in static code.
7713
7714         (SimpleName.DoResolve): Implement in terms of a helper function
7715         that allows static-references to be passed upstream to
7716         MemberAccess.
7717
7718         (Expression.ResolveWithSimpleName): Resolve specially simple
7719         names when called by MemberAccess to implement the special
7720         semantics. 
7721
7722         (Expression.ImplicitReferenceConversion): Handle conversions from
7723         Null to reference types before others, as Null's type is
7724         System.Object. 
7725
7726         * expression.cs (Invocation.EmitCall): Handle the special case of
7727         calling methods declared on a reference type from a ValueType
7728         (Base classes System.Object and System.Enum)
7729
7730         (MemberAccess.Resolve): Only perform lookups on Enumerations if
7731         the left hand side is a TypeExpr, not on every enumeration. 
7732
7733         (Binary.Resolve): If types are reference types, then do a cast to
7734         object on operators != and == of both arguments.
7735         
7736         * typemanager.cs (FindMembers): Extract instance and static
7737         members if requested.
7738
7739         * interface.cs (PopulateProperty): Use void_type instead of null
7740         as the return type for the setter method.
7741
7742         (PopulateIndexer): ditto.
7743
7744 2001-12-27  Ravi Pratap  <ravi@ximian.com>
7745
7746         * support.cs (ReflectionParameters): Fix minor bug where we
7747         were examining the wrong parameter for the ParamArray attribute.
7748
7749         Cope with requests for the type of the parameter at position
7750         greater than the params parameter's. We now return the element
7751         type of the params array as that makes more sense.
7752
7753         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
7754         accordingly as we no longer have to extract the element type
7755         ourselves.
7756
7757         (Invocation.OverloadResolve): Update.
7758
7759 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
7760
7761         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
7762         against IEnumerator, test whether the return value is a descendant
7763         of the IEnumerator interface.
7764
7765         * class.cs (Indexer.Define): Use an auxiliary method to implement
7766         the other bits of the method definition.  Begin support for
7767         explicit interface implementation.
7768
7769         (Property.DefineMethod): Use TypeManager.void_type instead of null
7770         for an empty return value.
7771
7772 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
7773
7774         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
7775         dealing with a FieldExpr which is composed of a FieldBuilder, in
7776         the code path we did extract the constant, but we should have
7777         obtained the underlying value to be able to cast it (otherwise we
7778         end up in an infinite loop, this is what Ravi was running into).
7779
7780         (ArrayCreation.UpdateIndices): Arrays might be empty.
7781
7782         (MemberAccess.ResolveMemberAccess): Add support for section
7783         14.5.4.1 that deals with the special case of E.I when E is a type
7784         and something else, that I can be a reference to a static member.
7785
7786         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
7787         handle a particular array type to create byte blobs, it is just
7788         something we dont generate byteblobs for.
7789
7790         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
7791         arguments. 
7792
7793         * location.cs (Push): remove the key from the hashtable that we
7794         are about to add.   This happens for empty files.
7795
7796         * driver.cs: Dispose files after we have parsed them.
7797
7798         (tokenize): new function that only runs the tokenizer on its
7799         input, for speed testing.
7800
7801 2001-12-26  Ravi Pratap  <ravi@ximian.com>
7802
7803         * class.cs (Event.Define): Define the private field only if there
7804         are no accessors defined.
7805
7806         * expression.cs (ResolveMemberAccess): If there is no associated
7807         field with the event, that means we have an event defined with its
7808         own accessors and we should flag error cs0070 since transforming
7809         ourselves into a field is not valid in that case.
7810
7811         * ecore.cs (SimpleName.DoResolve): Same as above.
7812
7813         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
7814         and charset to sane values.
7815
7816 2001-12-25  Ravi Pratap  <ravi@ximian.com>
7817
7818         * assign.cs (DoResolve): Perform check on events only if they 
7819         are being accessed outside the declaring type.
7820
7821         * cs-parser.jay (event_declarations): Update rules to correctly
7822         set the type of the implicit parameter etc.
7823
7824         (add_accessor, remove_accessor): Set current local parameters.
7825
7826         * expression.cs (Binary): For delegate addition and subtraction,
7827         cast the return value from the method into the appropriate delegate
7828         type.
7829
7830 2001-12-24  Ravi Pratap  <ravi@ximian.com>
7831
7832         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
7833         of these as the workaround is unnecessary.
7834
7835         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
7836         delegate data - none of that is needed at all.
7837
7838         Re-write bits to extract the instance expression and the delegate method
7839         correctly.
7840
7841         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
7842         on delegates too.
7843
7844         * attribute.cs (ApplyAttributes): New method to take care of common tasks
7845         of attaching attributes instead of duplicating code everywhere.
7846
7847         * everywhere : Update code to do attribute emission using the above method.
7848
7849 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
7850
7851         * expression.cs (IsParamsMethodApplicable): if there are not
7852         parameters, return immediately.
7853
7854         * ecore.cs: The 0 literal can be implicity converted to an enum
7855         type. 
7856
7857         (SimpleName.DoResolve): First lookup the type, then lookup the
7858         members. 
7859
7860         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
7861         want to get its address.  If the InstanceExpression is not
7862         addressable, store the result in a temporary variable, then get
7863         the address of it.
7864
7865         * codegen.cs: Only display 219 errors on warning level or above. 
7866
7867         * expression.cs (ArrayAccess): Make it implement the
7868         IMemoryLocation interface.
7869
7870         (Binary.DoResolve): handle the operator == (object a, object b)
7871         and operator != (object a, object b) without incurring into a
7872         BoxedCast (because 5 != o should never be performed).
7873
7874         Handle binary enumerator operators.
7875
7876         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
7877         value type, otherwise use Ldelem_ref.
7878
7879         Use precomputed names;
7880
7881         (AddressOf): Implement address of
7882
7883         * cs-parser.jay (labeled_statement): Fix recursive block
7884         addition by reworking the production.
7885
7886         * expression.cs (New.DoEmit): New has a special case:
7887                 
7888                  If we are dealing with a ValueType, we have a few
7889                  situations to deal with:
7890                 
7891                     * The target of New is a ValueType variable, that is
7892                       easy, we just pass this as the variable reference
7893                 
7894                     * The target of New is being passed as an argument,
7895                       to a boxing operation or a function that takes a
7896                       ValueType.
7897                 
7898                       In this case, we need to create a temporary variable
7899                       that is the argument of New.
7900
7901
7902 2001-12-23  Ravi Pratap  <ravi@ximian.com>
7903
7904         * rootcontext.cs (LookupType): Check that current_type is not null before
7905         going about looking at nested types.
7906
7907         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
7908         not implement the IAssignMethod interface any more.
7909
7910         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
7911         where we tranform them into FieldExprs if they are being resolved from within
7912         the declaring type.
7913
7914         * ecore.cs (SimpleName.DoResolve): Do the same here.
7915
7916         * assign.cs (DoResolve, Emit): Clean up code considerably. 
7917
7918         * ../errors/bug10.cs : Add.
7919
7920         * ../errors/cs0070.cs : Add.
7921
7922         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
7923
7924         * assign.cs : Get rid of EventIsLocal everywhere.
7925         
7926 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
7927
7928         * ecore.cs (ConvertIntLiteral): finished the implementation.
7929
7930         * statement.cs (SwitchLabel): Convert the value we are using as a
7931         key before looking up the table.
7932
7933 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
7934
7935         * codegen.cs (EmitTopBlock): Require a Location argument now.
7936
7937         * cs-parser.jay (constructor_declarator): We need to setup
7938         current_local_parameters before we parse the
7939         opt_constructor_initializer, to allow the variables to be bound
7940         to the constructor arguments.
7941
7942         * rootcontext.cs (LookupType): First lookup nested classes in our
7943         class and our parents before we go looking outside our class.
7944
7945         * expression.cs (ConstantFold): Extract/debox the values at the
7946         beginnning. 
7947
7948         * rootcontext.cs (EmitCode): Resolve the constants first before we
7949         resolve the types.  This is not really needed, but it helps debugging.
7950
7951         * statement.cs: report location.
7952         
7953         * cs-parser.jay: pass location to throw statement.
7954
7955         * driver.cs: Small bug fix.
7956
7957         * report.cs: Updated format to be 4-zero filled digits.
7958
7959 2001-12-22  Ravi Pratap  <ravi@ximian.com>
7960
7961         * expression.cs (CheckIndices): Fix minor bug where the wrong
7962         variable was being referred to ;-)
7963
7964         (DoEmit): Do not call EmitStaticInitializers when the 
7965         underlying type is System.Object.
7966
7967 2001-12-21  Ravi Pratap  <ravi@ximian.com>
7968
7969         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
7970         and do the usual workaround for SRE.
7971
7972         * class.cs (MyEventBuilder.EventType): New member to get at the type
7973         of the event, quickly.
7974
7975         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
7976
7977         * assign.cs (Assign.DoResolve): Handle the case when the target
7978         is an EventExpr and perform the necessary checks.
7979
7980         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
7981         interface.
7982
7983         (SimpleName.MemberStaticCheck): Include check for EventExpr.
7984
7985         (EventExpr): Set the type in the constructor itself since we 
7986         are meant to be born fully resolved.
7987
7988         (EventExpr.Define): Revert code I wrote earlier.
7989                 
7990         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
7991         instance expression is null. The instance expression is a This in that case
7992         or a null, depending on whether it is a static method or not.
7993
7994         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
7995         refers to more than one method.
7996
7997         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
7998         and accordingly flag errors.
7999
8000 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
8001
8002         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
8003
8004 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
8005
8006         * location.cs (ToString): Provide useful rutine.
8007
8008 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
8009
8010         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
8011         objects, return the actual integral boxed.
8012
8013         * statement.cs (SwitchLabel): define an ILLabel for each
8014         SwitchLabel. 
8015         
8016         (Switch.CheckSwitch): If the value is a Literal, extract
8017         the underlying literal.
8018         
8019         Also in the unused hashtable we had, add the SwitchLabel so we can
8020         quickly look this value up.
8021
8022         * constant.cs: Implement a bunch of new constants.  Rewrite
8023         Literal based on this.  Made changes everywhere to adapt to this.
8024         
8025         * expression.cs (Expression.MakeByteBlob): Optimize routine by
8026         dereferencing array only once, and also copes with enumrations.
8027
8028         bytes are two bytes wide, not one.
8029
8030         (Cast): Perform constant conversions.
8031         
8032         * ecore.cs (TryImplicitIntConversion): Return literals instead of
8033         wrappers to the literals here.
8034
8035         * expression.cs (DoNumericPromotions): long literals can converted
8036         to ulong implicity (this is taken care of elsewhere, but I was
8037         missing this spot).
8038
8039         * ecore.cs (Expression.Literalize): Make the return type Literal,
8040         to improve type checking.
8041
8042         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
8043
8044 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
8045
8046         * literal.cs: Revert code from ravi that checked the bounds.  The
8047         bounds are sane by the definition of the type itself. 
8048
8049         * typemanager.cs: Fix implementation of ImplementsInterface.  We
8050         need to actually look up in our parent hierarchy for interfaces
8051         implemented. 
8052
8053         * const.cs: Use the underlying type for enumerations
8054
8055         * delegate.cs: Compute the basename for the delegate creation,
8056         that should fix the delegate test case, and restore the correct
8057         Type Lookup semantics in rootcontext
8058
8059         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
8060         referencing a nested type with the Reflection API is using the "+"
8061         sign. 
8062
8063         * cs-parser.jay: Do not require EOF token at the end.
8064
8065 2001-12-20  Ravi Pratap  <ravi@ximian.com>
8066
8067         * rootcontext.cs (LookupType): Concatenate type names with
8068         a '.' instead of a '+' The test suite passes again.
8069
8070         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
8071         field of the enumeration.
8072
8073         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
8074         the case when the member is an EventExpr.
8075
8076         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
8077         static has an associated instance expression.
8078
8079         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
8080
8081         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
8082
8083         * class.cs (Event.Define): Register event and perform appropriate checks
8084         for error #111.
8085
8086         We define the Add and Remove methods even if the use provides none because
8087         in that case, we provide default implementations ourselves.
8088
8089         Define a private field of the type of the event. This is done by the CSC compiler
8090         and we should be doing it too ;-)
8091
8092         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
8093         More methods we use in code we generate.
8094
8095         (multicast_delegate_type, delegate_type): Two separate types since the distinction
8096         is important.
8097
8098         (InitCoreTypes): Update accordingly for the above.
8099
8100         * class.cs (Event.Emit): Generate code for default accessors that we provide
8101
8102         (EmitDefaultMethod): Do the job in the above.
8103
8104         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
8105         appropriate place.
8106
8107 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
8108
8109         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
8110         builders even if we were missing one.
8111
8112         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
8113         pass the Basename as our class name instead of the Name.  The
8114         basename will be correctly composed for us.
8115
8116         * parameter.cs (Paramters): Now takes a Location argument.
8117
8118         * decl.cs (DeclSpace.LookupType): Removed convenience function and
8119         make all the code call directly LookupType in RootContext and take
8120         this chance to pass the Location information everywhere.
8121
8122         * Everywhere: pass Location information.
8123
8124 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
8125
8126         * class.cs (Constructor.Define): Updated way of detecting the
8127         length of the parameters.
8128
8129         (TypeContainer.DefineType): Use basename as the type name for
8130         nested types.
8131
8132         (TypeContainer.Define): Do not recursively define types here, as
8133         definition is taken care in order by the RootContext.
8134
8135         * tree.cs: Keep track of namespaces in a per-file basis.
8136
8137         * parameter.cs (Parameter.ComputeSignature): Update to use
8138         DeclSpace. 
8139
8140         (Parameters.GetSignature): ditto.
8141
8142         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
8143         instead of a TypeContainer.
8144
8145         (Interface.SemanticAnalysis): Use `this' instead of our parent to
8146         resolve names.  Because we need to be resolve in our context, not
8147         our parents.
8148         
8149         * driver.cs: Implement response files.
8150
8151         * class.cs (TypeContainer.DefineType): If we are defined, do not
8152         redefine ourselves.
8153         
8154         (Event.Emit): Emit the code for add/remove handlers.
8155         (Event.Define): Save the MethodBuilders for add/remove.
8156
8157         * typemanager.cs: Use pair here too.
8158
8159         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
8160         DictionaryEntry requires the first argument to be non-null.  
8161         
8162         (enum_declaration): Compute full name for registering the
8163         enumeration.
8164         
8165         (delegate_declaration): Instead of using
8166         formal_parameter_list, use opt_formal_parameter_list as the list
8167         can be empty.
8168
8169         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
8170         (EventParsing): New property that controls whether `add' and
8171         `remove' are returned as tokens or identifiers (for events);
8172
8173 2001-12-19  Ravi Pratap  <ravi@ximian.com>
8174
8175         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
8176         use MyEventBuilder only and let it wrap the real builder for us.
8177
8178         (MyEventBuilder): Revamp constructor etc.
8179
8180         Implement all operations that we perform on EventBuilder in precisely the same
8181         way here too.
8182
8183         (FindMembers): Update to use the EventBuilder member.
8184
8185         (Event.Emit): Update accordingly.
8186
8187 2001-12-18  Ravi Pratap  <ravi@ximian.com>
8188
8189         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
8190         by calling the appropriate methods.
8191
8192         (GetCustomAttributes): Make stubs as they cannot possibly do anything
8193         useful.
8194
8195         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
8196
8197 2001-12-17  Ravi Pratap  <ravi@ximian.com>
8198
8199         * delegate.cs (Delegate.Populate): Check that the return type
8200         and various parameters types are indeed accessible.
8201
8202         * class.cs (Constructor.Define): Same here.
8203
8204         (Field.Define): Ditto.
8205
8206         (Event.Define): Ditto.
8207
8208         (Operator.Define): Check that the underlying Method defined itself
8209         correctly - so it's MethodBuilder should not be null.
8210
8211         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
8212         expression happens to be null.
8213
8214         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
8215         members but as of now we don't seem to be able to do anything really useful with it.
8216
8217         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
8218         not the EventBuilder.
8219
8220 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
8221
8222         * cs-tokenizer.cs: Add support for defines.
8223         Add support for #if, #elif, #else, #endif
8224         
8225         (eval_var): evaluates a variable.
8226         (eval): stubbed for evaluating functions.
8227
8228         * cs-parser.jay: Pass the defines information
8229
8230         * driver.cs: Add --define command line option.
8231
8232         * decl.cs: Move MemberCore here.
8233
8234         Make it the base class for DeclSpace.  This allows us to catch and
8235         report 108 and 109 for everything now.
8236
8237         * class.cs (TypeContainer.Define): Extract all the members
8238         before populating and emit the warning 108 (new keyword required
8239         to override) instead of having each member implement this.
8240
8241         (MemberCore.Define): New abstract method, we will be using this in
8242         the warning reporting engine in Populate.
8243         
8244         (Operator.Define): Adjust to new MemberCore protocol. 
8245
8246         * const.cs (Const): This does not derive from Expression, it is a
8247         temporary object we use to create fields, it is a MemberCore. 
8248
8249         * class.cs (Method.Define): Allow the entry point to be in a
8250         specific class.
8251
8252         * driver.cs: Rewrite the argument handler to clean it up a bit.
8253
8254         * rootcontext.cs: Made it just an auxiliary namespace feature by
8255         making everything static.
8256
8257         * driver.cs: Adapt code to use RootContext type name instead of
8258         instance variable.
8259
8260         * delegate.cs: Remove RootContext argument.
8261
8262         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
8263         argument. 
8264
8265         * class.cs (Event.Define): The lookup can fail.
8266         
8267         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
8268
8269         * expression.cs: Resolve the this instance before invoking the code.
8270
8271 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
8272
8273         * cs-parser.jay: Add a production in element_access that allows
8274         the thing to become a "type" reference.  This way we can parse
8275         things like "(string [])" as a type.
8276
8277         Note that this still does not handle the more complex rules of
8278         casts. 
8279         
8280
8281         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
8282
8283         * ecore.cs: (CopyNewMethods): new utility function used to
8284         assemble the list of methods from running FindMembers.
8285
8286         (MemberLookup): Rework FindMembers so that 
8287
8288 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
8289
8290         * class.cs (TypeContainer): Remove Delegates who fail to be
8291         defined.
8292
8293         * delegate.cs (Populate): Verify that we dont get null return
8294         values.   TODO: Check for AsAccessible.
8295
8296         * cs-parser.jay: Use basename to emit error 574 (destructor should
8297         have the same name as container class), not the full name.
8298
8299         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
8300         possible representation.  
8301
8302         Also implements integer type suffixes U and L.
8303
8304 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
8305
8306         * expression.cs (ArrayCreation.DoResolve): We need to do the
8307         argument resolution *always*.
8308
8309         * decl.cs: Make this hold the namespace.  Hold the root context as
8310         well.
8311         (LookupType): Move here.
8312
8313         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
8314
8315         * location.cs (Row, Name): Fixed the code, it was always returning
8316         references to the first file.
8317
8318         * interface.cs: Register properties defined through interfaces.
8319
8320         * driver.cs: Add support for globbing on the command line
8321
8322         * class.cs (Field): Make it derive from MemberCore as well.
8323         (Event): ditto.
8324
8325 2001-12-15  Ravi Pratap  <ravi@ximian.com>
8326
8327         * class.cs (Event::Define): Check that the type of the event is a delegate
8328         type else flag error #66.
8329
8330         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
8331         same.
8332
8333         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
8334         values of EntryPoint, CharSet etc etc.
8335
8336         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
8337
8338         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
8339         be null and we should ignore this. I am not sure if this is really clean. Apparently,
8340         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
8341         which needs this to do its work.
8342
8343         * ../errors/cs0066.cs : Add.
8344
8345 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
8346
8347         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
8348         helper functions.
8349
8350         * class.cs: (MethodSignature.MethodSignature): Removed hack that
8351         clears out the parameters field.
8352         (MemberSignatureCompare): Cleanup
8353
8354         (MemberCore): New base class used to share code between MethodCore
8355         and Property.
8356
8357         (RegisterRequiredImplementations) BindingFlags.Public requires
8358         either BindingFlags.Instace or Static.  Use instance here.
8359
8360         (Property): Refactored code to cope better with the full spec.
8361
8362         * parameter.cs (GetParameterInfo): Return an empty array instead
8363         of null on error.
8364
8365         * class.cs (Property): Abstract or extern properties have no bodies.
8366
8367         * parameter.cs (GetParameterInfo): return a zero-sized array.
8368
8369         * class.cs (TypeContainer.MethodModifiersValid): Move all the
8370         method modifier validation to the typecontainer so we can reuse
8371         this on properties.
8372
8373         (MethodCore.ParameterTypes): return an empty sized array of types.
8374
8375         (Property.Define): Test property modifier validity.
8376
8377         Add tests for sealed/override too.
8378
8379         (Method.Emit): abstract or extern methods have no bodies.
8380
8381 2001-12-14  Ravi Pratap  <ravi@ximian.com>
8382
8383         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
8384         thing.
8385
8386         (Method::Define, ::Emit): Modify accordingly.
8387
8388         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
8389
8390         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
8391
8392         * makefile: Pass in /unsafe.
8393
8394 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
8395
8396         * class.cs (MakeKey): Kill routine.
8397         
8398         * class.cs (TypeContainer.Define): Correctly define explicit
8399         method implementations (they require the full interface name plus
8400         the method name).
8401
8402         * typemanager.cs: Deply the PtrHashtable here and stop using the
8403         lame keys.  Things work so much better.
8404
8405         This of course broke everyone who depended on `RegisterMethod' to
8406         do the `test for existance' test.  This has to be done elsewhere.
8407
8408         * support.cs (PtrHashtable): A hashtable that avoid comparing with
8409         the object stupid Equals method (because, that like fails all over
8410         the place).  We still do not use it.
8411
8412         * class.cs (TypeContainer.SetRequiredInterface,
8413         TypeContainer.RequireMethods): Killed these two routines and moved
8414         all the functionality to RegisterRequiredImplementations.
8415
8416         (TypeContainer.RegisterRequiredImplementations): This routine now
8417         registers all the implementations required in an array for the
8418         interfaces and abstract methods.  We use an array of structures
8419         which can be computed ahead of time to reduce memory usage and we
8420         also assume that lookups are cheap as most classes will not
8421         implement too many interfaces.
8422
8423         We also avoid creating too many MethodSignatures.
8424
8425         (TypeContainer.IsInterfaceMethod): Update and optionally does not
8426         clear the "pending" bit if we find that there are problems with
8427         the declaration.
8428
8429         (TypeContainer.VerifyPendingMethods): Update to report errors of
8430         methods that look like implementations but are not.
8431
8432         (TypeContainer.Define): Add support for explicit interface method
8433         implementation. 
8434         
8435 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
8436
8437         * typemanager.cs: Keep track of the parameters here instead of
8438         being a feature of the TypeContainer.
8439
8440         * class.cs: Drop the registration of parameters here, as
8441         InterfaceMethods are also interface declarations.
8442
8443         * delegate.cs: Register methods with the TypeManager not only with
8444         the TypeContainer.  This code was buggy.
8445
8446         * interface.cs: Full registation here.
8447
8448 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
8449
8450         * expression.cs: Remove reducer for binary expressions, it can not
8451         be done this way.
8452
8453         * const.cs: Put here the code that used to go into constant.cs
8454
8455         * constant.cs: Put here the code for constants, this is a new base
8456         class for Literals.
8457
8458         * literal.cs: Make Literal derive from Constant.
8459
8460 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
8461
8462         * statement.cs (Return.Emit): Report error 157 if the user
8463         attempts to return from a finally block.
8464
8465         (Return.Emit): Instead of emitting a return, jump to the end of
8466         the function.
8467
8468         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
8469         LocalBuilder to store the result of the function.  ReturnLabel is
8470         the target where we jump.
8471         
8472
8473 2001-12-09  Radek Doulik  <rodo@ximian.com>
8474
8475         * cs-parser.jay: remember alias in current namespace
8476
8477         * ecore.cs (SimpleName::DoResolve): use aliases for types or
8478         namespaces
8479
8480         * class.cs (LookupAlias): lookup alias in my_namespace
8481
8482         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
8483         aliases hashtable
8484         (LookupAlias): lookup alias in this and if needed in parent
8485         namespaces
8486
8487 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
8488
8489         * support.cs: 
8490
8491         * rootcontext.cs: (ModuleBuilder) Made static, first step into
8492         making things static.  I need this to avoid passing the
8493         TypeContainer when calling ParameterType.
8494
8495         * support.cs (InternalParameters.ParameterType): Remove ugly hack
8496         that did string manipulation to compute the type and then call
8497         GetType.  Use Parameter.ParameterType instead.
8498
8499         * cs-tokenizer.cs: Consume the suffix for floating values.
8500
8501         * expression.cs (ParameterReference): figure out whether this is a
8502         reference parameter or not.  Kill an extra variable by computing
8503         the arg_idx during emission.
8504
8505         * parameter.cs (Parameters.GetParameterInfo): New overloaded
8506         function that returns whether a parameter is an out/ref value or not.
8507
8508         (Parameter.ParameterType): The type of the parameter (base,
8509         without ref/out applied).
8510         
8511         (Parameter.Resolve): Perform resolution here.
8512         (Parameter.ExternalType): The full type (with ref/out applied).
8513
8514         * statement.cs (Using.Emit, Using.EmitExpression): Implement
8515         support for expressions on the using statement.
8516
8517 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
8518
8519         * statement.cs (Using.EmitLocalVariableDecls): Split the
8520         localvariable handling of the using statement.
8521
8522         (Block.EmitMeta): Keep track of variable count across blocks.  We
8523         were reusing slots on separate branches of blocks.
8524
8525         (Try.Emit): Emit the general code block, we were not emitting it. 
8526
8527         Check the type of the declaration to be an IDisposable or
8528         something that can be implicity converted to it. 
8529
8530         Emit conversions if required.
8531
8532         * ecore.cs (EmptyExpression): New utility class.
8533         (Expression.ImplicitConversionExists): New utility function.
8534
8535 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
8536
8537         * statement.cs (Using): Implement.
8538
8539         * expression.cs (LocalVariableReference): Support read only variables.
8540
8541         * statement.cs: Remove the explicit emit for the Leave opcode.
8542         (VariableInfo): Add a readonly field.
8543
8544 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
8545
8546         * ecore.cs (ConvCast): new class used to encapsulate the various
8547         explicit integer conversions that works in both checked and
8548         unchecked contexts.
8549
8550         (Expression.ConvertNumericExplicit): Use new ConvCast class to
8551         properly generate the overflow opcodes.
8552
8553 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
8554
8555         * statement.cs: The correct type for the EmptyExpression is the
8556         element_type, not the variable type.  Ravi pointed this out.
8557
8558 2001-12-04  Ravi Pratap  <ravi@ximian.com>
8559
8560         * class.cs (Method::Define): Handle PInvoke methods specially
8561         by using DefinePInvokeMethod instead of the usual one.
8562
8563         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
8564         above to do the task of extracting information and defining the method.
8565         
8566 2001-12-04  Ravi Pratap  <ravi@ximian.com>
8567
8568         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
8569         of the condition for string type.
8570
8571         (Emit): Move that here. 
8572
8573         (ArrayCreation::CheckIndices): Keep string literals in their expression
8574         form.
8575
8576         (EmitDynamicInitializers): Handle strings appropriately.
8577
8578 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
8579
8580         * codegen.cs (EmitContext): Replace multiple variables with a
8581         single pointer to the current Switch statement.
8582
8583         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
8584         EmitContext.
8585
8586 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
8587
8588         * statement.cs 
8589
8590         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
8591         default'.
8592         
8593         (Foreach.Emit): Foreach on arrays was not setting
8594         up the loop variables (for break/continue).
8595
8596         (GotoCase): Semi-implented.
8597         
8598 2001-12-03  Ravi Pratap  <ravi@ximian.com>
8599
8600         * attribute.cs (CheckAttribute): Handle system attributes by using
8601         Attribute.GetAttributes to examine information we need.
8602
8603         (GetValidPlaces): Same here.
8604
8605         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
8606
8607         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
8608
8609         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
8610
8611         (Method::Define): Set appropriate flags if we have a DllImport attribute.
8612
8613         (Method::Emit): Handle the case when we are a PInvoke method.
8614
8615 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
8616
8617         * expression.cs: Use ResolveWithSimpleName on compound names.
8618
8619 2001-12-02  Ravi Pratap  <ravi@ximian.com>
8620
8621         * constant.cs (EmitConstant): Make sure we resolve the associated expression
8622         before trying to reduce it.
8623
8624         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
8625
8626         * constant.cs (LookupConstantValue): Implement.
8627
8628         (EmitConstant): Use the above in emitting the constant.
8629
8630         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
8631         that are user-defined by doing a LookupConstantValue on them.
8632
8633         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
8634         too, like above.
8635
8636 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
8637
8638         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
8639
8640         (BaseAccess.DoResolve): Implement.
8641
8642         (MemberAccess.DoResolve): Split this routine into a
8643         ResolveMemberAccess routine that can be used independently
8644
8645 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
8646
8647         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
8648         As that share bits of the implementation.  Is returns a boolean,
8649         while As returns the Type that is being probed.
8650
8651 2001-12-01  Ravi Pratap  <ravi@ximian.com>
8652
8653         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
8654         instead of a Literal - much easier.
8655
8656         (EnumInTransit): Remove - utterly useless :-)
8657
8658         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
8659
8660         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
8661
8662         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
8663         chain when we have no associated expression.
8664
8665 2001-11-30  Ravi Pratap  <ravi@ximian.com>
8666
8667         * constant.cs (Define): Use Location while reporting the errror.
8668
8669         Also emit a warning when 'new' is used and there is no inherited
8670         member to hide.
8671
8672         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
8673         populated.
8674
8675         (LookupEnumValue): Implement to lookup an enum member's value and define it
8676         if necessary.
8677
8678         (Populate): Re-write accordingly to use the above routine.
8679
8680 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
8681
8682         * expression.cs (This): Fix prototype for DoResolveLValue to
8683         override the base class DoResolveLValue.
8684
8685         * cs-parser.cs: Report errors cs574 and cs575 (destructor
8686         declarations) 
8687
8688         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
8689         (we need to load the address of the field here).  This fixes
8690         test-22. 
8691         
8692         (FieldExpr.DoResolveLValue): Call the DoResolve
8693         function to initialize the Instance expression.
8694         
8695         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
8696         correctly the GetEnumerator operation on a value type.
8697
8698         * cs-parser.jay: Add more simple parsing error catches.
8699
8700         * statement.cs (Switch): Add support for string switches.
8701         Handle null specially.
8702
8703         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
8704
8705 2001-11-28  Ravi Pratap  <ravi@ximian.com>
8706
8707         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
8708
8709         (declare_local_constant): New helper function.
8710
8711         * statement.cs (AddConstant): Keep a separate record of constants
8712
8713         (IsConstant): Implement to determine if a variable is a constant.
8714
8715         (GetConstantExpression): Implement.
8716
8717         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
8718
8719         * statement.cs (IsVariableDefined): Re-write.
8720
8721 2001-11-27  Ravi Pratap  <ravi@ximian.com>
8722
8723         * class.cs (TypeContainer::FindMembers): Look for constants
8724         in the case when we are looking for MemberTypes.Field
8725
8726         * expression.cs (MemberAccess::DoResolve): Check that in the
8727         case we are a FieldExpr and a Literal, we are not being accessed
8728         by an instance reference.
8729
8730         * cs-parser.jay (local_constant_declaration): Implement.
8731
8732         (declaration_statement): Implement for constant declarations.
8733
8734 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
8735
8736         * statement.cs (Switch): Catch double defaults.
8737
8738         (Switch): More work on the switch() statement
8739         implementation.  It works for integral values now, need to finish
8740         string support.
8741
8742
8743 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
8744
8745         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
8746         integer literals into other integer literals.  To be used by
8747         switch. 
8748
8749 2001-11-24  Ravi Pratap  <ravi@ximian.com>
8750
8751         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
8752         some memory.
8753
8754         (EmitDynamicInitializers): Cope with the above since we extract data
8755         directly from ArrayData now.
8756
8757         (ExpectInitializers): Keep track of whether initializers are mandatory
8758         or not.
8759
8760         (Bounds): Make it a hashtable to prevent the same dimension being 
8761         recorded for every element in that dimension.
8762
8763         (EmitDynamicInitializers): Fix bug which prevented the Set array method
8764         from being found.
8765
8766         Also fix bug which was causing the indices to be emitted in the reverse
8767         order.
8768
8769 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
8770
8771         * expression.cs (ArrayCreation): Implement the bits that Ravi left
8772         unfinished.  They do not work, because the underlying code is
8773         sloppy.
8774
8775 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
8776
8777         * cs-parser.jay: Remove bogus fixme.
8778
8779         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
8780         on Switch statement.
8781         
8782 2001-11-23  Ravi Pratap  <ravi@ximian.com>
8783
8784         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
8785         the same. 
8786         
8787         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
8788         parameter. Apparently, any expression is allowed. 
8789
8790         (ValidateInitializers): Update accordingly.
8791
8792         (CheckIndices): Fix some tricky bugs thanks to recursion.
8793
8794         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
8795         I was being completely brain-dead.
8796
8797         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
8798         and re-write acordingly.
8799
8800         (DelegateInvocation): Re-write accordingly.
8801
8802         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
8803
8804         (MakeByteBlob): Handle types more correctly.
8805
8806         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
8807         initialization from expressions but it is incomplete because I am a complete
8808         Dodo :-|
8809
8810 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
8811
8812         * statement.cs (If.Emit): Fix a bug that generated incorrect code
8813         on If.  Basically, we have to return `true' (ie, we do return to
8814         our caller) only if both branches of the if return.
8815
8816         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
8817         short-circuit operators, handle them as short circuit operators. 
8818
8819         (Cast.DoResolve): Resolve type.
8820         (Cast.Cast): Take an expression as the target type.
8821
8822         * cs-parser.jay (cast_expression): Remove old hack that only
8823         allowed a limited set of types to be handled.  Now we take a
8824         unary_expression and we resolve to a type during semantic
8825         analysis.
8826
8827         Use the grammar productions from Rhys to handle casts (this is
8828         not complete like Rhys syntax yet, we fail to handle that corner
8829         case that C# has regarding (-x), but we will get there.
8830         
8831 2001-11-22  Ravi Pratap  <ravi@ximian.com>
8832
8833         * class.cs (EmitFieldInitializer): Take care of the case when we have a
8834         field which is an array type.
8835
8836         * cs-parser.jay (declare_local_variables): Support array initialization too.
8837
8838         * typemanager.cs (MakeKey): Implement.
8839
8840         (everywhere): Use the above appropriately.
8841
8842         * cs-parser.jay (for_statement): Update for array initialization while
8843         declaring variables.
8844
8845         * ecore.cs : The error message was correct, it's the variable's names that
8846         were misleading ;-) Make the code more readable.
8847
8848         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
8849         the correct type etc.
8850
8851         (ConvertExplicit): Handle Enum types by examining the underlying type.
8852
8853 2001-11-21  Ravi Pratap  <ravi@ximian.com>
8854
8855         * parameter.cs (GetCallingConvention): Always return
8856         CallingConventions.Standard for now.
8857
8858 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
8859
8860         * expression.cs (Binary.ResolveOperator): Update the values of `l'
8861         and `r' after calling DoNumericPromotions.
8862
8863         * ecore.cs: Fix error message (the types were in the wrong order).
8864
8865         * statement.cs (Foreach.ProbeCollectionType): Need to pass
8866         BindingFlags.Instance as well 
8867
8868         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
8869         implicit int literal conversion in an empty cast so that we
8870         propagate the right type upstream.
8871
8872         (UnboxCast): new class used to unbox value types.
8873         (Expression.ConvertExplicit): Add explicit type conversions done
8874         by unboxing.
8875
8876         (Expression.ImplicitNumericConversion): Oops, forgot to test for
8877         the target type before applying the implicit LongLiterals to ULong
8878         literal cast.
8879
8880 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
8881
8882         * cs-parser.jay (for_statement): Reworked the way For works: now
8883         we declare manually any variables that are introduced in
8884         for_initializer to solve the problem of having out-of-band code
8885         emition (that is what got for broken).
8886
8887         (declaration_statement): Perform the actual variable declaration
8888         that used to be done in local_variable_declaration here.
8889
8890         (local_variable_declaration): Do not declare anything, just pass
8891         the information on a DictionaryEntry
8892
8893 2001-11-20  Ravi Pratap  <ravi@ximian.com>
8894
8895         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
8896         re-write of the logic to now make it recursive.
8897
8898         (UpdateIndices): Re-write accordingly.
8899
8900         Store element data in a separate ArrayData list in the above methods.
8901
8902         (MakeByteBlob): Implement to dump the array data into a byte array.
8903
8904 2001-11-19  Ravi Pratap  <ravi@ximian.com>
8905
8906         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
8907         into CheckIndices.
8908
8909         * constant.cs (Define): Implement.
8910
8911         (EmitConstant): Re-write fully.
8912
8913         Pass in location info.
8914
8915         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
8916         respectively.
8917
8918         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
8919         DictionaryEntry since we need location info too.
8920
8921         (constant_declaration): Update accordingly.
8922
8923         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
8924         code into another method : UpdateIndices.
8925
8926 2001-11-18  Ravi Pratap  <ravi@ximian.com>
8927
8928         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
8929         some type checking etc.
8930
8931 2001-11-17  Ravi Pratap  <ravi@ximian.com>
8932
8933         * expression.cs (ArrayCreation::ValidateInitializers): Implement
8934         bits to provide dimension info if the user skips doing that.
8935
8936         Update second constructor to store the rank correctly.
8937
8938 2001-11-16  Ravi Pratap  <ravi@ximian.com>
8939
8940         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
8941         and try to implement.
8942
8943         * ../errors/cs0150.cs : Add.
8944
8945         * ../errors/cs0178.cs : Add.
8946
8947 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
8948
8949         * statement.cs: Implement foreach on multi-dimensional arrays. 
8950
8951         * parameter.cs (Parameters.GetParameterByName): Also lookup the
8952         name of the params argument.
8953
8954         * expression.cs: Use EmitStoreOpcode to get the right opcode while
8955         initializing the array.
8956
8957         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
8958         we can use this elsewhere.
8959
8960         * statement.cs: Finish implementation of foreach for single
8961         dimension arrays.
8962
8963         * cs-parser.jay: Use an out-of-band stack to pass information
8964         around, I wonder why I need this.
8965
8966         foreach_block: Make the new foreach_block the current_block.
8967
8968         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
8969         function used to return a static Parameters structure.  Used for
8970         empty parameters, as those are created very frequently.
8971
8972         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
8973
8974 2001-11-15  Ravi Pratap  <ravi@ximian.com>
8975
8976         * interface.cs : Default modifier is private, not public. The
8977         make verify test passes again.
8978
8979 2001-11-15  Ravi Pratap  <ravi@ximian.com>
8980
8981         * support.cs (ReflectionParameters): Fix logic to determine
8982         whether the last parameter is a params one. Test 9 passes again.
8983
8984         * delegate.cs (Populate): Register the builders we define with
8985         RegisterParameterForBuilder. Test 19 passes again.
8986
8987         * cs-parser.jay (property_declaration): Reference $6 instead
8988         of $$ to get at the location.
8989
8990         (indexer_declaration): Similar stuff.
8991
8992         (attribute): Ditto.
8993
8994         * class.cs (Property): Register parameters for the Get and Set methods
8995         if they exist. Test 23 passes again.
8996
8997         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
8998         call to EmitArguments as we are sure there aren't any params arguments. 
8999         Test 32 passes again.
9000
9001         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
9002         IndexOutOfRangeException. 
9003
9004         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
9005         Test 33 now passes again.
9006         
9007 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
9008
9009         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
9010         broke a bunch of things.  Will have to come up with a better way
9011         of tracking locations.
9012
9013         * statement.cs: Implemented foreach for single dimension arrays.
9014
9015 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
9016
9017         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
9018         an error.  This removes the lookup from the critical path.
9019
9020         * cs-parser.jay: Removed use of temporary_loc, which is completely
9021         broken. 
9022
9023 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
9024
9025         * support.cs (ReflectionParameters.ParameterModifier): Report
9026         whether the argument is a PARAMS argument or not.
9027
9028         * class.cs: Set the attribute `ParamArrayAttribute' on the
9029         parameter argument.
9030
9031         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
9032         and cons_param_array_attribute (ConstructorInfo for
9033         ParamArrayAttribute)., 
9034
9035         * codegen.cs: Emit the return using the `Return' statement, that
9036         way we can report the error correctly for missing return values. 
9037
9038         * class.cs (Method.Emit): Clean up.
9039
9040         * expression.cs (Argument.Resolve): Take another argument: the
9041         location where this argument is used.  Notice that this is not
9042         part of the "Argument" class as to reduce the size of the
9043         structure (we know the approximate location anyways).
9044
9045         Test if the argument is a variable-reference, if not, then
9046         complain with a 206.
9047
9048         (Argument.Emit): Emit addresses of variables.
9049
9050         (Argument.FullDesc): Simplify.
9051
9052         (Invocation.DoResolve): Update for Argument.Resolve.
9053
9054         (ElementAccess.DoResolve): ditto.
9055
9056         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
9057         method should be virtual, as this method is always virtual.
9058
9059         (NewDelegate.DoResolve): Update for Argument.Resolve.
9060
9061         * class.cs (ConstructorInitializer.DoResolve): ditto.
9062         
9063         * attribute.cs (Attribute.Resolve): ditto.
9064
9065 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
9066
9067         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
9068
9069         * expression.cs (ParameterReference): Drop IStackStorage and implement
9070         IAssignMethod instead. 
9071
9072         (LocalVariableReference): ditto.
9073         
9074         * ecore.cs (FieldExpr): Drop IStackStorage and implement
9075         IAssignMethod instead. 
9076
9077 2001-11-13  Miguel de Icaza <miguel@ximian.com>
9078
9079         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
9080         enumerations that are used in heavily used structures derive from
9081         byte in a laughable and pathetic attempt to reduce memory usage.
9082         This is the kind of pre-optimzations that you should not do at
9083         home without adult supervision.
9084
9085         * expression.cs (UnaryMutator): New class, used to handle ++ and
9086         -- separatedly from the other unary operators.  Cleans up the
9087         code, and kills the ExpressionStatement dependency in Unary.
9088
9089         (Unary): Removed `method' and `Arguments' from this class, making
9090         it smaller, and moving it all to SimpleCall, so I can reuse this
9091         code in other locations and avoid creating a lot of transient data
9092         strucutres when not required.
9093
9094         * cs-parser.jay: Adjust for new changes.
9095
9096 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
9097
9098         * enum.cs (Enum.Populate): If there is a failure during
9099         definition, return
9100
9101         * cs-parser.jay (opt_enum_base): we used to catch type errors
9102         here, but this is really incorrect.  The type error should be
9103         catched during semantic analysis.
9104
9105 2001-12-11  Ravi Pratap  <ravi@ximian.com>
9106
9107         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
9108         current_local_parameters as expected since I, in my stupidity, had forgotten
9109         to do this :-)
9110
9111         * attribute.cs (GetValidPlaces): Fix stupid bug.
9112
9113         * class.cs (Method::Emit): Perform check on applicability of attributes.
9114
9115         (Constructor::Emit): Ditto.
9116
9117         (Field::Emit): Ditto.
9118
9119         (Field.Location): Store location information.
9120
9121         (Property, Event, Indexer, Operator): Ditto.
9122
9123         * cs-parser.jay (field_declaration): Pass in location for each field.
9124
9125         * ../errors/cs0592.cs : Add.
9126
9127 2001-11-12  Ravi Pratap  <ravi@ximian.com>
9128
9129         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
9130
9131         (InitCoreTypes): Update accordingly.
9132
9133         (RegisterAttrType, LookupAttr): Implement.
9134
9135         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
9136         info about the same.
9137
9138         (Resolve): Update to populate the above as necessary.
9139
9140         (Error592): Helper.
9141
9142         (GetValidPlaces): Helper to the above.
9143
9144         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
9145
9146         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
9147
9148 2001-11-12  Ravi Pratap  <ravi@ximian.com>
9149
9150         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
9151
9152         * ../errors/cs0617.cs : Add.
9153
9154 2001-11-11  Ravi Pratap  <ravi@ximian.com>
9155
9156         * enum.cs (Emit): Rename to Populate to be more consistent with what
9157         we expect it to do and when exactly it is called.
9158
9159         * class.cs, rootcontext.cs : Update accordingly.
9160
9161         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
9162         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
9163
9164         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
9165
9166         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
9167         of a fieldinfo using the above, when dealing with a FieldBuilder.
9168
9169 2001-11-10  Ravi Pratap  <ravi@ximian.com>
9170
9171         * ../errors/cs0031.cs : Add.
9172
9173         * ../errors/cs1008.cs : Add.
9174
9175         * ../errrors/cs0543.cs : Add.
9176
9177         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
9178         enum type.
9179
9180         (FindMembers): Implement.
9181
9182         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
9183         enums and delegates too.
9184
9185         (enum_types): Rename to builder_to_enum.
9186
9187         (delegate_types): Rename to builder_to_delegate.
9188
9189         * delegate.cs (FindMembers): Implement.
9190
9191 2001-11-09  Ravi Pratap  <ravi@ximian.com>
9192
9193         * typemanager.cs (IsEnumType): Implement.
9194
9195         * enum.cs (Emit): Re-write parts to account for the underlying type
9196         better and perform checking etc.
9197
9198         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
9199         of the underlying type.
9200
9201         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
9202         value
9203
9204         * enum.cs (error31): Helper to report error #31.
9205
9206         * cs-parser.jay (enum_declaration): Store location of each member too.
9207
9208         * enum.cs (member_to_location): New hashtable. 
9209
9210         (AddEnumMember): Update location hashtable.
9211
9212         (Emit): Use the location of each member while reporting errors.
9213
9214 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
9215
9216         * cs-parser.jay: A for_initializer if is a
9217         local_variable_declaration really ammount to have an implicit
9218         block with the variable declaration and no initializer for for.
9219
9220         * statement.cs (For.Emit): Cope with null initializers.
9221
9222         This fixes the infinite loop on for initializers.
9223
9224 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
9225
9226         * enum.cs: More cleanup.
9227
9228         * ecore.cs: Remove dead code.
9229
9230         * class.cs (Property.Emit): More simplification.
9231         (Event.Emit): ditto.
9232
9233         Reworked to have less levels of indentation.
9234         
9235 2001-11-08  Ravi Pratap  <ravi@ximian.com>
9236
9237         * class.cs (Property): Emit attributes.
9238
9239         (Field): Ditto.
9240         
9241         (Event): Ditto.
9242
9243         (Indexer): Ditto.
9244
9245         (Operator): Ditto.
9246
9247         * enum.cs (Emit): Ditto.
9248
9249         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
9250         Enums too.
9251
9252         * class.cs (Field, Event, etc.): Move attribute generation into the
9253         Emit method everywhere.
9254
9255         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
9256         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
9257         as we had no way of defining nested enums !
9258
9259         * rootcontext.cs : Adjust code accordingly.
9260
9261         * typemanager.cs (AddEnumType): To keep track of enum types separately.
9262
9263 2001-11-07  Ravi Pratap  <ravi@ximian.com>
9264
9265         * expression.cs (EvalConstantExpression): Move into ecore.cs
9266         
9267         * enum.cs (Enum): Rename some members and make them public and readonly
9268         according to our convention.
9269
9270         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
9271         nothing else.
9272
9273         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
9274
9275         (Enum::Emit): Write a simple version for now which doesn't try to compute
9276         expressions. I shall modify this to be more robust in just a while.
9277
9278         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
9279
9280         (TypeContainer::CloseType): Create the Enum types too.
9281
9282         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
9283
9284         * expression.cs (EvalConstantExpression): Get rid of completely.
9285
9286         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
9287         user-defined values and other cases.
9288
9289         (IsValidEnumLiteral): Helper function.
9290
9291         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
9292         out there in the case we had a literal FieldExpr.
9293
9294         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
9295
9296         (Literalize): Revamp a bit to take two arguments.
9297         
9298         (EnumLiteral): New class which derives from Literal to wrap enum literals.
9299         
9300 2001-11-06  Ravi Pratap  <ravi@ximian.com>
9301
9302         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
9303
9304         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
9305
9306         (Resolve): Use the above to ensure we have proper initializers.
9307
9308 2001-11-05  Ravi Pratap  <ravi@ximian.com>
9309
9310         * expression.cs (Expression::EvalConstantExpression): New method to 
9311         evaluate constant expressions.
9312
9313         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
9314
9315 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
9316
9317         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
9318         in an array.
9319
9320         (Binary.ResolveOperator): Handle operator != (object a, object b)
9321         and operator == (object a, object b);
9322
9323         (Binary.DoNumericPromotions): Indicate whether the numeric
9324         promotion was possible.
9325
9326         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
9327         Implement.  
9328
9329         Made the ArrayAccess implement interface IAssignMethod instead of
9330         IStackStore as the order in which arguments are passed reflects
9331         this.
9332
9333         * assign.cs: Instead of using expr.ExprClass to select the way of
9334         assinging, probe for the IStackStore/IAssignMethod interfaces.
9335
9336         * typemanager.cs: Load InitializeArray definition.
9337
9338         * rootcontext.cs (RootContext.MakeStaticData): Used to define
9339         static data that can be used to initialize arrays. 
9340
9341 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
9342
9343         * expression.cs: Handle operator== and operator!= for booleans.
9344
9345         (Conditioal.Reduce): Implement reducer for the ?: operator.
9346
9347         (Conditional.Resolve): Implement dead code elimination.
9348
9349         (Binary.Resolve): Catch string literals and return a new
9350         concatenated string.
9351
9352         (Unary.Reduce): Implement reduction of unary expressions.
9353
9354         * ecore.cs: Split out the expression core handling here.
9355
9356         (Expression.Reduce): New method used to perform constant folding
9357         and CSE.  This is needed to support constant-expressions. 
9358         
9359         * statement.cs (Statement.EmitBoolExpression): Pass true and false
9360         targets, and optimize for !x.
9361
9362 2001-11-04  Ravi Pratap  <ravi@ximian.com>
9363
9364         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
9365         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
9366         set custom atttributes.
9367
9368         * literal.cs (Literal::GetValue): New abstract method to return the actual
9369         value of the literal, cast as an object.
9370
9371         (*Literal): Implement GetValue method.
9372
9373         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
9374         expressions to the arraylist but objects of type Argument.
9375
9376         * class.cs (TypeContainer::Emit): Emit our attributes too.
9377
9378         (Method::Emit, Constructor::Emit): Ditto.
9379
9380         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
9381         to be ignoring earlier.
9382
9383 2001-11-03  Ravi Pratap  <ravi@ximian.com>
9384
9385         * attribute.cs (AttributeSection::Define): Implement to do the business
9386         of constructing a CustomAttributeBuilder.
9387
9388         (Attribute): New trivial class. Increases readability of code.  
9389
9390         * cs-parser.jay : Update accordingly.
9391
9392         (positional_argument_list, named_argument_list, named_argument): New rules
9393
9394         (attribute_arguments): Use the above so that we are more correct.
9395         
9396 2001-11-02  Ravi Pratap  <ravi@ximian.com>
9397         
9398         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
9399         to perform all checks for a method with a params parameter.
9400
9401         (Invocation::OverloadResolve): Update to use the above method and therefore
9402         cope correctly with params method invocations.
9403
9404         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
9405         params too.
9406
9407         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
9408         constructors in our parent too because we can't afford to miss out on 
9409         protected ones ;-)
9410
9411         * attribute.cs (AttributeSection): New name for the class Attribute
9412
9413         Other trivial changes to improve readability.
9414
9415         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
9416         use the new class names.
9417         
9418 2001-11-01  Ravi Pratap  <ravi@ximian.com>
9419
9420         * class.cs (Method::Define): Complete definition for params types too
9421
9422         (Indexer::Define): Ditto.
9423
9424         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
9425         Cope everywhere with a request for info about the array parameter.
9426
9427 2001-11-01  Ravi Pratap  <ravi@ximian.com>
9428
9429         * tree.cs (RecordNamespace): Fix up to check for the correct key.
9430
9431         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
9432         local_variable_type to extract the string corresponding to the type.
9433
9434         (local_variable_type): Fixup the action to use the new helper method.
9435
9436         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
9437         go.
9438
9439         * expression.cs : Clean out code which uses the above.
9440
9441 2001-10-31  Ravi Pratap  <ravi@ximian.com>
9442         
9443         * typemanager.cs (RegisterMethod): Check if we already have an existing key
9444         and bale out if necessary by returning a false.
9445
9446         (RegisterProperty): Ditto.
9447
9448         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
9449         and print out appropriate error messages.
9450
9451         * interface.cs (everywhere): Ditto.
9452
9453         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
9454         location to constructor.
9455
9456         * class.cs (Property, Event, Indexer): Update accordingly.
9457
9458         * ../errors/cs111.cs : Added.
9459
9460         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
9461         of a method, as laid down by the spec.
9462
9463         (Invocation::OverloadResolve): Use the above method.
9464
9465 2001-10-31  Ravi Pratap  <ravi@ximian.com>
9466
9467         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
9468         now take a TypeContainer and a Parameters object.
9469
9470         (ParameterData): Modify return type of ParameterModifier method to be 
9471         Parameter.Modifier and not a string.
9472
9473         (ReflectionParameters, InternalParameters): Update accordingly.
9474
9475         * expression.cs (Argument::GetParameterModifier): Same here.
9476
9477         * support.cs (InternalParameters::ParameterType): Find a better way of determining
9478         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
9479         symbol in it at all so maybe this is only for now.
9480
9481 2001-10-30  Ravi Pratap  <ravi@ximian.com>
9482
9483         * support.cs (InternalParameters): Constructor now takes an extra argument 
9484         which is the actual Parameters class.
9485
9486         (ParameterDesc): Update to provide info on ref/out modifiers.
9487
9488         * class.cs (everywhere): Update call to InternalParameters to pass in
9489         the second argument too.
9490
9491         * support.cs (ParameterData): Add ParameterModifier, which is a method 
9492         to return the modifier info [ref/out etc]
9493
9494         (InternalParameters, ReflectionParameters): Implement the above.
9495
9496         * expression.cs (Argument::ParameterModifier): Similar function to return
9497         info about the argument's modifiers.
9498
9499         (Invocation::OverloadResolve): Update to take into account matching modifiers 
9500         too.
9501
9502         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
9503         a new SetFormalParameters object which we pass to InternalParameters.
9504
9505 2001-10-30  Ravi Pratap  <ravi@ximian.com>
9506
9507         * expression.cs (NewArray): Merge into the ArrayCreation class.
9508
9509 2001-10-29  Ravi Pratap  <ravi@ximian.com>
9510
9511         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
9512         NewUserdefinedArray into one as there wasn't much of a use in having
9513         two separate ones.
9514
9515         * expression.cs (Argument): Change field's name to ArgType from Type.
9516
9517         (Type): New readonly property which returns the proper type, taking into 
9518         account ref/out modifiers.
9519
9520         (everywhere): Adjust code accordingly for the above.
9521
9522         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
9523         whether we are emitting for a ref or out parameter.
9524
9525         * expression.cs (Argument::Emit): Use the above field to set the state.
9526
9527         (LocalVariableReference::Emit): Update to honour the flag and emit the
9528         right stuff.
9529
9530         * parameter.cs (Attributes): Set the correct flags for ref parameters.
9531
9532         * expression.cs (Argument::FullDesc): New function to provide a full desc.
9533
9534         * support.cs (ParameterData): Add method ParameterDesc to the interface.
9535
9536         (ReflectionParameters, InternalParameters): Implement the above method.
9537
9538         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
9539         reporting errors.
9540
9541         (Invocation::FullMethodDesc): Ditto. 
9542
9543 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
9544
9545         * cs-parser.jay: Add extra production for the second form of array
9546         creation. 
9547
9548         * expression.cs (ArrayCreation): Update to reflect the above
9549         change. 
9550
9551         * Small changes to prepare for Array initialization.
9552
9553 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
9554
9555         * typemanager.cs (ImplementsInterface): interface might be null;
9556         Deal with this problem;
9557
9558         Also, we do store negative hits on the cache (null values), so use
9559         this instead of calling t.GetInterfaces on the type everytime.
9560
9561 2001-10-28  Ravi Pratap  <ravi@ximian.com>
9562
9563         * typemanager.cs (IsBuiltinType): New method to help determine the same.
9564
9565         * expression.cs (New::DoResolve): Get rid of array creation code and instead
9566         split functionality out into different classes.
9567
9568         (New::FormArrayType): Move into NewBuiltinArray.
9569
9570         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
9571         quite useless.
9572
9573         (NewBuiltinArray): New class to handle creation of built-in arrays.
9574
9575         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
9576         account creation of one-dimensional arrays.
9577
9578         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
9579
9580         (NewUserdefinedArray::DoResolve): Implement.
9581
9582         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
9583
9584         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
9585         we maintain inside the TypeManager. This is necessary to perform lookups on the
9586         module builder.
9587
9588         (LookupType): Update to perform GetType on the module builders too.     
9589
9590         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
9591
9592         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
9593
9594 2001-10-23  Ravi Pratap  <ravi@ximian.com>
9595
9596         * expression.cs (New::DoResolve): Implement guts of array creation.
9597
9598         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
9599         
9600 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
9601
9602         * expression.cs: Fix bug I introduced lsat night that broke
9603         Delegates. 
9604
9605         (Expression.Resolve): Report a 246 error (can not resolve name)
9606         if we find a SimpleName in the stream.
9607         
9608         (Expression.ResolveLValue): Ditto.
9609         
9610         (Expression.ResolveWithSimpleName): This function is a variant of
9611         ResolveName, this one allows SimpleNames to be returned without a
9612         warning.  The only consumer of SimpleNames is MemberAccess
9613
9614 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
9615
9616         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
9617         might arrive here.  I have my doubts that this is correct.
9618
9619         * statement.cs (Lock): Implement lock statement.
9620
9621         * cs-parser.jay: Small fixes to support `lock' and `using'
9622
9623         * cs-tokenizer.cs: Remove extra space
9624
9625         * driver.cs: New flag --checked, allows to turn on integer math
9626         checking. 
9627
9628         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
9629         Threading.Monitor.Exit 
9630         
9631 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
9632
9633         * expression.cs (IndexerAccess::DoResolveLValue): Set the
9634         Expression Class to be IndexerAccess.
9635
9636         Notice that Indexer::DoResolve sets the eclass to Value.
9637
9638 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
9639
9640         * class.cs (TypeContainer::Emit): Emit code for indexers.
9641
9642         * assign.cs (IAssignMethod): New interface implemented by Indexers
9643         and Properties for handling assignment.
9644
9645         (Assign::Emit): Simplify and reuse code. 
9646         
9647         * expression.cs (IndexerAccess, PropertyExpr): Implement
9648         IAssignMethod, clean up old code. 
9649
9650 2001-10-22  Ravi Pratap  <ravi@ximian.com>
9651
9652         * typemanager.cs (ImplementsInterface): New method to determine if a type
9653         implements a given interface. Provides a nice cache too.
9654
9655         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
9656         method.
9657
9658         (ConvertReferenceExplicit): Ditto.
9659
9660         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
9661         various methods, with correct names etc.
9662
9663         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
9664         Operator.UnaryNegation.
9665
9666         * cs-parser.jay (operator_declarator): Be a little clever in the case where
9667         we have a unary plus or minus operator.
9668
9669         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
9670         UnaryMinus.
9671
9672         * everywhere : update accordingly.
9673
9674         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
9675         respectively.
9676
9677         * class.cs (Method::Define): For the case where we are implementing a method
9678         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
9679         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
9680         
9681 2001-10-21  Ravi Pratap  <ravi@ximian.com>
9682
9683         * interface.cs (FindMembers): Implement to work around S.R.E
9684         lameness.
9685
9686         * typemanager.cs (IsInterfaceType): Implement.
9687
9688         (FindMembers): Update to handle interface types too.
9689
9690         * expression.cs (ImplicitReferenceConversion): Re-write bits which
9691         use IsAssignableFrom as that is not correct - it doesn't work.
9692
9693         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
9694         and accordingly override EmitStatement.
9695
9696         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
9697         using the correct logic :-)
9698
9699 2001-10-19  Ravi Pratap  <ravi@ximian.com>
9700
9701         * ../errors/cs-11.cs : Add to demonstrate error -11 
9702
9703 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
9704
9705         * assign.cs (Assign::Resolve): Resolve right hand side first, and
9706         then pass this as a hint to ResolveLValue.
9707         
9708         * expression.cs (FieldExpr): Add Location information
9709
9710         (FieldExpr::LValueResolve): Report assignment to readonly
9711         variable. 
9712         
9713         (Expression::ExprClassFromMemberInfo): Pass location information.
9714
9715         (Expression::ResolveLValue): Add new method that resolves an
9716         LValue. 
9717
9718         (Expression::DoResolveLValue): Default invocation calls
9719         DoResolve. 
9720
9721         (Indexers): New class used to keep track of indexers in a given
9722         Type. 
9723
9724         (IStackStore): Renamed from LValue, as it did not really describe
9725         what this did.  Also ResolveLValue is gone from this interface and
9726         now is part of Expression.
9727
9728         (ElementAccess): Depending on the element access type
9729         
9730         * typemanager.cs: Add `indexer_name_type' as a Core type
9731         (System.Runtime.CompilerServices.IndexerNameAttribute)
9732
9733         * statement.cs (Goto): Take a location.
9734         
9735 2001-10-18  Ravi Pratap  <ravi@ximian.com>
9736
9737         * delegate.cs (Delegate::VerifyDelegate): New method to verify
9738         if two delegates are compatible.
9739
9740         (NewDelegate::DoResolve): Update to take care of the case when
9741         we instantiate a delegate from another delegate.
9742
9743         * typemanager.cs (FindMembers): Don't even try to look up members
9744         of Delegate types for now.
9745
9746 2001-10-18  Ravi Pratap  <ravi@ximian.com>
9747
9748         * delegate.cs (NewDelegate): New class to take care of delegate
9749         instantiation.
9750
9751         * expression.cs (New): Split the delegate related code out into 
9752         the NewDelegate class.
9753
9754         * delegate.cs (DelegateInvocation): New class to handle delegate 
9755         invocation.
9756
9757         * expression.cs (Invocation): Split out delegate related code into
9758         the DelegateInvocation class.
9759
9760 2001-10-17  Ravi Pratap  <ravi@ximian.com>
9761
9762         * expression.cs (New::DoResolve): Implement delegate creation fully
9763         and according to the spec.
9764
9765         (New::DoEmit): Update to handle delegates differently.
9766
9767         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
9768         because of which we were printing out arguments in reverse order !
9769
9770         * delegate.cs (VerifyMethod): Implement to check if the given method
9771         matches the delegate.
9772
9773         (FullDelegateDesc): Implement.
9774
9775         (VerifyApplicability): Implement.
9776
9777         * expression.cs (Invocation::DoResolve): Update to accordingly handle
9778         delegate invocations too.
9779
9780         (Invocation::Emit): Ditto.
9781
9782         * ../errors/cs1593.cs : Added.
9783
9784         * ../errors/cs1594.cs : Added.
9785
9786         * delegate.cs (InstanceExpression, TargetMethod): New properties.
9787
9788 2001-10-16  Ravi Pratap  <ravi@ximian.com>
9789
9790         * typemanager.cs (intptr_type): Core type for System.IntPtr
9791
9792         (InitCoreTypes): Update for the same.
9793
9794         (iasyncresult_type, asynccallback_type): Ditto.
9795
9796         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
9797         correct.
9798
9799         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
9800         too.
9801
9802         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
9803         the builders for the 4 members of a delegate type :-)
9804
9805         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
9806         type.
9807
9808         * expression.cs (New::DoResolve): Implement guts for delegate creation.
9809
9810         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
9811
9812 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
9813
9814         * statement.cs (Break::Emit): Implement.   
9815         (Continue::Emit): Implement.
9816
9817         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
9818         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
9819         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
9820         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
9821         end loop
9822         
9823         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
9824         properties that track the label for the current loop (begin of the
9825         loop and end of the loop).
9826
9827 2001-10-15  Ravi Pratap  <ravi@ximian.com>
9828
9829         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
9830         use of emitting anything at all.
9831
9832         * class.cs, rootcontext.cs : Get rid of calls to the same.
9833
9834         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
9835
9836         (Populate): Define the constructor correctly and set the implementation
9837         attributes.
9838
9839         * typemanager.cs (delegate_types): New hashtable to hold delegates that
9840         have been defined.
9841
9842         (AddDelegateType): Implement.
9843
9844         (IsDelegateType): Implement helper method.
9845
9846         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
9847
9848         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
9849         and accordingly handle it.
9850
9851         * delegate.cs (Populate): Take TypeContainer argument.
9852         Implement bits to define the Invoke method. However, I still haven't figured out
9853         how to take care of the native int bit :-(
9854
9855         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
9856         Qualify the name of the delegate, not its return type !
9857
9858         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
9859         conversion.
9860
9861         (StandardConversionExists): Checking for array types turns out to be recursive.
9862
9863         (ConvertReferenceExplicit): Implement array conversion.
9864
9865         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
9866         
9867 2001-10-12  Ravi Pratap  <ravi@ximian.com>
9868
9869         * cs-parser.jay (delegate_declaration): Store the fully qualified
9870         name as it is a type declaration.
9871
9872         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
9873         readonly.
9874
9875         (DefineDelegate): Renamed from Define. Does the same thing essentially,
9876         as TypeContainer::DefineType.
9877
9878         (Populate): Method in which all the definition of the various methods (Invoke)
9879         etc is done.
9880
9881         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
9882         see.
9883         
9884         (CloseDelegate): Finally creates the delegate.
9885
9886         * class.cs (TypeContainer::DefineType): Update to define delegates.
9887         (Populate, Emit and CloseType): Do the same thing here too.
9888
9889         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
9890         delegates in all these operations.
9891
9892 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
9893
9894         * expression.cs: LocalTemporary: a new expression used to
9895         reference a temporary that has been created.
9896
9897         * assign.cs: Handle PropertyAccess back here, so that we can
9898         provide the proper semantic access to properties.
9899
9900         * expression.cs (Expression::ConvertReferenceExplicit): Implement
9901         a few more explicit conversions. 
9902
9903         * modifiers.cs: `NEW' modifier maps to HideBySig.
9904
9905         * expression.cs (PropertyExpr): Make this into an
9906         ExpressionStatement, and support the EmitStatement code path. 
9907
9908         Perform get/set error checking, clean up the interface.
9909
9910         * assign.cs: recognize PropertyExprs as targets, and if so, turn
9911         them into toplevel access objects.
9912
9913 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
9914
9915         * expression.cs: PropertyExpr::PropertyExpr: use work around the
9916         SRE.
9917
9918         * typemanager.cs: Keep track here of our PropertyBuilders again to
9919         work around lameness in SRE.
9920
9921 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
9922
9923         * expression.cs (LValue::LValueResolve): New method in the
9924         interface, used to perform a second resolution pass for LValues. 
9925         
9926         (This::DoResolve): Catch the use of this in static methods.
9927
9928         (This::LValueResolve): Implement.
9929
9930         (This::Store): Remove warning, assigning to `this' in structures
9931         is 
9932
9933         (Invocation::Emit): Deal with invocation of
9934         methods on value types.  We need to pass the address to structure
9935         methods rather than the object itself.  (The equivalent code to
9936         emit "this" for structures leaves the entire structure on the
9937         stack instead of a pointer to it). 
9938
9939         (ParameterReference::DoResolve): Compute the real index for the
9940         argument based on whether the method takes or not a `this' pointer
9941         (ie, the method is static).
9942
9943         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
9944         value types returned from functions when we need to invoke a
9945         method on the sturcture.
9946         
9947
9948 2001-10-11  Ravi Pratap  <ravi@ximian.com>
9949
9950         * class.cs (TypeContainer::DefineType): Method to actually do the business of
9951         defining the type in the Modulebuilder or Typebuilder. This is to take
9952         care of nested types which need to be defined on the TypeBuilder using
9953         DefineNestedMethod.
9954
9955         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
9956         methods in RootContext, only ported to be part of TypeContainer.
9957
9958         (TypeContainer::GetInterfaceOrClass): Ditto.
9959
9960         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
9961
9962         * interface.cs (Interface::DefineInterface): New method. Does exactly
9963         what RootContext.CreateInterface did earlier, only it takes care of nested types 
9964         too.
9965
9966         (Interface::GetInterfaces): Move from RootContext here and port.
9967
9968         (Interface::GetInterfaceByName): Same here.
9969
9970         * rootcontext.cs (ResolveTree): Re-write.
9971
9972         (PopulateTypes): Re-write.
9973
9974         * class.cs (TypeContainer::Populate): Populate nested types too.
9975         (TypeContainer::Emit): Emit nested members too.
9976
9977         * typemanager.cs (AddUserType): Do not make use of the FullName property,
9978         instead just use the name argument passed in as it is already fully
9979         qualified.
9980
9981         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
9982         to TypeContainer mapping to see if a type is user-defined.
9983
9984         * class.cs (TypeContainer::CloseType): Implement. 
9985
9986         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
9987         the default constructor.
9988         
9989         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
9990         twice.
9991
9992         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
9993
9994         * interface.cs (CloseType): Create the type here.
9995         
9996         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
9997         the hierarchy.
9998
9999         Remove all the methods which are now in TypeContainer.
10000
10001 2001-10-10  Ravi Pratap  <ravi@ximian.com>
10002
10003         * delegate.cs (Define): Re-write bits to define the delegate
10004         correctly.
10005
10006 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
10007
10008         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
10009
10010         * expression.cs (ImplicitReferenceConversion): handle null as well
10011         as a source to convert to any reference type.
10012
10013         * statement.cs (Return): Perform any implicit conversions to
10014         expected return type.  
10015
10016         Validate use of return statement.  
10017
10018         * codegen.cs (EmitContext): Pass the expected return type here.
10019
10020         * class.cs (Method, Constructor, Property): Pass expected return
10021         type to EmitContext.
10022
10023 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
10024
10025         * expression.cs: Make DoResolve take an EmitContext instead of a
10026         TypeContainer.
10027
10028         Replaced `l' and `location' for `loc', for consistency.
10029         
10030         (Error, Warning): Remove unneeded Tc argument.
10031
10032         * assign.cs, literal.cs, constant.cs: Update to new calling
10033         convention. 
10034         
10035         * codegen.cs: EmitContext now contains a flag indicating whether
10036         code is being generated in a static method or not.
10037
10038         * cs-parser.jay: DecomposeQI, new function that replaces the old
10039         QualifiedIdentifier.  Now we always decompose the assembled
10040         strings from qualified_identifier productions into a group of
10041         memberaccesses.
10042
10043 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
10044
10045         * rootcontext.cs: Deal with field-less struct types correctly now
10046         by passing the size option to Define Type.
10047
10048         * class.cs: Removed hack that created one static field. 
10049
10050 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
10051
10052         * statement.cs: Moved most of the code generation here. 
10053
10054 2001-10-09  Ravi Pratap  <ravi@ximian.com>
10055
10056         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
10057         seem very right.
10058
10059         (ElementAccess): Remove useless bits for now - keep checks as the spec
10060         says.
10061
10062 2001-10-08  Ravi Pratap  <ravi@ximian.com>
10063
10064         * expression.cs (ElementAccess::DoResolve): Remove my crap code
10065         and start performing checks according to the spec.
10066
10067 2001-10-07  Ravi Pratap  <ravi@ximian.com>
10068
10069         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
10070         rank_specifiers instead.
10071
10072         (rank_specifiers): Change the order in which the rank specifiers are stored
10073
10074         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
10075
10076         * expression.cs (ElementAccess): Implement the LValue interface too.
10077         
10078 2001-10-06  Ravi Pratap  <ravi@ximian.com>
10079         
10080         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
10081         except that user defined conversions are not included.
10082
10083         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
10084         perform the conversion of the return type, if necessary.
10085
10086         (New::DoResolve): Check whether we are creating an array or an object
10087         and accordingly do the needful.
10088
10089         (New::Emit): Same here.
10090
10091         (New::DoResolve): Implement guts of array creation.
10092
10093         (New::FormLookupType): Helper function.
10094
10095 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
10096
10097         * codegen.cs: Removed most of the code generation here, and move the
10098         corresponding code generation bits to the statement classes. 
10099
10100         Added support for try/catch/finalize and throw.
10101         
10102         * cs-parser.jay: Added support for try/catch/finalize.
10103
10104         * class.cs: Catch static methods having the flags override,
10105         virtual or abstract.
10106
10107         * expression.cs (UserCast): This user cast was not really doing
10108         what it was supposed to do.  Which is to be born in fully resolved
10109         state.  Parts of the resolution were being performed at Emit time! 
10110
10111         Fixed this code.
10112
10113 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
10114
10115         * expression.cs: Implicity convert the result from UserCast.
10116
10117 2001-10-05  Ravi Pratap  <ravi@ximian.com>
10118
10119         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
10120         prevented it from working correctly. 
10121
10122         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
10123         merely ConvertImplicit.
10124
10125 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
10126
10127         * typemanager.cs: Make the LookupTypeContainer function static,
10128         and not per-instance.  
10129
10130         * class.cs: Make static FindMembers (the one that takes a Type
10131         argument). 
10132
10133         * codegen.cs: Add EmitForeach here.
10134
10135         * cs-parser.jay: Make foreach a toplevel object instead of the
10136         inline expansion, as we need to perform semantic analysis on it. 
10137
10138 2001-10-05  Ravi Pratap  <ravi@ximian.com>
10139
10140         * expression.cs (Expression::ImplicitUserConversion): Rename to
10141         UserDefinedConversion.
10142
10143         (Expression::UserDefinedConversion): Take an extra argument specifying 
10144         whether we look for explicit user conversions too.
10145
10146         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
10147
10148         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
10149
10150         (ExplicitUserConversion): Make it a call to UserDefinedConversion
10151         with the appropriate arguments.
10152
10153         * cs-parser.jay (cast_expression): Record location too.
10154
10155         * expression.cs (Cast): Record location info.
10156
10157         (Expression::ConvertExplicit): Take location argument.
10158
10159         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
10160         to determine if we are doing explicit conversions.
10161
10162         (UserCast::Emit): Update accordingly.
10163
10164         (Expression::ConvertExplicit): Report an error if everything fails.
10165
10166         * ../errors/cs0030.cs : Add.
10167
10168 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
10169
10170         * modifiers.cs: If the ABSTRACT keyword is present, also set the
10171         virtual and newslot bits. 
10172
10173         * class.cs (TypeContainer::RegisterRequiredImplementations):
10174         Record methods we need.
10175
10176         (TypeContainer::MakeKey): Helper function to make keys for
10177         MethodBases, since the Methodbase key is useless.
10178
10179         (TypeContainer::Populate): Call RegisterRequiredImplementations
10180         before defining the methods.   
10181
10182         Create a mapping for method_builders_to_methods ahead of time
10183         instead of inside a tight loop.
10184
10185         (::RequireMethods):  Accept an object as the data to set into the
10186         hashtable so we can report interface vs abstract method mismatch.
10187
10188 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
10189
10190         * report.cs: Make all of it static.
10191
10192         * rootcontext.cs: Drop object_type and value_type computations, as
10193         we have those in the TypeManager anyways.
10194
10195         Drop report instance variable too, now it is a global.
10196
10197         * driver.cs: Use try/catch on command line handling.
10198
10199         Add --probe option to debug the error reporting system with a test
10200         suite. 
10201
10202         * report.cs: Add support for exiting program when a probe
10203         condition is reached.
10204
10205 2001-10-03  Ravi Pratap  <ravi@ximian.com>
10206
10207         * expression.cs (Binary::DoNumericPromotions): Fix the case when
10208         we do a forcible conversion regardless of type, to check if 
10209         ForceConversion returns a null.
10210
10211         (Binary::error19): Use location to report error.
10212
10213         (Unary::error23): Use location here too.
10214
10215         * ../errors/cs0019.cs : Check in.
10216
10217         * ../errors/cs0023.cs : Check in.
10218
10219         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
10220         case of a non-null MethodInfo object with a length of 0 !
10221
10222         (Binary::ResolveOperator): Flag error if overload resolution fails to find
10223         an applicable member - according to the spec :-)
10224         Also fix logic to find members in base types.
10225
10226         (Unary::ResolveOperator): Same here.
10227
10228         (Unary::report23): Change name to error23 and make first argument a TypeContainer
10229         as I was getting thoroughly confused between this and error19 :-)
10230         
10231         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
10232         (::FindMostEncompassedType): Implement.
10233         (::FindMostEncompassingType): Implement.
10234         (::StandardConversionExists): Implement.
10235
10236         (UserImplicitCast): Re-vamp. We now need info about most specific
10237         source and target types so that we can do the necessary conversions.
10238
10239         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
10240         mathematical union with no duplicates.
10241
10242 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
10243
10244         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
10245         in order from base classes to child classes, so that we can in
10246         child classes look up in our parent for method names and
10247         attributes (required for handling abstract, virtual, new, override
10248         constructs: we need to instrospect our base class, and if we dont
10249         populate the classes in order, the introspection might be
10250         incorrect.  For example, a method could query its parent before
10251         the parent has any methods and would determine that the parent has
10252         no abstract methods (while it could have had them)).
10253
10254         (RootContext::CreateType): Record the order in which we define the
10255         classes.
10256
10257 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
10258
10259         * class.cs (TypeContainer::Populate): Also method definitions can
10260         fail now, keep track of this.
10261
10262         (TypeContainer::FindMembers): Implement support for
10263         DeclaredOnly/noDeclaredOnly flag.
10264
10265         (Constructor::Emit) Return the ConstructorBuilder.
10266
10267         (Method::Emit) Return the MethodBuilder. 
10268         Check for abstract or virtual methods to be public.
10269
10270         * rootcontext.cs (RootContext::CreateType): Register all the
10271         abstract methods required for the class to be complete and the
10272         interface methods that must be implemented. 
10273
10274         * cs-parser.jay: Report error 501 (method requires body if it is
10275         not marked abstract or extern).
10276
10277         * expression.cs (TypeOf::Emit): Implement.
10278
10279         * typemanager.cs: runtime_handle_type, new global type.
10280
10281         * class.cs (Property::Emit): Generate code for properties.
10282
10283 2001-10-02  Ravi Pratap  <ravi@ximian.com>
10284
10285         * expression.cs (Unary::ResolveOperator): Find operators on base type
10286         too - we now conform exactly to the spec.
10287
10288         (Binary::ResolveOperator): Same here.
10289
10290         * class.cs (Operator::Define): Fix minor quirk in the tests.
10291
10292         * ../errors/cs0215.cs : Added.
10293
10294         * ../errors/cs0556.cs : Added.
10295
10296         * ../errors/cs0555.cs : Added.
10297
10298 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
10299
10300         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
10301         single integer which is really efficient
10302
10303 2001-10-01  Ravi Pratap  <ravi@ximian.com>
10304
10305         *  expression.cs (Expression::ImplicitUserConversion): Use location
10306         even in the case when we are examining True operators.
10307  
10308         * class.cs (Operator::Define): Perform extensive checks to conform
10309         with the rules for operator overloading in the spec.
10310
10311         * expression.cs (Expression::ImplicitReferenceConversion): Implement
10312         some of the other conversions mentioned in the spec.
10313
10314         * typemanager.cs (array_type): New static member for the System.Array built-in
10315         type.
10316
10317         (cloneable_interface): For System.ICloneable interface.
10318
10319         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
10320         we start resolving the tree and populating types.
10321
10322         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
10323  
10324 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
10325
10326         * expression.cs (Expression::ExprClassFromMemberInfo,
10327         Expression::Literalize): Create literal expressions from
10328         FieldInfos which are literals.
10329
10330         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
10331         type casts, because they were wrong.  The test suite in tests
10332         caught these ones.
10333
10334         (ImplicitNumericConversion): ushort to ulong requires a widening
10335         cast. 
10336
10337         Int32 constant to long requires widening cast as well.
10338
10339         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
10340         for integers because the type on the stack is not i4.
10341
10342 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
10343
10344         * expression.cs (report118): require location argument. 
10345
10346         * parameter.cs: Do not dereference potential null value.
10347
10348         * class.cs: Catch methods that lack the `new' keyword when
10349         overriding a name.  Report warnings when `new' is used without
10350         anything being there to override.
10351
10352         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
10353
10354         * class.cs: Only add constructor to hashtable if it is non-null
10355         (as now constructors can fail on define).
10356
10357         (TypeManager, Class, Struct): Take location arguments.
10358
10359         Catch field instance initialization in structs as errors.
10360
10361         accepting_filter: a new filter for FindMembers that is static so
10362         that we dont create an instance per invocation.
10363
10364         (Constructor::Define): Catch errors where a struct constructor is
10365         parameterless 
10366
10367         * cs-parser.jay: Pass location information for various new
10368         constructs. 
10369         
10370         * delegate.cs (Delegate): take a location argument.
10371
10372         * driver.cs: Do not call EmitCode if there were problesm in the
10373         Definition of the types, as many Builders wont be there. 
10374
10375         * decl.cs (Decl::Decl): Require a location argument.
10376
10377         * cs-tokenizer.cs: Handle properly hex constants that can not fit
10378         into integers, and find the most appropiate integer for it.
10379
10380         * literal.cs: Implement ULongLiteral.
10381
10382         * rootcontext.cs: Provide better information about the location of
10383         failure when CreateType fails.
10384         
10385 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
10386
10387         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
10388         as well.
10389
10390         * expression.cs (Binary::CheckShiftArguments): Add missing type
10391         computation.
10392         (Binary::ResolveOperator): Add type to the logical and and logical
10393         or, Bitwise And/Or and Exclusive Or code paths, it was missing
10394         before.
10395
10396         (Binary::DoNumericPromotions): In the case where either argument
10397         is ulong (and most signed types combined with ulong cause an
10398         error) perform implicit integer constant conversions as well.
10399
10400 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
10401
10402         * expression.cs (UserImplicitCast): Method should always be
10403         non-null. 
10404         (Invocation::BetterConversion): Simplified test for IntLiteral.
10405
10406         (Expression::ImplicitNumericConversion): Split this routine out.
10407         Put the code that performs implicit constant integer conversions
10408         here. 
10409
10410         (Expression::Resolve): Become a wrapper around DoResolve so we can
10411         check eclass and type being set after resolve.
10412
10413         (Invocation::Badness): Remove this dead function
10414
10415         (Binary::ResolveOperator): Do not compute the expensive argumnets
10416         unless we have a union for it.
10417
10418         (Probe::Emit): Is needs to do an isinst and then
10419         compare against null.
10420
10421         (::CanConvert): Added Location argument.  If the Location argument
10422         is null (Location.Null), then we do not report errors.  This is
10423         used by the `probe' mechanism of the Explicit conversion.  We do
10424         not want to generate an error for something that the user
10425         explicitly requested to be casted.  But the pipeline for an
10426         explicit cast first tests for potential implicit casts.
10427
10428         So for now, if the Location is null, it means `Probe only' to
10429         avoid adding another argument.   Might have to revise this
10430         strategy later.
10431
10432         (ClassCast): New class used to type cast objects into arbitrary
10433         classes (used in Explicit Reference Conversions).
10434
10435         Implement `as' as well.
10436
10437         Reverted all the patches from Ravi below: they were broken:
10438
10439                 * The use of `level' as a mechanism to stop recursive
10440                   invocations is wrong.  That was there just to catch the
10441                   bug with a strack trace but not as a way of addressing
10442                   the problem.
10443
10444                   To fix the problem we have to *understand* what is going
10445                   on and the interactions and come up with a plan, not
10446                   just get things going.
10447
10448                 * The use of the type conversion cache that I proposed
10449                   last night had an open topic: How does this work across
10450                   protection domains.  A user defined conversion might not
10451                   be public in the location where we are applying the
10452                   conversion, a different conversion might be selected
10453                   (ie, private A->B (better) but public B->A (worse),
10454                   inside A, A->B applies, but outside it, B->A will
10455                   apply).
10456
10457                 * On top of that (ie, even if the above is solved),
10458                   conversions in a cache need to be abstract.  Ie, `To
10459                   convert from an Int to a Short use an OpcodeCast', not
10460                   `To convert from an Int to a Short use the OpcodeCast on
10461                   the variable 5' (which is what this patch was doing).
10462         
10463 2001-09-28  Ravi Pratap  <ravi@ximian.com>
10464
10465         * expression.cs (Invocation::ConversionExists): Re-write to use
10466         the conversion cache
10467         
10468         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
10469         cache all conversions done, not just user-defined ones.
10470
10471         (Invocation::BetterConversion): The real culprit. Use ConversionExists
10472         to determine if a conversion exists instead of acutually trying to 
10473         perform the conversion. It's faster too.
10474
10475         (Expression::ConvertExplicit): Modify to use ConversionExists to check
10476         and only then attempt the implicit conversion.
10477
10478 2001-09-28  Ravi Pratap  <ravi@ximian.com>
10479
10480         * expression.cs (ConvertImplicit): Use a cache for conversions
10481         already found. Check level of recursion and bail out if necessary.
10482         
10483 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
10484
10485         * typemanager.cs (string_concat_string_string, string_concat_object_object):
10486         Export standard methods that we expect for string operations.
10487         
10488         * statement.cs (Block::UsageWarning): Track usage of variables and
10489         report the errors for not used variables.
10490
10491         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
10492         operator. 
10493
10494 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
10495
10496         * codegen.cs: remove unnneded code 
10497
10498         * expression.cs: Removed BuiltinTypeAccess class
10499
10500         Fix the order in which implicit conversions are
10501         done.  
10502
10503         The previous fixed dropped support for boxed conversions (adding a
10504         test to the test suite now)
10505
10506         (UserImplicitCast::CanConvert): Remove test for source being null,
10507         that code is broken.  We should not feed a null to begin with, if
10508         we do, then we should track the bug where the problem originates
10509         and not try to cover it up here.
10510
10511         Return a resolved expression of type UserImplicitCast on success
10512         rather than true/false.  Ravi: this is what I was talking about,
10513         the pattern is to use a static method as a "constructor" for
10514         objects. 
10515
10516         Also, do not create arguments until the very last minute,
10517         otherwise we always create the arguments even for lookups that
10518         will never be performed. 
10519
10520         (UserImplicitCast::Resolve): Eliminate, objects of type
10521         UserImplicitCast are born in a fully resolved state. 
10522         
10523         * typemanager.cs (InitCoreTypes): Init also value_type
10524         (System.ValueType). 
10525
10526         * expression.cs (Cast::Resolve): First resolve the child expression.
10527
10528         (LValue): Add new method AddressOf to be used by
10529         the `&' operator.  
10530
10531         Change the argument of Store to take an EmitContext instead of an
10532         ILGenerator, because things like FieldExpr need to be able to call
10533         their children expression to generate the instance code. 
10534
10535         (Expression::Error, Expression::Warning): Sugar functions for
10536         reporting errors.
10537
10538         (Expression::MemberLookup): Accept a TypeContainer instead of a
10539         Report as the first argument.
10540
10541         (Expression::ResolvePrimary): Killed.  I still want to improve
10542         this as currently the code is just not right.
10543
10544         (Expression::ResolveMemberAccess): Simplify, but it is still
10545         wrong. 
10546
10547         (Unary::Resolve): Catch errors in AddressOf operators.
10548
10549         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
10550         index to a byte for the short-version, or the compiler will choose
10551         the wrong Emit call, which generates the wrong data.
10552
10553         (ParameterReference::Emit, ::Store): same.
10554
10555         (FieldExpr::AddressOf): Implement.
10556         
10557         * typemanager.cs: TypeManager: made public variable instead of
10558         property.
10559         
10560         * driver.cs: document --fatal.
10561
10562         * report.cs (ErrorMessage, WarningMessage): new names for the old
10563         Error and Warning classes.
10564
10565         * cs-parser.jay (member_access): Turn built-in access to types
10566         into a normal simplename
10567
10568 2001-09-27  Ravi Pratap  <ravi@ximian.com>
10569
10570         * expression.cs (Invocation::BetterConversion): Fix to cope
10571         with q being null, since this was introducing a bug.
10572
10573         * expression.cs (ConvertImplicit): Do built-in conversions first.
10574
10575 2001-09-27  Ravi Pratap  <ravi@ximian.com>
10576
10577         * expression.cs (UserImplicitCast::Resolve): Fix bug.
10578
10579 2001-09-27  Ravi Pratap  <ravi@ximian.com>
10580
10581         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
10582         I had introduced long ago (what's new ?).
10583
10584         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
10585         the work of all the checking. 
10586         (ConvertImplicit): Call CanConvert and only then create object if necessary.
10587         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
10588
10589         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
10590         that is the right way. 
10591
10592         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
10593         overloading resolution. Use everywhere instead of cutting and pasting code.
10594
10595         (Binary::ResolveOperator): Use MakeUnionSet.
10596
10597         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
10598         we have to convert to bool types. Not complete yet.
10599         
10600 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
10601
10602         * typemanager.cs (TypeManager::CSharpName): support ushort.
10603
10604         * expression.cs (Expression::TryImplicitIntConversion): Attempts
10605         to provide an expression that performsn an implicit constant int
10606         conversion (section 6.1.6).
10607         (Expression::ConvertImplicitRequired): Reworked to include
10608         implicit constant expression conversions.
10609
10610         (Expression::ConvertNumericExplicit): Finished.
10611
10612         (Invocation::Emit): If InstanceExpression is null, then it means
10613         that we perform a call on this.
10614         
10615 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
10616
10617         * expression.cs (Unary::Emit): Remove some dead code.
10618         (Probe): Implement Resolve and Emit for `is'.
10619         (Expression::ConvertImplicitRequired): Attempt to do constant
10620         expression conversions here.  Maybe should be moved to
10621         ConvertImplicit, but I am not sure.
10622         (Expression::ImplicitLongConstantConversionPossible,
10623         Expression::ImplicitIntConstantConversionPossible): New functions
10624         that tell whether is it possible to apply an implicit constant
10625         expression conversion.
10626
10627         (ConvertNumericExplicit): Started work on explicit numeric
10628         conversions.
10629
10630         * cs-parser.jay: Update operator constants.
10631
10632         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
10633         (Parameters::GetSignature): Hook up VerifyArgs here.
10634         (Parameters::VerifyArgs): Verifies that no two arguments have the
10635         same name. 
10636
10637         * class.cs (Operator): Update the operator names to reflect the
10638         ones that the spec expects (as we are just stringizing the
10639         operator names).
10640         
10641         * expression.cs (Unary::ResolveOperator): Fix bug: Use
10642         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
10643         previous usage did only work for our methods.
10644         (Expression::ConvertImplicit): Handle decimal implicit numeric
10645         conversions as well.
10646         (Expression::InternalTypeConstructor): Used to invoke constructors
10647         on internal types for default promotions.
10648
10649         (Unary::Emit): Implement special handling for the pre/post
10650         increment/decrement for overloaded operators, as they need to have
10651         the same semantics as the other operators.
10652
10653         (Binary::ResolveOperator): ditto.
10654         (Invocation::ConversionExists): ditto.
10655         (UserImplicitCast::Resolve): ditto.
10656         
10657 2001-09-26  Ravi Pratap  <ravi@ximian.com>
10658
10659         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
10660         operator, return after emitting body. Regression tests pass again !
10661
10662         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
10663         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
10664         (Invocation::OverloadResolve): Ditto.
10665         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
10666
10667         * everywhere : update calls to the above methods accordingly.
10668
10669 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
10670
10671         * assign.cs (Assign): Make it inherit from ExpressionStatement.
10672
10673         * expression.cs (ExpressionStatement): New base class used for
10674         expressions that can appear in statements, so that we can provide
10675         an alternate path to generate expression that do not leave a value
10676         on the stack.
10677
10678         (Expression::Emit, and all the derivatives): We no longer return
10679         whether a value is left on the stack or not.  Every expression
10680         after being emitted leaves a single value on the stack.
10681
10682         * codegen.cs (EmitContext::EmitStatementExpression): Use the
10683         facilties of ExpressionStatement if possible.
10684
10685         * cs-parser.jay: Update statement_expression.
10686
10687 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
10688
10689         * driver.cs: Change the wording of message
10690
10691 2001-09-25  Ravi Pratap  <ravi@ximian.com>
10692
10693         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
10694         the type of the expression to the return type of the method if
10695         we have an overloaded operator match ! The regression tests pass again !
10696         (Unary::ResolveOperator): Ditto.
10697
10698         * expression.cs (Invocation::ConversionExists): Correct the member lookup
10699         to find "op_Implicit", not "implicit" ;-)
10700         (UserImplicitCast): New class to take care of user-defined implicit conversions.
10701         (ConvertImplicit, ForceConversion): Take TypeContainer argument
10702
10703         * everywhere : Correct calls to the above accordingly.
10704
10705         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
10706         (ConvertImplicit): Do user-defined conversion if it exists.
10707
10708 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
10709
10710         * assign.cs: track location.
10711         (Resolve): Use implicit conversions on assignment.
10712
10713         * literal.cs: Oops.  Not good, Emit of short access values should
10714         pass (Bytes) or the wrong argument will be selected.
10715
10716         * expression.cs (Unary::Emit): Emit code for -expr.
10717         
10718         (Unary::ResolveOperator): Handle `Substract' for non-constants
10719         (substract from zero from the non-constants).
10720         Deal with Doubles as well. 
10721         
10722         (Expression::ConvertImplicitRequired): New routine that reports an
10723         error if no implicit conversion exists. 
10724
10725         (Invocation::OverloadResolve): Store the converted implicit
10726         expressions if we make them
10727         
10728 2001-09-24  Ravi Pratap  <ravi@ximian.com>
10729
10730         * class.cs (ConstructorInitializer): Take a Location argument.
10731         (ConstructorBaseInitializer): Same here.
10732         (ConstructorThisInitializer): Same here.
10733
10734         * cs-parser.jay : Update all calls accordingly.
10735
10736         * expression.cs (Unary, Binary, New): Take location argument.
10737         Update accordingly everywhere.
10738
10739         * cs-parser.jay : Update all calls to the above to take a location
10740         argument.
10741
10742         * class.cs : Ditto.
10743
10744 2001-09-24  Ravi Pratap  <ravi@ximian.com>
10745
10746         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
10747         (Invocation::BetterConversion): Same here
10748         (Invocation::ConversionExists): Ditto.
10749
10750         (Invocation::ConversionExists): Implement.
10751
10752 2001-09-22  Ravi Pratap  <ravi@ximian.com>
10753
10754         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
10755         Also take an additional TypeContainer argument.
10756
10757         * All over : Pass in TypeContainer as argument to OverloadResolve.
10758
10759         * typemanager.cs (CSharpName): Update to check for the string type and return
10760         that too.
10761
10762         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
10763         a given method.
10764         
10765 2001-09-21  Ravi Pratap  <ravi@ximian.com>
10766
10767         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
10768         (Invocation::BetterFunction): Implement.
10769         (Invocation::BetterConversion): Implement.
10770         (Invocation::ConversionExists): Skeleton, no implementation yet.
10771
10772         Okay, things work fine !
10773
10774 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
10775
10776         * typemanager.cs: declare and load enum_type, delegate_type and
10777         void_type. 
10778
10779         * expression.cs (Expression::Emit): Now emit returns a value that
10780         tells whether a value is left on the stack or not.  This strategy
10781         might be reveted tomorrow with a mechanism that would address
10782         multiple assignments.
10783         (Expression::report118): Utility routine to report mismatches on
10784         the ExprClass.
10785
10786         (Unary::Report23): Report impossible type/operator combination
10787         utility function.
10788
10789         (Unary::IsIncrementableNumber): Whether the type can be
10790         incremented or decremented with add.
10791         (Unary::ResolveOperator): Also allow enumerations to be bitwise
10792         complemented. 
10793         (Unary::ResolveOperator): Implement ++, !, ~,
10794
10795         (Invocation::Emit): Deal with new Emit convetion.
10796         
10797         * All Expression derivatives: Updated their Emit method to return
10798         whether they leave values on the stack or not.
10799         
10800         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
10801         stack for expressions that are statements. 
10802
10803 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
10804
10805         * expression.cs (LValue): New interface.  Must be implemented by
10806         LValue objects.
10807         (LocalVariableReference, ParameterReference, FieldExpr): Implement
10808         LValue interface.
10809         
10810         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
10811         interface for generating code, simplifies the code.
10812
10813 2001-09-20  Ravi Pratap  <ravi@ximian.com>
10814
10815         * expression.cs (everywhere): Comment out return statements in ::Resolve
10816         methods to avoid the warnings.
10817
10818 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
10819
10820         * driver.cs (parse): Report error 2001 if we can not open the
10821         source file.
10822
10823         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
10824         not resolve it.
10825
10826         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
10827         object. 
10828
10829         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
10830         otherwise nested blocks end up with the same index.
10831
10832         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
10833
10834         * expression.cs:  Instead of having FIXMEs in the Resolve
10835         functions, throw exceptions so it is obvious that we are facing a
10836         bug. 
10837
10838         * cs-parser.jay (invocation_expression): Pass Location information.
10839
10840         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
10841         Use a basename for those routines because .NET does not like paths
10842         on them. 
10843
10844         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
10845         already defined.
10846
10847 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
10848
10849         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
10850         are loading the correct data types (throws an exception if not).
10851         (TypeManager::InitCoreTypes): Use CoreLookupType
10852
10853         * expression.cs (Unary::ResolveOperator): return the child
10854         expression for expressions which are just +expr.
10855         (Unary::ResolveOperator): Return negative literals for -LITERAL
10856         expressions (otherwise they are Unary {Literal}).
10857         (Invocation::Badness): Take into account `Implicit constant
10858         expression conversions'.
10859
10860         * literal.cs (LongLiteral): Implement long literal class.
10861         (IntLiteral): export the `Value' of the intliteral. 
10862
10863 2001-09-19  Ravi Pratap  <ravi@ximian.com>
10864
10865         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
10866
10867         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
10868         instead of 'Operator'
10869
10870         * expression.cs (Binary::ResolveOperator): Update accordingly.
10871         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
10872         and 'Minus'
10873
10874         * cs-parser.jay (unary_expression): Update to use the new names.
10875
10876         * gen-treedump.cs (GetUnary): Same here.
10877
10878         * expression.cs (Unary::Resolve): Implement.
10879         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
10880         operators are found instead of making noise ;-)
10881         (Unary::ResolveOperator): New method to do precisely the same thing which
10882         Binary::ResolveOperator does for Binary expressions.
10883         (Unary.method, .Arguments): Add.
10884         (Unary::OperName): Implement.   
10885         (Unary::ForceConversion): Copy and Paste !
10886
10887         * class.cs (Operator::Define): Fix a small bug for the case when we have 
10888         a unary operator.
10889
10890         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
10891         for the inbuilt operators. Only overloading works for now ;-)
10892
10893 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
10894
10895         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
10896         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
10897
10898         * expression.cs (This::Emit): Implement. 
10899         (This::Resolve): Implement.
10900         (TypeOf:Resolve): Implement.
10901         (Expression::ResolveSimpleName): Add an implicit this to instance
10902         field references. 
10903         (MemberAccess::Resolve): Deal with Parameters and Fields. 
10904         Bind instance variable to Field expressions.
10905         (FieldExpr::Instance): New field used to track the expression that
10906         represents the object instance.
10907         (FieldExpr::Resolve): Track potential errors from MemberLookup not
10908         binding 
10909         (FieldExpr::Emit): Implement.
10910
10911         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
10912         the last instruction contains a return opcode to avoid generating
10913         the last `ret' instruction (this generates correct code, and it is
10914         nice to pass the peverify output).
10915
10916         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
10917         initializer for static and instance variables.
10918         (Constructor::Emit): Allow initializer to be null in the case of
10919         static constructors.  Only emit initializer for instance
10920         constructors. 
10921
10922         (TypeContainer::FindMembers): Return a null array if there are no
10923         matches.
10924
10925         Also fix the code for the MemberTypes.Method branch, as it was not
10926         scanning that for operators (or tried to access null variables before).
10927
10928         * assign.cs (Assign::Emit): Handle instance and static fields. 
10929
10930         * TODO: Updated.
10931
10932         * driver.cs: Stop compilation if there are parse errors.
10933
10934         * cs-parser.jay (constructor_declaration): Provide default base
10935         initializer for non-static constructors.
10936         (constructor_declarator): Do not provide a default base
10937         initializers if none was specified.
10938         Catch the fact that constructors should not have parameters.
10939
10940         * class.cs: Do not emit parent class initializers for static
10941         constructors, that should be flagged as an error.
10942
10943 2001-09-18  Ravi Pratap  <ravi@ximian.com>
10944
10945         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
10946         Move back code into TypeContainer::Populate.
10947
10948 2001-09-18  Ravi Pratap  <ravi@ximian.com>
10949
10950         * class.cs (TypeContainer::AddConstructor): Fix the check to
10951         compare against Name, not Basename. 
10952         (Operator::OpType): Change Plus and Minus to Add and Subtract.
10953
10954         * cs-parser.jay : Update accordingly.
10955
10956         * class.cs (TypeContainer::FindMembers): For the case where we are searching
10957         for methods, don't forget to look into the operators too.
10958         (RegisterMethodBuilder): Helper method to take care of this for
10959         methods, constructors and operators.
10960         (Operator::Define): Completely revamp.
10961         (Operator.OperatorMethod, MethodName): New fields.
10962         (TypeContainer::Populate): Move the registering of builders into
10963         RegisterMethodBuilder.
10964         (Operator::Emit): Re-write.
10965
10966         * expression.cs (Binary::Emit): Comment out code path to emit method
10967         invocation stuff for the case when we have a user defined operator. I am
10968         just not able to get it right !
10969         
10970 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
10971
10972         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
10973         argument. 
10974
10975         (Expression::MemberLookup): Provide a version that allows to
10976         specify the MemberTypes and BindingFlags. 
10977
10978         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
10979         so it was not fetching variable information from outer blocks.
10980
10981         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
10982         Beforefieldinit as it was buggy.
10983
10984         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
10985         that Ravi put here.  
10986
10987         * class.cs (Constructor::Emit): Only emit if block is not null.
10988         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
10989         deal with this by semantically definining it as if the user had
10990         done it.
10991
10992         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
10993         constructors as we now "emit" them at a higher level.
10994
10995         (TypeContainer::DefineDefaultConstructor): Used to define the
10996         default constructors if none was provided.
10997
10998         (ConstructorInitializer): Add methods Resolve and Emit. 
10999         
11000         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
11001
11002 2001-09-17  Ravi Pratap  <ravi@ximian.com>
11003
11004         * class.cs (TypeContainer::EmitDefaultConstructor): Register
11005         the default constructor builder with our hashtable for methodbuilders
11006         to methodcores.
11007
11008         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
11009         and argument_count is 0 in which case we have a match.
11010         (Binary::ResolveOperator): More null checking and miscellaneous coding
11011         style cleanup.
11012
11013 2001-09-17  Ravi Pratap  <ravi@ximian.com>
11014
11015         * rootcontext.cs (IsNameSpace): Compare against null.
11016
11017         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
11018
11019         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
11020         and Unary::Operator.
11021
11022         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
11023         accordingly.
11024
11025         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
11026         we have overloaded operators.
11027         (Binary::ResolveOperator): Implement the part which does the operator overload
11028         resolution.
11029
11030         * class.cs (Operator::Emit): Implement.
11031         (TypeContainer::Emit): Emit the operators we have too.
11032
11033         * expression.cs (Binary::Emit): Update to emit the appropriate code for
11034         the case when we have a user-defined operator.
11035         
11036 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
11037
11038         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
11039
11040 2001-09-16  Ravi Pratap  <ravi@ximian.com>
11041
11042         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
11043         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
11044         (Constructor::Emit): Implement.
11045         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
11046         if we have no work to do. 
11047         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
11048         Emit method.
11049
11050         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
11051         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
11052
11053         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
11054         of parent.parent.
11055
11056 2001-09-15  Ravi Pratap  <ravi@ximian.com>
11057
11058         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
11059         in the source.
11060         (Tree::RecordNamespace): Method to do what the name says ;-)
11061         (Tree::Namespaces): Property to get at the namespaces hashtable.
11062
11063         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
11064         keep track.
11065
11066         * rootcontext.cs (IsNamespace): Fixed it :-)
11067
11068 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
11069
11070         * class.cs (TypeContainer::FindMembers): Add support for
11071         constructors. 
11072         (MethodCore): New class that encapsulates both the shared aspects
11073         of a Constructor and a Method.  
11074         (Method, Constructor): Factored pieces into MethodCore.
11075
11076         * driver.cs: Added --fatal which makes errors throw exceptions.
11077         Load System assembly as well as part of the standard library.
11078
11079         * report.cs: Allow throwing exceptions on errors for debugging.
11080
11081         * modifiers.cs: Do not use `parent', instead use the real type
11082         container to evaluate permission settings.
11083
11084         * class.cs: Put Ravi's patch back in.  He is right, and we will
11085         have to cope with the
11086
11087 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11088
11089         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
11090         FamORAssem, not FamANDAssem.
11091         
11092 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
11093
11094         * driver.cs: Added --parse option that only parses its input files
11095         and terminates.
11096
11097         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
11098         incorrect.  IsTopLevel is not used to tell whether an object is
11099         root_types or not (that can be achieved by testing this ==
11100         root_types).  But to see if this is a top-level *class* (not
11101         necessarly our "toplevel" container). 
11102
11103 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11104
11105         * enum.cs (Enum::Define): Modify to call the Lookup method on the
11106         parent instead of a direct call to GetType.
11107
11108 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11109
11110         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
11111         Modifiers.TypeAttr. This should just be a call to that method.
11112
11113         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
11114         object so that we can determine if we are top-level or not.
11115
11116         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
11117         TypeContainer too.
11118
11119         * enum.cs (Enum::Define): Ditto.
11120
11121         * modifiers.cs (FieldAttr): Re-write.
11122
11123         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
11124         (TypeContainer::HaveStaticConstructor): New property to provide access
11125         to precisely that info.
11126
11127         * modifiers.cs (MethodAttr): Re-write.
11128         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
11129
11130         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
11131         of top-level types as claimed.
11132         
11133 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
11134
11135         * expression.cs (MemberLookup): Fruitless attempt to lookup
11136         constructors.  Maybe I need to emit default constructors?  That
11137         might be it (currently .NET emits this for me automatically).
11138         (Invocation::OverloadResolve): Cope with Arguments == null.
11139         (Invocation::EmitArguments): new function, shared by the new
11140         constructor and us.
11141         (Invocation::Emit): Handle static and instance methods.  Emit
11142         proper call instruction for virtual or non-virtual invocations.
11143         (New::Emit): Implement.
11144         (New::Resolve): Implement.
11145         (MemberAccess:Resolve): Implement.
11146         (MethodGroupExpr::InstanceExpression): used conforming to the spec
11147         to track instances.
11148         (FieldExpr::Resolve): Set type.
11149
11150         * support.cs: Handle empty arguments.
11151                 
11152         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
11153         SimpleLookup): Auxiliary routines to help parse a qualifier
11154         identifier.  
11155
11156         Update qualifier_identifier rule.
11157
11158         * codegen.cs: Removed debugging messages.
11159
11160         * class.cs: Make this a global thing, this acts just as a "key" to
11161         objects that we might have around.
11162
11163         (Populate): Only initialize method_builders_to_methods once.
11164
11165         * expression.cs (PropertyExpr): Initialize type from the
11166         PropertyType. 
11167
11168         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
11169         Resolve pattern.  Attempt to implicitly convert value to boolean.
11170         Emit code.
11171
11172         * expression.cs: Set the type for the int32/int32 argument case.
11173         (Binary::ResolveOperator): Set the return type to boolean for
11174         comparission operators
11175
11176         * typemanager.cs: Remove debugging print code.
11177
11178         (Invocation::Resolve): resolve type.
11179
11180         * class.cs: Allocate a MemberInfo of the correct size, as the code
11181         elsewhere depends on the test to reflect the correct contents.
11182
11183         (Method::) Keep track of parameters, due to System.Reflection holes
11184
11185         (TypeContainer::Populate): Keep track of MethodBuilders to Method
11186         mapping here.
11187
11188         (TypeContainer::FindMembers): Use ArrayList and then copy an array
11189         of the exact size and return that.
11190
11191         (Class::LookupMethodByBuilder): New function that maps
11192         MethodBuilders to its methods.  Required to locate the information
11193         on methods because System.Reflection bit us again.
11194
11195         * support.cs: New file, contains an interface ParameterData and
11196         two implementations: ReflectionParameters and InternalParameters
11197         used to access Parameter information.  We will need to grow this
11198         as required.
11199
11200         * expression.cs (Invocation::GetParameterData): implement a cache
11201         and a wrapper around the ParameterData creation for methods. 
11202         (Invocation::OverloadResolve): Use new code.
11203
11204 2001-09-13  Ravi Pratap  <ravi@ximian.com>
11205
11206         * class.cs (TypeContainer::EmitField): Remove and move into 
11207         (Field::Define): here and modify accordingly.
11208         (Field.FieldBuilder): New member.
11209         (TypeContainer::Populate): Update accordingly.
11210         (TypeContainer::FindMembers): Implement.
11211
11212 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
11213
11214         * statement.cs: (VariableInfo::VariableType): New field to be
11215         initialized with the full type once it is resolved. 
11216
11217 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
11218
11219         * parameter.cs (GetParameterInfo): Use a type cache to compute
11220         things only once, and to reuse this information
11221
11222         * expression.cs (LocalVariableReference::Emit): Implement.
11223         (OpcodeCast::Emit): fix.
11224
11225         (ParameterReference::Resolve): Implement.
11226         (ParameterReference::Emit): Implement.
11227
11228         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
11229         that are expressions need to stay as Expressions.
11230
11231         * typemanager.cs (CSharpName): Returns the C# name of a type if
11232         possible. 
11233
11234         * expression.cs (Expression::ConvertImplicit): New function that
11235         implements implicit type conversions.
11236
11237         (Expression::ImplicitReferenceConversion): Implements implicit
11238         reference conversions.
11239
11240         (EmptyCast): New type for transparent casts.
11241
11242         (OpcodeCast): New type for casts of types that are performed with
11243         a sequence of bytecodes.
11244         
11245         (BoxedCast): New type used for casting value types into reference
11246         types.  Emits a box opcode.
11247
11248         (Binary::DoNumericPromotions): Implements numeric promotions of
11249         and computation of the Binary::Type.
11250
11251         (Binary::EmitBranchable): Optimization.
11252
11253         (Binary::Emit): Implement code emission for expressions.
11254         
11255         * typemanager.cs (TypeManager): Added two new core types: sbyte
11256         and byte.
11257
11258 2001-09-12  Ravi Pratap  <ravi@ximian.com>
11259
11260         * class.cs (TypeContainer::FindMembers): Method which does exactly
11261         what Type.FindMembers does, only we don't have to use reflection. No
11262         implementation yet.
11263
11264         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
11265         typecontainer objects as we need to get at them.
11266         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
11267
11268         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
11269         typecontainer object.
11270
11271         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
11272         of just a Report object.
11273
11274 2001-09-11  Ravi Pratap  <ravi@ximian.com>
11275
11276         * class.cs (Event::Define): Go back to using the prefixes "add_" and
11277         "remove_"
11278         (TypeContainer::Populate): Now define the delegates of the type too.
11279         (TypeContainer.Delegates): Property to access the list of delegates defined
11280         in the type.
11281
11282         * delegates.cs (Delegate::Define): Implement partially.
11283
11284         * modifiers.cs (TypeAttr): Handle more flags.
11285
11286 2001-09-11  Ravi Pratap  <ravi@ximian.com>
11287
11288         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
11289         and not <=
11290         (Operator::Define): Re-write logic to get types by using the LookupType method
11291         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
11292         (Indexer::Define): Ditto.
11293         (Event::Define): Ditto.
11294         (Property::Define): Ditto.
11295         
11296 2001-09-10  Ravi Pratap  <ravi@ximian.com>
11297
11298         * class.cs (TypeContainer::Populate): Now define operators too. 
11299         (TypeContainer.Operators): New property to access the list of operators
11300         in a type.
11301         (Operator.OperatorMethodBuilder): New member to hold the method builder
11302         for the operator we are defining.
11303         (Operator::Define): Implement.
11304
11305 2001-09-10  Ravi Pratap  <ravi@ximian.com>
11306
11307         * class.cs (Event::Define): Make the prefixes of the accessor methods
11308         addOn_ and removeOn_ 
11309
11310         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
11311         of the location being passed in too. Ideally, this should go later since all
11312         error reporting should be done through the Report object.
11313
11314         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
11315         (Populate): Iterate thru the indexers we have and define them too.
11316         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
11317         for the get and set accessors.
11318         (Indexer::Define): Implement.
11319         
11320 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
11321
11322         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
11323         my previous implementation, did not work.
11324
11325         * typemanager.cs: Add a couple of missing types (the longs).
11326
11327         * literal.cs: Use TypeManager.bool_type instead of getting it.
11328
11329         * expression.cs (EventExpr): New kind of expressions.
11330         (Expressio::ExprClassFromMemberInfo): finish
11331
11332 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
11333
11334         * assign.cs: Emit stores to static fields differently.
11335
11336 2001-09-08  Ravi Pratap  <ravi@ximian.com>
11337
11338         * Merge in changes and adjust code to tackle conflicts. Backed out my
11339         code in Assign::Resolve ;-) 
11340
11341 2001-09-08  Ravi Pratap  <ravi@ximian.com>
11342
11343         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
11344         instead Report.Error and also pass in the location.
11345         (CSharpParser::Lexer): New readonly property to return the reference
11346         to the Tokenizer object.
11347         (declare_local_variables): Use Report.Error with location instead of plain 
11348         old error.
11349         (CheckDef): Ditto.
11350
11351         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
11352         (Operator.CheckBinaryOperator): Ditto.
11353
11354         * cs-parser.jay (operator_declarator): Update accordingly.
11355
11356         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
11357         (CheckBinaryOperator): Same here.
11358
11359         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
11360         on the name without any prefixes of namespace names etc. This is because we
11361         already might have something already fully qualified like 
11362         'System.Console.WriteLine'
11363
11364         * assign.cs (Resolve): Begin implementation. Stuck ;-)
11365
11366 2001-09-07  Ravi Pratap  <ravi@ximian.com>
11367
11368         * cs-tokenizer.cs (location): Return a string which also contains
11369         the file name.
11370
11371         * expression.cs (ElementAccess): New class for expressions of the
11372         type 'element access.'
11373         (BaseAccess): New class for expressions of the type 'base access.'
11374         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
11375         respectively.
11376         
11377         * cs-parser.jay (element_access): Implement action.
11378         (base_access): Implement actions.
11379         (checked_expression, unchecked_expression): Implement.
11380
11381         * cs-parser.jay (local_variable_type): Correct and implement.
11382         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
11383
11384         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
11385
11386         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
11387         name and the specifiers.
11388
11389         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
11390         
11391         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
11392         making them all public ;-)
11393
11394         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
11395         class anyways.
11396         
11397 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
11398
11399         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
11400         PropertyExprs.
11401         (FieldExpr, PropertyExprs): New resolved expressions.
11402         (SimpleName::MemberStaticCheck): Perform static checks for access
11403         to non-static fields on static methods. Maybe this should be
11404         generalized for MemberAccesses. 
11405         (SimpleName::ResolveSimpleName): More work on simple name
11406         resolution. 
11407
11408         * cs-parser.jay (primary_expression/qualified_identifier): track
11409         the parameter index.
11410
11411         * codegen.cs (CodeGen::Save): Catch save exception, report error.
11412         (EmitContext::EmitBoolExpression): Chain to expression generation
11413         instead of temporary hack.
11414         (::EmitStatementExpression): Put generic expression code generation.
11415
11416         * assign.cs (Assign::Emit): Implement variable assignments to
11417         local variables, parameters and fields.
11418
11419 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
11420
11421         * statement.cs (Block::GetVariableInfo): New method, returns the
11422         VariableInfo for a variable name in a block.
11423         (Block::GetVariableType): Implement in terms of GetVariableInfo
11424
11425         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
11426         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
11427
11428 2001-09-06  Ravi Pratap  <ravi@ximian.com>
11429
11430         * cs-parser.jay (operator_declaration): Continue on my quest : update
11431         to take attributes argument.
11432         (event_declaration): Ditto.
11433         (enum_declaration): Ditto.
11434         (indexer_declaration): Ditto.
11435         
11436         * class.cs (Operator::Operator): Update constructor accordingly.
11437         (Event::Event): Ditto.
11438
11439         * delegate.cs (Delegate::Delegate): Same here.
11440
11441         * enum.cs (Enum::Enum): Same here.
11442         
11443 2001-09-05  Ravi Pratap  <ravi@ximian.com>
11444
11445         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
11446
11447         * ../tests/cs0658.cs : New file to demonstrate error 0658.
11448
11449         * attribute.cs (Attributes): New class to encapsulate all attributes which were
11450         being passed around as an arraylist.
11451         (Attributes::AddAttribute): Method to add attribute sections.
11452
11453         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
11454         (struct_declaration): Update accordingly.
11455         (constant_declaration): Update.
11456         (field_declaration): Update.
11457         (method_header): Update.
11458         (fixed_parameter): Update.
11459         (parameter_array): Ditto.
11460         (property_declaration): Ditto.
11461         (destructor_declaration): Ditto.
11462         
11463         * class.cs (Struct::Struct): Update constructors accordingly.
11464         (Class::Class): Ditto.
11465         (Field::Field): Ditto.
11466         (Method::Method): Ditto.
11467         (Property::Property): Ditto.
11468         (TypeContainer::OptAttribute): update property's return type.
11469         
11470         * interface.cs (Interface.opt_attributes): New member.
11471         (Interface::Interface): Update to take the extra Attributes argument.
11472
11473         * parameter.cs (Parameter::Parameter): Ditto.
11474
11475         * constant.cs (Constant::Constant): Ditto.
11476
11477         * interface.cs (InterfaceMemberBase): New OptAttributes field.
11478         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
11479         the attributes as a parameter.
11480         (InterfaceProperty): Update constructor call.
11481         (InterfaceEvent): Ditto.
11482         (InterfaceMethod): Ditto.
11483         (InterfaceIndexer): Ditto.
11484
11485         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
11486         pass the attributes too.
11487         (interface_event_declaration): Ditto.
11488         (interface_property_declaration): Ditto.
11489         (interface_method_declaration): Ditto.
11490         (interface_declaration): Ditto.
11491
11492 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
11493
11494         * class.cs (Method::Define): Track the "static Main" definition to
11495         create an entry point. 
11496
11497         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
11498         EntryPoint if we find it. 
11499
11500         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
11501         (EmitContext::ig): Make this variable public.
11502
11503         * driver.cs: Make the default output file be the first file name
11504         with the .exe extension.  
11505
11506         Detect empty compilations
11507
11508         Handle various kinds of output targets.  Handle --target and
11509         rename -t to --dumper.
11510
11511         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
11512         methods inherited from Expression return now an Expression.  This
11513         will is used during the tree rewriting as we resolve them during
11514         semantic analysis.
11515
11516         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
11517         the spec.  Missing entirely is the information about
11518         accessability of elements of it.
11519
11520         (Expression::ExprClassFromMemberInfo): New constructor for
11521         Expressions that creates a fully initialized Expression based on
11522         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
11523         a Type.
11524
11525         (Invocation::Resolve): Begin implementing resolution of invocations.
11526         
11527         * literal.cs (StringLiteral):  Implement Emit.
11528
11529 2001-09-05  Ravi Pratap  <ravi@ximian.com>
11530
11531         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
11532         member.
11533         
11534 2001-09-04  Ravi Pratap  <ravi@ximian.com>
11535
11536         * cs-parser.jay (attribute_arguments): Implement actions.
11537         (attribute): Fix bug in production. Implement action.
11538         (attribute_list): Implement.
11539         (attribute_target): Implement.
11540         (attribute_target_specifier, opt_target_specifier): Implement
11541         (CheckAttributeTarget): New method to check if the attribute target
11542         is valid.
11543         (attribute_section): Implement.
11544         (opt_attributes): Implement.
11545
11546         * attribute.cs : New file to handle attributes.
11547         (Attribute): Class to hold attribute info.
11548
11549         * cs-parser.jay (opt_attribute_target_specifier): Remove production
11550         (attribute_section): Modify production to use 2 different rules to 
11551         achieve the same thing. 1 s/r conflict down !
11552         Clean out commented, useless, non-reducing dimension_separator rules.
11553         
11554         * class.cs (TypeContainer.attributes): New member to hold list
11555         of attributes for a type.
11556         (Struct::Struct): Modify to take one more argument, the attribute list.
11557         (Class::Class): Ditto.
11558         (Field::Field): Ditto.
11559         (Method::Method): Ditto.
11560         (Property::Property): Ditto.
11561         
11562         * cs-parser.jay (struct_declaration): Update constructor call to
11563         pass in the attributes too.
11564         (class_declaration): Ditto.
11565         (constant_declaration): Ditto.
11566         (field_declaration): Ditto.
11567         (method_header): Ditto.
11568         (fixed_parameter): Ditto.
11569         (parameter_array): Ditto.
11570         (property_declaration): Ditto.
11571
11572         * constant.cs (Constant::Constant): Update constructor similarly.
11573         Use System.Collections.
11574
11575         * parameter.cs (Parameter::Parameter): Update as above.
11576
11577 2001-09-02  Ravi Pratap  <ravi@ximian.com>
11578
11579         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
11580         (TypeContainer.delegates): New member to hold list of delegates.
11581
11582         * cs-parser.jay (delegate_declaration): Implement the action correctly 
11583         this time as I seem to be on crack ;-)
11584
11585 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
11586
11587         * rootcontext.cs (RootContext::IsNamespace): new function, used to
11588         tell whether an identifier represents a namespace.
11589
11590         * expression.cs (NamespaceExpr): A namespace expression, used only
11591         temporarly during expression resolution.
11592         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
11593         utility functions to resolve names on expressions.
11594
11595 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
11596
11597         * codegen.cs: Add hook for StatementExpressions. 
11598
11599         * class.cs: Fix inverted test for static flag in methods.
11600
11601 2001-09-02  Ravi Pratap  <ravi@ximian.com>
11602
11603         * class.cs (Operator::CheckUnaryOperator): Correct error number used
11604         to make it coincide with MS' number.
11605         (Operator::CheckBinaryOperator): Ditto.
11606
11607         * ../errors/errors.txt : Remove error numbers added earlier.
11608
11609         * ../errors/cs1019.cs : Test case for error # 1019
11610
11611         * ../errros/cs1020.cs : Test case for error # 1020
11612
11613         * cs-parser.jay : Clean out commented cruft.
11614         (dimension_separators, dimension_separator): Comment out. Ostensibly not
11615         used anywhere - non-reducing rule.
11616         (namespace_declarations): Non-reducing rule - comment out.
11617
11618         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
11619         with TypeContainer::AddEnum.
11620
11621         * delegate.cs : New file for delegate handling classes.
11622         (Delegate): Class for declaring delegates.
11623
11624         * makefile : Update.
11625
11626         * cs-parser.jay (delegate_declaration): Implement.
11627
11628 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
11629
11630         * class.cs (Event::Define): Implement.
11631         (Event.EventBuilder): New member.
11632
11633         * class.cs (TypeContainer::Populate): Update to define all enums and events
11634         we have.
11635         (Events): New property for the events arraylist we hold. Shouldn't we move to using
11636         readonly fields for all these cases ?
11637
11638 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
11639
11640         * class.cs (Property): Revamp to use the convention of making fields readonly.
11641         Accordingly modify code elsewhere.
11642
11643         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
11644         the Define method of the Property class.
11645
11646         * class.cs : Clean up applied patch and update references to variables etc. Fix 
11647         trivial bug.
11648         (TypeContainer::Populate): Update to define all the properties we have. Also
11649         define all enumerations.
11650
11651         * enum.cs (Define): Implement.
11652         
11653 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
11654
11655         * cs-parser.jay (overloadable_operator): The semantic value is an
11656         enum of the Operator class.
11657         (operator_declarator): Implement actions.
11658         (operator_declaration): Implement.
11659
11660         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
11661         validity of definitions.
11662         (Operator::CheckBinaryOperator): Static method to check for binary operators
11663         (TypeContainer::AddOperator): New method to add an operator to a type.
11664
11665         * cs-parser.jay (indexer_declaration): Added line to actually call the
11666         AddIndexer method so it gets added ;-)
11667
11668         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
11669         already taken care of by the MS compiler ?  
11670
11671 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
11672
11673         * class.cs (Operator): New class for operator declarations.
11674         (Operator::OpType): Enum for the various operators.
11675
11676 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
11677
11678         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
11679         ostensibly handle this in semantic analysis.
11680
11681         * cs-parser.jay (general_catch_clause): Comment out
11682         (specific_catch_clauses, specific_catch_clause): Ditto.
11683         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
11684         (catch_args, opt_catch_args): New productions.
11685         (catch_clause): Rewrite to use the new productions above
11686         (catch_clauses): Modify accordingly.
11687         (opt_catch_clauses): New production to use in try_statement
11688         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
11689         and re-write the code in the actions to extract the specific and
11690         general catch clauses by being a little smart ;-)
11691
11692         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
11693         Hooray, try and catch statements parse fine !
11694         
11695 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
11696
11697         * statement.cs (Block::GetVariableType): Fix logic to extract the type
11698         string from the hashtable of variables.
11699
11700         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
11701         I end up making that mistake ;-)
11702         (catch_clauses): Fixed gross error which made Key and Value of the 
11703         DictionaryEntry the same : $1 !!
11704
11705 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
11706
11707         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
11708
11709         * cs-parser.jay (event_declaration): Correct to remove the semicolon
11710         when the add and remove accessors are specified. 
11711
11712 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
11713
11714         * cs-parser.jay (IndexerDeclaration): New helper class to hold
11715         information about indexer_declarator.
11716         (indexer_declarator): Implement actions.
11717         (parsing_indexer): New local boolean used to keep track of whether
11718         we are parsing indexers or properties. This is necessary because 
11719         implicit_parameters come into picture even for the get accessor in the 
11720         case of an indexer.
11721         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
11722
11723         * class.cs (Indexer): New class for indexer declarations.
11724         (TypeContainer::AddIndexer): New method to add an indexer to a type.
11725         (TypeContainer::indexers): New member to hold list of indexers for the
11726         type.
11727
11728 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
11729
11730         * cs-parser.jay (add_accessor_declaration): Implement action.
11731         (remove_accessor_declaration): Implement action.
11732         (event_accessors_declaration): Implement
11733         (variable_declarators): swap statements for first rule - trivial.
11734
11735         * class.cs (Event): New class to hold information about event
11736         declarations.
11737         (TypeContainer::AddEvent): New method to add an event to a type
11738         (TypeContainer::events): New member to hold list of events.
11739
11740         * cs-parser.jay (event_declaration): Implement actions.
11741
11742 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
11743
11744         * cs-parser.jay (dim_separators): Implement. Make it a string
11745         concatenating all the commas together, just as they appear.
11746         (opt_dim_separators): Modify accordingly
11747         (rank_specifiers): Update accordingly. Basically do the same
11748         thing - instead, collect the brackets here.
11749         (opt_rank_sepcifiers): Modify accordingly.
11750         (array_type): Modify to actually return the complete type string
11751         instead of ignoring the rank_specifiers.
11752         (expression_list): Implement to collect the expressions
11753         (variable_initializer): Implement. We make it a list of expressions
11754         essentially so that we can handle the array_initializer case neatly too.
11755         (variable_initializer_list): Implement.
11756         (array_initializer): Make it a list of variable_initializers
11757         (opt_array_initializer): Modify accordingly.
11758
11759         * expression.cs (New::NType): Add enumeration to help us
11760         keep track of whether we have an object/delegate creation
11761         or an array creation.
11762         (New:NewType, New::Rank, New::Indices, New::Initializers): New
11763         members to hold data about array creation.
11764         (New:New): Modify to update NewType
11765         (New:New): New Overloaded contructor for the array creation
11766         case.
11767
11768         * cs-parser.jay (array_creation_expression): Implement to call
11769         the overloaded New constructor.
11770         
11771 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
11772
11773         * class.cs (TypeContainer::Constructors): Return member
11774         constructors instead of returning null.
11775
11776 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
11777
11778         * typemanager.cs (InitCoreTypes): Initialize the various core
11779         types after we have populated the type manager with the user
11780         defined types (this distinction will be important later while
11781         compiling corlib.dll)
11782
11783         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
11784         on Expression Classification.  Now all expressions have a method
11785         `Resolve' and a method `Emit'.
11786
11787         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
11788         generation from working.     Also add some temporary debugging
11789         code. 
11790         
11791 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
11792
11793         * codegen.cs: Lots of code generation pieces.  This is only the
11794         beginning, will continue tomorrow with more touches of polish.  We
11795         handle the fundamentals of if, while, do, for, return.  Others are
11796         trickier and I need to start working on invocations soon.
11797         
11798         * gen-treedump.cs: Bug fix, use s.Increment here instead of
11799         s.InitStatement. 
11800
11801         * codegen.cs (EmitContext): New struct, used during code
11802         emission to keep a context.   Most of the code generation will be
11803         here. 
11804
11805         * cs-parser.jay: Add embedded blocks to the list of statements of
11806         this block.  So code generation proceeds in a top down fashion.
11807
11808 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
11809
11810         * statement.cs: Add support for multiple child blocks.
11811
11812 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
11813
11814         * codegen.cs (EmitCode): New function, will emit the code for a
11815         Block of code given a TypeContainer and its ILGenerator. 
11816
11817         * statement.cs (Block): Standard public readonly optimization.
11818         (Block::Block constructors): Link children. 
11819         (Block::Child): Child Linker.
11820         (Block::EmitVariables): Emits IL variable declarations.
11821
11822         * class.cs: Drop support for MethodGroups here, delay until
11823         Semantic Analysis.
11824         (Method::): Applied the same simplification that I did before, and
11825         move from Properties to public readonly fields.
11826         (Method::ParameterTypes): Returns the parameter types for the
11827         function, and implements a cache that will be useful later when I
11828         do error checking and the semantic analysis on the methods is
11829         performed.
11830         (Constructor::GetCallingConvention): Renamed from CallingConvetion
11831         and made a method, optional argument tells whether this is a class
11832         or a structure to apply the `has-this' bit.
11833         (Method::GetCallingConvention): Implement, returns the calling
11834         convention. 
11835         (Method::Define): Defines the type, a second pass is performed
11836         later to populate the methods.
11837
11838         (Constructor::ParameterTypes): implement a cache similar to the
11839         one on Method::ParameterTypes, useful later when we do semantic
11840         analysis. 
11841
11842         (TypeContainer::EmitMethod):  New method.  Emits methods.
11843
11844         * expression.cs: Removed MethodGroup class from here.
11845         
11846         * parameter.cs (Parameters::GetCallingConvention): new method.
11847
11848 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
11849
11850         * class.cs (TypeContainer::Populate): Drop RootContext from the
11851         argument. 
11852
11853         (Constructor::CallingConvention): Returns the calling convention.
11854         (Constructor::ParameterTypes): Returns the constructor parameter
11855         types. 
11856         
11857         (TypeContainer::AddConstructor): Keep track of default constructor
11858         and the default static constructor.
11859
11860         (Constructor::) Another class that starts using `public readonly'
11861         instead of properties. 
11862
11863         (Constructor::IsDefault): Whether this is a default constructor. 
11864
11865         (Field::) use readonly public fields instead of properties also.
11866
11867         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
11868         track of static constructors;  If none is used, turn on
11869         BeforeFieldInit in the TypeAttributes. 
11870
11871         * cs-parser.jay (opt_argument_list): now the return can be null
11872         for the cases where there are no arguments. 
11873
11874         (constructor_declarator): If there is no implicit `base' or
11875         `this', then invoke the default parent constructor. 
11876         
11877         * modifiers.cs (MethodAttr): New static function maps a set of
11878         modifiers flags into a MethodAttributes enum
11879         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
11880         MethodAttr, TypeAttr to represent the various mappings where the
11881         modifiers are used.
11882         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
11883
11884 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
11885
11886         * parameter.cs (GetParameterInfo): Fix bug where there would be no
11887         method arguments.
11888
11889         * interface.cs (PopulateIndexer): Implemented the code generator
11890         for interface indexers.
11891
11892 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
11893
11894         * interface.cs (InterfaceMemberBase): Now we track the new status
11895         here.  
11896
11897         (PopulateProperty): Implement property population.  Woohoo!  Got
11898         Methods and Properties going today. 
11899
11900         Removed all the properties for interfaces, and replaced them with
11901         `public readonly' fields. 
11902
11903 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
11904
11905         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
11906         initialize their hashtables/arraylists only when they are needed
11907         instead of doing this always.
11908
11909         * parameter.cs: Handle refs and out parameters.
11910
11911         * cs-parser.jay: Use an ArrayList to construct the arguments
11912         instead of the ParameterCollection, and then cast that to a
11913         Parameter[] array.
11914
11915         * parameter.cs: Drop the use of ParameterCollection and use
11916         instead arrays of Parameters.
11917
11918         (GetParameterInfo): Use the Type, not the Name when resolving
11919         types. 
11920
11921 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
11922
11923         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
11924         and instead use public readonly fields.
11925
11926         * class.cs: Put back walking code for type containers.
11927
11928 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
11929
11930         * class.cs (MakeConstant): Code to define constants.
11931
11932         * rootcontext.cs (LookupType): New function.  Used to locate types 
11933
11934         
11935 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
11936
11937         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
11938         this System.Reflection code is.  Kudos to Microsoft
11939         
11940         * typemanager.cs: Implement a type cache and avoid loading all
11941         types at boot time.  Wrap in LookupType the internals.  This made
11942         the compiler so much faster.  Wow.  I rule!
11943         
11944         * driver.cs: Make sure we always load mscorlib first (for
11945         debugging purposes, nothing really important).
11946
11947         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
11948         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
11949
11950         * rootcontext.cs: Lookup types on their namespace;  Lookup types
11951         on namespaces that have been imported using the `using' keyword.
11952
11953         * class.cs (TypeContainer::TypeAttr): Virtualize.
11954         (Class::TypeAttr): Return attributes suitable for this bad boy.
11955         (Struct::TypeAttr): ditto.
11956         Handle nested classes.
11957         (TypeContainer::) Remove all the type visiting code, it is now
11958         replaced with the rootcontext.cs code
11959
11960         * rootcontext.cs (GetClassBases): Added support for structs. 
11961
11962 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
11963
11964         * interface.cs, statement.cs, class.cs, parameter.cs,
11965         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
11966         Drop use of TypeRefs, and use strings instead.
11967
11968 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
11969
11970         * rootcontext.cs: 
11971
11972         * class.cs (Struct::Struct): set the SEALED flags after
11973         checking the modifiers.
11974         (TypeContainer::TypeAttr): new property, returns the
11975         TypeAttributes for a class.  
11976
11977         * cs-parser.jay (type_list): Oops, list production was creating a
11978         new list of base types.
11979
11980         * rootcontext.cs (StdLib): New property.
11981         (GetInterfaceTypeByName): returns an interface by type name, and
11982         encapsulates error handling here.
11983         (GetInterfaces): simplified.
11984         (ResolveTree): Encapsulated all the tree resolution here.
11985         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
11986         types. 
11987         
11988         * driver.cs: Add support for --nostdlib, to avoid loading the
11989         default assemblies.
11990         (Main): Do not put tree resolution here. 
11991
11992         * rootcontext.cs: Beginning of the class resolution.
11993
11994 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
11995
11996         * rootcontext.cs: Provide better error reporting. 
11997
11998         * cs-parser.jay (interface_base): set our $$ to be interfaces.
11999
12000         * rootcontext.cs (CreateInterface): Handle the case where there
12001         are no parent interfaces.
12002         
12003         (CloseTypes): Routine to flush types at the end.
12004         (CreateInterface): Track types.
12005         (GetInterfaces): Returns an array of Types from the list of
12006         defined interfaces.
12007
12008         * typemanager.c (AddUserType): Mechanism to track user types (puts
12009         the type on the global type hash, and allows us to close it at the
12010         end). 
12011         
12012 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
12013
12014         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
12015         RecordInterface instead.
12016
12017         * cs-parser.jay: Updated to reflect changes above.
12018
12019         * decl.cs (Definition): Keep track of the TypeBuilder type that
12020         represents this type here.  Not sure we will use it in the long
12021         run, but wont hurt for now.
12022
12023         * driver.cs: Smaller changes to accomodate the new code.
12024
12025         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
12026         when done. 
12027
12028         * rootcontext.cs (CreateInterface):  New method, used to create
12029         the System.TypeBuilder type for interfaces.
12030         (ResolveInterfaces): new entry point to resolve the interface
12031         hierarchy. 
12032         (CodeGen): Property, used to keep track of the code generator.
12033
12034 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
12035
12036         * cs-parser.jay: Add a second production for delegate_declaration
12037         with `VOID'.
12038
12039         (enum_body): Put an opt_comma here instead of putting it on
12040         enum_body or enum_member_declarations so we can handle trailing
12041         commas on enumeration members.  Gets rid of a shift/reduce.
12042         
12043         (type_list): Need a COMMA in the middle.
12044
12045         (indexer_declaration): Tell tokenizer to recognize get/set
12046
12047         * Remove old targets.
12048
12049         * Re-add the parser target.
12050
12051 2001-07-13  Simon Cozens <simon@simon-cozens.org>
12052
12053         * cs-parser.jay: Add precendence rules for a number of operators
12054         ot reduce the number of shift/reduce conflicts in the grammar.
12055         
12056 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
12057
12058         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
12059         and put it here.
12060
12061         Get rid of old crufty code.
12062
12063         * rootcontext.cs: Use this to keep track of the parsed
12064         representation and the defined types available to the program. 
12065
12066         * gen-treedump.cs: adjust for new convention.
12067
12068         * type.cs: Split out the type manager, and the assembly builder
12069         from here. 
12070
12071         * typemanager.cs: the type manager will live here now.
12072
12073         * cil-codegen.cs: And the code generator here. 
12074
12075 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
12076
12077         * makefile: Fixed up for easy making.
12078
12079 2001-07-13  Simon Cozens <simon@simon-cozens.org>
12080
12081         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
12082         the 
12083
12084         (unary_expression): Expand pre_increment_expression and
12085         post_decrement_expression to reduce a shift/reduce.
12086
12087 2001-07-11  Simon Cozens
12088
12089         * cs-tokenizer.cs: Hex numbers should begin with a 0.
12090
12091         Improve allow_keyword_as_indent name.
12092
12093 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
12094
12095         * Adjustments for Beta2. 
12096
12097 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
12098
12099         * decl.cs: Added `Define' abstract method.
12100         (InTransit): new property, used to catch recursive definitions. 
12101
12102         * interface.cs: Implement `Define'. 
12103
12104         * modifiers.cs: Map Modifiers.constants to
12105         System.Reflection.TypeAttribute flags.
12106
12107         * class.cs: Keep track of types and user-defined types.
12108         (BuilderInit): New method for creating an assembly
12109         (ResolveType): New function to launch the resolution process, only
12110         used by interfaces for now.
12111
12112         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
12113         that are inserted into the name space. 
12114
12115 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
12116
12117         * ARGH.  I have screwed up my tree so many times due to the use of
12118         rsync rather than using CVS.  Going to fix this at once. 
12119
12120         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
12121         load types.
12122
12123 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
12124
12125         * Experiment successful: Use System.Type rather that our own
12126         version of Type.  
12127
12128 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
12129
12130         * cs-parser.jay: Removed nsAliases from here.
12131
12132         Use new namespaces, handle `using XXX;' 
12133
12134         * namespace.cs: Reimplemented namespace handling, use a recursive
12135         definition of the class.  Now we can keep track of using clauses
12136         and catch invalid using clauses.
12137
12138 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
12139
12140         * gen-treedump.cs: Adapted for all the renaming.
12141
12142         * expression.cs (Expression): this class now has a Type property
12143         which returns an expression Type.
12144
12145         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
12146         `Type', as this has a different meaning now in the base
12147
12148 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
12149
12150         * interface.cs, class.cs: Removed from all the sources the
12151         references to signature computation, as we can not do method
12152         signature computation during the parsing time, as we are not
12153         trying to solve at that point distinguishing:
12154
12155         class X {
12156                 void a (Blah x) {}
12157                 void a (NS.Blah x) {}
12158         }
12159
12160         Which depending on the context might be valid or not, as we do not
12161         know if Blah is the same thing as NS.Blah at that point.
12162
12163         * Redid everything so the code uses TypeRefs now instead of
12164         Types.  TypeRefs are just temporary type placeholders, that need
12165         to be resolved.  They initially have a pointer to a string and the
12166         current scope in which they are used.  This is used later by the
12167         compiler to resolve the reference to an actual Type. 
12168
12169         * DeclSpace is no longer a CIR.Type, and neither are
12170         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
12171         are all DeclSpaces, but no Types. 
12172
12173         * type.cs (TypeRefManager): This implements the TypeRef manager,
12174         which keeps track of all the types that need to be resolved after
12175         the parsing has finished. 
12176
12177 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
12178
12179         * ARGH.  We are going to have to store `foreach' as a class rather
12180         than resolving it, as we need to verify error 1579 after name
12181         resolution.   *OR* we could keep a flag that says `This request to
12182         IEnumerator comes from a foreach statement' which we can then use
12183         to generate the error.
12184
12185 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
12186
12187         * class.cs (TypeContainer.AddMethod): we now add methods to the
12188         MethodGroup instead of the method hashtable.  
12189
12190         * expression.cs: Add MethodGroup abstraction, which gets us one
12191         step closer to the specification in the way we handle method
12192         declarations.  
12193
12194         * cs-parser.jay (primary_expression): qualified_identifier now
12195         tried to match up an identifier to a local variable reference or
12196         to a parameter reference.
12197
12198         current_local_parameters is now a parser global variable that
12199         points to the current parameters for the block, used during name
12200         lookup.
12201
12202         (property_declaration): Now creates an implicit `value' argument to
12203         the set accessor.
12204
12205 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
12206
12207         * parameter.cs: Do not use `param' arguments as part of the
12208         signature, per the spec.
12209
12210 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
12211
12212         * decl.cs: Base class for classes, structs and interfaces.  This
12213         is the "Declaration Space" 
12214
12215         * cs-parser.jay: Use CheckDef for checking declaration errors
12216         instead of having one on each function.
12217
12218         * class.cs: Factor out some code for handling error handling in
12219         accordance to the "Declarations" section in the "Basic Concepts"
12220         chapter in the ECMA C# spec.
12221
12222         * interface.cs: Make all interface member classes derive from
12223         InterfaceMemberBase.
12224
12225 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
12226
12227         * Many things: all interfaces are parsed and generated in
12228         gen-treedump.  Support for member variables, constructors,
12229         destructors, properties, constants is there.
12230
12231         Beginning of the IL backend, but very little done, just there for
12232         testing purposes. 
12233
12234 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
12235
12236         * cs-parser.jay: Fix labeled statement.
12237
12238         * cs-tokenizer.cs (escape): Escape " and ' always.
12239         ref_line, ref_name: keep track of the line/filename as instructed
12240         by #line by the compiler.
12241         Parse #line.
12242
12243 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
12244
12245         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
12246         to match the values in System.CodeDOM.
12247
12248         Divid renamed to Divide.
12249
12250         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
12251         statements. 
12252         (Statements.set): remove.
12253
12254         * System.CodeDOM/CodeCatchClause.cs: always have a valid
12255         statements. 
12256
12257         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
12258         falseStatements always have valid values. 
12259
12260         * cs-parser.jay: Use System.CodeDOM now.
12261