fix typo
[mono.git] / mcs / mcs / ChangeLog
1 2003-10-20  Nick Drochak <ndrochak@gol.com>
2
3         * ecore.cs: Fix typo and build.  Needed another right paren.
4
5 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
6
7         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8         `internal' case regular and protected, but not allowing protected
9         to be evaluated later.  Bug 49840
10
11 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12
13         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14         to kb.Nlast, and not the kb.nFirst to isolate the switch
15         statement.
16
17         Extract the underlying type, so enumerations of long/ulong are
18         treated like long/ulong.
19
20 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
21
22         * expression.cs (New): Overload the meaning of RequestedType to
23         track the possible creation of the NewDelegate type, since
24         DoResolve is invoked more than once for new constructors on field
25         initialization.
26
27         See bugs: #48800 and #37014
28
29         * cs-parser.jay (declare_local_constants): Take an arraylist
30         instead of a single constant.
31
32         (local_constant_declaration): It should take a
33         constant_declarators, not a constant_declarator.  Fixes 49487
34
35         * convert.cs: Fix error report.
36
37 2003-10-13 Jackson Harper <jackson@ximian.com>
38
39         * typemanager.cs (TypeToCoreType): Add float and double this fixes
40         bug #49611
41         
42 2003-10-09  Martin Baulig  <martin@ximian.com>
43
44         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
45         to the .ctor.
46         (MethodCore.DoDefineParameters): Removed the TypeContainer
47         argument; use the DeclSpace which was passed to the .ctor instead.
48         (MethodCore.CheckParameter): Take a DeclSpace instead of a
49         TypeContainer; we only need a DeclSpace here.
50
51 2003-10-09  Martin Baulig  <martin@ximian.com>
52
53         * class.cs (MethodData): Added additional `DeclSpace ds' argument
54         to the .ctor.
55         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
56         EmitContext's .ctor.    
57
58 2003-10-09  Martin Baulig  <martin@ximian.com>
59
60         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
61         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
62         AsAccessible(), moved them as well.
63
64         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
65
66 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
67
68         * cs-parser.jay : Renamed yyName to yyNames related to jay.
69
70 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
71
72         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
73         generation for >=, as spotted by Paolo, bug 48679.  
74         Patch from David Waite.
75
76         * cs-tokenizer.cs: Add handling for #pragma.
77
78         * cs-parser.jay: Allow for both yield and yield return in the
79         syntax.  The anti-cobolization of C# fight will go on!
80
81         * class.cs (TypeBuilder.DefineType): Catch error condition here
82         (Parent.DefineType erroring out and returning null).
83
84         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
85         coping with enumerations variables, we were mistakenly processing
86         them as a regular value type instead of built-in types.  Fixes the
87         bug #48063
88
89         * typemanager.cs (IsBuiltinOrEnum): New method.
90
91 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
92
93         * cs-parser.jay: Upgrade: yield now needs the return clause.
94
95 2003-09-19  Martin Baulig  <martin@ximian.com>
96
97         * decl.cs (MemberCache.SetupCacheForInterface): Take a
98         `MemberCache parent' argument.  Normally, an interface doesn't
99         have a parent type except System.Object, but we use this in gmcs
100         for generic type parameters.
101
102 2003-09-18  Martin Baulig  <martin@ximian.com>
103
104         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
105         on `type.IsInterface'; don't check whether the type has a parent
106         to determine whether it's an interface.
107
108 2003-09-15  Martin Baulig  <martin@ximian.com>
109
110         * class.cs (TypeContainer.DefineType): Added an error flag to
111         avoid reporting duplicate CS0146's ("class definition is
112         circular.").
113
114         * driver.cs (Driver.MainDriver): Abort if
115         RootContext.ResolveTree() reported any errors.
116
117 2003-09-07  Martin Baulig  <martin@ximian.com>
118
119         * report.cs (Error, Warning): Added overloaded versions which take
120         a `params object[] args' and call String.Format().
121
122 2003-09-07  Martin Baulig  <martin@ximian.com>
123
124         * decl.cs (DeclSpace..ctor): Don't call
125         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
126         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
127         (DeclSpace.RecordDecl): New method.
128
129         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
130
131 2003-09-02  Ravi Pratap  <ravi@ximian.com>
132
133         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
134         value attributes to be applied to ParameterBuilders.
135
136         * class.cs (MethodCore.LabelParameters): Make static and more
137         generic so that it can be used from other places - like interface
138         methods, for instance.
139
140         * interface.cs (Interface.Emit): Call LabelParameters before
141         emitting attributes on the InterfaceMethod.
142
143 2003-08-26  Martin Baulig  <martin@ximian.com>
144
145         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
146         resolving aliases; fixes #47927.
147
148 2003-08-26  Martin Baulig  <martin@ximian.com>
149
150         * statement.cs (Using.DoResolve): This is internally emitting a
151         try/finally clause, so we need to set ec.NeedExplicitReturn if we
152         do not always return.  Fixes #47681.
153
154 2003-08-26  Martin Baulig  <martin@ximian.com>
155
156         * decl.cs (MemberCore): Moved WarningNotHiding(),
157         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
158         into MemberBase.
159         (AdditionResult): Make this nested in DeclSpace.
160         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
161         argument; call NamespaceEntry.Define() unless we're nested in a
162         class or struct.
163
164         * namespace.cs (Namespace.DefineName): New public function.  This
165         is called from DeclSpace's .ctor to add 
166         (Namespace.Lookup): Include DeclSpaces in the lookup.
167
168         * class.cs (Operator): Derive from MemberBase, not MemberCore.
169
170         * const.cs (Const): Derive from MemberBase, not MemberCore.     
171
172 2003-08-25  Martin Baulig  <martin@ximian.com>
173
174         * convert.cs (Convert.ExplicitReferenceConversion): When
175         converting from an interface type to a class, unbox if the target
176         type is a struct type.  Fixes #47822.
177
178 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
179
180         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
181         #47854.
182
183 2003-08-22  Martin Baulig  <martin@ximian.com>
184
185         * class.cs (TypeManager.DefineType): When defining a nested type,
186         call DefineType() on our parent; fixes #47801.
187
188 2003-08-22  Martin Baulig  <martin@ximian.com>
189
190         * class.cs (MethodData.Define): While checking if a method is an
191         interface implementation, improve the test a bit more to fix #47654.
192
193 2003-08-22  Martin Baulig  <martin@ximian.com>
194
195         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
196         correctly; fixes #47722.
197
198 2003-08-22  Martin Baulig  <martin@ximian.com>
199
200         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
201         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
202
203         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
204
205 2003-08-22  Martin Baulig  <martin@ximian.com>
206
207         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
208         can only be assigned in static constructors.  Fixes #47161.
209
210 2003-08-22  Martin Baulig  <martin@ximian.com>
211
212         Rewrote and improved the flow analysis code.
213
214         * flowbranching.cs (FlowBranching): Make this class abstract.
215         (FlowBranching.CreateBranching): New static function to create a
216         new flow branching.
217         (FlowBranchingBlock, FlowBranchingException): New classes.
218         (FlowBranching.UsageVector.Type): New public readonly field.
219         (FlowBranching.UsageVector.Breaks): Removed the setter.
220         (FlowBranching.UsageVector.Returns): Removed the setter.
221         (FlowBranching.UsageVector): Added Break(), Return(),
222         NeverReachable() and Throw() methods to modify the reachability.
223         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
224         done by FlowBranching.Merge().
225         (FlowBranching.UsageVector.MergeChild): New method; merges the
226         merge result into the current vector.
227         (FlowBranching.Merge): New abstract method to merge a branching.
228
229 2003-08-12  Martin Baulig  <martin@ximian.com>
230
231         * expression.cs (Indirection.CacheTemporaries): Create the
232         LocalTemporary with the pointer type, not its element type.
233
234 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
235
236         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
237         token was a keyword or not.
238
239         Add `error' options where an IDENTIFIER was expected;  Provide
240         CheckToken and CheckIdentifierToken convenience error reporting
241         functions. 
242
243         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
244
245         * decl.cs: Rename `NamespaceEntry Namespace' public field into
246         NameSpaceEntry NameSpaceEntry.
247
248         (LookupInterfaceOrClass): Avoid creating a full qualified name
249         from namespace and name: avoid doing lookups when we know the
250         namespace is non-existant.   Use new Tree.LookupByNamespace which
251         looks up DeclSpaces based on their namespace, name pair.
252
253         * driver.cs: Provide a new `parser verbose' to display the
254         exception thrown during parsing.  This is turned off by default
255         now, so the output of a failure from mcs is more graceful.
256
257         * namespace.cs: Track all the namespaces defined in a hashtable
258         for quick lookup.
259         
260         (IsNamespace): New method
261
262 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
263
264         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
265         we know that we need to concatenate (full typename can never be
266         null). 
267
268         * class.cs: ditto.
269
270         * statement.cs: Use a bitfield;  Do not initialize to null things
271         which are done by the constructor by default.
272
273         * cs-parser.jay: bug fix, parameter was 4, not 3.
274
275         * expression.cs: Just use the property;
276
277         * statement.cs: No need for GetVariableInfo method.
278
279 2003-08-08  Martin Baulig  <martin@ximian.com>
280
281         * flowanalysis.cs (FlowReturns): This is now nested in the
282         `FlowBranching' class.
283         (MyBitVector): Moved this here from statement.cs.
284         (FlowBranching.SiblingType): New enum type.
285         (FlowBranching.CreateSibling): Added `SiblingType' argument.
286
287 2003-08-07  Martin Baulig  <martin@ximian.com>
288
289         * flowanalysis.cs (FlowBranchingType): This is now nested in the
290         `FlowBranching' class and called `BranchingType'.
291
292 2003-08-07  Martin Baulig  <martin@ximian.com>
293
294         * flowanalysis.cs: Moved all the control flow analysis code into
295         its own file.
296
297 2003-08-07  Martin Baulig  <martin@ximian.com>
298
299         * assign.cs (Assign.DoResolve): `target' must either be an
300         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
301         #37319.
302
303 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
304
305         * expression.cs (BinaryMethod): This kind of expression is created by the
306         Binary class if it determines that the operator has to be handled
307         by a method.
308
309         (BinaryDelegate): This kind of expression is created if we are
310         dealing with a + or - operator on delegates.
311
312         (Binary): remove method, argumetns, and DelegateOperator: when
313         dealing with methods, 
314         
315         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
316
317         * statement.cs (Block): use bitfields for the three extra booleans
318         we had in use.   Remove unused topblock parameter.
319
320         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
321
322         * assign.cs: Drop extra unneeded tests.
323
324 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
325
326         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
327
328         * statement.cs (Foreach): Use VariableStorage instead of
329         LocalBuilders.   
330
331         * codegen.cs (VariableStorage): New class used by clients that
332         require a variable stored: locals or fields for variables that
333         need to live across yield.
334
335         Maybe provide a convenience api for EmitThis+EmitLoad?
336
337         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
338         these bad boys.
339
340 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
341
342         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
343         RemapParameterLValue): New methods that are used to turn a
344         precomputed FieldInfo into an expression like this:
345
346                 instance.FieldInfo
347
348         The idea is to use this instead of making LocalVariableReference
349         have more than one meaning.
350
351         * cs-parser.jay: Add error production to BASE.
352
353         * ecore.cs: Deal with TypeManager.GetField returning null, which
354         is now a valid return value.
355
356         (FieldExprNoAddress): New expression for Fields whose address can
357         not be taken.
358
359         * expression.cs (LocalVariableReference): During the resolve
360         phases, create new expressions if we are in a remapping context.
361         Remove code that dealt with remapping here.
362
363         (ParameterReference): same.
364
365         (ProxyInstance): New expression, like the `This' expression, but
366         it is born fully resolved.  We know what we are doing, so remove
367         the errors that are targeted to user-provided uses of `this'.
368
369         * statement.cs (Foreach): our variable is now stored as an
370         Expression;  During resolution, follow the protocol, dont just
371         assume it will return this.
372         
373 2003-08-06  Martin Baulig  <martin@ximian.com>
374
375         * support.cs (SeekableStreamReader.cs): New public class.
376
377         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
378         SeekableStreamReader instead of the normal StreamReader.
379
380 2003-08-04  Martin Baulig  <martin@ximian.com>
381
382         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
383         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
384         deambiguate casts and delegate invocations.
385         (parenthesized_expression): Use the new tokens to ensure this is
386         not a cast of method invocation.
387
388         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
389         when reading a `)' and Deambiguate_CloseParens () was previously
390         called.
391
392         * expression.cs (ParenthesizedExpression): New class.  This is
393         just used for the CS0075 test.
394         (Binary.DoResolve): Check for CS0075.   
395
396 2003-07-29  Ravi Pratap  <ravi@ximian.com>
397
398         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
399         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
400         reference comparison.
401
402         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
403         examine the ReturnType for equality - this is necessary in the
404         cases of implicit and explicit operators whose signature also
405         includes the return type.
406
407 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
408
409         * namespace.cs: Cache the result of the namespace computation,
410         instead of computing it every time.
411
412 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
413
414         * decl.cs: Use a global arraylist that we reuse over invocations
415         to avoid excesive memory consumption.  Reduces memory usage on an
416         mcs compile by one meg (45 average).
417
418         * typemanager.cs (LookupTypeReflection): In .NET pointers are
419         private, work around that.
420
421 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
422
423         * literal.cs (IntLiteral): Define Zero and One static literals. 
424
425         * cs-parser.jay (integer_literal): use static literals to reduce
426         memory usage for the most used literals (0, 1 and -1).  211kb
427         reduced in memory usage.
428
429         Replace all calls to `new ArrayList' with `new
430         ArrayList(4)' which is a good average number for most allocations,
431         and also requires only 16 bytes of memory for its buffer by
432         default. 
433
434         This reduced MCS memory usage in seven megabytes for the RSS after
435         bootstrapping.
436
437 2003-07-28  Ravi Pratap  <ravi@ximian.com>
438
439         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
440         handle params methods the correct way by forming only one
441         applicable set with params and normal methods in them. Earlier we
442         were looking at params methods only if we found no normal methods
443         which was not the correct thing to do.
444
445         (Invocation.BetterFunction): Take separate arguments indicating
446         when candidate and the best method are params methods in their
447         expanded form.
448
449         This fixes bugs #43367 and #46199.
450
451         * attribute.cs: Documentation updates.
452
453         (CheckAttribute): Rename to CheckAttributeTarget.
454         (GetValidPlaces): Rename to GetValidTargets.
455
456         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
457         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
458
459         Fixes bug #44468.
460
461 2003-07-28  Martin Baulig  <martin@ximian.com>
462
463         * class.cs (TypeContainer.DefineMembers): Use the base type's full
464         name when looking up the base class of a nested class.  Fixes #46977.
465
466 2003-07-26  Martin Baulig  <martin@ximian.com>
467
468         * expression.cs (Indexers.Indexer): New nested struct; contains
469         getter, setter and the indexer's type.
470         (Indexers.Properties): This is now an ArrayList of
471         Indexers.Indexer's.
472         (IndexerAccess.DoResolveLValue): Correctly set the type if the
473         indexer doesn't have any getters.
474
475         * assign.cs (Assign.DoResolve): Also do the implicit conversions
476         for embedded property and indexer assignments.
477
478 2003-07-26  Martin Baulig  <martin@ximian.com>
479
480         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
481         preprocessor directive is not the first non-whitespace character
482         on a line.
483
484 2003-07-26  Martin Baulig  <martin@ximian.com>
485
486         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
487         namespace parsing, follow the spec more closely.
488
489         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
490         NamespaceEntry.Lookup().
491
492 2003-07-25  Martin Baulig  <martin@ximian.com>
493
494         * MethodCore.cs (OverridesSomething): New public field; it's set
495         from TypeContainer.DefineMembers if this method overrides
496         something (which doesn't need to be a method).  Fix #39462.
497
498 2003-07-25  Ravi Pratap  <ravi@ximian.com>
499
500         * typemanager.cs (GetMembers): Ensure that the list of members is
501         reversed. This keeps things in sync.
502
503         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
504         find an AttributeUsage attribute.
505
506         * expression.cs (Invocation.OverloadResolve): Perform the check
507         which disallows Invoke to be directly called on a Delegate.
508
509         (Error_InvokeOnDelegate): Report error cs1533.
510         
511 2003-07-25  Martin Baulig  <martin@ximian.com>
512
513         * expression.cs (Indexers.GetIndexersForType): Only look in the
514         interface hierarchy if the requested type is already an
515         interface.  Fixes #46788 while keeping #46502 fixed.
516
517 2003-07-25  Martin Baulig  <martin@ximian.com>
518
519         * class.cs (TypeContainer.DefineMembers): Check whether all
520         readonly fields have been assigned and report warning CS0649 if
521         not.
522
523         * statement.cs (LocalInfo.IsFixed): Always return true if this is
524         a valuetype.
525
526 2003-07-24  Ravi Pratap  <ravi@ximian.com>
527
528         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
529         returned from GetMethods to make things consistent with the
530         assumptions MCS makes about ordering of methods.
531
532         This should comprehensively fix bug #45127 and it does :-)
533
534         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
535         ordering is actually reverse.
536
537         * Clean up some debug messages I left lying around.
538
539         * interface.cs (Populate*): Get rid of code which emits attributes
540         since the stage in which we emit attributes is the 'Emit' stage,
541         not the define stage.
542
543         (Emit): Move attribute emission for interface members here.
544         
545 2003-07-22  Ravi Pratap  <ravi@ximian.com>
546
547         * expression.cs (Invocation.OverloadResolve): Follow the spec more
548         closely: we eliminate methods in base types when we have an
549         applicable method in a top-level type.
550
551         Please see section 14.5.5.1 for an exact description of what goes
552         on. 
553
554         This fixes bug #45127 and a host of other related to corlib compilation.
555
556         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
557         array is the method corresponding to the top-level type (this is
558         because of the changes made to icall.c) so we change this
559         accordingly.
560
561         (MethodGroupExpr.Name): This too.
562
563         * typemanager.cs (GetElementType): New method which does the right
564         thing when compiling corlib. 
565
566         * everywhere: Make use of the above in the relevant places.
567
568 2003-07-22  Martin Baulig  <martin@ximian.com>
569
570         * cs-parser.jay (invocation_expression): Moved
571         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
572         `cast_expression', but create a InvocationOrCast which later
573         resolves to either an Invocation or a Cast.
574
575         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
576         method; call this before EmitStatement() to make sure that this
577         expression can be used as a statement.
578
579         * expression.cs (InvocationOrCast): New class; resolves to either
580         an Invocation or a Cast.
581
582         * statement.cs (StatementExpression): Call ResolveStatement() on
583         the ExpressionStatement before emitting it.
584
585 2003-07-21  Martin Baulig  <martin@ximian.com>
586
587         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
588         `ref' and `out' attributes match; fixes #46220.
589         (MemberAccess.ResolveMemberAccess): You can't reference a type
590         through an expression; fixes #33180.
591         (Indexers.GetIndexersForType): Don't return the indexers from
592         interfaces the class implements; fixes #46502.
593
594 2003-07-21  Martin Baulig  <martin@ximian.com>
595
596         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
597         CS0661 checks; fixes bug #30442.
598
599 2003-07-21  Martin Baulig  <martin@ximian.com>
600
601         * decl.cs (AdditionResult): Added `Error'.
602
603         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
604
605         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
606         makes cs0031.cs actually work.
607
608 2003-07-20  Martin Baulig  <martin@ximian.com>
609
610         * namespace.cs: Fixed that bug which caused a crash when compiling
611         the debugger's GUI.
612
613 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
614
615         * typemanager.cs (LookupTypeReflection): Never expose types which
616         are NotPublic, NestedPrivate, NestedAssembly, or
617         NestedFamANDAssem.  We used to return these, and later do a check
618         that would report a meaningful error, but the problem is that we
619         would not get the real match, if there was a name override.
620
621 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
622
623         * namespace.cs (Namespace, Name): Do not compute the namespace
624         name dynamically, compute it in the constructor.  This reduced
625         memory usage by 1697 KB.
626
627         * driver.cs: Use --pause to pause at the end.
628
629 2003-07-17  Peter Williams  <peter@newton.cx>
630
631         * Makefile: Change the name of the test target so that it doesn't
632         conflict with the recursive test target.
633
634 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
635
636         * expression.cs (LocalVariableReference.Emit, EmitAssign,
637         AddressOf): Do not use EmitThis, that was wrong, use the actual
638         this pointer.
639
640 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
641
642         * class.cs (MethodData.Define): While checking if a method is an
643         interface implementation, improve the test: If we are not public
644         (use new test here: use the computed MethodAttributes directly,
645         instead of the parsed modifier flags) check if the `implementing'
646         method comes from an interface or not.
647
648         * pending.cs (VerifyPendingMethods): Slightly better error
649         message.
650
651         * makefile: add test target that does the mcs bootstrap.
652
653 2003-07-16  Ravi Pratap  <ravi@ximian.com>
654
655         * interface.cs (Define): Do nothing here since there are no
656         members to populate etc. Move the attribute emission out of here
657         since this was just totally the wrong place to put it. Attribute
658         application happens during the 'Emit' phase, not in the 'Define'
659         phase.
660
661         (Emit): Add this method and move the attribute emission here
662
663         * rootcontext.cs (EmitCode): Call the Emit method on interface
664         types too.
665
666 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
667
668         * expression.cs (OverloadResolve): Report error only if Location
669         is not 'Null' which means that there was a probe going on.
670
671 2003-07-14  Martin Baulig  <martin@ximian.com>
672
673         * expression.cs (ConditionalLogicalOperator): New public class to
674         implement user defined conditional logical operators.
675         This is section 14.11.2 in the spec and bug #40505.
676
677 2003-07-14  Martin Baulig  <martin@ximian.com>
678
679         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
680
681 2003-07-14  Martin Baulig  <martin@ximian.com>
682
683         * codegen.cs (EmitContext.InFixedInitializer): New public field.
684
685         * ecore.cs (IVariable.VerifyFixed): New interface method.
686
687         * expression.cs (Unary.ResolveOperator): When resolving the `&'
688         operator, check whether the variable is actually fixed.  Fixes bug
689         #36055.  Set a variable definitely assigned when taking its
690         address as required by the spec.
691
692         * statement.cs (LocalInfo.IsFixed): New field.
693         (LocalInfo.MakePinned): Set `IsFixed' to true.
694
695 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
696
697         * attribute.cs (Attribute.Resolve): While doing a Member lookup
698         for .ctors, ensure that we only ask for members declared in the
699         attribute type (BindingFlags.DeclaredOnly).
700
701         Fixes bug #43632.
702
703         * expression.cs (Error_WrongNumArguments): Report error 1501
704         correctly the way CSC does.
705
706 2003-07-13  Martin Baulig  <martin@ximian.com>
707
708         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
709         lookup on the fully qualified name, to make things like "X.X" work
710         where "X.X" is a fully qualified type name, but we also have a
711         namespace "X" in the using list.  Fixes #41975.
712
713 2003-07-13  Martin Baulig  <martin@ximian.com>
714
715         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
716         function. If we're a CompoundAssign, we need to create an embedded
717         CompoundAssign, not an embedded Assign.
718         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
719         Fixes #45854.
720
721 2003-07-13  Martin Baulig  <martin@ximian.com>
722
723         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
724         work to fix bug #46088.
725
726 2003-07-13  Ravi Pratap <ravi@ximian.com>
727
728         * class.cs (Operator.Emit): Do not emit attributes here - it is
729         taken care of by the Method class that we delegate too. This takes
730         care of bug #45876.
731         
732 2003-07-10  Martin Baulig  <martin@ximian.com>
733
734         * expression.cs (TypeOfVoid): New class.
735         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
736
737 2003-07-10  Martin Baulig  <martin@ximian.com>
738
739         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
740         bug #35957.
741
742 2003-07-10  Martin Baulig  <martin@ximian.com>
743
744         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
745         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
746
747         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
748
749         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
750
751 2003-07-10  Martin Baulig  <martin@ximian.com>
752
753         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
754         of decimal.  Fixes #42850.
755
756         NOTE: I also fixed the created byte blob, but this doesn't work on
757         the MS runtime and csc never produces any byte blobs for decimal
758         arrays.
759
760 2003-07-10  Martin Baulig  <martin@ximian.com>
761
762         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
763         structs; fixes #32068.
764         (Block.AddChildVariableNames): Fixed #44302.
765
766 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
767
768         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
769         
770 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
771
772         * attribute.cs: And this test is onger needed.
773
774 2003-07-08  Martin Baulig  <martin@ximian.com>
775
776         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
777         inaccessible types.  Fixes #36313.
778
779         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
780
781         * namespace.cs (NamespaceEntry): Create implicit entries for all
782         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
783         implicit entries for N1.N2 and N1.
784
785 2003-07-08  Martin Baulig  <martin@ximian.com>
786
787         Rewrote the handling of namespaces to fix a lot of the issues
788         wrt. `using' aliases etc.
789
790         * namespace.cs (Namespace): Splitted this class into a
791         per-assembly `Namespace' and a per-file `NamespaceEntry'.
792
793         * typemanager.cs (TypeManager.IsNamespace): Removed.
794         (TypeManager.ComputeNamespaces): Only compute namespaces from
795         loaded assemblies here, not the namespaces from the assembly we're
796         currently compiling.
797
798 2003-07-08  Martin Baulig  <martin@ximian.com>
799
800         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
801
802 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
803
804         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
805         already fixed it.  
806
807         I thought about the memory savings here, but LookupTypeReflection
808         is used under already very constrained scenarios.  Compiling
809         corlib or mcs only exposes one hit, so it would not really reduce
810         any memory consumption.
811
812 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
813
814         * typemanager.cs: fixes bug #45889 by only adding public types from
815         other assemblies to the list of known types.
816
817 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
818
819         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
820         on the type we resolved.
821
822 2003-07-05  Martin Baulig  <martin@ximian.com>
823
824         * pending.cs (PendingImplementation.ParentImplements): Don't
825         create the proxy if the parent is abstract.
826
827         * class.cs (TypeContainer.DefineIndexers): Process explicit
828         interface implementations first.  Fixes #37714.
829
830 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
831
832         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
833         defined recursively;  but since we modify the input parameters
834         (left is set to `this' temporarily), we reset this value if the
835         left_is_explicit is false, which gives the original semantics to
836         the code.  
837
838         * literal.cs (NullPointer): new class used to represent a null
839         literal in a pointer context.
840
841         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
842         type is a pointer, use a NullPointer object instead of a
843         NullLiteral.   Closes 43687
844
845         (ExplicitConversion): Convert pointer values using
846         the conv opcode to the proper type.
847
848         * ecore.cs (New): change ValueTypeVariable property into a method,
849         that returns whether the valuetype is suitable for being used.
850
851         * expression.cs (Binary.DoNumericPromotions): Only return if we
852         the int constant was a valid uint, and we can return both left and
853         right as uints.  If not, we continue processing, to trigger the
854         type conversion.  This fixes 39018.
855
856         * statement.cs (Block.EmitMeta): During constant resolution, set
857         the CurrentBlock property on the emitcontext, so that we resolve
858         constants propertly.
859
860 2003-07-02  Martin Baulig  <martin@ximian.com>
861
862         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
863         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
864
865         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
866         than emitting it here.
867
868         * statement.cs: Fixed some more flow analysis bugs.
869
870 2003-07-02  Martin Baulig  <martin@ximian.com>
871
872         * class.cs (MethodData.Define): When implementing interface
873         methods, set Final unless we're Virtual.
874
875         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
876         check work for interface methods.
877
878 2003-07-01  Martin Baulig  <martin@ximian.com>
879
880         * ecore.cs (EmitContext.This): Replaced this property with a
881         GetThis() method which takes a Location argument.  This ensures
882         that we get the correct error location for a CS0188.
883
884 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
885
886         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
887         ImplicitStandardConversion.
888
889         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
890
891 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
892
893         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
894         optimization.
895
896 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
897
898         * class.cs (Constructor.Define): Turn off initlocals for unsafe
899         constructors.
900
901         (MethodData.Define): Turn off initlocals for unsafe methods.
902
903 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
904
905         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
906         complete;  Fixes #37521.
907
908         * delegate.cs: Use Modifiers.TypeAttr to compute the
909         TypeAttributes, instead of rolling our own.  This makes the flags
910         correct for the delegates.
911
912 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
913
914         * class.cs (Constructor.Define): Set the private flag for static
915         constructors as well.
916
917         * cs-parser.jay (statement_expression): Set the return value to
918         null, to avoid a crash when we catch an error.
919
920 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
921
922         * cs-parser.jay: Applied patch from Jackson that adds support for
923         extern and unsafe modifiers to destructor declarations.
924
925         * expression.cs: Report error 21 if the user is trying to index a
926         System.Array.
927
928         * driver.cs: Add an error message, suggested by the bug report.
929
930         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
931         if we do not have a ": this ()" constructor initializer.  Fixes 45149
932
933 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
934
935         * namespace.cs: Add some information to reduce FAQs.
936
937 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
938
939         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
940         underlying enumeration types.  Fixes #43915.
941
942         * expression.cs: Treat ushort/short as legal values to be used in
943         bitwise operations.
944
945 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
946
947         * delegate.cs: transfer custom attributes for paramenters from
948         the delegate declaration to Invoke and BeginInvoke.
949
950 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
951
952         * attribute.cs: handle custom marshalers and emit marshal info
953         for fields, too.
954
955 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
956
957         * makefile.gnu: Added anonymous.cs to the compiler sources.
958
959 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
960
961         * iterators.cs: Change the name of the proxy class to include two
962         underscores.
963
964         * cs-parser.jay: Update grammar to include anonymous methods.
965         
966         * anonymous.cs: new file.
967
968 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
969
970         * class.cs (Field.Define): Add missing test for pointers and
971         safety. 
972
973 2003-05-27  Ravi Pratap  <ravi@ximian.com>
974
975         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
976         we use the stobj opcode.
977
978         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
979         since it wasn't the correct fix. 
980
981         It still is puzzling that we are required to use stobj for IntPtr
982         which seems to be a ValueType.
983
984 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
985
986         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
987         during regular simple name resolution.   Now, the trick is that
988         instead of returning for processing the simplename, we do a
989         TypeManager.LookupType (ie, a rooted lookup as opposed to a
990         contextual lookup type).   If a match is found, return that, if
991         not, return for further composition.
992
993         This fixes long-standing 30485.
994
995         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
996         using the address to initialize an object, do an Stobj instead of
997         using the regular Stelem.
998
999         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
1000         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
1001         Because if we are a BaseIndexerAccess that value will be true.
1002         Fixes 43643.
1003
1004         * statement.cs (GotoCase.Resolve): Return after reporting an
1005         error, do not attempt to continue. 
1006
1007         * expression.cs (PointerArithmetic.Emit): If our operand is a
1008         long, convert our constants to match the operand before
1009         multiplying.  Convert to I type before adding.   Fixes 43670.
1010         
1011 2003-05-14  Ravi Pratap  <ravi@ximian.com>
1012
1013         * enum.cs (ImplicitConversionExists) : Rename to
1014         ImplicitEnumConversionExists to remove ambiguity. 
1015
1016         * ecore.cs (NullCast): New type of cast expression class which
1017         basically is very similar to EmptyCast with the difference being
1018         it still is a constant since it is used only to cast a null to
1019         something else
1020         (eg. (string) null)
1021
1022         * convert.cs (ImplicitReferenceConversion): When casting a null
1023         literal, we return a NullCast.
1024
1025         * literal.cs (NullLiteralTyped): Remove - I don't see why this
1026         should be around anymore.
1027
1028         The renaming (reported was slightly wrong). Corrections:
1029
1030         ConvertImplicitStandard -> ImplicitConversionStandard
1031         ConvertExplicitStandard -> ExplicitConversionStandard
1032
1033         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
1034         before passing them in !
1035
1036         * convert.cs (ImplicitConversionStandard): When comparing for
1037         equal expr and target types, ensure that expr is not a
1038         NullLiteral.
1039
1040         In general, we must not be checking (expr_type ==
1041         target_type) in the top level conversion methods
1042         (ImplicitConversion, ExplicitConversion etc). This checking is
1043         done in the methods that they delegate to.
1044
1045 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
1046
1047         * convert.cs: Move Error_CannotConvertType,
1048         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
1049         ImplicitNumericConversion, ImplicitConversionExists,
1050         ImplicitUserConversionExists, StandardConversionExists,
1051         FindMostEncompassedType, FindMostSpecificSource,
1052         FindMostSpecificTarget, ImplicitUserConversion,
1053         ExplicitUserConversion, GetConversionOperators,
1054         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
1055         TryImplicitIntConversion, Error_CannotConvertImplicit,
1056         ConvertImplicitRequired, ConvertNumericExplicit,
1057         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
1058         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
1059         its own file.
1060
1061         Perform the following renames:
1062         
1063         StandardConversionExists -> ImplicitStandardConversionExists
1064         ConvertImplicit -> ImplicitConversion
1065         ConvertImplicitStandard -> ImplicitStandardConversion
1066         TryImplicitIntConversion -> ImplicitIntConversion
1067         ConvertImplicitRequired -> ImplicitConversionRequired
1068         ConvertNumericExplicit -> ExplicitNumericConversion
1069         ConvertReferenceExplicit -> ExplicitReferenceConversion
1070         ConvertExplicit -> ExplicitConversion
1071         ConvertExplicitStandard -> ExplicitStandardConversion
1072
1073 2003-05-19  Martin Baulig  <martin@ximian.com>
1074
1075         * statement.cs (TypeInfo.StructInfo): Made this type protected.
1076         (TypeInfo): Added support for structs having structs as fields.
1077
1078         * ecore.cs (FieldExpr): Implement IVariable.
1079         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
1080         VariableInfo for the field.
1081
1082 2003-05-18  Martin Baulig  <martin@ximian.com>
1083
1084         * expression.cs (This.DoResolve): Report a CS0027 if we're
1085         emitting a field initializer.
1086
1087 2003-05-18  Martin Baulig  <martin@ximian.com>
1088
1089         * expression.cs (This.ResolveBase): New public function.
1090         (This.DoResolve): Check for CS0188.
1091
1092         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
1093         This.Resolve().
1094
1095         * ecore.cs (MethodGroupExpr.DoResolve): Set the
1096         `instance_expression' to null if we don't have any non-static
1097         methods.
1098
1099 2003-05-18  Martin Baulig  <martin@ximian.com>
1100
1101         Reworked the way how local variables and parameters are handled by
1102         the flow analysis code.
1103
1104         * statement.cs (TypeInfo, VariableMap): New public classes.
1105         (VariableInfo): New public class.  This is now responsible for
1106         checking whether a variable has been assigned.  It is used for
1107         parameters and local variables.
1108         (Block.EmitMeta): Take the InternalParameters as argument; compute
1109         the layout of the flow vectors here.
1110         (Block.LocalMap, Block.ParameterMap): New public properties.
1111         (FlowBranching): The .ctor doesn't get the InternalParameters
1112         anymore since Block.EmitMeta() now computes the layout of the flow
1113         vector.
1114         (MyStructInfo): This class is now known as `StructInfo' and nested
1115         in `TypeInfo'; we don't access this directly anymore.
1116
1117         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
1118         property and removed IsAssigned(), IsFieldAssigned(),
1119         SetAssigned() and SetFieldAssigned(); we now call them on the
1120         VariableInfo so we don't need to duplicate this code everywhere.
1121
1122         * expression.cs (ParameterReference): Added `Block block' argument
1123         to the .ctor.
1124         (LocalVariableReference, ParameterReference, This): The new
1125         VariableInfo class is now responsible for all the definite
1126         assignment stuff.
1127
1128         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
1129         IsParameterAssigned, SetParameterAssigned): Removed.
1130
1131 2003-05-18  Martin Baulig  <martin@ximian.com>
1132
1133         * typemanager.cs (InitCoreTypes): Try calling
1134         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
1135         the 3-args-version.  Corlib now also needs our `void_type'.
1136         (GetMethod): Added overloaded version which takes an optional
1137         `bool report_errors' to allow lookups of optional methods.
1138
1139 2003-05-12  Martin Baulig  <martin@ximian.com>
1140
1141         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
1142         only used for locals and not for parameters.
1143
1144 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
1145
1146         * support.cs (InternalParameters.ParameterType): Return the
1147         ExternalType of the parameter.
1148
1149         * parameter.cs (Parameter.ExternalType): drop the two arguments,
1150         they were unused.
1151
1152 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
1153
1154         * class.cs (MethodData.Define): Do not set the `newslot' on
1155         interface members, if they are also flagged as "override".
1156
1157         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
1158         better code for ++i and i++.  This only works for static fields
1159         and local variables.
1160
1161         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
1162         want to pull the DeclSpace out of the builder_to_declspace instead
1163         of the TypeBuilder (like in TypeContainer.FindMembers).
1164
1165         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
1166         instead of LookupTypeContainer.  Fixes the crash on .NET for
1167         looking up interface members.
1168
1169         * const.cs: Create our own emit context during the Definition
1170         stage, so that constants are evaluated in the proper context, when
1171         a recursive definition happens.
1172
1173 2003-05-11  Martin Baulig  <martin@ximian.com>
1174
1175         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
1176         new block for a switch section.
1177         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
1178         the adding/lookup in the switch block.  Fixes #39828.
1179
1180 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
1181
1182         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
1183         functionality: I needed to convert the data after I had performed
1184         the add/sub operation into the operands type size.
1185
1186         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
1187         pass the type for the box operation, otherwise the resulting
1188         object would have been of type object.
1189
1190         (BoxedCast): Add constructor to specify the type to box as.
1191
1192 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
1193
1194         * iterators.cs: I was reusing the `count' variable inadvertently,
1195         take steps to not allow this to happen.
1196
1197 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
1198
1199         * attribute.cs (Attribute.Resolve): Params attributes are encoded
1200         by creating an array at the point where the params starts and
1201         putting all those arguments there, then adjusting the size of the
1202         array.
1203
1204 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
1205
1206         * expression.cs (New.AddressOf): Implement interface
1207         IMemoryLocation.  This is used when the `new' operator is used in
1208         the context of an invocation to a method on a value type.
1209
1210         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
1211         example. 
1212
1213         * namespace.cs: Also check the using aliases here.
1214
1215         * driver.cs: Move the test for using validity after the types have
1216         been entered, so we do a single pass that also includes the using
1217         aliases. 
1218
1219         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
1220         in the regular case.   CreateSiblingForFinally is doing extra
1221         error checking.
1222
1223         * attribute.cs (GetAttributeArgumentExpression): Store the result
1224         on an out value, and use the return value to indicate failure
1225         instead of using null (which is a valid return for Constant.GetValue).
1226
1227         * statement.cs: Perform the analysis flow for the increment
1228         portion after the statement, because this will be the real flow of
1229         execution.  Fixes #42385
1230
1231         * codegen.cs (EmitContext.EmitArgument,
1232         EmitContext.EmitStoreArgument): New helper functions when the
1233         RemapToProxy flag is set.
1234
1235         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
1236         function.
1237
1238         Add support for remapping parameters. 
1239
1240         * iterators.cs: Propagate parameter values;  Store parameter
1241         values in the proxy classes.
1242         
1243 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
1244
1245         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
1246         need a proxy reference;  I do not know what I was thinking
1247
1248         * cs-parser.jay (constructor_initializer): catch another error,
1249         and display nice message.
1250         
1251         (field_declaration): catch void field declaration
1252         to flag a better error. 
1253
1254         * class.cs (MemberBase.CheckBase): Report an error instead of a
1255         warning if a new protected member is declared in a struct. 
1256         (Field.Define): catch the error of readonly/volatile.
1257
1258         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
1259
1260         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
1261         volatile variable is taken
1262
1263 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
1264
1265         * statement.cs (Fixed.Resolve): Report an error if we are not in
1266         an unsafe context.
1267
1268 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
1269
1270         * typemanager.cs: reuse the code that handles type clashes for
1271         delegates and enumerations.
1272
1273         * class.cs (Report28): Always report.
1274
1275         * expression.cs (EncodeAsAttribute): Allow nulls here.
1276
1277 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
1278
1279         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
1280         the functionality for testing whether an expression is valid for
1281         an attribute here.  Also handle the case of arrays of elements
1282         being stored. 
1283
1284         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
1285         encoding a linear array into an array of objects that are suitable
1286         to be passed to an CustomAttributeBuilder.
1287
1288         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
1289
1290         * ecore.cs: (FieldExpr): Handle field remapping here.
1291
1292         * iteratators.cs: Pass the instance variable (if the method is an
1293         instance method) to the constructors, so we can access the field
1294         variables on the class.
1295
1296         TODO: Test this with structs.  I think the THIS variable on
1297         structs might have to be a pointer, and not a refenrece
1298
1299 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
1300
1301         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
1302         local variables to fields in a proxy class.
1303
1304         * iterators.cs (PopulateProxy): Rename our internal fields to
1305         <XXX>.  
1306         Create a <THIS> field if we are an instance method, so we can
1307         reference our parent container variables.
1308         (MapVariable): Called back from the EmitContext code to enter a
1309         new variable to field mapping into the proxy class (we just create
1310         a FieldBuilder).
1311
1312         * expression.cs
1313         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
1314         for using the remapped locals to fields.
1315
1316         I placed the code here, because that gives the same semantics to
1317         local variables, and only changes the Emit code.
1318
1319         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
1320         statements inside iterators.
1321         (VariableInfo): Add a FieldBuilder for the cases when we are
1322         remapping local variables to fields in a proxy class
1323
1324         * ecore.cs (SimpleNameResolve): Avoid testing two times for
1325         current_block != null.
1326
1327         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
1328         not cope with strings, as it has been moved to the
1329         TableSwitchEmit.  Fixed bug in switch generation.
1330
1331         * expression.cs (New.DoResolve): Provide more context for the user
1332         when reporting an error.
1333
1334         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
1335         pointers. 
1336
1337         * expression.cs (MemberAccess.DoResolve): When we get a type back,
1338         check the permissions for it.  Note than in a type-resolution
1339         context the check was already present in DeclSpace.ResolveType,
1340         but was missing from the MemberAccess.
1341
1342         (ArrayCreation.CheckIndices): warn if the user has
1343         more nested levels of expressions, but there are no more
1344         dimensions specified.  Avoids crash on bug 41906.
1345
1346 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
1347
1348         * statement.cs (Block): replace Implicit bool, for a generic
1349         flags.   
1350         New flag: `Unchecked'.  This is used during the EmitMeta phase
1351         (which is out-of-line with the regular Resolve/Emit process for a
1352         statement, as this is done ahead of time, but still gets a chance
1353         to call constant resolve).
1354         
1355         (Block.Flags): new enum for adding a new flag.
1356
1357         (Block.EmitMeta): track the state of unchecked.
1358         
1359         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
1360         to enable constant resolution to work there as well.
1361
1362 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
1363
1364         * typemanager.cs (ienumerable_type): Also look up
1365         System.Collections.IEnumerable. 
1366
1367 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
1368
1369         TODO: Test more than one conditional per method.
1370         
1371         * class.cs (Indexer.Define): Report the location where the user is
1372         referencing the unsupported feature.
1373
1374         (MethodData): Overload the use of `conditionals' to
1375         minimize the creation of needless ArrayLists.   This saves roughly
1376         212kb on my machine.
1377
1378         (Method): Implement the new IIteratorContainer interface.
1379         (Method.SetYields): Implement the method by setting the ModFlags
1380         to contain METHOD_YIELDS.
1381         
1382         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
1383         which just got set to null.
1384
1385         * iterators.cs: New file.
1386
1387         (Yield, YieldBreak): New statements.
1388
1389         * statement.cs (Return.Resolve): Flag an error if we are used in
1390         an iterator method.
1391
1392         * codegen.cs (InIterator): New flag set if the code is being
1393         compiled in an iterator method.
1394
1395         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
1396         internal modifier, and we just use it to avoid adding extra
1397         fields, as this is seldom used.  
1398
1399         * cs-parser.jay: Add yield_statement (yield and yield break).
1400
1401         * driver.cs: New flag -v2 to turn on version 2 features. 
1402
1403         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
1404         hashtable when v2 is enabled.
1405
1406 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
1407
1408         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
1409         there is already a namespace defined with this name.
1410
1411         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
1412         people upgraded their corlibs.
1413
1414         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
1415         always use fully qualified types, no need to use the compiler
1416         front end.
1417
1418         (TypeManager.IsNamespace): Use binarysearch.
1419         
1420         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
1421         AddDelegate): I did not quite use the new IsValid API properly: I
1422         have to pass the short-name and the fullname.  I was passing only
1423         the basename instead of the fullname sometimes. 
1424
1425         (TypeContainer.DefineType): call NamespaceClash.
1426
1427         * interface.cs (Interface.DefineType): use NamespaceClash before
1428         defining the type.
1429
1430         * delegate.cs (Delegate.DefineType): use NamespaceClash before
1431         defining the type.
1432
1433         * enum.cs: (Enum.DefineType): use NamespaceClash before
1434         defining the type.
1435
1436         * typemanager.cs (: 3-line patch that gives us some tasty 11%
1437         speed increase.  First, use the negative_hits cache when we get a
1438         negative.  Second, add the type with its full original name
1439         instead of the new . and + encoded name (reflection uses + to
1440         separate type from a nested type).  Use LookupTypeReflection
1441         directly which bypasses the type->name hashtable (that we already
1442         know does not contain the type.
1443         
1444         * decl.cs (DeclSpace.ResolveTypeExpr): track the
1445         location/container type. 
1446
1447         * driver.cs: When passing utf8, use directly the UTF8Encoding.
1448
1449 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
1450
1451         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
1452
1453         * delegate.cs (NewDelegate.Resolve): Test whether an instance
1454         method is being referenced in the method group from a static
1455         context, and report error 120 if so.
1456
1457         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
1458         Error118. 
1459
1460         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
1461         is created, we create the A namespace).
1462
1463         * cs-parser.jay: A namespace also introduces a DeclarationFound.
1464         Fixes #41591
1465
1466 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
1467
1468         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
1469         invocation to ModuleBuilder.GetType with the same values will
1470         return a new type instance, so we need to cache its return
1471         values. 
1472
1473         * expression.cs (Binary.ResolveOperator): Only allow the compare
1474         operators on enums if they are of the same type.
1475
1476         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
1477         types of ValueType on their own case.  Before we were giving them
1478         the same treatment as objects.
1479
1480         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
1481         fullname.  Short name is used to compare against container name.
1482         Fullname is used to check against defined namespace names.
1483         
1484         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
1485         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
1486
1487         (Method.CheckBase): Call parent.
1488         (MemberBase.CheckBase): Check for protected members on sealed
1489         classes.
1490         (PropertyBase.CheckBase): Call parent.
1491         (Field.Define): Call parent.
1492
1493         * report.cs: Negative error codes are now mapped to 8000 - code,
1494         so that the display is render more nicely.
1495
1496         * typemanager.cs: Do not use try/catch, instead report a regular
1497         error. 
1498
1499         (GetPointerType, GetReferenceType): These methods provide
1500         mechanisms to obtain the T* and T& from a T.  We had the code
1501         previously scattered around the code base, and it also used
1502         TypeManager.LookupType that would go through plenty of caches.
1503         This one goes directly to the type source.
1504
1505         In some places we did the Type.GetType followed by
1506         ModuleBuilder.GetType, but not in others, so this unifies the
1507         processing as well.
1508
1509         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
1510         statements now that we have namespace information.
1511
1512         * typemanager.cs (IsNamespace): New method, returns whether the
1513         string presented is a namespace or not.
1514
1515         (ComputeNamespaces): New public entry point, computes the list of
1516         available namespaces, using the GetNamespaces API call in Mono, or
1517         the slower version in MS.NET.   
1518
1519         Now before we start the semantic analysis phase, we have a
1520         complete list of namespaces including everything that the user has
1521         provided.
1522
1523         Deleted old code to cache namespaces in .nsc files.
1524
1525 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
1526
1527         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
1528         class/struct location definition Location for the implicit
1529         constructor location.
1530
1531         (Operator.Define): Use the location of the operator for the
1532         implicit Method definition.
1533
1534         (Constructor.Emit): use the constructor location for the implicit
1535         base initializer constructor.
1536
1537         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
1538         and the Expression class now contains two new methods:
1539
1540         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
1541         isolate type lookup from the rest of the resolution process.
1542
1543         Since we use Expressions to hold type definitions due to the way
1544         we parse the input we have historically overloaded Resolve to
1545         perform the Type lookups if a special flag is passed.  Now this is
1546         eliminated and two methods take their place. 
1547         
1548         The differences in the two methods between xStep and xTerminal is
1549         that xStep is involved in our current lookup system that uses
1550         SimpleNames to compose a name, while xTerminal is used just to
1551         catch the case where the simplename lookup failed.
1552         
1553 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
1554
1555         * expression.cs (ResolveMemberAccess): Remove redundant code.
1556         TypeExpr expressions are always born fully resolved.
1557
1558         * interface.cs (PopulateMethod): Do not lookup the types twice.
1559         We were doing it once during SemanticAnalysis and once during
1560         PopulateMethod.
1561
1562         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
1563         in local variable type definitions, were being returned as a
1564         SimpleName (we decomposed everything into a string), that is
1565         because primary_expression was being used instead of a type in the
1566         grammar (reduce/reduce conflicts).
1567
1568         The part that was wrong is that we converted the expression into a
1569         string (an oversimplification in one hand, compounded with primary
1570         expressions doing string concatenation).
1571
1572         So things like:
1573
1574         A.B.C [] x;
1575
1576         Would return "A.B.C[]" as a SimpleName.  This stopped things like
1577         using clauses from working on this particular context.  And a type
1578         was being matched directly against "A.B.C[]".
1579
1580         We now use the correct approach, and allow for ComposedCast to be
1581         part of the unary expression.  So the "A.B.C []" become a composed
1582         cast of "A.B.C" (as a nested group of MemberAccess with a
1583         SimpleName at the end) plus the rank composition "[]". 
1584
1585         Also fixes 35567
1586         
1587 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
1588
1589         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
1590         for the access level checking.
1591
1592         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
1593         `TypeContainer container', because I kept getting confused when I
1594         was debugging this code.
1595
1596         * expression.cs (Indexers): Instead of tracking getters/setters,
1597         we now track them in parallel.  We create one arraylist less, but
1598         most importantly it is possible now for the LValue code to find a
1599         matching get for a set.
1600
1601         (IndexerAccess.DoResolveLValue): Update the code.
1602         GetIndexersForType has been modified already to extract all the
1603         indexers from a type.  The code assumed it did not.
1604
1605         Also make the code set the correct return type for the indexer.
1606         This was fixed a long time ago for properties, but was missing for
1607         indexers.  It used to be void_type.
1608
1609         (Binary.Emit): Test first for doubles instead of
1610         floats, as they are more common.
1611
1612         (Binary.EmitBranchable): Use the .un version of the branch opcodes
1613         when dealing with floats and the <=, >= operators.  This fixes bug
1614         #39314 
1615
1616         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
1617         to load the array value by emitting a load on the foreach variable
1618         type.  This was incorrect.  
1619
1620         We now emit the code to load an element using the the array
1621         variable type, and then we emit the conversion operator.
1622
1623         Fixed #40176
1624
1625 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
1626
1627         * attribute.cs: Avoid allocation of ArrayLists in the common case.
1628
1629 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
1630
1631         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
1632         test for protection before we test for signatures. 
1633
1634         (MethodSignature.ToString): implement.
1635
1636         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
1637         to the case where we reduced into a LongConstant.
1638
1639         * decl.cs (CheckAccessLevel): If the type is an array, we can not
1640         depend on whether the information is acurrate, because the
1641         Microsoft runtime will always claim that the array type is public,
1642         regardless of the real state.
1643
1644         If the type is a pointer, another problem happens: the type is
1645         reported as non-public in Microsoft.  
1646
1647         In both cases we have to call CheckAccessLevel recursively with
1648         the underlying type as the argument to be tested.
1649
1650 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
1651
1652         * assign.cs (Assign.Emit): If we are dealing with a compound
1653         assignment expression, we should use the code path that stores the
1654         intermediate result in a temporary value.  This fixes #40903.
1655
1656         *expression.cs (Indirection.ToString): Provide ToString method for
1657         debugging. 
1658         
1659 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
1660
1661         * class.cs: Null out fields holding references to Block objects so
1662         they can be garbage collected.
1663
1664         * expression.cs (OverloadResolve): Remove unused local.
1665
1666 2003-04-07  Martin Baulig  <martin@ximian.com>
1667
1668         * codegen.cs (EmitContext.CurrentFile): New public field.
1669         (EmitContext.Mark): Use the CurrentFile to check whether the
1670         location is in the correct file.
1671         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
1672
1673 2003-04-07  Martin Baulig  <martin@ximian.com>
1674
1675         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
1676
1677         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
1678         location.  [FIXME: The location argument which gets passed to this
1679         method is sometimes wrong!]
1680
1681 2003-04-07  Nick Drochak <ndrochak@gol.com>
1682
1683         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
1684
1685 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
1686
1687         * expression.cs (Indirection.EmitAssign): We were using the
1688         temporary, but returning immediately instead of continuing the
1689         EmitAssing flow.
1690
1691 2003-04-06  Martin Baulig  <martin@ximian.com>
1692
1693         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
1694         if it's a nested child, but also deriving from the outer class.
1695         See test 190.cs.
1696
1697         * typemanager.cs (IsNestedChildOf): Make this work if it's a
1698         nested child, but also deriving from the outer class.  See
1699         test-190.cs.
1700         (FilterWithClosure): We may access private members of the outer
1701         class if we're a nested child and deriving from the outer class.
1702         (RealMemberLookup): Only set `closure_private_ok' if the
1703         `original_bf' contained BindingFlags.NonPublic.
1704
1705 2003-04-05  Martin Baulig  <martin@ximian.com>
1706
1707         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
1708
1709 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
1710
1711         * class.cs (Event.Define): Do not allow abstract events to have
1712         initializers. 
1713
1714 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
1715
1716         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
1717         block in event declarations.
1718
1719         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
1720         value type, get its address.
1721
1722         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
1723         leaving a class on the stack instead of a boolean value (int
1724         0/1).  Change the code so we compare against null, and then the
1725         result against zero.
1726
1727         * class.cs (TypeContainer.GetClassBases): We were checking for the
1728         parent class being sealed too late.
1729
1730         * expression.cs (Binary.Emit): For <= and >= when dealing with
1731         floating point values, use cgt.un and clt.un instead of cgt and
1732         clt alone.
1733
1734 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
1735
1736         * statement.cs: Apply the same optimization as MS: skip the 
1737         GetEnumerator returning an IEnumerator, and use the one returning a 
1738         CharEnumerator instead. This allows us to avoid the try-finally block 
1739         and the boxing.
1740
1741 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
1742
1743         * cs-parser.jay: Attributes cannot be applied to
1744                          namespaces. Fixes #40473
1745
1746 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1747
1748         * class.cs:
1749         (Add*): check if the name is valid using the full name for constants,
1750         fields, properties and events.
1751
1752 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
1753
1754         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
1755         char constants to be part of the enumeration.
1756
1757         * expression.cs (Conditional.DoResolve): Add support for operator
1758         true. Implements the missing functionality from 14.12
1759
1760         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
1761         operator true/false as required by the spec.
1762
1763         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
1764         implicit conversion to boolean.
1765
1766         * statement.cs (Statement.ResolveBoolean): A boolean expression is
1767         also one where the type implements `operator true'. 
1768
1769         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
1770         get an expression that will invoke operator true based on an
1771         expression.  
1772
1773         (GetConversionOperators): Removed the hack that called op_True
1774         here.  
1775
1776         (Expression.ResolveBoolean): Move this from Statement.
1777
1778 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
1779
1780         * ecore.cs (FieldExpr): do not allow initialization of initonly
1781         fields on derived classes
1782
1783 2003-03-13  Martin Baulig  <martin@ximian.com>
1784
1785         * statement.cs (Block.Emit): Call ig.BeginScope() and
1786         ig.EndScope() when compiling with debugging info; call
1787         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
1788
1789 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
1790
1791         * expression.cs (Indexers): Do not construct immediately, allow
1792         for new members to be appended as we go.  Fixes 38143
1793
1794 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1795
1796         * expression.cs: save/restore context when resolving an unchecked
1797         expression.
1798
1799 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
1800
1801         * cfold.cs: Catch division by zero in modulus operator during
1802         constant folding.
1803
1804 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
1805
1806         * interface.cs (Interface.DefineMembers): Avoid defining members
1807         twice. 
1808
1809 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
1810
1811         * driver.cs: handle the +/- options for -noconfig
1812
1813         * statement.cs (Unckeched.Resolve): Also track the state of
1814         unchecked in the Resolve phase.
1815
1816 2003-02-27  Martin Baulig  <martin@ximian.com>
1817
1818         * ecore.cs (Expression.MemberLookup): Don't create a
1819         MethodGroupExpr for something which is not a method.  Fixes #38291.
1820
1821 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
1822
1823         * class.cs (MemberBase.CheckParameters): Also check that the type
1824         is unmanaged if it is a pointer.
1825
1826         * expression.cs (SizeOf.Resolve): Add location information.
1827
1828         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
1829         a managed type is declared.
1830
1831         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
1832         parameter modifiers as well.  Fixes bug 38606
1833
1834         * class.cs: Very sad.  Am backing out the speed up changes
1835         introduced by the ArrayList -> Array in the TypeContainer, as they
1836         were not actually that much faster, and introduced a bug (no error
1837         reports on duplicated methods).
1838
1839         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
1840         source first, this will guarantee that we have a valid expression
1841         before calling in lower levels functions that will require a
1842         resolved object.  Then use this original_source in the
1843         target.ResolveLValue instead of the original source that was
1844         passed to us.
1845
1846         Another change.  Use target.Resolve instead of LValueResolve.
1847         Although we are resolving for LValues, we will let the Assign code
1848         take care of that (it will be called again from Resolve).  This
1849         basically allows code like this:
1850
1851         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
1852         class Y { void A (X x) { x [0] += o; }
1853
1854         The problem was that the indexer was trying to resolve for
1855         set_Item (idx, object o) and never finding one.  The real set_Item
1856         was set_Item (idx, X).  By delaying the process we get the right
1857         semantics. 
1858
1859         Fixes bug 36505
1860         
1861 2003-02-23  Martin Baulig  <martin@ximian.com>
1862
1863         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
1864         while calling DoEmit ().
1865
1866         * codegen.cs (EmitContext.Mark): Don't mark locations in other
1867         source files; if you use the #line directive inside a method, the
1868         compiler stops emitting line numbers for the debugger until it
1869         reaches the end of the method or another #line directive which
1870         restores the original file.
1871
1872 2003-02-23  Martin Baulig  <martin@ximian.com>
1873
1874         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
1875
1876 2003-02-23  Martin Baulig  <martin@ximian.com>
1877
1878         * statement.cs (Block.AddChildVariableNames): We need to call this
1879         recursively, not just for our immediate children.
1880
1881 2003-02-23  Martin Baulig  <martin@ximian.com>
1882
1883         * class.cs (Event.Define): Always make the field private, like csc does.
1884
1885         * typemanager.cs (TypeManager.RealMemberLookup): Make events
1886         actually work, fixes bug #37521.
1887
1888 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
1889
1890         * delegate.cs: When creating the various temporary "Parameters"
1891         classes, make sure that we call the ComputeAndDefineParameterTypes
1892         on those new parameters (just like we do with the formal ones), to
1893         allow them to be resolved in the context of the DeclSpace.
1894
1895         This fixes the bug that Dick observed in Bugzilla #38530.
1896
1897 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
1898
1899         * expression.cs (ResolveMemberAccess): When resolving a constant,
1900         do not attempt to pull a constant if the value was not able to
1901         generate a valid constant.
1902
1903         * const.cs (LookupConstantValue): Do not report more errors than required.
1904
1905 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1906
1907         * expression.cs: fixes bug #38328.
1908
1909 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
1910
1911         * class.cs: Changed all the various members that can be part of a
1912         class from being an ArrayList to be an Array of the right type.
1913         During the DefineType type_list, interface_list, delegate_list and
1914         enum_list are turned into types, interfaces, delegates and enums
1915         arrays.  
1916
1917         And during the member population, indexer_list, event_list,
1918         constant_list, field_list, instance_constructor_list, method_list,
1919         operator_list and property_list are turned into their real arrays.
1920
1921         Although we could probably perform this operation earlier, for
1922         good error reporting we need to keep the lists and remove the
1923         lists for longer than required.
1924
1925         This optimization was triggered by Paolo profiling the compiler
1926         speed on the output of `gen-sample-program.pl' perl script. 
1927
1928         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
1929         not crash in methods like MemberLookupFailed that use this field.  
1930
1931         This problem arises when the compiler fails to resolve a type
1932         during interface type definition for example.
1933
1934 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
1935
1936         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
1937         inherit from System.Object, so we have to stop at null, not only
1938         when reaching System.Object.
1939
1940 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
1941
1942         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
1943         DeclaredOnly because the parent indexer might have had a different
1944         name, but did not loop until the top of the hierarchy was reached.
1945
1946         The problem this one fixes is 35492: when a class implemented an
1947         indexer from an interface, we were getting the interface method
1948         (which was abstract) and we were flagging an error (can not invoke
1949         abstract method).
1950
1951         This also keeps bug 33089 functioning, and test-148 functioning.
1952
1953         * typemanager.cs (IsSpecialMethod): The correct way of figuring
1954         out if a method is special is to see if it is declared in a
1955         property or event, or whether it is one of the predefined operator
1956         names.   This should fix correctly #36804.
1957
1958 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
1959
1960         The goal here is to remove the dependency on EmptyCast.Peel ().
1961         Killing it completely.
1962         
1963         The problem is that currently in a number of places where
1964         constants are expected, we have to "probe" for an EmptyCast, and
1965         Peel, which is not the correct thing to do, as this will be
1966         repetitive and will likely lead to errors. 
1967
1968         The idea is to remove any EmptyCasts that are used in casts that
1969         can be reduced to constants, so we only have to cope with
1970         constants. 
1971
1972         This bug hunt was triggered by Bug 37363 and the desire to remove
1973         the duplicate pattern where we were "peeling" emptycasts to check
1974         whether they were constants.  Now constants will always be
1975         constants.
1976         
1977         * ecore.cs: Use an enumconstant here instead of wrapping with
1978         EmptyCast.  
1979
1980         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
1981         throwing me off.  By handling this we can get rid of a few hacks.
1982         
1983         * statement.cs (Switch): Removed Peel() code.
1984
1985 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
1986
1987         * class.cs: Location information for error 508
1988
1989         * expression.cs (New.DoResolve): Add a guard against double
1990         resolution of an expression.  
1991
1992         The New DoResolve might be called twice when initializing field
1993         expressions (see EmitFieldInitializers, the call to
1994         GetInitializerExpression will perform a resolve on the expression,
1995         and later the assign will trigger another resolution
1996
1997         This leads to bugs (#37014)
1998
1999         * delegate.cs: The signature for EndInvoke should contain any ref
2000         or out parameters as well.  We were not doing this in the past. 
2001
2002         * class.cs (Field.Define): Do not overwrite the type definition
2003         inside the `volatile' group.  Turns out that volatile enumerations
2004         were changing the type here to perform a validity test, which
2005         broke conversions. 
2006
2007 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
2008
2009         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
2010         and structs, we do not want to load the instance variable
2011
2012         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
2013         enum_type has to be handled like an object reference (implicit
2014         conversions exists from this to object), but the regular IsClass
2015         and IsValueType tests will never return true for this one.
2016
2017         Also we use TypeManager.IsValueType instead of type.IsValueType,
2018         just for consistency with the rest of the code (this is only
2019         needed if we ever use the construct exposed by test-180.cs inside
2020         corlib, which we dont today).
2021
2022 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
2023
2024         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
2025         just InternalCall.
2026
2027 2003-02-09  Martin Baulig  <martin@ximian.com>
2028
2029         * namespace.cs (Namespace..ctor): Added SourceFile argument.
2030         (Namespace.DefineNamespaces): New static public method; this is
2031         called when we're compiling with debugging to add all namespaces
2032         to the symbol file.
2033
2034         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
2035         pass it to the Namespace's .ctor.
2036
2037         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
2038         and MethodBase arguments; pass the namespace ID to the symwriter;
2039         pass the MethodBase instead of the token to the symwriter.
2040         (SymbolWriter.DefineNamespace): New method to add a namespace to
2041         the symbol file.
2042
2043 2003-02-09  Martin Baulig  <martin@ximian.com>
2044
2045         * symbolwriter.cs: New file.  This is a wrapper around
2046         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
2047         methods here in near future.
2048
2049 2003-02-09  Martin Baulig  <martin@ximian.com>
2050
2051         * codegen.cs (EmitContext.Mark): Just pass the arguments to
2052         ILGenerator.MarkSequencePoint() which are actually used by the
2053         symbol writer.
2054
2055 2003-02-09  Martin Baulig  <martin@ximian.com>
2056
2057         * location.cs (SourceFile): New public sealed class.  This
2058         contains the name and an index which is used in the location's token.
2059         (Location): Reserve an appropriate number of bits in the token for
2060         the source file instead of walking over that list, this gives us a
2061         really huge performance improvement when compiling with debugging.
2062
2063         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
2064         `SourceFile' argument instead of a string.
2065         (Driver.ProcessFile): Add all the files via Location.AddFile(),
2066         but don't parse/tokenize here, we need to generate the list of all
2067         source files before we do that.
2068         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
2069         the files.
2070
2071         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
2072         instead of a string.
2073
2074         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
2075         of a string.
2076
2077 2003-02-09  Martin Baulig  <martin@ximian.com>
2078
2079         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
2080         filename on `#line default'.
2081
2082 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
2083
2084         * statement.cs: don't clear the pinned var when the fixed statement
2085         returns from the method (fixes bug#37752).
2086
2087 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
2088
2089         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
2090         to IsValueType.
2091
2092 2003-02-07  Martin Baulig  <martin@ximian.com>
2093
2094         * driver.cs: Removed the `--debug-args' command line argument.
2095
2096         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
2097         automatically by the AsssemblyBuilder.
2098         (CodeGen.InitializeSymbolWriter): We don't need to call any
2099         initialization function on the symbol writer anymore.  This method
2100         doesn't take any arguments.
2101
2102 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
2103
2104         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
2105         from referenced assemblies as well.
2106
2107 2003-02-02  Martin Baulig  <martin@ximian.com>
2108
2109         * class.cs (MethodData.Emit): Generate debugging info for external methods.
2110
2111 2003-02-02  Martin Baulig  <martin@ximian.com>
2112
2113         * class.cs (Constructor.Emit): Open the symbol writer before
2114         emitting the constructor initializer.
2115         (ConstructorInitializer.Emit): Call ec.Mark() to allow
2116         single-stepping through constructor initializers.
2117
2118 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
2119
2120         * class.cs: Handle error 549: do not allow virtual methods in
2121         sealed classes. 
2122
2123 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
2124
2125         * decl.cs: Check access levels when resolving types
2126         
2127 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
2128
2129         * statement.cs: Add parameters and locals set in catch blocks that might 
2130         return to set vector
2131
2132 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
2133
2134         * class.cs (Operator): Set the SpecialName flags for operators.
2135         
2136         * expression.cs (Invocation.DoResolve): Only block calls to
2137         accessors and operators on SpecialName methods.
2138
2139         (Cast.TryReduce): Handle conversions from char constants.
2140
2141
2142 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
2143
2144         * statement.cs: small memory and time optimization in FlowBranching.
2145         
2146 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
2147
2148         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
2149         problem that the last fix but in the other sid (Set).
2150
2151         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
2152         access when there is no indexer in the hierarchy.
2153         
2154 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
2155
2156         * class.cs: Combine some if statements.
2157
2158 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2159
2160         * driver.cs: fixed bug #37187.
2161
2162 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
2163
2164         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
2165         any indexer, it's needed to build a list with all the indexers in the
2166         hierarchy (AllGetters), else we have problems. Fixes #35653.
2167
2168 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
2169
2170         * class.cs (MethodData.Define): It is wrong for an interface
2171         implementation to be static in both cases: explicit and implicit.
2172         We were only handling this in one case.
2173
2174         Improve the if situation there to not have negations.
2175         
2176         * class.cs (Field.Define): Turns out that we do not need to check
2177         the unsafe bit on field definition, only on usage.  Remove the test.
2178
2179 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2180
2181         * driver.cs: use assembly.Location instead of Codebase (the latest
2182         patch made mcs fail when using MS assemblies).
2183
2184 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
2185
2186         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
2187         get the path to *corlib.dll.
2188
2189 2003-01-21  Nick Drochak <ndrochak@gol.com>
2190
2191         * cs-tokenizer.cs:
2192         * pending.cs:
2193         * typemanager.cs: Remove compiler warnings
2194
2195 2003-01-20  Duncan Mak  <duncan@ximian.com>
2196
2197         * AssemblyInfo.cs: Bump the version number to 0.19.
2198         
2199 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2200
2201         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
2202
2203 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
2204
2205         * class.cs (Constructor::Emit): Emit debugging info for constructors.
2206
2207 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
2208
2209         * cs-parser.jay: Small fix: we were not comparing the constructor
2210         name correctly.   Thanks to Zoltan for the initial pointer.
2211
2212 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
2213
2214         * cs-tokenizer.cs: Set file name when specified with #line
2215
2216 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
2217
2218         * cs-parser.jay: Only perform the constructor checks here if we
2219         are named like the class;  This will help provider a better
2220         error.  The constructor path is taken when a type definition is
2221         not found, but most likely the user forgot to add the type, so
2222         report that rather than the constructor error.
2223
2224 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
2225
2226         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
2227         allocations.
2228
2229 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
2230
2231         * cs-parser.jay: Add cleanup call.
2232
2233 2003-01-13  Duncan Mak  <duncan@ximian.com>
2234
2235         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
2236         consistent with other methods.
2237
2238 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
2239
2240         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
2241         
2242 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
2243
2244         * attribute.cs: only set GuidAttr to true when we have a
2245         GuidAttribute.
2246
2247 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2248
2249         * ecore.cs:
2250         * expression.cs:
2251         * typemanager.cs: fixes to allow mcs compile corlib with the new
2252         Type.IsSubclassOf fix.
2253
2254 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
2255
2256         * expression.cs (LocalVariableReference.DoResolve): Classify a
2257         constant as a value, not as a variable.   Also, set the type for
2258         the variable.
2259
2260         * cs-parser.jay (fixed_statement): take a type instead of a
2261         pointer_type, so we can produce a better error message later.
2262         
2263         * statement.cs (Fixed.Resolve): Flag types that are not pointers
2264         as an error.  
2265         
2266         (For.DoEmit): Make inifinite loops have a
2267         non-conditional branch back.
2268
2269         (Fixed.DoEmit): First populate the pinned variables, then emit the
2270         statement, then clear the variables.  Before I was emitting the
2271         code once for each fixed piece.
2272
2273
2274 2003-01-08  Martin Baulig  <martin@ximian.com>
2275
2276         * statement.cs (FlowBranching.MergeChild): A break in a
2277         SWITCH_SECTION does not leave a loop.  Fixes #36155.
2278
2279 2003-01-08  Martin Baulig  <martin@ximian.com>
2280
2281         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
2282         lives in the same number space than `param_map'.  Fixes #36154.
2283
2284 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
2285
2286         * cs-parser.jay (constructor_declaration): Set the
2287         Constructor.ModFlags before probing for it.  This makes the
2288         compiler report 514, 515 and 132 (the code was there, but got
2289         broken). 
2290
2291         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
2292         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
2293         (GotoCase.Resolve): Set `Returns' to ALWAYS.
2294
2295 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
2296
2297         * enum.cs: create the enum static fields using the enum type.
2298
2299 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
2300
2301         * class.cs: don't try to create the ParamBuilder for the return
2302         type if it's not needed (and handle it breaking for the ms runtime
2303         anyway).
2304
2305 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
2306
2307         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
2308
2309 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
2310
2311         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
2312         the command.   This showed up while compiling the JANET source
2313         code, which used \r as its only newline separator.
2314
2315 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
2316
2317         * class.cs (Method.Define): If we are an operator (because it
2318         reuses our code), then set the SpecialName and HideBySig.  #36128
2319
2320 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
2321
2322         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
2323         exception, report error 120 `object reference required'.
2324
2325         * driver.cs: Add --pause option, used during to measure the size
2326         of the process as it goes with --timestamp.
2327
2328         * expression.cs (Invocation.DoResolve): Do not allow methods with
2329         SpecialName to be invoked.
2330
2331 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
2332
2333         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
2334         number before adding it.
2335
2336 2002-12-21  Ravi Pratap  <ravi@ximian.com>
2337
2338         * ecore.cs (StandardImplicitConversion): When in an unsafe
2339         context, we allow conversion between void * to any other pointer
2340         type. This fixes bug #35973.
2341
2342 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
2343
2344         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
2345         is not thrown when extensionless outputs are used 
2346
2347 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2348
2349         * rootcontext.cs: fixed compilation of corlib.
2350
2351 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
2352
2353         * attribute.cs (Attributes.Contains): Add new method.
2354
2355         * class.cs (MethodCore.LabelParameters): if the parameter is an
2356         `out' parameter, check that no attribute `[In]' has been passed.
2357
2358         * enum.cs: Handle the `value__' name in an enumeration.
2359
2360 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
2361
2362         * decl.cs: Added special case to allow overrides on "protected
2363         internal" methods
2364         
2365 2002-12-18  Ravi Pratap  <ravi@ximian.com>
2366
2367         * attribute.cs (Attributes.AddAttributeSection): Rename to this
2368         since it makes much more sense.
2369
2370         (Attributes.ctor): Don't require a Location parameter.
2371         
2372         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
2373
2374         * attribute.cs (ApplyAttributes): Remove extra Location parameters
2375         since we already have that information per attribute.
2376
2377         * everywhere : make appropriate changes.
2378
2379         * class.cs (LabelParameters): Write the code which actually
2380         applies attributes to the return type. We can't do this on the MS
2381         .NET runtime so we flag a warning in the case an exception is
2382         thrown.
2383
2384 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
2385
2386         * const.cs: Handle implicit null conversions here too.
2387
2388 2002-12-17  Ravi Pratap  <ravi@ximian.com>
2389
2390         * class.cs (MethodCore.LabelParameters): Remove the extra
2391         Type [] parameter since it is completely unnecessary. Instead
2392         pass in the method's attributes so that we can extract
2393         the "return" attribute.
2394
2395 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
2396
2397         * cs-parser.jay (parse): Use Report.Error to flag errors instead
2398         of ignoring it and letting the compile continue.
2399
2400         * typemanager.cs (ChangeType): use an extra argument to return an
2401         error condition instead of throwing an exception.
2402
2403 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
2404
2405         * expression.cs (Unary.TryReduce): mimic the code for the regular
2406         code path.  Perform an implicit cast in the cases where we can
2407         implicitly convert to one of the integral types, and then reduce
2408         based on that constant.   This fixes bug #35483.
2409
2410 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2411
2412         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
2413
2414 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2415
2416         * namespace.cs: fixed bug #35489.
2417
2418 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
2419
2420         * class.cs: Remove some dead code.
2421
2422         * cs-parser.jay: Estimate the number of methods needed
2423         (RootContext.MethodCount);
2424
2425         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
2426         numbers instead of StringBuilders.
2427
2428         * support.cs (PtrHashtable): Add constructor with initial size;
2429         We can now reduce reallocations of the method table.
2430
2431 2002-12-10  Ravi Pratap  <ravi@ximian.com>
2432
2433         * attribute.cs (ApplyAttributes): Keep track of the emitted
2434         attributes on a per-target basis. This fixes bug #35413.
2435
2436 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
2437
2438         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
2439         default to the Windows 1252 encoding.
2440
2441         (UnixParseOption): Support version, thanks to Alp for the missing
2442         pointer. 
2443
2444         * AssemblyInfo.cs: Add nice assembly information.
2445
2446         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
2447         (bug 35169).
2448
2449         * cs-parser.jay: Allow a trailing comma before the close bracked
2450         in the attribute_section production.
2451
2452         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
2453         address of the instance was being taken, I will take this out,
2454         because we take the address of the object immediately here.
2455
2456 2002-12-09  Ravi Pratap  <ravi@ximian.com>
2457
2458         * typemanager.cs (AreMultipleAllowed): Take care of the most
2459         obvious case where attribute type is not in the current assembly -
2460         stupid me ;-)
2461
2462 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
2463
2464         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
2465         definitions, instead of doing that afterwards.  
2466
2467         Also we use a nice little hack, depending on the constructor, we
2468         know if we are a "composed" name or a simple name.  Hence, we
2469         avoid the IndexOf test, and we avoid 
2470
2471         * codegen.cs: Add code to assist in a bug reporter to track down
2472         the source of a compiler crash. 
2473
2474 2002-12-07  Ravi Pratap  <ravi@ximian.com>
2475
2476         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
2477         types have been emitted for a given element and flag an error
2478         if something which does not have AllowMultiple set is used more
2479         than once.
2480
2481         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
2482         attribute types and their corresponding AllowMultiple properties
2483
2484         (AreMultipleAllowed): Check the property for a given type.
2485
2486         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
2487         property in the case we have a TypeContainer.
2488
2489         (Attributes.AddAttribute): Detect duplicates and just skip on
2490         adding them. This trivial fix catches a pretty gross error in our
2491         attribute emission - global attributes were being emitted twice!
2492
2493         Bugzilla bug #33187 is now fixed.
2494
2495 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
2496
2497         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
2498         instead of pp_and).
2499
2500         * expression.cs (Binary.ResolveOperator): I can only use the
2501         Concat (string, string, string) and Concat (string, string,
2502         string, string) if the child is actually a concatenation of
2503         strings. 
2504
2505 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
2506
2507         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
2508         context where we need a 2-character lookahead.
2509
2510         * pending.cs (PendingImplementation): Rework so we can keep track
2511         of interface types all the time, and flag those which were
2512         implemented by parents as optional.
2513
2514 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
2515
2516         * expression.cs (Binary.ResolveOperator): Use
2517         String.Concat(string,string,string) or
2518         String.Concat(string,string,string,string) when possible. 
2519
2520         * typemanager: More helper methods.
2521
2522
2523 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
2524
2525         * pending.cs: remove the bogus return from GetMissingInterfaces()
2526         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
2527
2528 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2529
2530         * namespace.cs: avoid duplicated 'using xxx' being added to
2531         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
2532         when we get more than one 'using' statement for the same namespace.
2533         Report a CS0105 warning for it.
2534
2535 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
2536
2537         * cs-tokenizer.cs (consume_identifier): use read directly, instead
2538         of calling getChar/putback, uses internal knowledge of it.    
2539
2540         (xtoken): Reorder tokenizer so most common patterns are checked
2541         first.  This reduces the compilation time in another 5% (from 8.11s
2542         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
2543
2544         The parsing time is 22% of the compilation in mcs, and from that
2545         64% is spent on the tokenization process.  
2546
2547         I tried using a binary search for keywords, but this is slower
2548         than the hashtable.  Another option would be to do a couple of
2549         things:
2550
2551                 * Not use a StringBuilder, instead use an array of chars,
2552                   with a set value.  Notice that this way we could catch
2553                   the 645 error without having to do it *afterwards*.
2554
2555                 * We could write a hand-parser to avoid the hashtable
2556                   compares altogether.
2557
2558         The identifier consumption process takes 37% of the tokenization
2559         time.  Another 15% is spent on is_number.  56% of the time spent
2560         on is_number is spent on Int64.Parse:
2561
2562                 * We could probably choose based on the string length to
2563                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
2564                   computations. 
2565
2566         Another 3% is spend on wrapping `xtoken' in the `token' function.
2567
2568         Handle 0xa0 as whitespace (#34752)
2569         
2570 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
2571
2572         * typemanager.cs (IsCLRType): New routine to tell whether a type
2573         is one of the builtin types.  
2574
2575         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
2576         typecode in more places instead of doing pointer comparissions.
2577         We could leverage some knowledge about the way the typecodes are
2578         laid out.
2579
2580         New code to cache namespaces in assemblies, it is currently not
2581         invoked, to be used soon.
2582
2583         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
2584
2585         * expression.cs (Binary.ResolveOperator): specially handle
2586         strings, and do not perform user-defined operator overloading for
2587         built-in types.
2588
2589 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
2590
2591         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
2592         internalcall as it is a pretty simple operation;  Avoid whenever
2593         possible to call Char.IsLetter.
2594
2595         (consume_identifier): Cut by half the number of
2596         hashtable calls by merging the is_keyword and GetKeyword behavior.
2597
2598         Do not short-circuit, because if we do, we
2599         report errors (ie, #if false && true would produce an invalid
2600         directive error);
2601         
2602
2603 2002-11-24  Martin Baulig  <martin@ximian.com>
2604
2605         * expression.cs (Cast.TryReduce): If we're in checked syntax,
2606         check constant ranges and report a CS0221.  Fixes #33186.
2607
2608 2002-11-24  Martin Baulig  <martin@ximian.com>
2609
2610         * cs-parser.jay: Make this work for uninitialized variable
2611         declarations in the `for' initializer.  Fixes #32416.
2612
2613 2002-11-24  Martin Baulig  <martin@ximian.com>
2614
2615         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
2616         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
2617
2618 2002-11-24  Martin Baulig  <martin@ximian.com>
2619
2620         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
2621         argument; if true, we also check for user-defined conversions.
2622         This is only needed if both arguments are of a user-defined type.
2623         Fixes #30443, added test-175.cs.
2624         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
2625
2626         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
2627
2628 2002-11-24  Martin Baulig  <martin@ximian.com>
2629
2630         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
2631         function to get the store opcode.
2632         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
2633         only emit the Ldelema if the store opcode is Stobj.  You must run
2634         both test-34 and test-167 to test this.  Fixes #34529.
2635
2636 2002-11-23  Martin Baulig  <martin@ximian.com>
2637
2638         * ecore.cs (Expression.MemberLookup): Added additional
2639         `qualifier_type' argument which is used when we're being called
2640         from MemberAccess.DoResolve() and null if we're called from a
2641         SimpleName lookup.
2642         (Expression.MemberLookupFailed): New method to report errors; this
2643         does the CS1540 check and reports the correct error message.
2644
2645         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
2646         argument for the CS1540 check and redone the way how we're dealing
2647         with private members.  See the comment in the source code for details.
2648         (FilterWithClosure): Reverted this back to revision 1.197; renamed
2649         `closure_start_type' to `closure_qualifier_type' and check whether
2650         it's not null.  It was not this filter being broken, it was just
2651         being called with the wrong arguments.
2652
2653         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
2654         and pass it the correct `qualifier_type'; this also does the error
2655         handling for us.
2656
2657 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
2658
2659         * expression.cs (Invocation.EmitParams): If the we are dealing
2660         with a non-built-in value type, load its address as well.
2661
2662         (ArrayCreation): Use a a pretty constant instead
2663         of the hardcoded value 2.   Use 6 instead of 2 for the number of
2664         static initializers.  
2665
2666         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
2667         because they are not really value types, just glorified integers. 
2668
2669         * driver.cs: Do not append .exe, the CSC compiler does not do it.
2670
2671         * ecore.cs: Remove redundant code for enumerations, make them use
2672         the same code path as everything else, fixes the casting issue
2673         with enumerations in Windows.Forms.
2674
2675         * attribute.cs: Do only cast to string if it is a string, the
2676         validation happens later.
2677
2678         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
2679         people upgrade their corlibs.
2680
2681         * ecore.cs: Oops, enumerations were not following the entire code path
2682
2683 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
2684
2685         * typemanager.cs (FilterWithClosure): Commented out the test for
2686         1540 in typemanager.cs, as it has problems when accessing
2687         protected methods from a parent class (see test-174.cs). 
2688
2689         * attribute.cs (Attribute.ValidateGuid): new method.
2690         (Attribute.Resolve): Use above.
2691
2692 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
2693
2694         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
2695
2696         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
2697         handling for enumerations, as we only needed the TypeContainer
2698         functionality to begin with (this is required for the fix below to
2699         work for enums that reference constants in a container class for
2700         example). 
2701
2702         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
2703
2704         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
2705         a valid TypeBuilder to perform lookups on.o
2706
2707         * class.cs (InheritableMemberSignatureCompare): Use true in the
2708         call to GetGetMethod and GetSetMethod, because we are comparing
2709         the signature, and we need to get the methods *even* if they are
2710         private. 
2711
2712         (PropertyBase.CheckBase): ditto.
2713
2714         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
2715         GotoCase.Resolve): Use Peel on EmpytCasts.
2716
2717         * ecore.cs (EmptyCast): drop child, add Peel method.
2718
2719 2002-11-17  Martin Baulig  <martin@ximian.com>
2720
2721         * ecore.cs (EmptyCast.Child): New public property.
2722
2723         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
2724         label resolved to an EmptyCast.  Fixes #34162.
2725         (GotoCase.Resolve): Likewise.
2726         (Block.EmitMeta): Likewise.
2727
2728 2002-11-17  Martin Baulig  <martin@ximian.com>
2729
2730         * expression.cs (Invocation.BetterConversion): Prefer int over
2731         uint; short over ushort; long over ulong for integer literals.
2732         Use ImplicitConversionExists instead of StandardConversionExists
2733         since we also need to check for user-defined implicit conversions.
2734         Fixes #34165.  Added test-173.cs.
2735
2736 2002-11-16  Martin Baulig  <martin@ximian.com>
2737
2738         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
2739         with the `true' and `false' literals.  Fixes #33151.
2740
2741 2002-11-16  Martin Baulig  <martin@ximian.com>
2742
2743         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
2744         October 22nd; don't do the cs1540 check for static members.
2745
2746         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
2747         now using our own filter here and doing the cs1540 check again.
2748
2749 2002-11-16  Martin Baulig  <martin@ximian.com>
2750
2751         * support.cs (InternalParameters): Don't crash if we don't have
2752         any fixed parameters.  Fixes #33532.
2753
2754 2002-11-16  Martin Baulig  <martin@ximian.com>
2755
2756         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
2757         when looking up static methods to make this work on Windows.
2758         Fixes #33773.
2759
2760 2002-11-16  Martin Baulig  <martin@ximian.com>
2761
2762         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
2763         a setter rather than using PropertyInfo.CanWrite.
2764
2765 2002-11-15  Nick Drochak  <ndrochak@gol.com>
2766
2767         * class.cs: Allow acces to block member by subclasses. Fixes build
2768         breaker.
2769
2770 2002-11-14  Martin Baulig  <martin@ximian.com>
2771
2772         * class.cs (Constructor.Emit): Added the extern/block check.
2773         Fixes bug #33678.
2774
2775 2002-11-14  Martin Baulig  <martin@ximian.com>
2776
2777         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
2778         iteration while looking for indexers, this is needed because the
2779         indexer may have a different name in our base classes.  Fixed the
2780         error reporting (no indexers at all, not get accessor, no
2781         overloaded match).  Fixes bug #33089.
2782         (IndexerAccess.DoResolveLValue): Likewise.
2783
2784 2002-11-14  Martin Baulig  <martin@ximian.com>
2785
2786         * class.cs (PropertyBase.CheckBase): Make this work for multiple
2787         indexers.  Fixes the first part of bug #33089.
2788         (MethodSignature.InheritableMemberSignatureCompare): Added support
2789         for properties.
2790
2791 2002-11-13  Ravi Pratap  <ravi@ximian.com>
2792
2793         * attribute.cs (Attribute.Resolve): Catch the
2794         NullReferenceException and report it since it isn't supposed to
2795         happen. 
2796         
2797 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
2798
2799         * expression.cs (Binary.EmitBranchable): Also handle the cases for
2800         LogicalOr and LogicalAnd that can benefit from recursively
2801         handling EmitBranchable.  The code now should be nice for Paolo.
2802
2803 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
2804
2805         * typemanager.cs (LookupType): Added a negative-hit hashtable for
2806         the Type lookups, as we perform quite a number of lookups on
2807         non-Types.  This can be removed once we can deterministically tell
2808         whether we have a type or a namespace in advance.
2809
2810         But this might require special hacks from our corlib.
2811
2812         * TODO: updated.
2813
2814         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
2815         and double which avoids a conversion from an integer to a double.
2816
2817         * expression.cs: tiny optimization, avoid calling IsConstant,
2818         because it effectively performs the lookup twice.
2819
2820 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
2821
2822         But a bogus return here to keep the semantics of the old code
2823         until the Mono runtime is fixed.
2824         
2825         * pending.cs (GetMissingInterfaces): New method used to remove all
2826         the interfaces that are already implemented by our parent
2827         classes from the list of pending methods. 
2828
2829         * interface.cs: Add checks for calls after ResolveTypeExpr.
2830
2831 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
2832
2833         * class.cs (Class.Emit): Report warning 67: event not used if the
2834         warning level is beyond 3.
2835
2836         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
2837         being a NullLiteral.
2838
2839         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
2840         specifiers. 
2841
2842         * class.cs (TypeContainer.GetClassBases): Cover a missing code
2843         path that might fail if a type can not be resolved.
2844
2845         * expression.cs (Binary.Emit): Emit unsigned versions of the
2846         operators. 
2847
2848         * driver.cs: use error 5.
2849         
2850 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
2851
2852         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
2853
2854 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
2855
2856         * cs-parser.jay (switch_section): A beautiful patch from Martin
2857         Baulig that fixed 33094.
2858
2859 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
2860
2861         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
2862         Check whether the base is abstract and report an error if so.
2863
2864         * expression.cs (IndexerAccess.DoResolveLValue,
2865         IndexerAccess.DoResolve): ditto. 
2866
2867         (Invocation.DoResolve): ditto.
2868         
2869         (Invocation.FullMethodDesc): Improve the report string.
2870
2871         * statement.cs (Block): Eliminate IsVariableDefined as it is
2872         basically just a wrapper for GetVariableInfo.
2873
2874         * ecore.cs (SimpleName): Use new 
2875
2876         * support.cs (ReflectionParamter.ParameterType): We unwrap the
2877         type, as we return the actual parameter ref/unref state on a
2878         different call.
2879
2880 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
2881
2882         * support.cs: Return proper flags REF/OUT fixing the previous
2883         commit.  
2884
2885         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
2886         not used to mean `ref' but `ref or out' in ParameterReference
2887         
2888         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
2889         full type signature instead of calling TypeManger.CSharpName
2890         ourselves. 
2891
2892         * support.cs (InternalParameters.ParameterDesc): Do not compare
2893         directly to the modflags, because REF/OUT will actually be bitsets
2894         if set. 
2895
2896         * delegate.cs (VerifyMethod): Check also the modifiers.
2897
2898         * cs-tokenizer.cs: Fix bug where floating point values with an
2899         exponent where a sign was missing was ignored.
2900
2901         * driver.cs: Allow multiple assemblies to be specified in a single
2902         /r: argument
2903
2904 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
2905
2906         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
2907         because identifiers after a parenthesis would end up in this kind
2908         of production, and we needed to desamiguate it for having casts
2909         like:
2910
2911                 (UserDefinedType *) xxx
2912
2913 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
2914
2915         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
2916         we should set on the Bindingflags.NonPublic, but not turn on
2917         private_ok.  private_ok controls whether a Private member is
2918         returned (this is chekced on the filter routine), while the
2919         BindingFlags.NonPublic just controls whether private/protected
2920         will be allowed.   This fixes the problem part of the problem of
2921         private properties being allowed to be used in derived classes.
2922
2923         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
2924         so we can call the children DoResolveLValue method (this will
2925         properly signal errors on lvalue assignments to base properties)
2926         
2927         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
2928         getter are null, and we have a property info, we know that this
2929         happened because the lookup failed, so we report an error 122 for
2930         protection level violation.
2931
2932         We also silently return if setter and getter are null in the
2933         resolve functions, this condition only happens if we have flagged
2934         the error before.  This is the other half of the problem. 
2935
2936         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
2937         not have accessibility information, that is why we were returning
2938         true in the filter function in typemanager.cs.
2939
2940         To properly report 122 (property is inaccessible because of its
2941         protection level) correctly, we report this error in ResolveAccess
2942         by failing if both the setter and the getter are lacking (ie, the
2943         lookup failed). 
2944
2945         DoResolve and DoLResolve have been modified to check for both
2946         setter/getter being null and returning silently, the reason being
2947         that I did not want to put the knowledge about this error in upper
2948         layers, like:
2949
2950         int old = Report.Errors;
2951         x = new PropertyExpr (...);
2952         if (old != Report.Errors)
2953                 return null;
2954         else
2955                 return x;
2956
2957         So the property expr is returned, but it is invalid, so the error
2958         will be flagged during the resolve process. 
2959
2960         * class.cs: Remove InheritablePropertySignatureCompare from the
2961         class, as we no longer depend on the property signature to compute
2962         whether it is possible to implement a method or not.
2963
2964         The reason is that calling PropertyInfo.GetGetMethod will return
2965         null (in .NET, in Mono it works, and we should change this), in
2966         cases where the Get Method does not exist in that particular
2967         class.
2968
2969         So this code:
2970
2971         class X { public virtual int A { get { return 1; } } }
2972         class Y : X { }
2973         class Z : Y { public override int A { get { return 2; } } }
2974
2975         Would fail in Z because the parent (Y) would not have the property
2976         defined.  So we avoid this completely now (because the alternative
2977         fix was ugly and slow), and we now depend exclusively on the
2978         method names.
2979
2980         (PropertyBase.CheckBase): Use a method-base mechanism to find our
2981         reference method, instead of using the property.
2982
2983         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
2984         routines are gone now.
2985
2986         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
2987         names, they were incorrectly named.
2988
2989         * cs-tokenizer.cs: Return are more gentle token on failure. 
2990
2991         * pending.cs (PendingImplementation.InterfaceMethod): This routine
2992         had an out-of-sync index variable, which caused it to remove from
2993         the list of pending methods the wrong method sometimes.
2994
2995 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
2996
2997         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
2998         CanWrite, because those refer to this particular instance of the
2999         property, and do not take into account the fact that we can
3000         override single members of a property.
3001
3002         Constructor requires an EmitContext.  The resolution process does
3003         not happen here, but we need to compute the accessors before,
3004         because the resolution does not always happen for properties.
3005         
3006         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
3007         subclass, before we did not update this flag, but we did update
3008         bindingflags. 
3009
3010         (GetAccessors): Drop this routine, as it did not work in the
3011         presence of partially overwritten set/get methods. 
3012
3013         Notice that this broke the cs1540 detection, but that will require
3014         more thinking. 
3015         
3016 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3017
3018         * class.cs:
3019         * codegen.cs:
3020         * driver.cs: issue a warning instead of an error if we don't support
3021         debugging for the platform. Also ignore a couple of errors that may
3022         arise when trying to write the symbols. Undo my previous patch.
3023
3024 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3025
3026         * driver.cs: ignore /debug switch except for Unix platforms.
3027
3028 2002-10-23  Nick Drochak  <ndrochak@gol.com>
3029
3030         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
3031
3032 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
3033
3034         * driver.cs: Do not make mcs-debug conditional, so we do not break
3035         builds that use it.
3036
3037         * statement.cs (UsageVector.MergeChildren): I would like Martin to
3038         review this patch.  But basically after all the children variables
3039         have been merged, the value of "Breaks" was not being set to
3040         new_breaks for Switch blocks.  I think that it should be set after
3041         it has executed.  Currently I set this to the value of new_breaks,
3042         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
3043         conservative, but I do not understand this code very well.
3044
3045         I did not break anything in the build, so that is good ;-)
3046
3047         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
3048
3049 2002-10-20  Mark Crichton  <crichton@gimp.org>
3050
3051         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
3052
3053 2002-10-20  Nick Drochak  <ndrochak@gol.com>
3054
3055         * cfold.cs: Fixed compile blocker.
3056
3057 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
3058
3059         * driver.cs: I was chekcing the key, not the file.
3060
3061 2002-10-19  Ravi Pratap  <ravi@ximian.com>
3062
3063         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
3064         message that we were generating - we just need to silently return
3065         a null.
3066
3067 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
3068
3069         * class.cs (Event.Define): Change my previous commit, as this
3070         breaks the debugger.  This is a temporary hack, as it seems like
3071         the compiler is generating events incorrectly to begin with.
3072
3073         * expression.cs (Binary.ResolveOperator): Added support for 
3074         "U operator - (E x, E y)"
3075
3076         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
3077         y)".
3078
3079         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
3080         init-only variables, but this path did not take into account that
3081         there might be also instance readonly variables.  Correct this
3082         problem. 
3083
3084         This fixes bug 32253
3085
3086         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
3087         delegates as well.
3088
3089         * driver.cs: Change the extension for modules to `netmodule'
3090
3091         * cs-parser.jay: Improved slightly the location tracking for
3092         the debugger symbols.
3093
3094         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
3095         modifiers that were specified instead of the hardcoded value
3096         (FamAndAssem).  This was basically ignoring the static modifier,
3097         and others.  Fixes 32429.
3098
3099         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
3100         fixed a bug in the process (32476)
3101
3102         * expression.cs (ArrayAccess.EmitAssign): Patch from
3103         hwang_rob@yahoo.ca that fixes bug 31834.3
3104
3105 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
3106
3107         * driver.cs: Make the module extension .netmodule.
3108
3109 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
3110
3111         * driver.cs: Report an error if the resource file is not found
3112         instead of crashing.
3113
3114         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
3115         false, like Emit does.
3116
3117 2002-10-16  Nick Drochak  <ndrochak@gol.com>
3118
3119         * typemanager.cs: Remove unused private member.  Also reported mcs
3120         bug to report this as a warning like csc.
3121
3122 2002-10-15  Martin Baulig  <martin@gnome.org>
3123
3124         * statement.cs (Statement.Emit): Made this a virtual method; emits
3125         the line number info and calls DoEmit().
3126         (Statement.DoEmit): New protected abstract method, formerly knows
3127         as Statement.Emit().
3128
3129         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
3130
3131 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
3132
3133         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
3134         have fixed a remaining problem: not every AddXXXX was adding a
3135         fully qualified name.  
3136
3137         Now everyone registers a fully qualified name in the DeclSpace as
3138         being defined instead of the partial name.  
3139
3140         Downsides: we are slower than we need to be due to the excess
3141         copies and the names being registered this way.  
3142
3143         The reason for this is that we currently depend (on the corlib
3144         bootstrap for instance) that types are fully qualified, because
3145         we dump all the types in the namespace, and we should really have
3146         types inserted into the proper namespace, so we can only store the
3147         basenames in the defined_names array.
3148
3149 2002-10-10  Martin Baulig  <martin@gnome.org>
3150
3151         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
3152         from bug #31834, see the bug report for a testcase which is
3153         miscompiled.
3154
3155 2002-10-10  Martin Baulig  <martin@gnome.org>
3156
3157         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
3158         flow analysis code for this.
3159
3160         * statement.cs (Do, While, For): Tell the flow analysis code about
3161         infinite loops.
3162         (FlowBranching.UsageVector): Added support for infinite loops.
3163         (Block.Resolve): Moved the dead code elimination here and use flow
3164         analysis to do it.
3165
3166 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
3167
3168         * class.cs (Field.Define): Catch cycles on struct type
3169         definitions. 
3170
3171         * typemanager.cs (IsUnmanagedtype): Do not recursively check
3172         fields if the fields are static.  We only need to check instance
3173         fields. 
3174
3175         * expression.cs (As.DoResolve): Test for reference type.
3176
3177         * statement.cs (Using.ResolveExpression): Use
3178         ConvertImplicitRequired, not ConvertImplicit which reports an
3179         error on failture
3180         (Using.ResolveLocalVariableDecls): ditto.
3181
3182         * expression.cs (Binary.ResolveOperator): Report errors in a few
3183         places where we had to.
3184
3185         * typemanager.cs (IsUnmanagedtype): Finish implementation.
3186
3187 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
3188
3189         * expression.cs: Use StoreFromPtr instead of extracting the type
3190         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
3191
3192         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
3193         an enumeration value to a System.Enum, but System.Enum is not a
3194         value type, but an class type, so we need to box.
3195
3196         (Expression.ConvertExplicit): One codepath could return
3197         errors but not flag them.  Fix this.  Fixes #31853
3198
3199         * parameter.cs (Resolve): Do not allow void as a parameter type.
3200
3201 2002-10-06  Martin Baulig  <martin@gnome.org>
3202
3203         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
3204         if it's a class type and not a struct.  Fixes #31815.
3205
3206 2002-10-06  Martin Baulig  <martin@gnome.org>
3207
3208         * statement.cs: Reworked the flow analysis code a bit to make it
3209         usable for dead code elimination.
3210
3211 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3212
3213         * cs-parser.jay: allow empty source files. Fixes bug #31781.
3214
3215 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
3216
3217         * expression.cs (ComposedCast.DoResolveType): A quick workaround
3218         to fix the test 165, will investigate deeper.
3219
3220 2002-10-04  Martin Baulig  <martin@gnome.org>
3221
3222         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
3223         finally blocks actually work.
3224         (Try.Resolve): We don't need to create a sibling for `finally' if
3225         there is no finally block.
3226
3227 2002-10-04  Martin Baulig  <martin@gnome.org>
3228
3229         * class.cs (Constructor.Define): The default accessibility for a
3230         non-default constructor is private, not public.
3231
3232 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
3233
3234         * class.cs (Constructor): Make AllowedModifiers public, add
3235         EXTERN.
3236
3237         * cs-parser.jay: Perform the modifiers test here, as the
3238         constructor for the Constructor class usually receives a zero
3239         because of the way we create it (first we create, later we
3240         customize, and we were never checking the modifiers).
3241
3242         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
3243         is a version of LookupTypeReflection that includes the type-name
3244         cache.  This can be used as a fast path for functions that know
3245         the fully qualified name and are only calling into *.GetType() to
3246         obtain a composed type.
3247
3248         This is also used by TypeManager.LookupType during its type
3249         composition.
3250
3251         (LookupType): We now also track the real type name, as sometimes
3252         we can get a quey for the real type name from things like
3253         ComposedCast.  This fixes bug 31422.
3254         
3255         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
3256         complete type fullname, it does not have to go through the type
3257         resolution system to obtain the composed version of the type (for
3258         obtaining arrays or pointers).
3259         
3260         (Conditional.Emit): Use the EmitBoolExpression to
3261         generate nicer code, as requested by Paolo.
3262
3263         (ArrayCreation.CheckIndices): Use the patch from
3264         hwang_rob@yahoo.ca to validate the array initializers. 
3265
3266 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
3267
3268         * class.cs (ConstructorInitializer.Emit): simplify code by using
3269         Invocation.EmitCall, and at the same time, fix the bugs in calling
3270         parent constructors that took variable arguments. 
3271
3272         * ecore.cs (Expression.ConvertNumericExplicit,
3273         Expression.ImplicitNumericConversion): Remove the code that
3274         manually wrapped decimal (InternalTypeConstructor call is now gone
3275         as well).
3276
3277         * expression.cs (Cast.TryReduce): Also handle decimal types when
3278         trying to perform a constant fold on the type.
3279
3280         * typemanager.cs (IsUnmanagedtype): Partially implemented.
3281
3282         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
3283         that only turned off an error report, and did nothing else. 
3284
3285 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
3286
3287         * driver.cs: Handle and ignore /fullpaths
3288
3289 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
3290
3291         * expression.cs (Binary.ResolveOperator): Catch the case where
3292         DoNumericPromotions returns true, 
3293
3294         (Binary.DoNumericPromotions): Simplify the code, and the tests.
3295
3296 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
3297
3298         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
3299         report error 70.
3300
3301 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
3302
3303         * ecore.cs (ConvertNumericExplicit): It is not enough that the
3304         conversion exists, but it is also required that the conversion be
3305         performed.  This manifested in "(Type64Enum) 2".  
3306
3307         * class.cs (TypeManager.AddMethod): The fix is not to change
3308         AddEnum, because that one was using a fully qualified name (every
3309         DeclSpace derivative does), but to change the AddMethod routine
3310         that was using an un-namespaced name.  This now correctly reports
3311         the duplicated name.
3312
3313         Revert patch until I can properly fix it.  The issue
3314         is that we have a shared Type space across all namespaces
3315         currently, which is wrong.
3316
3317         Options include making the Namespace a DeclSpace, and merge
3318         current_namespace/current_container in the parser.
3319
3320 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
3321
3322         * cs-parser.jay: Improve error reporting when we get a different
3323         kind of expression in local_variable_type and
3324         local_variable_pointer_type. 
3325
3326         Propagate this to avoid missleading errors being reported.
3327
3328         * ecore.cs (ImplicitReferenceConversion): treat
3329         TypeManager.value_type as a target just like object_type.   As
3330         code like this:
3331
3332         ValueType v = 1;
3333
3334         Is valid, and needs to result in the int 1 being boxed before it
3335         is assigned to the value type v.
3336
3337         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
3338         to validate the enumeration name.
3339
3340         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
3341         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
3342         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
3343
3344         * ecore.cs (TryImplicitIntConversion): When doing an
3345         implicit-enumeration-conversion, check if the type is 64-bits and
3346         perform a conversion before passing to EnumConstant.
3347
3348 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
3349
3350         * decl.cs (Error_AmbiguousTypeReference); New routine used to
3351         report ambiguous type references.  Unlike the MS version, we
3352         report what the ambiguity is.   Innovation at work ;-)
3353
3354         (DeclSpace.FindType): Require a location argument to
3355         display when we display an ambiguous error.
3356
3357         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
3358
3359         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
3360
3361         * expression.cs (EmitDynamicInitializers): Apply patch from
3362         hwang_rob@yahoo.ca that fixes the order in which we emit our
3363         initializers. 
3364
3365 2002-09-21  Martin Baulig  <martin@gnome.org>
3366
3367         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
3368         delegate takes no arguments.
3369
3370 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
3371
3372         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
3373         from integers.
3374
3375         * expression.cs: Extract the underlying type.
3376
3377         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
3378
3379         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
3380
3381 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
3382
3383         * class.cs (TypeContainer.DefineType): We can not use the nice
3384         PackingSize with the size set to 1 DefineType method, because it
3385         will not allow us to define the interfaces that the struct
3386         implements.
3387
3388         This completes the fixing of bug 27287
3389
3390         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
3391         means also structs.  This fixes part of the problem. 
3392         (Expresion.ImplicitReferenceConversionExists): ditto.
3393
3394         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
3395         error if there were no errors reported during the type lookup
3396         process, to avoid duplicates or redundant errors.  Without this
3397         you would get an ambiguous errors plus a type not found.  We have
3398         beaten the user enough with the first error.  
3399
3400         (DeclSparce.FindType): Emit a warning if we have an ambiguous
3401         reference. 
3402
3403         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
3404         during the resolution process, stop the lookup, this avoids
3405         repeated error reports (same error twice).
3406
3407         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
3408
3409         * typemanager.cs (LookupType): Redo the type lookup code to match
3410         the needs of System.Reflection.  
3411
3412         The issue is that System.Reflection requires references to nested
3413         types to begin with a "+" sign instead of a dot.  So toplevel
3414         types look like: "NameSpace.TopLevelClass", and nested ones look
3415         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
3416         levels. 
3417
3418 2002-09-19  Martin Baulig  <martin@gnome.org>
3419
3420         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
3421         says that a method always returns or always throws an exception,
3422         don't report the CS0161.
3423
3424         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
3425         set `Returns = new_returns'.
3426
3427 2002-09-19  Martin Baulig  <martin@gnome.org>
3428
3429         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
3430         to an enum constant, check for a CS0176.
3431
3432 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
3433
3434         * class.cs (TypeContainer.CheckPairedOperators): Now we check
3435         for operators that must be in pairs and report errors.
3436
3437         * ecore.cs (SimpleName.DoResolveType): During the initial type
3438         resolution process, when we define types recursively, we must
3439         check first for types in our current scope before we perform
3440         lookups in the enclosing scopes.
3441
3442         * expression.cs (MakeByteBlob): Handle Decimal blobs.
3443
3444         (Invocation.VerifyArgumentsCompat): Call
3445         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
3446         I thought we were supposed to always call this, but there are a
3447         few places in the code where we dont do it.
3448
3449 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
3450
3451         * driver.cs: Add support in -linkres and -resource to specify the
3452         name of the identifier.
3453
3454 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
3455
3456         * ecore.cs (StandardConversionExists): Sync with the conversion
3457         code: allow anything-* to void* conversions.
3458
3459         (FindMostSpecificSource): Use an Expression argument
3460         instead of a Type, because we might be handed over a Literal which
3461         gets a few more implicit conversions that plain types do not.  So
3462         this information was being lost.
3463
3464         Also, we drop the temporary type-holder expression when not
3465         required.
3466
3467 2002-09-17  Martin Baulig  <martin@gnome.org>
3468
3469         * class.cs (PropertyBase.CheckBase): Don't check the base class if
3470         this is an explicit interface implementation.
3471
3472 2002-09-17  Martin Baulig  <martin@gnome.org>
3473
3474         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
3475         different `IndexerName' attributes.
3476
3477         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
3478         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
3479         virtual CommonResolve().
3480
3481 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
3482
3483         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
3484         and convert that to the UnderlyingType.
3485
3486         * statement.cs (Foreach.Resolve): Indexers are just like variables
3487         or PropertyAccesses.
3488
3489         * cs-tokenizer.cs (consume_string): Track line numbers and columns
3490         inside quoted strings, we were not doing this before.
3491
3492 2002-09-16  Martin Baulig  <martin@gnome.org>
3493
3494         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
3495         resolve it.  This is needed for the definite assignment check of the
3496         instance expression, fixes bug #29846.
3497         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
3498
3499 2002-09-16  Nick Drochak  <ndrochak@gol.com>
3500
3501         * parameter.cs: Fix compile error.  Cannot reference static member
3502         from an instance object.  Is this an mcs bug?
3503
3504 2002-09-14  Martin Baulig  <martin@gnome.org>
3505
3506         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
3507         multiple times.  Fixes bug #30295, added test-166.cs.
3508
3509 2002-09-14  Martin Baulig  <martin@gnome.org>
3510
3511         * statement.cs (Block.Emit): Don't emit unreachable code.
3512         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
3513         `break' statements.
3514         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
3515
3516 2002-09-14  Martin Baulig  <martin@gnome.org>
3517
3518         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
3519         is set.
3520
3521 2002-09-14  Martin Baulig  <martin@gnome.org>
3522
3523         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
3524         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
3525         be false on the ms runtime.
3526
3527 2002-09-13  Martin Baulig  <martin@gnome.org>
3528
3529         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
3530         the CS0038 error message.
3531
3532 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
3533
3534         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
3535         constant inside, return it.
3536
3537 2002-09-12  Martin Baulig  <martin@gnome.org>
3538
3539         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
3540         implicit conversion can be done between enum types.
3541
3542         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
3543         check whether an implicit conversion to the current enum's UnderlyingType
3544         exists and report an error if not.
3545
3546         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
3547         without debugging support.
3548
3549         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
3550         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
3551
3552 2002-09-12  Martin Baulig  <martin@gnome.org>
3553
3554         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
3555
3556         * ecore.cs (IMemberExpr.DeclaringType): New property.
3557         (SimpleName.SimpleNameResolve): Check whether we're accessing a
3558         nonstatic member of an outer type (CS0038).
3559
3560 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
3561
3562         * driver.cs: Activate the using-error detector at warning level
3563         4 (at least for MS-compatible APIs).
3564
3565         * namespace.cs (VerifyUsing): Small buglett fix.
3566
3567         * pending.cs (PendingImplementation): pass the container pointer. 
3568
3569         * interface.cs (GetMethods): Allow for recursive definition.  Long
3570         term, I would like to move every type to support recursive
3571         definitions, not the current ordering mechanism that we have right
3572         now.
3573
3574         The situation is this: Attributes are handled before interfaces,
3575         so we can apply attributes to interfaces.  But some attributes
3576         implement interfaces, we will now handle the simple cases
3577         (recursive definitions will just get an error).  
3578
3579         * parameter.cs: Only invalidate types at the end if we fail to
3580         lookup all types.  
3581
3582 2002-09-09  Martin Baulig  <martin@gnome.org>
3583
3584         * ecore.cs (PropertyExpr.Emit): Also check for
3585         TypeManager.system_int_array_get_length so this'll also work when
3586         compiling corlib.  Fixes #30003.
3587
3588 2002-09-09  Martin Baulig  <martin@gnome.org>
3589
3590         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
3591         and throw an exception if we can't get the type's size.  Fixed #30040,
3592         added test-165.cs.
3593
3594 2002-09-09  Martin Baulig  <martin@gnome.org>
3595
3596         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
3597
3598         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
3599         context.  Fixes bug #30027.
3600
3601         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
3602         virtual functions.  Fixes bug #30043, added test-164.cs.
3603
3604 2002-09-08  Ravi Pratap  <ravi@ximian.com>
3605
3606         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
3607
3608 2002-09-08  Nick Drochak  <ndrochak@gol.com>
3609
3610         * driver.cs: Use an object to get the windows codepage since it's not a
3611         static property.
3612
3613 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
3614
3615         * statement.cs (For.Emit): for infinite loops (test == null)
3616         return whether there is a break inside, not always "true".
3617
3618         * namespace.cs (UsingEntry): New struct to hold the name of the
3619         using definition, the location where it is defined, and whether it
3620         has been used in a successful type lookup.
3621         
3622         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
3623         strings.
3624
3625         * decl.cs: ditto.
3626
3627 2002-09-06  Ravi Pratap  <ravi@ximian.com>
3628
3629         * attribute.cs : Fix incorrect code which relied on catching
3630         a NullReferenceException to detect a null being passed in
3631         where an object was expected.
3632
3633 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
3634
3635         * statement.cs (Try): flag the catch variable as assigned
3636
3637         * expression.cs (Cast): Simplified by using ResolveType instead of
3638         manually resolving.
3639
3640         * statement.cs (Catch): Fix bug by using ResolveType.
3641
3642 2002-09-06  Ravi Pratap  <ravi@ximian.com>
3643
3644         * expression.cs (BetterConversion): Special case for when we have
3645         a NullLiteral as the argument and we have to choose between string
3646         and object types - we choose string the way csc does.
3647
3648         * attribute.cs (Attribute.Resolve): Catch the
3649         NullReferenceException and report error #182 since the Mono
3650         runtime no more has the bug and having this exception raised means
3651         we tried to select a constructor which takes an object and is
3652         passed a null.
3653
3654 2002-09-05  Ravi Pratap  <ravi@ximian.com>
3655
3656         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
3657         message (1502, 1503) when we can't locate a method after overload
3658         resolution. This is much more informative and closes the bug
3659         Miguel reported.
3660
3661         * interface.cs (PopulateMethod): Return if there are no argument
3662         types. Fixes a NullReferenceException bug.
3663
3664         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
3665         expressions too. Previously we were checking only in one place for
3666         positional arguments leaving out named arguments.
3667
3668         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
3669         type to the enum type is not allowed. Remove code corresponding to
3670         that.
3671
3672         (ConvertNumericExplicit): Allow explicit conversions from
3673         the underlying type to enum type. This precisely follows the spec
3674         and closes a bug filed by Gonzalo.
3675         
3676 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3677
3678         * compiler.csproj:
3679         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
3680
3681 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
3682
3683         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
3684         it was important that we stored the right value after the
3685         reduction in `converted'.
3686
3687 2002-09-04  Martin Baulig  <martin@gnome.org>
3688
3689         * location.cs (Location.SymbolDocument): Use full pathnames for the
3690         source files.
3691
3692 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
3693
3694         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
3695         of the expression resolve mechanism, because that will catch the
3696         SimpleName error failures.
3697
3698         (Conditional): If we can not resolve the
3699         expression, return, do not crash.
3700
3701 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3702
3703         * cs-tokenizer.cs:
3704         (location): display token name instead of its number.
3705
3706 2002-08-28  Martin Baulig  <martin@gnome.org>
3707
3708         * expression.cs (Binary.ResolveOperator): Don't silently return
3709         but return an error if an operator cannot be applied between two
3710         enum types.
3711
3712 2002-08-28  Martin Baulig  <martin@gnome.org>
3713
3714         * class.cs (Constructor.Define): Set the permission attributes
3715         correctly instead of making all constructors public.
3716
3717 2002-08-28  Martin Baulig  <martin@gnome.org>
3718
3719         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
3720         for private members before reporting a CS0103; if we find anything,
3721         it's a CS0122.
3722
3723 2002-08-28  Martin Baulig  <martin@gnome.org>
3724
3725         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
3726         to check whether `closure_start_type == closure_invocation_type',
3727         we also need to check whether `m.DeclaringType == closure_invocation_type'
3728         before bypassing the permission checks.  We might be accessing
3729         protected/private members from the base class.
3730         (TypeManager.RealMemberLookup): Only set private_ok if private
3731         members were requested via BindingFlags.NonPublic.
3732
3733         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
3734
3735         * expression.cs (MemberAccess.ResolveMemberAccess): Set
3736         MethodGroupExpr.IsExplicitImpl if appropriate.
3737         (Invocation.DoResolve): Don't report the CS0120 for explicit
3738         interface implementations.
3739
3740 2002-08-27  Martin Baulig  <martin@gnome.org>
3741
3742         * expression.cs (Invocation.DoResolve): If this is a static
3743         method and we don't have an InstanceExpression, we must report
3744         a CS0120.
3745
3746 2002-08-25  Martin Baulig  <martin@gnome.org>
3747
3748         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
3749         `==' between a valuetype and an object.
3750
3751 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
3752
3753         * ecore.cs (TypeExpr): Provide a ToString method.
3754
3755 2002-08-24  Martin Baulig  <martin@gnome.org>
3756
3757         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
3758         now called proggie.dbg and it's a binary file.
3759
3760 2002-08-23  Martin Baulig  <martin@gnome.org>
3761
3762         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
3763
3764 2002-08-23  Martin Baulig  <martin@gnome.org>
3765
3766         * struct.cs (MyStructInfo.ctor): Make this work with empty
3767         structs; it's not allowed to use foreach() on null.
3768
3769 2002-08-23  Martin Baulig  <martin@gnome.org>
3770
3771         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
3772         writer the full pathname of the generated assembly.
3773
3774 2002-08-23  Martin Baulig  <martin@gnome.org>
3775
3776         * statements.cs (FlowBranching.UsageVector.MergeChildren):
3777         A `finally' block never returns or breaks; improved handling of
3778         unreachable code.
3779
3780 2002-08-23  Martin Baulig  <martin@gnome.org>
3781
3782         * statement.cs (Throw.Resolve): Allow `throw null'.
3783
3784 2002-08-23  Martin Baulig  <martin@gnome.org>
3785
3786         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
3787         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
3788         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
3789         MemberLookup would return a wrong event if this is an explicit
3790         interface implementation and the class has an event with the same
3791         name.
3792
3793 2002-08-23  Martin Baulig  <martin@gnome.org>
3794
3795         * statement.cs (Block.AddChildVariableNames): New public method.
3796         (Block.AddChildVariableName): Likewise.
3797         (Block.IsVariableNameUsedInChildBlock): Likewise.
3798         (Block.AddVariable): Check whether a variable name has already
3799         been used in a child block.
3800
3801         * cs-parser.jay (declare_local_variables): Mark all variable names
3802         from the current block as being used in a child block in the
3803         implicit block.
3804
3805 2002-08-23  Martin Baulig  <martin@gnome.org>
3806
3807         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
3808         find the symbol writer.
3809
3810         * driver.cs: csc also allows the arguments to /define being
3811         separated by commas, not only by semicolons.
3812
3813 2002-08-23  Martin Baulig  <martin@gnome.org>
3814
3815         * interface.cs (Interface.GetMembers): Added static check for events.
3816
3817 2002-08-15  Martin Baulig  <martin@gnome.org>
3818
3819         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
3820         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
3821
3822         * ecore.cs (Expression.MemberLookup): Added documentation and explained
3823         why the MethodData.EmitDestructor() change was necessary.
3824
3825 2002-08-20  Martin Baulig  <martin@gnome.org>
3826
3827         * class.cs (TypeContainer.FindMembers): Added static check for events.
3828
3829         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
3830
3831         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
3832         use Type.GetEvents(), not Type.FindMembers().
3833
3834 2002-08-20  Martin Baulig  <martin@gnome.org>
3835
3836         * decl.cs (MemberCache): Added a special method cache which will
3837         be used for method-only searched.  This ensures that a method
3838         search will return a MethodInfo with the correct ReflectedType for
3839         inherited methods.      
3840
3841 2002-08-20  Martin Baulig  <martin@gnome.org>
3842
3843         * decl.cs (DeclSpace.FindMembers): Made this public.
3844
3845 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3846
3847         * delegate.cs: fixed build on windows.
3848         [FIXME:  Filed as bug #29150: MCS must report these errors.]
3849
3850 2002-08-19  Ravi Pratap  <ravi@ximian.com>
3851
3852         * ecore.cs (StandardConversionExists): Return a false
3853         if we are trying to convert the void type to anything else
3854         since that is not allowed.
3855
3856         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
3857         we flag error 70 in the event an event is trying to be accessed
3858         directly from outside the declaring type.
3859
3860 2002-08-20  Martin Baulig  <martin@gnome.org>
3861
3862         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
3863         MemberCache from typemanager.cs to decl.cs.
3864
3865 2002-08-19  Martin Baulig  <martin@gnome.org>
3866
3867         * class.cs (TypeContainer): Implement IMemberContainer.
3868         (TypeContainer.DefineMembers): Create the MemberCache.
3869         (TypeContainer.FindMembers): Do better BindingFlags checking; only
3870         return public members if BindingFlags.Public was given, check
3871         whether members are static.
3872
3873 2002-08-16  Martin Baulig  <martin@gnome.org>
3874
3875         * decl.cs (DeclSpace.Define): Splitted this in Define and
3876         DefineMembers.  DefineMembers is called first and initializes the
3877         MemberCache.
3878
3879         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
3880         DefineMembers() on all our DeclSpaces.
3881
3882         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
3883         but call DefineMembers() on all nested interfaces.  We call their
3884         Define() in our new Define() function.
3885
3886         * interface.cs (Interface): Implement IMemberContainer.
3887         (Interface.Define): Moved all code except the attribute stuf to
3888         DefineMembers().
3889         (Interface.DefineMembers): Initialize the member cache.
3890
3891         * typemanager.cs (IMemberFinder): Removed this interface, we don't
3892         need this anymore since we can use MemberCache.FindMembers directly.
3893
3894 2002-08-19  Martin Baulig  <martin@gnome.org>
3895
3896         * typemanager.cs (MemberCache): When creating the cache for an
3897         interface type, add all inherited members.
3898         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
3899         to `out bool used_cache' and documented it.
3900         (TypeManager.MemberLookup): If we already used the cache in the first
3901         iteration, we don't need to do the interfaces check.
3902
3903 2002-08-19  Martin Baulig  <martin@gnome.org>
3904
3905         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
3906         here from IMemberFinder and don't implement this interface anymore.
3907         (DeclSpace.MemberCache): Moved here from IMemberFinder.
3908
3909         * typemanager.cs (IMemberFinder): This interface is now only used by
3910         classes which actually support the member cache.
3911         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
3912         since we only put DeclSpaces into this Hashtable.
3913         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
3914         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
3915
3916 2002-08-16  Martin Baulig  <martin@gnome.org>
3917
3918         * typemanager.cs (ICachingMemberFinder): Removed.
3919         (IMemberFinder.MemberCache): New property.
3920         (TypeManager.FindMembers): Merged this with RealFindMembers().
3921         This function will never be called from TypeManager.MemberLookup()
3922         so we can't use the cache here, just the IMemberFinder.
3923         (TypeManager.MemberLookup_FindMembers): Check whether the
3924         IMemberFinder has a MemberCache and call the cache's FindMembers
3925         function.
3926         (MemberCache): Rewrote larger parts of this yet another time and
3927         cleaned it up a bit.
3928
3929 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
3930
3931         * driver.cs (LoadArgs): Support quoting.
3932
3933         (Usage): Show the CSC-like command line arguments.
3934
3935         Improved a few error messages.
3936
3937 2002-08-15  Martin Baulig  <martin@gnome.org>
3938
3939         * typemanager.cs (IMemberContainer.Type): New property.
3940         (IMemberContainer.IsInterface): New property.
3941
3942         The following changes are conditional to BROKEN_RUNTIME, which is
3943         defined at the top of the file.
3944
3945         * typemanager.cs (MemberCache.MemberCache): Don't add the base
3946         class'es members, but add all members from TypeHandle.ObjectType
3947         if we're an interface.
3948         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
3949         is the current type.
3950         (MemberCache.CacheEntry.Container): Removed this field.
3951         (TypeHandle.GetMembers): Include inherited members.
3952
3953 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3954
3955         * typemanager.cs: fixed compilation and added a comment on a field that
3956         is never used.
3957
3958 2002-08-15  Martin Baulig  <martin@gnome.org>
3959
3960         * class.cs (ConstructorInitializer.Resolve): In the
3961         Expression.MemberLookup call, use the queried_type as
3962         invocation_type.
3963
3964         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
3965         declared' attribute, it's always true.
3966         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
3967         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
3968         temporary wrapper for FindMembers which tells MemberLookup whether
3969         members from the base classes are included in the return value.
3970         This will go away soon.
3971         (TypeManager.MemberLookup): Use this temporary hack here; once the
3972         new MemberCache is completed, we don't need to do the DeclaredOnly
3973         looping here anymore since the MemberCache will take care of this.
3974         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
3975         (MemberCache): When creating the MemberCache for a class, get
3976         members from the current class and all its base classes.
3977         (MemberCache.CacheEntry.Container): New field.  This is a
3978         temporary hack until the Mono runtime is fixed to distinguish
3979         between ReflectedType and DeclaringType.  It allows us to use MCS
3980         with both the MS runtime and the unfixed Mono runtime without
3981         problems and without accecting performance.
3982         (MemberCache.SearchMembers): The DeclaredOnly looping from
3983         TypeManager.MemberLookup is now done here.      
3984
3985 2002-08-14  Martin Baulig  <martin@gnome.org>
3986
3987         * statement.cs (MyStructInfo.MyStructInfo): Don't call
3988         Type.GetFields on dynamic types but get the fields from the
3989         corresponding TypeContainer.
3990         (MyStructInfo.GetStructInfo): Added check for enum types.
3991
3992         * typemanager.cs (MemberList.IsSynchronized): Implemented.
3993         (MemberList.SyncRoot): Implemented.
3994         (TypeManager.FilterWithClosure): No need to check permissions if
3995         closure_start_type == closure_invocation_type, don't crash if
3996         closure_invocation_type is null.
3997
3998 2002-08-13  Martin Baulig  <martin@gnome.org>
3999
4000         Rewrote TypeContainer.FindMembers to use a member cache.  This
4001         gives us a speed increase of about 35% for the self-hosting MCS
4002         build and of about 15-20% for the class libs (both on GNU/Linux).
4003
4004         * report.cs (Timer): New class to get enhanced profiling.  This
4005         whole class is "TIMER" conditional since it remarkably slows down
4006         compilation speed.
4007
4008         * class.cs (MemberList): New class.  This is an IList wrapper
4009         which we're now using instead of passing MemberInfo[]'s around to
4010         avoid copying this array unnecessarily.
4011         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
4012         (ICachingMemberFinder, IMemberContainer): New interface.
4013         (TypeManager.FilterWithClosure): If `criteria' is null, the name
4014         has already been checked, otherwise use it for the name comparision.
4015         (TypeManager.FindMembers): Renamed to RealMemberFinder and
4016         provided wrapper which tries to use ICachingMemberFinder.FindMembers
4017         if possible.  Returns a MemberList, not a MemberInfo [].
4018         (TypeHandle): New class, implements IMemberContainer.  We create
4019         one instance of this class per type, it contains a MemberCache
4020         which is used to do the member lookups.
4021         (MemberCache): New class.  Each instance of this class contains
4022         all members of a type and a name-based hash table.
4023         (MemberCache.FindMembers): This is our new member lookup
4024         function.  First, it looks up all members of the requested name in
4025         the hash table.  Then, it walks this list and sorts out all
4026         applicable members and returns them.
4027
4028 2002-08-13  Martin Baulig  <martin@gnome.org>
4029
4030         In addition to a nice code cleanup, this gives us a performance
4031         increase of about 1.4% on GNU/Linux - not much, but it's already
4032         half a second for the self-hosting MCS compilation.
4033
4034         * typemanager.cs (IMemberFinder): New interface.  It is used by
4035         TypeManager.FindMembers to call FindMembers on a TypeContainer,
4036         Enum, Delegate or Interface.
4037         (TypeManager.finder_to_member_finder): New PtrHashtable.
4038         (TypeManager.finder_to_container): Removed.
4039         (TypeManager.finder_to_delegate): Removed.
4040         (TypeManager.finder_to_interface): Removed.
4041         (TypeManager.finder_to_enum): Removed.
4042
4043         * interface.cs (Interface): Implement IMemberFinder.
4044
4045         * delegate.cs (Delegate): Implement IMemberFinder.
4046
4047         * enum.cs (Enum): Implement IMemberFinder.
4048
4049         * class.cs (TypeContainer): Implement IMemberFinder.
4050
4051 2002-08-12  Martin Baulig  <martin@gnome.org>
4052
4053         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
4054
4055 2002-08-12  Martin Baulig  <martin@gnome.org>
4056
4057         * ecore.cs (ITypeExpression): New interface for expressions which
4058         resolve to a type.
4059         (TypeExpression): Renamed to TypeLookupExpression.
4060         (Expression.DoResolve): If we're doing a types-only lookup, the
4061         expression must implement the ITypeExpression interface and we
4062         call DoResolveType() on it.
4063         (SimpleName): Implement the new ITypeExpression interface.
4064         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
4065         hack, the situation that we're only looking up types can't happen
4066         anymore when this method is called.  Moved the type lookup code to
4067         DoResolveType() and call it.
4068         (SimpleName.DoResolveType): This ITypeExpression interface method
4069         is now doing the types-only lookup.
4070         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
4071         (ResolveFlags): Added MaskExprClass.
4072
4073         * expression.cs (MemberAccess): Implement the ITypeExpression
4074         interface.
4075         (MemberAccess.DoResolve): Added support for a types-only lookup
4076         when we're called via ITypeExpression.DoResolveType().
4077         (ComposedCast): Implement the ITypeExpression interface.
4078
4079         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
4080         Expression.Resolve() with ResolveFlags.Type instead.
4081
4082 2002-08-12  Martin Baulig  <martin@gnome.org>
4083
4084         * interface.cs (Interface.Define): Apply attributes.
4085
4086         * attribute.cs (Attribute.ApplyAttributes): Added support for
4087         interface attributes.
4088
4089 2002-08-11  Martin Baulig  <martin@gnome.org>
4090
4091         * statement.cs (Block.Emit): Only check the "this" variable if we
4092         do not always throw an exception.
4093
4094         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
4095         whether the property has a set accessor.
4096
4097 2002-08-11  Martin Baulig  <martin@gnome.org>
4098
4099         Added control flow analysis support for structs.
4100
4101         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
4102         with control flow analysis turned off.
4103         (IVariable): New interface.
4104         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
4105         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
4106         (FieldExpr.DoResolve): Resolve the instance expression with flow
4107         analysis turned off and do the definite assignment check after the
4108         resolving when we know what the expression will resolve to.
4109
4110         * expression.cs (LocalVariableReference, ParameterReference):
4111         Implement the new IVariable interface, only call the flow analysis
4112         code if ec.DoFlowAnalysis is true.
4113         (This): Added constructor which takes a Block argument.  Implement
4114         the new IVariable interface.
4115         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
4116         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
4117         This does the definite assignment checks for struct members.
4118
4119         * class.cs (Constructor.Emit): If this is a non-static `struct'
4120         constructor which doesn't have any initializer, call
4121         Block.AddThisVariable() to tell the flow analysis code that all
4122         struct elements must be initialized before control returns from
4123         the constructor.
4124
4125         * statement.cs (MyStructInfo): New public class.
4126         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
4127         argument to this indexer.  If non-zero, check an individual struct
4128         member, not the whole struct.
4129         (FlowBranching.CheckOutParameters): Check struct members.
4130         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
4131         overloaded versions of these methods which take an additional
4132         `int field_idx' argument to check struct members.
4133         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
4134         overloaded versions of these methods which take an additional
4135         `string field_name' argument to check struct member.s
4136         (VariableInfo): Implement the IVariable interface.
4137         (VariableInfo.StructInfo): New public property.  Returns the
4138         MyStructInfo instance of the variable if it's a struct or null.
4139         (Block.AddThisVariable): New public method.  This is called from
4140         Constructor.Emit() for non-static `struct' constructor which do
4141         not have any initializer.  It creates a special variable for the
4142         "this" instance variable which will be checked by the flow
4143         analysis code to ensure that all of the struct's fields are
4144         initialized before control returns from the constructor.
4145         (UsageVector): Added support for struct members.  If a
4146         variable/parameter is a struct with N members, we reserve a slot
4147         in the usage vector for each member.  A struct is considered fully
4148         initialized if either the struct itself (slot 0) or all its
4149         members are initialized.
4150
4151 2002-08-08  Martin Baulig  <martin@gnome.org>
4152
4153         * driver.cs (Driver.MainDriver): Only report an error CS5001
4154         if there were no compilation errors.
4155
4156         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
4157         `UnsafeContext' property to determine whether the parent is in
4158         unsafe context rather than checking the parent's ModFlags:
4159         classes nested in an unsafe class are unsafe as well.
4160
4161 2002-08-08  Martin Baulig  <martin@gnome.org>
4162
4163         * statement.cs (UsageVector.MergeChildren): Distinguish between
4164         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
4165         we return.  Added test17() and test18() to test-154.cs.
4166
4167 2002-08-08  Martin Baulig  <martin@gnome.org>
4168
4169         * typemanager.cs (TypeManager.FilterWithClosure): If we have
4170         Family access, make sure the invoking type isn't a subclass of the
4171         queried type (that'd be a CS1540).
4172
4173         * ecore.cs (Expression.MemberLookup): Added overloaded version of
4174         this method which takes an additional `Type invocation_type'.
4175
4176         * expression.cs (BaseAccess.DoResolve): Use the base type as
4177         invocation and query type.
4178         (MemberAccess.DoResolve): If the lookup failed and we're about to
4179         report a CS0122, try a lookup with the ec.ContainerType - if this
4180         succeeds, we must report a CS1540.
4181
4182 2002-08-08  Martin Baulig  <martin@gnome.org>
4183
4184         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
4185         (MethodGroupExpr): Implement the IMemberExpr interface.
4186
4187         * expression (MemberAccess.ResolveMemberAccess): No need to have
4188         any special code for MethodGroupExprs anymore, they're now
4189         IMemberExprs.   
4190
4191 2002-08-08  Martin Baulig  <martin@gnome.org>
4192
4193         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
4194         Family, FamANDAssem and FamORAssem permissions.
4195         (TypeManager.IsSubclassOrNestedChildOf): New public method.
4196
4197 2002-08-08  Martin Baulig  <martin@gnome.org>
4198
4199         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
4200         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
4201         or loop block.
4202
4203 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
4204
4205         * driver.cs: implemented /resource option to embed managed resources.
4206
4207 2002-08-07  Martin Baulig  <martin@gnome.org>
4208
4209         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
4210         (FieldBase.HasFieldInitializer): New public property.
4211         (FieldBase.GetInitializerExpression): New public method.  Resolves and
4212         returns the field initializer and makes sure it is only resolved once.
4213         (TypeContainer.EmitFieldInitializers): Call
4214         FieldBase.GetInitializerExpression to get the initializer, this ensures
4215         that it isn't resolved multiple times.
4216
4217         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
4218         the resolving process (SimpleName/MemberLookup) that we're currently
4219         emitting a field initializer (which must not access any instance members,
4220         this is an error CS0236).
4221
4222         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
4223         argument, if the `IsFieldInitializer' flag is set, we must report and
4224         error CS0236 and not an error CS0120.   
4225
4226 2002-08-07  Martin Baulig  <martin@gnome.org>
4227
4228         * ecore.cs (IMemberExpr): New public interface.
4229         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
4230         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
4231         if the expression is an IMemberExpr.
4232
4233         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
4234         to be null, implicitly default to `this' if we're non-static in
4235         this case.  Simplified the code a lot by using the new IMemberExpr
4236         interface.  Also fixed bug #28176 here.
4237
4238 2002-08-06  Martin Baulig  <martin@gnome.org>
4239
4240         * cs-parser.jay (SimpleLookup): Removed.  We need to create
4241         ParameterReferences during semantic analysis so that we can do a
4242         type-only search when resolving Cast, TypeOf and SizeOf.
4243         (block): Pass the `current_local_parameters' to the Block's
4244         constructor.
4245
4246         * class.cs (ConstructorInitializer): Added `Parameters parameters'
4247         argument to the constructor.
4248         (ConstructorInitializer.Resolve): Create a temporary implicit
4249         block with the parameters.
4250
4251         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
4252         references here if we aren't doing a type-only search.
4253
4254         * statement.cs (Block): Added constructor which takes a
4255         `Parameters parameters' argument.
4256         (Block.Parameters): New public property.
4257
4258         * support.cs (InternalParameters.Parameters): Renamed `parameters'
4259         to `Parameters' and made it public readonly.
4260
4261 2002-08-06  Martin Baulig  <martin@gnome.org>
4262
4263         * ecore.cs (Expression.Warning): Made this public as well.
4264
4265         * report.cs (Report.Debug): Print the contents of collections.
4266
4267 2002-08-06  Martin Baulig  <martin@gnome.org>
4268
4269         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
4270         used to tell Resolve() which kinds of expressions it may return.
4271         (Expression.Resolve): Added overloaded version of this method which
4272         takes a `ResolveFlags flags' argument.  This can be used to tell
4273         Resolve() which kinds of expressions it may return.  Reports a
4274         CS0118 on error.
4275         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
4276         ResolveFlags.SimpleName.
4277         (Expression.Error118): Added overloaded version of this method which
4278         takes a `ResolveFlags flags' argument.  It uses the flags to determine
4279         which kinds of expressions are allowed.
4280
4281         * expression.cs (Argument.ResolveMethodGroup): New public method.
4282         Resolves an argument, but allows a MethodGroup to be returned.
4283         This is used when invoking a delegate.
4284
4285         * TODO: Updated a bit.
4286
4287 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4288
4289         Fixed compilation with csc.
4290
4291         * ecore.cs: Expression.Error made public. Is this correct? Should
4292         Warning be made public too?
4293
4294         * expression.cs: use ea.Location instead of ea.loc.
4295         [FIXME:  Filed as bug #28607: MCS must report these errors.]
4296
4297 2002-08-06  Martin Baulig  <martin@gnome.org>
4298
4299         * ecore.cs (Expression.loc): Moved the location here instead of
4300         duplicating it in all derived classes.
4301         (Expression.Location): New public property.
4302         (Expression.Error, Expression.Warning): Made them non-static and
4303         removed the location argument.
4304         (Expression.Warning): Added overloaded version which takes an
4305         `int level' argument.
4306         (Expression.Error118): Make this non-static and removed the
4307         expression and location arguments.
4308         (TypeExpr): Added location argument to the constructor.
4309
4310         * expression.cs (StaticCallExpr): Added location argument to
4311         the constructor.
4312         (Indirection, PointerArithmetic): Likewise.
4313         (CheckedExpr, UnCheckedExpr): Likewise.
4314         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
4315         (StringPtr): Likewise.
4316
4317
4318 2002-08-05  Martin Baulig  <martin@gnome.org>
4319
4320         * expression.cs (BaseAccess.DoResolve): Actually report errors.
4321
4322         * assign.cs (Assign.DoResolve): Check whether the source
4323         expression is a value or variable.
4324
4325         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
4326         while resolving the corresponding blocks.
4327
4328         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
4329         an error, don't silently return null.
4330
4331         * statement.cs (Block.AddVariable): Do the error reporting here
4332         and distinguish between CS0128 and CS0136.
4333         (Block.DoResolve): Report all unused labels (warning CS0164).
4334         (LabeledStatement): Pass the location to the constructor.
4335         (LabeledStatement.HasBeenReferenced): New property.
4336         (LabeledStatement.Resolve): Set it to true here.
4337
4338         * statement.cs (Return.Emit): Return success even after reporting
4339         a type mismatch error (CS0126 or CS0127), this is what csc does and
4340         it avoids confusing the users with any consecutive errors.
4341
4342 2002-08-05  Martin Baulig  <martin@gnome.org>
4343
4344         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
4345
4346         * const.cs (Const.LookupConstantValue): Catch circular definitions.
4347
4348         * expression.cs (MemberAccess.DoResolve): Silently return if an
4349         error has already been reported.
4350
4351         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
4352         error has already been reported.
4353
4354 2002-08-05  Martin Baulig  <martin@gnome.org>
4355
4356         * statement.cs (UsageVector): Only initialize the `parameters'
4357         vector if we actually have any "out" parameters.
4358
4359 2002-08-05  Martin Baulig  <martin@gnome.org>
4360
4361         * expression.cs (Binary.ResolveOperator): When combining delegates,
4362         they must have the same type.
4363
4364 2002-08-05  Martin Baulig  <martin@gnome.org>
4365
4366         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
4367         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
4368         work with the ms runtime and we also don't need it: if we're a
4369         PropertyBuilder and not in the `indexer_arguments' hash, then we
4370         are a property and not an indexer.
4371
4372         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
4373         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
4374         since the latter one doesn't work with the ms runtime.
4375
4376 2002-08-03  Martin Baulig  <martin@gnome.org>
4377
4378         Fixed bugs #27998 and #22735.
4379
4380         * class.cs (Method.IsOperator): New public field.
4381         (Method.CheckBase): Report CS0111 if there's already a method
4382         with the same parameters in the current class.  Report CS0508 when
4383         attempting to change the return type of an inherited method.
4384         (MethodData.Emit): Report CS0179 if a method doesn't have a body
4385         and it's not marked abstract or extern.
4386         (PropertyBase): New abstract base class for Property and Indexer.
4387         (PropertyBase.CheckBase): Moved here from Property and made it work
4388         for indexers.
4389         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
4390         the same so we can reuse it there.
4391         (Property, Indexer): Derive from PropertyBase.
4392         (MethodSignature.inheritable_property_signature_filter): New delegate
4393         to find properties and indexers.
4394
4395         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
4396         argument and improved error reporting.
4397
4398         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
4399         EmptyReadOnlyParameters and made it a property.
4400
4401         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
4402         version of this method which takes a `PropertyInfo indexer'.
4403         (TypeManager.RegisterIndexer): New method.
4404
4405         * class.cs: Added myself as author of this file :-)
4406
4407 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4408
4409         * class.cs: fixed compilation on windoze.
4410
4411 2002-08-03  Martin Baulig  <martin@gnome.org>
4412
4413         * interface.cs (Interface.GetInterfaceBases): Check whether all
4414         base interfaces are at least as accessible than the current one.
4415
4416         * class.cs (TypeContainer.GetClassBases): Check whether base types
4417         are at least as accessible than the current type.
4418         (TypeContainer.AsAccessible): Implemented and made non-static.
4419         (MemberBase.CheckParameters): Report errors if the accessibility
4420         checks fail.
4421
4422         * delegate.cs (Delegate.Delegate): The default visibility is
4423         internal for top-level types and private for nested types.
4424         (Delegate.Define): Report errors if the accessibility checks fail.
4425
4426         * enum.cs (Enum.Enum): The default visibility is internal for
4427         top-level types and private for nested types.
4428         (Enum.DefineType): Compute the correct visibility.
4429
4430         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
4431         function which takes a `bool is_toplevel' instead of a TypeContainer.
4432
4433         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
4434         builtin type.
4435
4436 2002-08-02  Martin Baulig  <martin@gnome.org>
4437
4438         * expression.cs (LocalVariableReferenc): Added constructor which
4439         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
4440         (LocalVariableReference.IsReadOnly): New property.
4441         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
4442         variable is readonly, use our own readonly flag to do this; you can
4443         use the new constructor to get a writable reference to a read-only
4444         variable.
4445
4446         * cs-parser.jay (foreach_statement, using_statement): Get a writable
4447         reference to the local variable.
4448
4449 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
4450
4451         * rootcontext.cs (ResolveCore): Also include System.Exception
4452
4453         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
4454         we reach an EmptyStatement.
4455
4456         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
4457         is also fine.
4458
4459         * expression.cs (Binary.ResolveOperator): Check error result in
4460         two places.
4461
4462         use brtrue/brfalse directly and avoid compares to null.
4463
4464 2002-08-02  Martin Baulig  <martin@gnome.org>
4465
4466         * class.cs (TypeContainer.Define): Define all nested interfaces here.
4467         Fixes bug #28407, added test-155.cs.
4468
4469 2002-08-01  Martin Baulig  <martin@gnome.org>
4470
4471         * class.cs (Event.EmitDefaultMethod): Make this work with static
4472         events.  Fixes #28311, added verify-3.cs.
4473
4474 2002-08-01  Martin Baulig  <martin@gnome.org>
4475
4476         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
4477         `is_disposable' fields.
4478         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
4479         `hm.is_disposable' if we're using the collection pattern.
4480         (Foreach.EmitCollectionForeach): Use the correct type for the
4481         enumerator's local variable, only emit the try/finally block if
4482         necessary (fixes #27713).
4483
4484 2002-08-01  Martin Baulig  <martin@gnome.org>
4485
4486         * ecore.cs (Expression.report118): Renamed to Error118 and made
4487         it public static.
4488
4489         * statement.cs (Throw.Resolve): Check whether the expression is of
4490         the correct type (CS0118) and whether the type derives from
4491         System.Exception (CS0155).
4492         (Catch.Resolve): New method.  Do the type lookup here and check
4493         whether it derives from System.Exception (CS0155).
4494         (Catch.CatchType, Catch.IsGeneral): New public properties.
4495
4496         * typemanager.cs (TypeManager.exception_type): Added.
4497
4498 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
4499
4500         * driver.cs: Updated About function.
4501
4502 2002-07-31  Martin Baulig  <martin@gnome.org>
4503
4504         Implemented Control Flow Analysis.
4505
4506         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
4507         (EmitContext.CurrentBranching): Added.
4508         (EmitContext.StartFlowBranching): Added.
4509         (EmitContext.EndFlowBranching): Added.
4510         (EmitContext.KillFlowBranching): Added.
4511         (EmitContext.IsVariableAssigned): Added.
4512         (EmitContext.SetVariableAssigned): Added.
4513         (EmitContext.IsParameterAssigned): Added.
4514         (EmitContext.SetParameterAssigned): Added.
4515         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
4516         Added control flow analysis stuff here.
4517
4518         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
4519         resolve the expression as lvalue.
4520         (LocalVariableReference.DoResolve): Check whether the variable has
4521         already been assigned.
4522         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
4523         the parameter as assigned here.
4524         (ParameterReference.DoResolve): Check whether the parameter has already
4525         been assigned.
4526         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
4527         expression as lvalue.
4528
4529         * statement.cs (FlowBranching): New class for the flow analysis code.
4530         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
4531         (LabeledStatement.IsDefined): New public property.
4532         (LabeledStatement.AddUsageVector): New public method to tell flow
4533         analyis that the label may be reached via a forward jump.
4534         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
4535         flow analysis.
4536         (VariableInfo.Number): New public field.  This is used by flow analysis
4537         to number all locals of a block.
4538         (Block.CountVariables): New public property.  This is the number of
4539         local variables in this block (including the locals from all parent
4540         blocks).
4541         (Block.EmitMeta): Number all the variables.
4542
4543         * statement.cs: Added flow analysis support to all classes.
4544
4545 2002-07-31  Martin Baulig  <martin@gnome.org>
4546
4547         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
4548         To get debugging messages, compile mcs with /define:MCS_DEBUG and
4549         then use this argument.
4550
4551         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
4552
4553         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
4554         use this to specify /define options.
4555
4556 2002-07-29  Martin Baulig  <martin@gnome.org>
4557
4558         * statement.cs (Fixed): Moved all code that does variable lookups
4559         and resolvings from Emit to Resolve.
4560
4561         * statement.cs (For): Moved all code that does variable lookups
4562         and resolvings from Emit to Resolve.
4563
4564         * statement.cs (Using): Moved all code that does variable lookups
4565         and resolvings from Emit to Resolve.
4566
4567 2002-07-29  Martin Baulig  <martin@gnome.org>
4568
4569         * attribute.cs (Attribute.Resolve): Explicitly catch a
4570         System.NullReferenceException when creating the
4571         CustromAttributeBuilder and report a different warning message.
4572
4573 2002-07-29  Martin Baulig  <martin@gnome.org>
4574
4575         * support.cs (ParameterData.ParameterName): Added method to
4576         get the name of a parameter.
4577
4578         * typemanager.cs (TypeManager.IsValueType): New public method.
4579
4580 2002-07-29  Martin Baulig  <martin@gnome.org>
4581
4582         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
4583         is a flag which specifies that it's either ref or out.
4584         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
4585         the out parameter to `out Parameter.Modifier mod', also set the
4586         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
4587
4588         * support.cs (InternalParameters.ParameterModifier): Distinguish
4589         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
4590         Parameter.Modifier.ISBYREF flag if it's either ref or out.
4591
4592         * expression.cs (Argument.GetParameterModifier): Distinguish
4593         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
4594         Parameter.Modifier.ISBYREF flag if it's either ref or out.
4595
4596 2002-07-29  Martin Baulig  <martin@gnome.org>
4597
4598         * expression.cs (ParameterReference.ParameterReference): Added
4599         `Location loc' argument to the constructor.
4600
4601         * cs-parser.jay: Pass location to ParameterReference.
4602
4603 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
4604
4605         * statement.cs (Try): Initialize the location.
4606
4607         * cs-parser.jay: pass location to Try.
4608
4609         * expression.cs (Unary.Reduce): Change the prototype to return
4610         whether a constant fold could be performed or not.  The result is
4611         returned in an out parameters.  In the case of Indirection and
4612         AddressOf, we want to perform the full tests.
4613
4614 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
4615
4616         * statement.cs (Statement.Emit): Flag dead code.
4617
4618 2002-07-27  Andrew Birkett  <andy@nobugs.org>
4619
4620         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
4621
4622 2002-07-27  Martin Baulig  <martin@gnome.org>
4623
4624         * class.cs (MethodData.Define): Put back call to
4625         TypeManager.AddMethod(), accidentally commented this out.
4626
4627         * report.cs (Debug): New public method to print debugging information,
4628         this is `[Conditional ("DEBUG")]'.
4629
4630 2002-07-26  Martin Baulig  <martin@gnome.org>
4631
4632         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
4633         (switch_statement): Push the current_block to the switch_stack and
4634         pop it again when we're done with the switch.
4635         (switch_section): The new block is a child of the current_block.
4636         Fixes bug #24007, added test-152.cs.
4637
4638 2002-07-27  Martin Baulig  <martin@gnome.org>
4639
4640         * expression.cs (Invocation.EmitArguments): When calling a varargs
4641         function with only its fixed arguments, we need to pass an empty
4642         array.
4643
4644 2002-07-27  Martin Baulig  <martin@gnome.org>
4645
4646         Mono 0.13 has been released.
4647
4648 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
4649
4650         * driver.cs: Rename --resource to --linkres, because that is what
4651         we do currently, we dont support --resource yet.
4652
4653         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
4654
4655 2002-07-25  Martin Baulig  <martin@gnome.org>
4656
4657         * class.cs (MethodData): New public class.  This is a `method builder'
4658         class for a method or one accessor of a Property/Indexer/Event.
4659         (MethodData.GetMethodFlags): Moved here from MemberBase.
4660         (MethodData.ApplyAttributes): Likewise.
4661         (MethodData.ApplyObsoleteAttribute): Likewise.
4662         (MethodData.ApplyConditionalAttribute): Likewise.
4663         (MethodData.ApplyDllImportAttribute): Likewise.
4664         (MethodData.CheckAbstractAndExternal): Likewise.
4665         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
4666         (MethodData.Emit): Formerly known as Method.Emit().
4667         (MemberBase): Moved everything which was specific to a single
4668         accessor/method to MethodData.
4669         (Method): Create a new MethodData and call Define() and Emit() on it.
4670         (Property, Indexer, Event): Create a new MethodData objects for each
4671         accessor and call Define() and Emit() on them.
4672
4673 2002-07-25  Martin Baulig  <martin@gnome.org>
4674
4675         Made MethodCore derive from MemberBase to reuse the code from there.
4676         MemberBase now also checks for attributes.
4677
4678         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
4679         (MemberBase.GetMethodFlags): Moved here from class Method and marked
4680         as virtual.
4681         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
4682         `CallingConventions cc' and `Attributes opt_attrs' arguments.
4683         (MemberBase.ApplyAttributes): New virtual method; applies the
4684         attributes to a method or accessor.
4685         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
4686         (MemberBase.ApplyConditionalAttribute): Likewise.
4687         (MemberBase.ApplyDllImportAttribute): Likewise.
4688         (MemberBase.CheckAbstractAndExternal): Likewise.
4689         (MethodCore.ParameterTypes): This is now a property instead of a
4690         method, it's initialized from DoDefineParameters().
4691         (MethodCore.ParameterInfo): Removed the set accessor.
4692         (MethodCore.DoDefineParameters): New protected virtual method to
4693         initialize ParameterTypes and ParameterInfo.
4694         (Method.GetReturnType): We can now simply return the MemberType.
4695         (Method.GetMethodFlags): Override the MemberBase version and add
4696         the conditional flags.
4697         (Method.CheckBase): Moved some code from Define() here, call
4698         DoDefineParameters() here.
4699         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
4700         here to avoid some larger code duplication.
4701         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
4702         ensure that abstract and external accessors don't declare a body.
4703
4704         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
4705         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
4706         lookup in the attribute's parent classes, so we need to abort as soon
4707         as we found the first match.
4708         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
4709         the attribute has no arguments.
4710
4711         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
4712         of a Method.
4713
4714 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4715
4716         * cs-parser.jay: reverted previous patch.
4717
4718 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4719
4720         * cs-parser.jay: fixed bug #22119.
4721
4722 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4723
4724         * attribute.cs: fixed compilation. The error was:
4725         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
4726         be assigned to before control leaves the current method."
4727         [FIXME:  Filed as bug #28186: MCS must report this error.]
4728
4729 2002-07-25  Martin Baulig  <martin@gnome.org>
4730
4731         * attribute.cs (Attribute.Conditional_GetConditionName): New static
4732         method to pull the condition name ouf of a Conditional attribute.
4733         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
4734         the obsolete message and error flag out of an Obsolete attribute.
4735
4736         * class.cs (Method.GetMethodFlags): New public method to get the
4737         TypeManager.MethodFlags for this method.
4738         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
4739         private methods.
4740         (Method.Define): Get and apply the Obsolete and Conditional attributes;
4741         if we're overriding a virtual function, set the new private variable
4742         `parent_method'; call the new TypeManager.AddMethod().
4743
4744         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
4745         the MethodBuilder and the Method in a PtrHashtable.
4746         (TypeManager.builder_to_method): Added for this purpose.
4747         (TypeManager.MethodFlags): Added IsObsoleteError.
4748         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
4749         Obsolete and Conditional arguments in MethodBuilders.  If we discover
4750         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
4751         the message from the attribute.
4752
4753 2002-07-24  Martin Baulig  <martin@gnome.org>
4754
4755         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
4756         preprocessor directives, ensure that the argument to #define/#undef is
4757         exactly one identifier and that it's actually an identifier.
4758
4759         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
4760         did not work ....
4761
4762 2002-07-24  Martin Baulig  <martin@gnome.org>
4763
4764         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
4765         initialize it to TypeManager.object_type in the constructor.
4766         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
4767         of the `hm.get_current' method if we're using the collection pattern.
4768         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
4769         for the explicit conversion to make it work when we're using the collection
4770         pattern and the `Current' property has a different return type than `object'.
4771         Fixes #27713.
4772
4773 2002-07-24  Martin Baulig  <martin@gnome.org>
4774
4775         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
4776         does not match, but don't report any errors.  This method is called in
4777         order for all methods in a MethodGroupExpr until a matching method is
4778         found, so we don't want to bail out if the first method doesn't match.
4779         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
4780         matches, report the 123.  Fixes #28070.
4781
4782 2002-07-24  Martin Baulig  <martin@gnome.org>
4783
4784         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
4785         TypeManager.TypeToCoreType() to the top of the method so the
4786         following equality checks will work.  Fixes #28107.
4787
4788 2002-07-24  Martin Baulig  <martin@gnome.org>
4789
4790         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
4791         operand is of type uint, and the other operand is of type sbyte,
4792         short or int, the operands are converted to type long." -
4793         Actually do what this comment already told us.  Fixes bug #28106,
4794         added test-150.cs.
4795
4796 2002-07-24  Martin Baulig  <martin@gnome.org>
4797
4798         * class.cs (MethodBase): New abstract class.  This is now a base
4799         class for Property, Indexer and Event to avoid some code duplication
4800         in their Define() and DefineMethods() methods.
4801         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
4802         generic methods for Define() and DefineMethods().
4803         (FieldBase): Derive from MemberBase, not MemberCore.
4804         (Property): Derive from MemberBase, not MemberCore.
4805         (Property.DefineMethod): Moved all the code from this method to the
4806         new MethodBase.DefineAccessor(), just call it with appropriate
4807         argumetnts.
4808         (Property.Define): Call the new Property.DoDefine(), this does some
4809         sanity checks and we don't need to duplicate the code everywhere.
4810         (Event): Derive from MemberBase, not MemberCore.
4811         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
4812         accessors, this will also make them work with interface events.
4813         (Indexer): Derive from MemberBase, not MemberCore.
4814         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
4815         (Indexer.Define): Use the new MethodBase functions.
4816
4817         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
4818         argument to the constructor.
4819         (Interface.FindMembers): Added support for interface events.
4820         (Interface.PopluateEvent): Implemented.
4821
4822         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
4823
4824 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
4825
4826         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
4827         but this is required to check for a method name being the same as
4828         the containing class.  
4829
4830         Handle this now.
4831
4832 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4833
4834         * interface.cs: initialize variable.
4835
4836 2002-07-23  Martin Baulig  <martin@gnome.org>
4837
4838         Implemented the IndexerName attribute in interfaces.
4839
4840         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
4841         name if this is an explicit interface implementation.
4842         (Indexer.InterfaceIndexerName): New public variable.  If we're
4843         implementing an interface indexer, this is the IndexerName in that
4844         interface.  Otherwise, it's the IndexerName.
4845         (Indexer.DefineMethod): If we're implementing interface indexer,
4846         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
4847         and Pending.ImplementIndexer methods.
4848         (Indexer.Define): Also define the PropertyBuilder if we're
4849         implementing an interface indexer and this is neither an explicit
4850         interface implementation nor do the IndexerName match the one in
4851         the interface.
4852
4853         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
4854         If a method is defined here, then we always need to create a proxy
4855         for it.  This is used when implementing interface indexers.
4856         (Pending.IsInterfaceIndexer): New public method.
4857         (Pending.ImplementIndexer): New public method.
4858         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
4859         This is used when implementing interface indexers to define a proxy
4860         if necessary.
4861         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
4862         define a proxy if necessary.
4863
4864         * interface.cs (Interface.IndexerName): New public variable.
4865         (Interface.PopulateIndexer): Set the IndexerName.
4866         (Interface.DefineIndexers): New private method.  Populate all the
4867         indexers and make sure their IndexerNames match.
4868
4869         * typemanager.cs (IndexerPropertyName): Added support for interface
4870         indexers.
4871
4872 2002-07-22  Martin Baulig  <martin@gnome.org>
4873
4874         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
4875         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
4876         ret if HasReturnLabel.
4877         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
4878         variables.
4879
4880         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
4881         and set the ec.LoopBeginTryCatchLevel.
4882         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
4883         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
4884         the current ec.TryCatchLevel, the branch goes out of an exception
4885         block.  In this case, we need to use Leave and not Br.
4886
4887 2002-07-22  Martin Baulig  <martin@gnome.org>
4888
4889         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
4890         block unless the block does not always return or it is contained in
4891         another try { ... } catch { ... } block.  Fixes bug #26506.
4892         Added verify-1.cs to the test suite.
4893
4894 2002-07-22  Martin Baulig  <martin@gnome.org>
4895
4896         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
4897         then we do not always return.  Fixes bug #24985.
4898
4899 2002-07-22  Martin Baulig  <martin@gnome.org>
4900
4901         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
4902         lookup on a per-class level; ie. walk up the class hierarchy until we
4903         found at least one applicable method, then choose the best among them.
4904         Fixes bug #24463 and test-29.cs.
4905
4906 2002-07-22  Martin Baulig  <martin@gnome.org>
4907
4908         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
4909         return types of the methods.  The return type is not part of the
4910         signature and we must not check it to make the `new' modifier work.
4911         Fixes bug #27999, also added test-147.cs.
4912         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
4913
4914         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
4915         on the method's return type.
4916
4917 2002-07-21  Martin Baulig  <martin@gnome.org>
4918
4919         * assign.cs: Make this work if the rightmost source is a constant and
4920         we need to do an implicit type conversion.  Also adding a few more tests
4921         to test-38.cs which should have caught this.
4922
4923         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
4924         target in the makefile for this.  The makefile.gnu is primarily intended
4925         for end-users who don't want to debug the compiler.
4926
4927 2002-07-21  Martin Baulig  <martin@gnome.org>
4928
4929         * assign.cs: Improved the Assign class so it can now handle embedded
4930         assignments (X = Y = Z = something).  As a side-effect this'll now also
4931         consume less local variables.  test-38.cs now passes with MCS, added
4932         a few new test cases to that test.
4933
4934 2002-07-20  Martin Baulig  <martin@gnome.org>
4935
4936         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
4937         instructions.  Fixes bug #27977, also added test-146.cs.
4938
4939 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4940
4941         * cs-tokenizer.cs: fixed getHex ().
4942
4943 2002-07-19  Martin Baulig  <martin@gnome.org>
4944
4945         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
4946         not Type.GetType() to lookup the array type.  This is needed when
4947         we're constructing an array of a user-defined type.
4948         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
4949         single-dimensional arrays, but also for single-dimensial arrays of
4950         type decimal.
4951
4952 2002-07-19  Martin Baulig  <martin@gnome.org>
4953
4954         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
4955         this function is called, it's not allowed to share LocalBuilders
4956         among ILGenerators.
4957
4958 2002-07-19  Martin Baulig  <martin@gnome.org>
4959
4960         * expression.cs (Argument.Resolve): Report an error 118 when trying
4961         to pass a type as argument.
4962
4963 2002-07-18  Martin Baulig  <martin@gnome.org>
4964
4965         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
4966         Conv_R_Un for the signed `long' type.
4967
4968 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
4969
4970         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
4971         `expr' for the temporary result, as that will fail if we do
4972         multiple resolves on the same expression.
4973
4974 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
4975
4976         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
4977         ec.TypeContainer for looking up aliases. 
4978
4979         * class.cs (TypeContainer): Remove LookupAlias from here.
4980
4981         * decl.cs (DeclSpace); Move here.
4982
4983 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
4984
4985         * class.cs (FindMembers): Only call filter if the constructor
4986         bulider is not null.
4987
4988         Also handle delegates in `NestedTypes' now.  Now we will perform
4989         type lookups using the standard resolution process.  This also
4990         fixes a bug.
4991
4992         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
4993         This uses Expressions (the limited kind that can be parsed by the
4994         tree) instead of strings.
4995
4996         * expression.cs (ComposedCast.ToString): Implement, used to flag
4997         errors since now we have to render expressions.
4998
4999         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
5000         FormArrayType. 
5001
5002         * ecore.cs (SimpleName.ToString): ditto.
5003
5004         * cs-parser.jay: Instead of using strings to assemble types, use
5005         Expressions to assemble the type (using SimpleName, ComposedCast,
5006         MemberAccess).  This should fix the type lookups in declarations,
5007         because we were using a different code path for this.
5008
5009         * statement.cs (Block.Resolve): Continue processing statements
5010         even when there is an error.
5011
5012 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
5013
5014         * class.cs (Event.Define): Also remove the `remove' method from
5015         the list of pending items.
5016
5017         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
5018         generate more compact code. 
5019
5020 2002-07-17  Martin Baulig  <martin@gnome.org>
5021
5022         * const.cs (Const.LookupConstantValue): Add support for constant
5023         `unchecked' and `checked' expressions.
5024         Also adding test case test-140.cs for this.
5025
5026 2002-07-17  Martin Baulig  <martin@gnome.org>
5027
5028         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
5029         check whether mi.ReturnType implements the IEnumerator interface; the
5030         `==' and the IsAssignableFrom() will fail in this situation.
5031
5032 2002-07-16  Ravi Pratap  <ravi@ximian.com>
5033
5034         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
5035         here too.
5036
5037 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5038
5039         * expression.cs: fixed bug #27811.
5040
5041 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
5042
5043         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
5044         Molaro: when we are a ref, the value already contains a pointer
5045         value, do not take the address of it.
5046
5047 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
5048         * removed mb-parser.jay and mb-tokenizer.cs
5049
5050 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
5051
5052         * expression.cs: check against the building corlib void type.
5053
5054 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
5055
5056         * ecore.cs: fix for valuetype static readonly fields: when 
5057         initializing them, we need their address, not the address of a copy.
5058
5059 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
5060
5061         * typemanager.cs: register also enum_type in corlib.
5062
5063 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
5064
5065         * class.cs: allow calling this (but not base) initializers in structs.
5066
5067 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
5068
5069         * ecore.cs: make sure we compare against the building base types
5070         in GetTypeSize ().
5071
5072 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
5073
5074         * typemanager.cs: fix TypeToCoreType() to handle void and object
5075         (corlib gets no more typerefs after this change).
5076
5077 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
5078
5079         * expression.cs (ArrayCreation.EmitArrayArguments): use
5080         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
5081
5082         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
5083         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
5084         array indexes, the runtime actually forbids them.
5085
5086         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
5087         for array arguments here.
5088
5089         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
5090         instead of the default for ValueTypes.
5091
5092         (New.DoEmit): Use IsValueType instead of
5093         IsSubclassOf (value_type)
5094         (New.DoResolve): ditto.
5095         (Invocation.EmitCall): ditto.
5096
5097         * assign.cs (Assign): ditto.
5098
5099         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
5100         Statements *are* currently doing part of their resolution during
5101         Emit.  
5102
5103         Expressions do always resolve during resolve, but statements are
5104         only required to propagate resolution to their children.
5105
5106 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
5107
5108         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
5109
5110         (LoadAssembly): Do not add the dll if it is already specified
5111         
5112         (MainDriver): Add the System directory to the link path at the end,
5113         after all the other -L arguments. 
5114
5115         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
5116         wrong opcode for loading bytes and bools (ldelem.i1 instead of
5117         ldelem.u1) and using the opposite for sbytes.
5118
5119         This fixes Digger, and we can finally run it.
5120
5121         * driver.cs (UnixParseOption): Move the option parsing here.  
5122         (CSCParseOption): Implement CSC-like parsing of options.
5123
5124         We now support both modes of operation, the old Unix way, and the
5125         new CSC-like way.  This should help those who wanted to make cross
5126         platform makefiles.
5127
5128         The only thing broken is that /r:, /reference: and /lib: are not
5129         implemented, because I want to make those have the same semantics
5130         as the CSC compiler has, and kill once and for all the confussion
5131         around this.   Will be doing this tomorrow.
5132
5133         * statement.cs (Unsafe.Resolve): The state is checked during
5134         resolve, not emit, so we have to set the flags for IsUnsfe here.
5135
5136 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
5137
5138         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
5139         not catch the Error_ObjectRefRequired in SimpleName (as it is
5140         possible to have a class/instance variable name that later gets
5141         deambiguated), we have to check this here.      
5142
5143 2002-07-10  Ravi Pratap  <ravi@ximian.com>
5144
5145         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
5146         make static and put into Expression.
5147
5148         (Event.Define): Register the private field of the event with the 
5149         TypeManager so that GetFieldFromEvent can get at it.
5150
5151         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
5152         keep track of the private field associated with an event which
5153         has no accessors.
5154
5155         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
5156         private field.
5157
5158         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
5159         
5160 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
5161
5162         * expression.cs (Binary.EmitBranchable): this routine emits the
5163         Binary expression in a branchable context.  This basically means:
5164         we need to branch somewhere, not just get the value on the stack.
5165
5166         This works together with Statement.EmitBoolExpression.
5167
5168         * statement.cs (Statement.EmitBoolExpression): Use
5169         EmitBranchable. 
5170
5171 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
5172
5173         * statement.cs (For): Reduce the number of jumps in loops.
5174
5175         (For): Implement loop inversion for the For statement.
5176
5177         (Break): We can be breaking out of a Try/Catch controlled section
5178         (foreach might have an implicit try/catch clause), so we need to
5179         use Leave instead of Br.
5180
5181         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
5182         now).  If the instace expression supports IMemoryLocation, we use
5183         the AddressOf method from the IMemoryLocation to extract the
5184         address instead of emitting the instance.
5185
5186         This showed up with `This', as we were emitting the instance
5187         always (Emit) instead of the Address of This.  Particularly
5188         interesting when This is a value type, as we dont want the Emit
5189         effect (which was to load the object).
5190         
5191 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
5192
5193         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
5194
5195         * statement.cs (Checked): Set the CheckedState during the resolve
5196         process too, as the ConvCast operations track the checked state on
5197         the resolve process, and not emit.
5198
5199         * cs-parser.jay (namespace_member_declaration): Flag that we have
5200         found a declaration when we do.  This is used to flag error 1529
5201
5202         * driver.cs: Report ok when we display the help only.
5203
5204 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
5205
5206         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
5207
5208 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
5209
5210         * cs-tokenizer.cs (define): We also have to track locally the
5211         defines.  AllDefines is just used for the Conditional Attribute,
5212         but we also need the local defines for the current source code. 
5213
5214 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
5215
5216         * statement.cs (While, For, Do): These loops can exit through a
5217         Break statement, use this information to tell whether the
5218         statement is the last piece of code.
5219
5220         (Break): Flag that we break.
5221
5222         * codegen.cs (EmitContexts): New `Breaks' state variable.
5223
5224 2002-07-03  Martin Baulig  <martin@gnome.org>
5225
5226         * class.cs (TypeContainer.MethodModifiersValid): Allow override
5227         modifiers in method declarations in structs.  Otherwise, you won't
5228         be able to override things like Object.Equals().
5229
5230 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
5231
5232         * class.cs (Method, Property, Indexer): Do not allow the public
5233         modifier to be used in explicit interface implementations.
5234
5235         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
5236         override modifiers in method declarations in structs
5237
5238 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
5239
5240         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
5241         integer or real overflow, report an error
5242
5243 2002-07-02  Martin Baulig  <martin@gnome.org>
5244
5245         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
5246         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
5247         to tell the runtime about our newly created System.Object and
5248         System.ValueType types.
5249
5250 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
5251
5252         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
5253         struct instead of Ldarg/Starg.
5254
5255 2002-07-02  Martin Baulig  <martin@gnome.org>
5256
5257         * expression.cs (Indirection.Indirection): Call
5258         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
5259
5260 2002-07-02  Martin Baulig  <martin@gnome.org>
5261
5262         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
5263         ValueType, call TypeManager.TypeToCoreType() on it.
5264         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
5265         the OpCodes.Newarr argument.
5266
5267 2002-07-02  Martin Baulig  <martin@gnome.org>
5268
5269         * expression.cs (Invocation.EmitCall): When compiling corlib,
5270         replace all calls to the system's System.Array type to calls to
5271         the newly created one.
5272
5273         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
5274         System.Array methods.
5275         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
5276         from the system's System.Array type which must be replaced.
5277
5278 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
5279
5280         * typemanager.cs: load unverifiable_code_ctor so we can build
5281         corlib using the correct type. Avoid using GetTypeCode() with
5282         TypeBuilders.
5283         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
5284         TypeManager.object_type to allow building corlib.
5285
5286 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
5287
5288         * ecore.cs: handle System.Enum separately in LoadFromPtr().
5289
5290 2002-07-01  Martin Baulig  <martin@gnome.org>
5291
5292         * class.cs: Make the last change actually work, we need to check
5293         whether `ifaces != null' to avoid a crash.
5294
5295 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
5296
5297         * class.cs: when we build structs without fields that implement
5298         interfaces, we need to add the interfaces separately, since there is
5299         no API to both set the size and add the interfaces at type creation
5300         time.
5301
5302 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
5303
5304         * expression.cs: the dimension arguments to the array constructors
5305         need to be converted if they are a long.
5306
5307 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
5308
5309         * class.cs: don't emit ldarg.0 if there is no parent constructor
5310         (fixes showstopper for corlib).
5311
5312 2002-06-29  Martin Baulig  <martin@gnome.org>
5313
5314         MCS now compiles corlib on GNU/Linux :-)
5315
5316         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
5317         ie. check for MethodImplOptions.InternalCall.
5318
5319         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
5320         and TypeManager.attribute_type are null, so we must explicitly check
5321         whether parent is not null to find out whether it's an attribute type.
5322         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
5323         and SetBuilder, not only if the property is neither abstract nor external.
5324         This is necessary to set the MethodImplOptions on the accessor methods.
5325         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
5326         SetBuilder, see Property.Emit().
5327
5328         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
5329         populate "System.Object", "System.ValueType" and "System.Attribute" since
5330         they've already been populated from BootCorlib_PopulateCoreTypes().
5331
5332 2002-06-29  Martin Baulig  <martin@gnome.org>
5333
5334         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
5335         is the NullLiteral, we also need to make sure that target_type is not
5336         an enum type.   
5337
5338 2002-06-29  Martin Baulig  <martin@gnome.org>
5339
5340         * rootcontext.cs (RootContext.ResolveCore): We must initialize
5341         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
5342         before calling BootstrapCorlib_ResolveDelegate ().
5343
5344 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5345
5346         * statement.cs: fixed build-breaker. All tests passed ok.
5347
5348 2002-06-27  Martin Baulig  <martin@gnome.org>
5349
5350         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
5351         for System.Decimal when compiling corlib.
5352
5353 2002-06-27  Martin Baulig  <martin@gnome.org>
5354
5355         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
5356         switch blocks which contain nothing but a default clause.
5357
5358 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
5359
5360        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
5361
5362 2002-06-27  Martin Baulig  <martin@gnome.org>
5363
5364         * ecore.cs (PropertyExpr.PropertyExpr): Call
5365         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
5366
5367         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
5368         is already a TypeBuilder.
5369
5370 2002-06-27  Martin Baulig  <martin@gnome.org>
5371
5372         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
5373         `target_type == TypeManager.array_type', not IsAssignableFrom() in
5374         the "from an array-type to System.Array" case.  This makes it work
5375         when compiling corlib.
5376
5377 2002-06-27  Martin Baulig  <martin@gnome.org>
5378
5379         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
5380         non-static PropertyExpr, set its InstanceExpression.  This makes
5381         the `ICollection.Count' property work in System/Array.cs.
5382
5383 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
5384
5385         * driver.cs: Made error handling more consistent.  Errors now
5386         tracked by Report class, so many methods which used to return int
5387         now return void.  Main() now prints success/failure and 
5388         errors/warnings message.
5389
5390         Renamed '--probe' compiler argument to '--expect-error'.  Removed
5391         the magic number return values (123 and 124).  Now, if the
5392         expected error occurs, the compiler exits with success (exit value
5393         0).  If the compilation completes without seeing that particular
5394         error, the compiler exits with failure (exit value 1).  The
5395         makefile in mcs/errors has been changed to handle the new behaviour.
5396
5397         * report.cs: Made 'expected error' number a property and renamed
5398         it from 'Probe' to 'ExpectedError'.
5399
5400         * genericparser.cs: Removed error handling support, since it is
5401         now all done by Report class.
5402
5403         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
5404         class, so parse() no longer returns an int.
5405
5406         * namespace.cs: Use Report.Error instead of GenericParser.error
5407
5408 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
5409
5410         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
5411         TypeContainer.AddOperator): At the front of the list put the
5412         explicit implementations, so they get resolved/defined first. 
5413
5414 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
5415
5416         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
5417         interface type is implemented by this TypeContainer.  Used during
5418         explicit interface implementation.
5419
5420         (Property.Define, Indexer.Define, Method.Define): Validate that
5421         the given interface in the explicit implementation is one of the
5422         base classes for the containing type.
5423
5424         Also if we are explicitly implementing an interface, but there is
5425         no match in the pending implementation table, report an error.
5426
5427         (Property.Define): Only define the property if we are
5428         not explicitly implementing a property from an interface.  Use the
5429         correct name also for those properties (the same CSC uses,
5430         although that is really not needed).
5431         
5432         (Property.Emit): Do not emit attributes for explicitly implemented
5433         properties, as there is no TypeBuilder.
5434
5435         (Indexer.Emit): ditto.
5436
5437         Hiding then means that we do not really *implement* a pending
5438         implementation, which makes code fail.
5439
5440 2002-06-22  Martin Baulig  <martin@gnome.org>
5441
5442         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
5443         the return value of Object.GetType().  [FIXME: we need to do this whenever
5444         we get a type back from the reflection library].
5445
5446 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
5447
5448         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
5449
5450 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
5451
5452         * attribute.cs: Return null if we can not look up the type.
5453
5454         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
5455         the interface types found.
5456
5457         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
5458         interface types found.
5459
5460         * typemanager.cs (GetInterfaces): Make this routine returns alll
5461         the interfaces and work around the lame differences between
5462         System.Type and System.Reflection.Emit.TypeBuilder in the results
5463         result for GetInterfaces.
5464         
5465         (ExpandInterfaces): Given an array of interface types, expand and
5466         eliminate repeated ocurrences of an interface.  This expands in
5467         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
5468         be IA, IB, IC.
5469         
5470 2002-06-21  Martin Baulig  <martin@gnome.org>
5471
5472         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
5473         on System.Enum.
5474
5475 2002-06-21  Martin Baulig  <martin@gnome.org>
5476
5477         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
5478         and called with one of the core types, return the corresponding typebuilder for
5479         that type.
5480
5481         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
5482         element type.
5483
5484 2002-06-21  Martin Baulig  <martin@gnome.org>
5485
5486         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
5487         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
5488         (Expression.ConvertReferenceExplicit): Likewise.
5489
5490         * expression.cs (ElementAccess.DoResolve): Likewise.
5491         (ElementAccess.DoResolveLValue): Likewise.
5492
5493 2002-06-10  Martin Baulig  <martin@gnome.org>
5494
5495         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
5496         add the "value" parameter to the parameter list.
5497
5498         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
5499         to our caller.
5500
5501 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
5502
5503         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
5504         the argument to an int, uint, long or ulong, per the spec.  Also
5505         catch negative constants in array creation.
5506
5507 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
5508
5509         * class.cs: do not allow the same interface to appear twice in
5510         the definition list.
5511
5512 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
5513
5514         * ecore.cs: don't use ldlen with System.Array.
5515
5516 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
5517
5518         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
5519
5520 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
5521
5522         * modifiers.cs: produce correct field attributes for protected
5523         internal. Easy fix so miguel can work on ther harder stuff:-)
5524
5525 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
5526
5527         * pending.cs: New file.  Move the code from class.cs here.
5528         Support clearning the pending flag for all methods (when not doing
5529         explicit interface implementation).
5530
5531 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
5532
5533         * rootcontext.cs: added a couple more types needed to bootstrap.
5534
5535 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
5536
5537         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
5538         constructor in the type, instead of any constructor in the type
5539         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
5540         a bug in the Mono runtime when applying the params attribute). 
5541
5542 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
5543         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
5544
5545 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
5546
5547         * expression.cs (Unary.ResolveOperator): Use TypeManager
5548         to resolve the type.
5549         
5550 2002-06-13  Ravi Pratap  <ravi@ximian.com>
5551
5552         * cs-parser.jay (enum_member_declaration): Pass in the attributes
5553         attached.
5554
5555         * enum.cs (AddEnumMember): Add support to store the attributes associated 
5556         with each member too.
5557
5558         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
5559         field builders too - this takes care of the enum member case.
5560
5561 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
5562
5563         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
5564         address-of operator on both value types and pointers.
5565         
5566 2002-06-10  Martin Baulig  <martin@gnome.org>
5567
5568         * interface.cs (Interface.PopulateIndexer): Add the indexer's
5569         PropertyBuilder to the `property_builders' list.
5570
5571         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
5572         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
5573         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
5574         find any indexers which are inherited from an interface.
5575
5576 2002-06-09  Martin Baulig  <martin@gnome.org>
5577
5578         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
5579         the same type as the constant if necessary.  There's also a test-130.cs
5580         for this.
5581
5582         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
5583
5584         * typemanager.cs (TypeManager.ChangeType): Previously known as
5585         Enum.ChangeEnumType().
5586
5587 2002-06-09  Martin Baulig  <martin@gnome.org>
5588
5589         * expression.cs (Cast.TryReduce): Added support for consts.
5590
5591 2002-06-08  Ravi Pratap  <ravi@ximian.com>
5592
5593         * class.cs (Accessor): Hold attributes information so we can pass
5594         it along.
5595
5596         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
5597         Modify to pass in attributes attached to the methods.
5598
5599         (add_accessor_declaration, remove_accessor_declaration): Ditto.
5600
5601         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
5602         to handle the Accessor kind :-)
5603
5604         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
5605         
5606 2002-06-08  Martin Baulig  <martin@gnome.org>
5607
5608         * expression.cs (Unary.TryReduceNegative): Added support for
5609         ULongConstants.
5610
5611 2002-06-08  Martin Baulig  <martin@gnome.org>
5612
5613         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
5614         name can't be found in the `defined_names' - the caller will do a
5615         MemberLookup in this case and thus find methods in System.Enum
5616         such as Enum.IsDefined().
5617
5618 2002-06-08  Martin Baulig  <martin@gnome.org>
5619
5620         * enum.cs (Enum.ChangeEnumType): This is a custom version of
5621         Convert.ChangeType() which works with TypeBuilder created types.
5622         (Enum.LookupEnumValue, Enum.Define): Use it here.
5623
5624         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
5625         `TypeBuilder.BaseType != null' check.
5626         (TypeContainer.FindMembers): Only lookup parent members if we
5627         actually have a parent.
5628         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
5629         (ConstructorInitializer.Resolve): Likewise.
5630
5631         * interface.cs (Interface.FindMembers): Added
5632         `TypeBuilder.BaseType != null' check.
5633
5634         * rootcontext.cs (RootContext.ResolveCore): Added
5635         "System.Runtime.CompilerServices.IndexerNameAttribute" to
5636         classes_second_stage.
5637
5638         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
5639         debug_type and trace_type when compiling with --nostdlib.       
5640
5641 2002-06-07  Martin Baulig  <martin@gnome.org>
5642
5643         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
5644         (AddField): Set it to true when adding a non-static field.
5645         (DefineType): Use `have_nonstatic_fields' to find out whether we
5646         have non-static fields, not `Fields != null'.
5647
5648 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
5649
5650         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
5651         dereferencing a null on the static-field code path)
5652
5653 2002-05-30  Martin Baulig  <martin@gnome.org>
5654
5655         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
5656         to take command line arguments.  Use reflection to call the new
5657         custom `Initialize' function on the symbol writer and pass it the
5658         command line arguments.
5659
5660         * driver.cs (--debug-args): New command line argument to pass command
5661         line arguments to the symbol writer.
5662
5663 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
5664
5665         * assign.cs (DoResolve): Forgot to do the implicit conversion to
5666         the target type for indexers and properties.  Thanks to Joe for
5667         catching this.
5668
5669 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
5670
5671         * typemanager.cs (MethodFlags): returns the method flags
5672         (Obsolete/ShouldIgnore) that control warning emission and whether
5673         the invocation should be made, or ignored. 
5674
5675         * expression.cs (Invocation.Emit): Remove previous hack, we should
5676         not do this on matching a base type, we should do this based on an attribute
5677
5678         Only emit calls to System.Diagnostics.Debug and
5679         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
5680         on the command line.
5681
5682         * rootcontext.cs: Global settings for tracing and debugging.
5683
5684         * cs-tokenizer.cs (define): New utility function to track
5685         defines.   Set the global settings for TRACE and DEBUG if found.
5686
5687 2002-05-25  Ravi Pratap  <ravi@ximian.com>
5688
5689         * interface.cs (Populate*): Pass in the TypeContainer as well as
5690         the DeclSpace as parameters so that we can create EmitContexts and
5691         then use that to apply attributes etc.
5692
5693         (PopulateMethod, PopulateEvent, PopulateProperty)
5694         (PopulateIndexer): Apply attributes everywhere.
5695
5696         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
5697         etc.
5698
5699         (ApplyAttributes): Update accordingly.
5700
5701         We now apply interface attributes for all members too.
5702
5703 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
5704
5705         * class.cs (Indexer.Define); Correctly check if we are explicit
5706         implementation (instead of checking the Name for a ".", we
5707         directly look up if the InterfaceType was specified).
5708
5709         Delay the creation of the PropertyBuilder.
5710
5711         Only create the PropertyBuilder if we are not an explicit
5712         interface implementation.   This means that explicit interface
5713         implementation members do not participate in regular function
5714         lookups, and hence fixes another major ambiguity problem in
5715         overload resolution (that was the visible effect).
5716
5717         (DefineMethod): Return whether we are doing an interface
5718         implementation. 
5719         
5720         * typemanager.cs: Temporary hack until we get attributes in
5721         interfaces (Ravi is working on that) and we get IndexerName
5722         support in interfaces.
5723
5724         * interface.cs: Register the indexers as properties.
5725
5726         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
5727         warning, I have verified that this is a bug in the .NET runtime
5728         (JavaScript suffers of the same problem).
5729
5730         * typemanager.cs (MemberLookup): When looking up members for
5731         interfaces, the parent of an interface is the implicit
5732         System.Object (so we succeed in searches of Object methods in an
5733         interface method invocation.  Example:  IEnumerable x;  x.ToString
5734         ()) 
5735
5736 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
5737
5738         * class.cs (Event): Events should also register if they do
5739         implement the methods that an interface requires.
5740
5741         * typemanager.cs (MemberLookup); use the new GetInterfaces
5742         method. 
5743
5744         (GetInterfaces): The code used to lookup interfaces for a type is
5745         used in more than one place, factor it here. 
5746
5747         * driver.cs: Track the errors at the bottom of the file, we kept
5748         on going.
5749
5750         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
5751         instance if the method we are calling is static!
5752
5753 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
5754
5755         * attribute.cs (ApplyAttributes): Make this function filter out
5756         the IndexerName attribute (as that attribute in reality is never
5757         applied) and return the string constant for the IndexerName
5758         attribute. 
5759
5760         * class.cs (TypeContainer.Emit): Validate that all the indexers
5761         have the same IndexerName attribute, and if so, set the
5762         DefaultName attribute on the class. 
5763
5764         * typemanager.cs: The return value might contain other stuff (not
5765         only methods).  For instance, consider a method with an "Item"
5766         property and an Item method.
5767
5768         * class.cs: If there is a problem with the parameter types,
5769         return. 
5770
5771 2002-05-24  Ravi Pratap  <ravi@ximian.com>
5772
5773         * ecore.cs (ImplicitConversionExists): Wrapper function which also
5774         looks at user defined conversion after making a call to 
5775         StandardConversionExists - we need this for overload resolution.
5776
5777         * expression.cs : Update accordingly the various method calls.
5778
5779         This fixes 2 bugs filed against implicit user defined conversions 
5780
5781 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
5782
5783         * statement.cs: Track the result of the assignment.
5784
5785 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
5786
5787         * expression.cs (MemberAccess): Improved error reporting for
5788         inaccessible members.
5789
5790 2002-05-22  Martin Baulig  <martin@gnome.org>
5791
5792         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
5793         itself with debugging support.
5794
5795 2002-05-22  Martin Baulig  <martin@gnome.org>
5796
5797         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
5798         Removed, this isn't needed anymore.
5799
5800 2002-05-20  Martin Baulig  <martin@gnome.org>
5801
5802         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
5803         be underlying type for an enum.
5804
5805 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
5806
5807         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
5808         that splits out the loading of just the core types.
5809
5810         * rootcontext.cs (ResolveCore): Split the struct resolution in
5811         two, so we can load the enumeration underlying types before any
5812         enums are used.
5813
5814         * expression.cs (Is): Bandaid until we fix properly Switch (see
5815         bug #24985 for details).
5816
5817         * typemanager.cs (ImplementsInterface): The hashtable will contain
5818         a null if there are no interfaces implemented.
5819
5820 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
5821
5822         * cs-parser.jay (indexer_declarator): It is fine to have array
5823         parameters
5824
5825 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
5826
5827         * typemanager.cs: (RegisterBuilder): New function used to register
5828         TypeBuilders that implement interfaces.  Since
5829         TypeBuilder.GetInterfaces (as usual) does not work with lame
5830         Reflection.Emit. 
5831         (AddUserType): register interfaces.
5832
5833         (ImplementsInterface): Use the builder_to_ifaces hash if we are
5834         dealing with TypeBuilder.  Also, arrays are showing up as
5835         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
5836         methods can not be invoked on them!
5837
5838         * ecore.cs (ExplicitReferenceConversionExists): Made public.
5839         (ImplicitReferenceConversionExists): Split out from
5840         StandardConversionExists. 
5841
5842         * expression.cs (As): We were only implementing one of the three
5843         cases for the as operator.  We now implement them all.
5844         (Is): Implement the various other cases for Is as well.
5845
5846         * typemanager.cs (CACHE): New define used to control if we want or
5847         not the FindMembers cache.  Seems to have a negative impact on
5848         performance currently
5849
5850         (MemberLookup): Nested types have full acess to
5851         enclosing type members
5852
5853         Remove code that coped with instance/static returns for events, we
5854         now catch this in RealFindMembers.
5855
5856         (RealFindMembers): only perform static lookup if the instance
5857         lookup did not return a type or an event.  
5858
5859 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
5860
5861         * assign.cs (CompoundAssign): We pass more semantic information
5862         now to Compound Assignments than we did before: now we have all
5863         the information at hand, and now we resolve the target *before* we
5864         do the expression expansion, which allows the "CacheValue" method
5865         to have the effect we intended (before, a [x] += 1 would generate
5866         two differen ArrayAccess expressions from the ElementAccess,
5867         during the resolution process).
5868
5869         (CompoundAssign.DoResolve): Resolve target and original_source here.
5870
5871 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
5872
5873         * expression.cs (ArrayAccess): dropped debugging information. 
5874
5875         * typemanager.cs: Small bug fix: I was always returning i_members,
5876         instead of one of i_members or s_members (depending on which had
5877         the content).
5878
5879         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
5880         method is invoked before any code generation takes place, and it
5881         is a mechanism to inform that the expression will be invoked more
5882         than once, and that the method should use temporary values to
5883         avoid having side effects
5884
5885         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
5886         
5887         * ecore.cs (Expression.CacheTemporaries): Provide empty default
5888         implementation.
5889
5890         * expression.cs (Indirection, ArrayAccess): Add support for
5891         CacheTemporaries in these two bad boys. 
5892
5893         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
5894         ldobj or ldind_ref.  
5895         (StoreFromPtr): Handle stobj as well.
5896
5897         * expression.cs (UnaryMutator): Share more code.
5898         
5899         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
5900         down: I was not tracking the Filter function as well, which
5901         was affecting the results of the cache.
5902
5903 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
5904
5905         * attribute.cs: Remove the hack to handle the CharSet property on
5906         StructLayouts. 
5907
5908 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
5909
5910         * attribute.cs (DoResolve): More uglyness, we now only try to
5911         resolve the attribute partially, to extract the CharSet
5912         information (only if we are a StructLayout attribute).  Otherwise 
5913
5914         (GetExtraTypeInfo): Add some code to conditionally kill in the
5915         future this.   I am more and more convinced that the .NET
5916         framework has special code to handle the attribute setting on
5917         certain elements.
5918
5919         * expression.cs (IsParamsMethodApplicable): Revert my previous
5920         foreach change here, it was wrong.
5921
5922 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
5923
5924         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
5925         (pp_expr): do not abort on unknown input, just return.
5926         (eval): abort if there are pending chars.
5927
5928         * attribute.cs (Attribute.Resolve): Positional parameters are
5929         optional.  Deal with that case.
5930
5931         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
5932         the Ansi/Unicode/Auto information for the type.
5933
5934         (TypeContainer.DefineType): instantiate the EmitContext here, as
5935         we will be using it during the type definition (to resolve
5936         attributes) and during the emit phase.
5937
5938         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
5939         to pull type information out of the attributes
5940
5941         (Attribute.Resolve): track the constructor builder, and allow for
5942         multiple invocations (structs and classes will use this).
5943
5944         * ecore.cs (MemberLookupFinal): new version with all the
5945         parameters customizable.
5946
5947         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
5948         constructors.  Return if the result value is null (as the error
5949         would have been flagged already by MemberLookupFinal)
5950
5951         Do not allow instances of abstract classes or interfaces to be
5952         created.
5953         
5954         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
5955         We have to compare the assembly property here when dealing with
5956         FamANDAssem and Assembly access modifiers, because we might be
5957         creating an assembly from *modules* (that means that we are not
5958         getting TypeBuilders for types defined in other modules that are
5959         part of this assembly).
5960
5961         (Method.Emit): If the method is marked abstract and has a body,
5962         emit an error. 
5963
5964         (TypeContainer.DefineMembers): If both the defined member and the
5965         parent name match are methods, then do not emit any warnings: let
5966         the Method.Define routine take care of flagging warnings.  But if
5967         there is a mismatch (method overrides something else, or method is
5968         overriwritten by something, then emit warning).
5969
5970         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
5971         set to null, this means `do not check for the return type on the
5972         signature'. 
5973
5974         (Method.Define): set the return type for the method signature to
5975         null, so that we get methods with the same name and parameters and
5976         different return types.  This is used to flag warning 114 (you are
5977         hiding a method, and you probably want to use the new/override
5978         keywords instead).
5979
5980         * typemanager.cs (MemberLookup): Implemented proper access
5981         control, closing a long standing set of bug reports.  The problem
5982         was that the Framework only has two bits: Public and NonPublic,
5983         and NonPublic includes private and protected methods, but we need
5984         to enforce the FamANDAssem, FamOrAssem and Family. 
5985
5986 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
5987
5988         * statement.cs (GotoCase): Return true: Ammounts to giving up
5989         knowledge on whether we return or not, and letting the other case
5990         be responsible for it.
5991
5992 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
5993
5994         * driver.cs: Do not load directories for each file processed, only
5995         do it if there is a pattern.
5996
5997         * ecore.cs: Report readonly assigns here as well, as we might have
5998         been resolved only by MemberAccess.
5999
6000         (SimpleName.SimpleNameResolve): Also be useful for LValue
6001         resolution.   We need this to propagate assign to local readonly variables
6002
6003         * typemanager.cs: Use a ptrhashtable for the criteria, because we
6004         do not want to reuse potential criteria memory.
6005
6006         * class.cs (MyEventBuilder): Set reflected_type;
6007
6008         * ecore.cs (Constantify): Added support for constifying bools.
6009
6010         (RootContext.LookupType): Added a cache for values looked up in
6011         the declaration space.
6012
6013         * typemanager.cs (FindMembers): Now is a front-end to
6014         RealFindMembers, and provides a two-level hashtable-based cache to
6015         the request.  
6016
6017         15% performance improvement: from 22.5 to 19.2 seconds.
6018
6019         * expression.cs (IsParamsMethodApplicable): use foreach.
6020         (Invocation.DoResolve): ditto.
6021         (New.DoResolve): ditto.
6022         (ArrayCreation.DoResolve): ditto.
6023
6024         * ecore.cs (FindMostEncompassingType): use foreach.
6025
6026         * delegate.cs (NewDelegate.DoResolve): Use foreach
6027
6028         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
6029         (RemoveMethods): use foreach.
6030
6031         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
6032         nested foreach statements instead of for, and also break out of
6033         the inner loop once a match is found.
6034         
6035         (Invocation.OverloadResolve): Use foreach, simplify the code. 
6036
6037 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
6038
6039         * cfold.cs (BinaryFold): During an enumeration evaluation context,
6040         we actually unwrap the expression to allow for extra information
6041         to be extracted. 
6042
6043         * expression.cs: Use Shr_Un on unsigned operations. 
6044
6045 2002-05-08  Ravi Pratap  <ravi@ximian.com>
6046
6047         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
6048         applicable operators was not being considered correctly. This closes
6049         the bug Miguel reported.
6050
6051 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
6052
6053         * attribute.cs: check that the type derives from System.Attribute
6054         and report the correct error in that case (moved the duplicate code to
6055         its own method, too).
6056
6057 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
6058
6059         * attribute.cs: lookup attribute type name as the spec says: first the
6060         bare attribute name and then name + "Attribute" (nant compiles with
6061         mcs after this fix).
6062
6063 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
6064
6065         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
6066         Because of the way we parse things, we should try to see if a
6067         UIntConstant can fit in an integer.
6068
6069 2002-05-07  Ravi Pratap  <ravi@ximian.com>
6070
6071         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
6072         when we are in an explicit context.
6073
6074         (ConvertReferenceExplicit): When converting from Iface type S to Class
6075         T make sure the rules are implemented as an OR.
6076
6077         * parameter.cs (ParameterType): Make it a property for now although the
6078         purpose really isn't anything immediate.
6079         
6080         * expression.cs (Is*Applicable): Do better checking on the parameter type
6081         of a ref/out parameter. The ones from the system assemblies are already 
6082         marked with the correct type so we don't need to do any correction.
6083
6084         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
6085         the object type is standard too so include that.
6086
6087 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6088
6089         * ecore.cs (StandardConversionExists): Augment with missing code:
6090         deal with IntConstant, LongConstants and Enumerations.
6091
6092         * assign.cs: Report the error, instead of failing silently
6093
6094         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
6095         typecontainer that they are declared, because the
6096         typecontainer/namespace will have the list of using clauses that
6097         need to be applied.
6098
6099         Assembly Attributes were escaping the normal registration
6100         mechanism. 
6101
6102         (EmitCode): Apply attributes within an EmitContext that represents
6103         the container they were declared on.
6104         
6105         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
6106
6107 2002-05-06  Ravi Pratap  <ravi@ximian.com>
6108
6109         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
6110         Revamp completely - make much cleaner as we now operate only
6111         on a set of Types.
6112
6113         (FindMostSpecificSource, FindMostSpecificTarget): New methods
6114         to implement the logic detailed in the spec more correctly.
6115
6116         (UserDefinedConversion): Update accordingly.
6117
6118 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6119
6120         * statement.cs: Return flow analysis information up.
6121
6122         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
6123         and the default.
6124
6125         (token): Do not consume an extra character before calling
6126         decimal_digits.
6127
6128 2002-05-06  Piers Haken <piersh@friskit.com>
6129
6130         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
6131
6132 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6133
6134         * class.cs (Constructor.Emit): Set the IsStatic flag in the
6135         EmitContext during the instance constructor initializer
6136         resolution, to stop access to instance variables.
6137
6138         This is mandated by the spec, last paragraph of the `constructor
6139         initializers' section. 
6140
6141 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
6142
6143         * cs-parser.jay, class.cs (Accessor): new class used to represent
6144         an accessor (get or set).  In the past we used `null' to represent
6145         a missing accessor.  But this is ambiguous because there was no
6146         way to tell in abstract indexers/properties if one of them was
6147         specified.
6148
6149         Now there is a way of addressing that.
6150
6151         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
6152         instead of FindMembers.
6153
6154         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
6155         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
6156
6157         * attribute.cs: Treat indexers and properties as the same in terms
6158         of applying attributes
6159
6160         * ecore.cs (FindMostEncompassedType): Use statically initialized
6161         EmptyExpressions()s like we do elsewhere to avoid creating useless
6162         objects (and we take this out of the tight loop).
6163
6164         (GetConversionOperators): Move the code to extract the actual
6165         operators to a separate routine to clean things up.
6166
6167 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
6168
6169         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
6170         events are always registered FieldBuilders.
6171         
6172         * class.cs (FieldBase): New class shared by Fields 
6173
6174         * delegate.cs: If we are a toplevel delegate, use our full name.
6175         If we are a nested delegate, then only use our tail name.
6176
6177 2002-05-02  Ravi Pratap  <ravi@ximian.com>
6178
6179         * expression.cs (IsApplicable): Ensure that we add the "&" to
6180         ref/out types before comparing it with the type of the argument.
6181
6182         (IsParamsMethodApplicable): Ditto.
6183
6184         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
6185         silly me ;-)
6186
6187         * delegate.cs : Handle the case when we have more than one applicable
6188         method. Flag an error only when we finish checking all.
6189
6190 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
6191
6192         * expression.cs: Add support for boolean static initializers.
6193
6194 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
6195
6196         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
6197
6198         * parameter.cs (ComputeParameterTypes,
6199         ComputeAndDefineParameterTypes): Better error handling: now we
6200         clear the `types' cache if we fail during any of the type lookups.
6201         We also return the status code correctly to our caller
6202
6203         * delegate.cs: If we fail to define a delegate, abort the extra
6204         steps. 
6205
6206         * expression.cs (Binary.ResolveOperator): for
6207         operator==(object,object) and operator !=(object, object) we also
6208         have to verify that there is an implicit conversion from one to
6209         the other.
6210
6211         (ArrayAccess.DoResolve): Array Access can operate on
6212         non-variables. 
6213
6214 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
6215
6216         * assign.cs (CompoundAssign): A new class used as a "flag" that
6217         the assignment actually is happening as part of a compound
6218         assignment operator.
6219
6220         During compound assignment, a few new rules exist to enable things
6221         like:
6222
6223         byte b |= 1 + 2
6224
6225         From the spec:
6226         
6227         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
6228         to the type of x) if y is implicitly convertible to the type of x,
6229         and the operator is a builtin operator and the return type of the
6230         operator is explicitly convertible to the type of x. 
6231
6232         * rootcontext.cs: Reset warning level to 2.  4 catches various
6233         "interesting" features in mcs, we must clean this up at some
6234         point, but currently am trying to kill other bugs ;-)
6235
6236         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
6237         in container classes as well.  
6238
6239         * expression.cs (Binary.ResolveOperator): Handle string case
6240         before anything else (as operator overloading does emit an error
6241         before doing anything else).
6242
6243         This code could go away when we move to a table driven model, but
6244         i could not come up with a good plan last night.
6245         
6246 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
6247
6248         * typemanager.cs (CSharpName): reimplementation using regex.
6249         * class.cs: added null check for fields in Emit
6250         * rootcontext.cs: set warninglevel to 4
6251
6252 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
6253
6254         * typemanager.cs (CSharpName): reimplemented with Lupus
6255         suggestion.
6256
6257 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
6258
6259         * statement.cs (If): correclty implement Resolve, because we were
6260         not catching sem errors in there.  The same process is needed
6261         everywhere else. 
6262         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
6263         
6264
6265         (Statement.Warning_DeadCodeFound): Factorize code.
6266         (While): Report dead code here too.
6267
6268         (Statement): Added Resolve virtual method to allow
6269         for resolution split from the emit code.
6270
6271 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
6272
6273         * statement.cs (EmitBoolExpression): No longer try to resolve the
6274         expression here.    
6275         (MakeBoolean): New utility function that resolve, implicitly
6276         converts to boolean and tags the expression. 
6277         
6278
6279         (If, Do): Implement dead code elimination.
6280         (While): Implement loop inversion
6281
6282         (Do, While, For, If): Resolve the expression prior to calling our
6283         code generation.
6284
6285 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
6286
6287         * class.cs:
6288           - added method Report28 (warning: program has more than one entry point)
6289           - added method IsEntryPoint, implements paragraph 10.1 of the spec
6290           - modified method Method.Define, the part at the end of the method
6291
6292         * rootcontext.cs: added static public Location EntryPointLocation;
6293           
6294         * ../errors/cs0028.cs : Add test case for the above warning.              
6295
6296         * typemanager.cs:
6297           - modified method CSharpName to allow arrays of primitive type to
6298             be printed nicely (e.g. instead of System.Int32[][] it now prints
6299             int[][])
6300           - added method CSharpSignature: returns the signature of a method
6301             in string format to be used in reporting errors, warnings, etc.
6302
6303         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
6304         with String.Empty.
6305         
6306 2002-04-26  Ravi Pratap  <ravi@ximian.com>
6307
6308         * delegate.cs (Define): Fix extremely silly bug where I was
6309         setting the type of the 'object' parameter of the BeginInvoke
6310         method to System.IAsyncResult instead of System.Object ;-)
6311
6312 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
6313
6314         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
6315         here. 
6316
6317         (Constructor.Emit): return if we fail to initialize the
6318         constructor.  Another door closed!  
6319
6320         * expression.cs (New.DoResolve): Improve error message (from -6 to
6321         1501).  Use DeclaredOnly lookup to find the exact constructor.
6322
6323         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
6324         loop.  This is useful.
6325
6326         * cs-parser.jay: Adjust the default parameters so that destructors
6327         have the proper signature.
6328
6329 2002-04-26  Martin Baulig  <martin@gnome.org>
6330
6331         * driver.cs (LoadAssembly): If `assembly' contains any characters
6332         which are only valid in path names and not in assembly names
6333         (currently slash, backslash and point), use Assembly.LoadFrom ()
6334         instead of Assembly.Load () on the `assembly' (before iteration
6335         over the link_paths).
6336
6337 2002-04-26  Martin Baulig  <martin@gnome.org>
6338
6339         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
6340
6341 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
6342
6343         * class.cs (Property): use the new typemanager.MemberLookup
6344
6345         (TypeContainer.MemberLookup): Implement using the
6346         TypeManager.MemberLookup now. 
6347         
6348         * typemanager.cs: Make MemberLookup a function of the TypeManager,
6349         and return MemberInfos, so that these can be used without an
6350         EmitContext (what we had before).
6351
6352 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
6353
6354         * expression.cs: Fix the case where the argument to params if the
6355         type of the params.  I omitted handling this before.   Fixed
6356
6357 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
6358
6359         * driver.cs: Call BootCorlib_PopulateCoreType
6360
6361         * class.cs (Property.CheckBase): Check for properties only, not
6362         for all members. 
6363
6364         * interface.cs: Temporary hack: try/catch around the
6365         CustomAttributeBuilder, because I am getting an exception that I
6366         do not understand.
6367
6368         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
6369         types whose definitions are required to be there (attributes are
6370         defined before standard types).
6371
6372         Compute definitions as we boot the various types, as they are used
6373         immediately (value_type class will need object_type, but if we do
6374         not initialize object_type, we will pass a null, which will let
6375         the runtime pick the System.Object from the existing corlib, which
6376         is not what we want).
6377
6378 2002-04-22  Patrik Torstensson <totte@labs2.com>
6379
6380         * cs-tokenizer.cs: fixed a number of trim() issues.
6381
6382 2002-04-22  Ravi Pratap  <ravi@ximian.com>
6383
6384         * expression.cs (Argument.Type): Ensure that we return the correct
6385         type when we have out or ref parameters [in which case we 
6386         append a "&"].
6387         
6388 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
6389
6390         * class.cs (Property, Indexer): Allow extern modifier in there. 
6391
6392         * typemanager.cs (InitBaseTypes): Initializes object_type and
6393         value_type, since those will be used early on during the bootstrap
6394         process to compile corlib.
6395
6396         (InitCoreTypes): Move code from here to InitBaseTypes.
6397
6398 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
6399
6400         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
6401         single-dimension arrays as using the ldlen opcode.  
6402
6403         Daniel Lewis discovered this optimization.  
6404
6405         * typemanager.cs: Add signature for System.Array::get_Length
6406
6407 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6408
6409         * statement.cs: report the error when the foreach does not apply to an
6410         array nor a collection.
6411
6412 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
6413
6414         * expression.cs: Add implicit conversions to the operator ~.
6415
6416         * constant.cs (DecimalConstant.Emit): Emit decimal value.
6417
6418         * typemanager.cs: Locate the decimal constructor.
6419
6420 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6421
6422         * attribute.cs: use the new property of TypeOf.
6423         * expression.cs: added 'get' property around typearg.
6424
6425         These changes fix a build breaker reported by NickD. Is this the
6426         correct way to fix?  If not, please, revert my changes and make it
6427         work :-).
6428
6429 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
6430
6431         * attribute.cs: Add support for typeof in attribute invocations.
6432         I am not sure that this is right though.
6433
6434 2002-04-14  Duncan Mak  <duncan@ximian.com>
6435
6436         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
6437         Binary.Operator.Division case.
6438
6439 2002-04-13  Ravi Pratap  <ravi@ximian.com>
6440
6441         * class.cs (DefineType): Ensure that we do a proper check on
6442         attribute types and also register it with the TypeManager.
6443
6444         (TypeContainer.Targets): The default for attribute types is
6445         AttributeTargets.All.
6446         
6447         * attribute.cs (ApplyAttributes): Registering the attribute type
6448         is done elsewhere, not when we discover we have a Usage attribute.
6449
6450 2002-04-12  Ravi Pratap  <ravi@ximian.com>
6451
6452         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
6453         and get rid of is_delegate parameter.
6454
6455         * everywhere : update.
6456         
6457 2002-04-12  Ravi Pratap  <ravi@ximian.com>
6458
6459         * cs-parser.jay (compilation_unit): Revamp completely to use
6460         some new ideas that I got from Rhys' grammar to solve the problems
6461         with assembly level attributes.
6462
6463         (outer_declaration): New grammar production.
6464
6465         (attribute_sections): Add.
6466
6467         (opt_attributes): Base on attribute_sections
6468
6469         (namespace_declaration): Allow opt_attributes to tackle the case
6470         when we have assembly level attributes - we are clever in this
6471         regard now ;-)
6472
6473         * attribute.cs (ApplyAttributes): Do not worry about assembly 
6474         attributes in the non-global context.
6475
6476         * rootcontext.cs (AddGlobalAttributes): Go back to using this
6477         instead of SetGlobalAttributes.
6478
6479         * class.cs, rootcontext.cs : Ensure we define and generate 
6480         attribute types before anything else.
6481
6482         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
6483         and flag the new error -20 for the case when the attribute type
6484         does not have valid targets specified. csc does not catch this.
6485
6486         * ../errors/errors.txt : update for error # -20
6487
6488 2002-04-11  Ravi Pratap  <ravi@ximian.com>
6489
6490         * support.cs (InternalParameters.ParameterModifier): Do some null
6491         checking and return sane values.
6492
6493         * class.cs (Method.Define): If we are a PInvoke method, ensure
6494         that we are static and extern. Report error # 601
6495
6496         * ../errors/cs0601.cs : Add test case for the above error.
6497
6498 2002-04-07  Ravi Pratap  <ravi@ximian.com>
6499
6500         * rootcontext.cs (attribute_types): We need to keep type of
6501         all attribute types separately and emit code for them first.
6502
6503         (RegisterAttribute) : Implement.
6504
6505         * class.cs (DefineType): Check if the current Type is a custom
6506         attribute type and register it accordingly.
6507
6508         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
6509         adding the first attribute twice and rename to
6510
6511         (SetGlobalAttributes): this.
6512
6513         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
6514         lookups.
6515
6516         * attribute.cs (ApplyAttributes): Take an additional argument telling us
6517         if we are processing global arguments. Hmm, I am unsure of this.
6518
6519 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6520
6521         * expression.cs: added static array of strings to avoid calling
6522         Enum.ToString () for Operator in Binary. Significant recover of
6523         performance.
6524
6525 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
6526
6527         * class.cs (FindMembers): Allow the Builders of the various
6528         members to be null.  If they are skip them.  This only happens
6529         during the PInvoke declaration.
6530
6531 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
6532
6533         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
6534         failure, so we do not keep going afterwards.
6535
6536         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
6537         wanted to pass `false' as the `is_delegate' argument.  If this is
6538         the case, why not use delegate_type == null to mean `is_delegate =
6539         false' and anything else as is_delegate = true.
6540
6541 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
6542
6543         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
6544         code for the section, not the beginning of the tests.
6545
6546 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
6547
6548         * cfold.cs: Handle operator + (Enum x, Underlying x) 
6549
6550         * expression.cs (Binary): same.  Warn about errors where we have
6551         Enum/Enum in operator + as well.
6552
6553 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
6554
6555         * statement.cs:
6556                 - added support for switch(bool)
6557                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
6558                 - add TableSwitchEmit() to handle table-based switch statements
6559
6560 2002-04-05  Ravi Pratap  <ravi@ximian.com>
6561
6562         * expression.cs (Invocation.OverloadResolve): Factor out code which
6563         does parameter compatibility checking with arguments so that we can 
6564         re-use the code even from Delegate.VerifyApplicability
6565
6566         (VerifyArgumentsCompat): Move above code here.
6567
6568         * delegate.cs (VerifyApplicability): Get rid of duplicate code
6569         and instead make a call to the above method.
6570
6571 2002-03-31  Ravi Pratap  <ravi@ximian.com>
6572
6573         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
6574         We use it to keep track of classes which are attribute types.
6575
6576 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
6577
6578         * delegate.cs (Delegate.Define): Correctly define the types in the
6579         presence of fixed and array parameters.
6580
6581         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
6582         doing FindMembers.
6583
6584         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
6585         include NonPublic after the first iteration.
6586
6587         * class.cs (Indexer.CheckBase): Only check if both parents are
6588         non-null. 
6589         
6590         * cs-parser.jay (accessor_body): If empty, set to null.
6591
6592         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
6593         same code path here to resolve constants names that we did have in
6594         MemberAccess.DoResolve.  There is too much code duplicated here.
6595
6596 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
6597
6598         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
6599
6600         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
6601         to MakeUnionSet.
6602
6603         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
6604         tokens, numbers and strings.
6605
6606         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
6607         parenthesis.
6608
6609         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
6610         asyncronous parameters and the regular parameters.  
6611
6612         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
6613         specify the target directory.
6614
6615         * expression.cs: (This.DoResolve): Simplify
6616         (As.Emit): Optimize, do not generate IsInst if the expression is
6617         always of the given type.
6618
6619         (Is.DoResolve): Bug fix, we were reporting both always/never for
6620         the is expression.
6621
6622         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
6623         creating too many unnecessary arrays.
6624
6625 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
6626
6627         * class.cs (EmitFieldInitializer): Use Assign expression to assign
6628         fields instead of rolling our own initializer.   Takes care of all
6629         implicit conversions, and drops unnecessary static checks/argument.
6630
6631 2002-03-31  Dick Porter  <dick@ximian.com>
6632
6633         * driver.cs: use the GetDirectories() return values properly, and
6634         use "/" as path separator.
6635
6636 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
6637
6638         * expression.cs (Unary): Optimize - - expr into expr.
6639         (Binary): Optimize a + (-b) into a -b.
6640
6641         * codegen.cs (CodeGen): Made all methods static.
6642
6643 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
6644
6645         * rootcontext.cs: 
6646
6647         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
6648         TypeBuilder property.
6649
6650         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
6651         instead. 
6652
6653         * tree.cs: Removed the various RecordXXXX, and replaced with a
6654         single RecordDecl.  Removed all the accessor methods, and just
6655         left a single access point Type 
6656
6657         * enum.cs: Rename DefineEnum to DefineType.
6658
6659         * decl.cs: New abstract method `DefineType' used to unify the
6660         Defines for Enumerations, Interfaces, TypeContainers and
6661         Delegates.
6662
6663         (FindType): Moved LookupInterfaceOrClass here.  Moved the
6664         LookupBaseClasses method that used to live in class.cs and
6665         interface.cs here, and renamed to FindType.
6666         
6667         * delegate.cs: Implement DefineType.  Take advantage of the
6668         refactored pattern for locating the parent builder without taking
6669         the parent_builder argument (which we know does not work if we are
6670         nested, and triggering a toplevel definition).
6671
6672 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6673
6674         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
6675         accessibility of a member has changed during override and report
6676         an error if so.
6677
6678         * class.cs (Method.Define, Property.Define): Only complain on
6679         overrides if the method is private, any other accessibility is
6680         fine (and since we just checked the permission is the same, we are
6681         good to go).
6682
6683         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
6684         and elif are processed always.  The other pre-processing
6685         directives are only processed if we are "taking" the path
6686
6687 2002-03-29  Martin Baulig  <martin@gnome.org>
6688
6689         * class.cs (Method.Emit): Only emit symbolic debugging info if the
6690         current location is not Null.
6691
6692         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
6693         a separate method so we can profile it.
6694
6695         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
6696         `span.Seconds' are just seconds, but no minutes or hours.
6697         (MainDriver): Profile the CodeGen.SaveSymbols calls.
6698
6699 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6700
6701         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
6702         Remove the gratuitous set of Final:
6703
6704                                 // If an interface implementation, then we can set Final.
6705                                 if (((flags & MethodAttributes.Abstract) == 0) &&
6706                                     implementing.DeclaringType.IsInterface)
6707                                         flags |= MethodAttributes.Final;
6708
6709         I do not know what I was smoking when I used that.
6710         
6711
6712         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
6713         step into fixing the name resolution issues for delegates and
6714         unifying the toplevel name resolution.
6715
6716 2002-03-28  Martin Baulig  <martin@gnome.org>
6717
6718         * class.cs (Method.Emit): If we have a symbol writer, call its
6719         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
6720         tell it about the current method.
6721
6722         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
6723         writer that we're going to emit the first byte of IL code for a new
6724         statement (a new source line).
6725         (EmitContext.EmitTopBlock): If we have a symbol writer, call
6726         EmitContext.Mark() before emitting any code.
6727
6728         * location.cs (SymbolDocument): Return null when we're Null.
6729
6730         * statement.cs (Statement): Moved the `Location loc' variable here.
6731         (Statement.EmitBoolExpression): If we have a symbol writer, call
6732         ec.Mark() before emitting any code to tell it that we're at the
6733         beginning of a new statement.
6734         (StatementExpression): Added `Location' argument to the constructor.
6735         (Block): Added public readonly variable `StartLocation' and public
6736         variable `EndLocation'.  The latter is to be set using SetEndLocation().
6737         (Block): Added constructor which takes a start and end location.
6738         (Block.SetEndLocation): New method. This sets the end location.
6739         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
6740         local variables we create.
6741         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
6742         each statement and do also mark the begin and end of the block.
6743
6744         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
6745         tell it the current lexer.Location, use Location.Null for the end of the
6746         block.
6747         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
6748         current block, set its end location using SetEndLocation().
6749         (statement_expression): StatementExpression constructor now takes the
6750         lexer.Location as additional argument.
6751         (for_statement, declare_local_variables): Likewise.
6752         (declare_local_variables): When creating a new implicit block, use the
6753         new Block constructor and pass it the lexer.Location.
6754
6755 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6756
6757         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
6758         members also on the parent interfaces recursively.
6759
6760 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
6761
6762         * report.cs: Use new formats, since Gonzalo finished the missing
6763         bits. 
6764
6765         * expression.cs (Binary.ResolveOperator): added missing operator|
6766         operator& and operator^ for bool/bool.
6767
6768         * cs-parser.jay: CheckDef now takes a Location argument that is
6769         used to report errors more precisly (instead of reporting the end
6770         of a definition, we try to track something which is a lot closer
6771         to the source of the problem).
6772
6773         * cs-tokenizer.cs: Track global token use, so we can properly flag
6774         the use of #define/#undef after the first token has been seen.
6775
6776         Also, rename the reportXXXX to Error_DescriptiveName
6777
6778         * decl.cs (DeclSpace.IsTopLevel): Move property here from
6779         TypeContainer, so that Enum and Interface can use this too.
6780
6781         * class.cs (TypeContainer.LookupInterfaceOrClass,
6782         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
6783         `builder' argument.  Typically this was used to pass the parent
6784         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
6785         the definition).  
6786
6787         The problem is that a nested class could trigger the definition of
6788         a toplevel class, and the builder would be obviously wrong in that
6789         case. 
6790
6791         So we drop this argument, and we compute dynamically the
6792         TypeBuilder/ModuleBuilder (the correct information was available
6793         to us anyways from DeclSpace.Parent)
6794
6795         * interface.cs (Interface.DefineInterface): Drop builder
6796         parameter cleanup like class.cs
6797
6798         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
6799         like class.cs
6800
6801         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
6802         values. 
6803
6804         (Try.Emit): Propagate the returns value from the statement.
6805
6806         (Return.Emit): Even if we are leavning 
6807
6808         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
6809
6810         * modifiers.cs: Fix the computation of MethodAttributes flags.
6811
6812 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
6813
6814         * driver.cs: allow compilation of files that start with '/'.
6815         Add a default case when checking the argument of --target.
6816
6817 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
6818
6819         * interface.cs: Implement the same search algorithm for types in
6820         the interface code.
6821
6822         * delegate.cs: Do not allow multiple definition.
6823
6824         * Recovered ChangeLog that got accidentally amputated
6825
6826         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
6827
6828         * rootcontext.cs: Load manually enum to allow core classes to
6829         contain enumerations.
6830
6831         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
6832         Update to new static methods in TypeManager.
6833
6834         * typemanager.cs (GetMethod, GetConstructor): Use our
6835         implementation of FindMembers to find the members, since during
6836         corlib compilation, the types are TypeBuilders and GetMethod and
6837         GetConstructor do not work.
6838
6839         Make all methods in TypeManager static.
6840
6841         (InitCodeHelpers): Split the functionality from
6842         the InitCodeTypes function.
6843
6844         * driver.cs: Call InitCodeHelpers after we have populated the
6845         types. 
6846
6847         * cs-parser.jay (delegate_declaration): we did not used to compute
6848         the delegate name correctly for void delegates.
6849
6850 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
6851
6852         * rootcontext.cs (RootContext): Init the interface_resolve_order
6853         and type_container_resolve_order always.
6854
6855         (ResolveCore, BootstrapCorlib_ResolveClass,
6856         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
6857         compiler when compiling with --nostdlib
6858
6859         * class.cs (TypeContainer.DefineType): Check that our parent is
6860         not null.  This test is most important when we are bootstraping
6861         the core types.
6862
6863         * codegen.cs: Split out the symbol writing code.
6864
6865 2002-03-25  Martin Baulig  <martin@gnome.org>
6866
6867         * driver.cs (-g): Made -g an alias for --debug.
6868
6869 2002-03-24  Martin Baulig  <martin@gnome.org>
6870
6871         * codegen.cs (SymbolWriter): New public variable. Returns the
6872         current symbol writer.
6873         (CodeGen): Added `bool want_debugging_support' argument to the
6874          constructor. If true, tell the ModuleBuild that we want debugging
6875         support and ask it for the ISymbolWriter.
6876         (Save): If we have a symbol writer, call it's Close() method after
6877         saving the assembly.
6878
6879         * driver.c (--debug): New command line argument to create a
6880         debugger information file.
6881
6882         * location.cs (SymbolDocument): New public property. Returns an
6883         ISymbolDocumentWriter object for the current source file or null
6884         if we don't have a symbol writer.
6885
6886 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
6887
6888         * driver.cs (LoadAssembly): Correctly return when all the paths
6889         have been tried and not before.
6890
6891         * statement.cs (Switch.Emit): return the actual coverage for this
6892         statement (returns/not-returns)
6893
6894         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
6895         switch of the statement if we are the last switch section.  That
6896         kills two problems: try/catch problems (we used to emit an empty
6897         nop at the end) and switch statements where all branches would
6898         return. 
6899
6900 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
6901
6902         * driver.cs: Add default assemblies (the equivalent to the
6903         Microsoft CSC.RSP file)
6904
6905         * cs-tokenizer.cs: When updating `cols and setting it to zero,
6906         also update tokens_seen and set it to false.
6907
6908         * driver.cs: Implement --recurse for Mike.
6909
6910         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
6911         correctly splitting out the paths.
6912
6913 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
6914
6915         * interface.cs (Interface.PopulateProperty): Instead of using
6916         `parent' as the declaration space for the set parameters, use
6917         `this' 
6918
6919         * support.cs (InternalParameters): InternalParameters constructor
6920         takes a DeclSpace instead of a TypeContainer.
6921
6922         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
6923         types are being initialized, load the address of it before calling
6924         the function.  
6925
6926         (New): Provide a mechanism to disable the generation of local
6927         value type temporaries when the caller will be providing us with
6928         an address to store it.
6929
6930         (ArrayCreation.EmitDynamicInitializers): Use it.
6931
6932 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
6933
6934         * expression.cs (Invocation.EmitArguments): Only probe for array
6935         property if there is more than one argument.  Sorry about that.
6936
6937         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
6938         empty param arrays.
6939         
6940         * class.cs (Method.LabelParameters): Fix incorrect code path that
6941         prevented the `ParamArrayAttribute' from being applied to the
6942         params attribute.
6943
6944 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
6945
6946         * support.cs (ReflectionParameters): Correctly compute whether the
6947         last argument is a params array.  Fixes the problem with
6948         string.Split ('a')
6949
6950         * typemanager.cs: Make the assemblies array always be non-null
6951         (empty, but non-null)
6952
6953         * tree.cs (RecordDecl): New function that abstracts the recording
6954         of names.  This reports error 101, and provides a pointer to the
6955         previous declaration.  Fixes a crash in the compiler.
6956
6957         * cs-parser.jay (constructor_declaration): Update to new grammar,
6958         and provide a constructor_body that can be empty.
6959
6960 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
6961
6962         * driver.cs: Add support for --resources.
6963
6964         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
6965         Make all types for the various array helper methods be integer.
6966
6967         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
6968         CheckState to ConvCast.
6969
6970         (ConvCast): Now it takes a `checked' state argument, to avoid
6971         depending on the emit context for the conversion, and just using
6972         the resolve time setting.
6973
6974         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
6975         instead of Invocation.EmitArguments.  We do not emit the original
6976         arguments, instead we emit those which have been converted to
6977         unsigned int expressions.
6978
6979         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
6980
6981         * codegen.cs: ditto.
6982
6983         * expression.cs (LocalVariableReference): Drop the use of the
6984         Store function that depended on the variable index.
6985
6986         * statement.cs (VariableInfo): Drop the `Idx' property from this
6987         class, as this is not taking into account the indexes for
6988         temporaries tat we generate during the execution, getting the
6989         indexes wrong.
6990
6991         * class.cs: First emit class initializers, then call the parent
6992         constructor. 
6993
6994         * expression.cs (Binary): Fix opcode emision.
6995         (UnaryMutator.EmitCode): Support checked code generation
6996
6997         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
6998         matches for events for both the Static and Instance scans,
6999         pointing to the same element.   Fix that.
7000
7001 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
7002
7003         * rootcontext.cs (ResolveTree): Always set the
7004         interface_resolve_order, because nested interfaces will be calling
7005         into us.
7006
7007         * class.cs (GetInterfaceOrClass): Track the same resolution
7008         process used by TypeManager.LookupType.  This fixes the nested
7009         type lookups in class declarations (separate path from
7010         LookupType). 
7011
7012         (TypeContainer.DefineType): Also define nested interfaces.
7013         (TypeContainer.RegisterOrder): New public function used to
7014         register the order in which child interfaces need to be closed.
7015
7016         Nested interfaces need to be closed after their parents have been
7017         created. 
7018         
7019         * interface.cs (InterfaceAttr): Put all the logic for computing
7020         the interface attribute here. 
7021
7022         (DefineInterface): Register our interface order with the
7023         RootContext or with the TypeContainer depending on the case.
7024
7025 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
7026
7027         * cs-parser.jay: rework foreach statement to work with the new
7028         changes to the policy on SimpleNames.
7029         
7030         * report.cs: support Stacktrace on warnings as well.
7031
7032         * makefile: drop --unsafe and /unsafe from the compile.
7033
7034 2002-03-13  Ravi Pratap  <ravi@ximian.com>
7035
7036         * ecore.cs (StandardConversionExists): Modify to take an Expression
7037         as the first parameter. Ensure we do null -> reference type conversion
7038         checking.
7039
7040         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
7041         temporary Expression objects.
7042
7043 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
7044
7045         * interface.cs: workaround bug in method overloading resolution
7046         (there is already a bugzilla bug for it).
7047
7048 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
7049
7050         We could also solve this problem by having a separate path for
7051         performing type lookups, instead of DoResolve, we could have a
7052         ResolveType entry point, and only participating pieces of the
7053         production (simplename, deref, array) would implement this. 
7054         
7055         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
7056         signal SimpleName to only resolve type names and not attempt to
7057         resolve anything else.
7058
7059         * expression.cs (Cast): Set the flag.
7060
7061         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
7062
7063         * class.cs: Only report 108 if there is no `new' modifier.
7064
7065         * cs-parser.jay: rework foreach statement to work with the new
7066         changes to the policy on SimpleNames.
7067         
7068         * report.cs: support Stacktrace on warnings as well.
7069
7070         * makefile: drop --unsafe and /unsafe from the compile.
7071
7072 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
7073
7074         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
7075         lookups here, instead of doing that at parse time.  This means
7076         that our grammar will not introduce `LocalVariableReferences' as
7077         expressions at this point.  That solves the problem of code like
7078         this:
7079
7080         class X {
7081            static void Main ()
7082            { int X = 1;
7083             { X x = null }}}
7084
7085         This is only half the fix.  The full fix requires parameters to
7086         also be handled in this way.
7087
7088         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
7089         makes the use more obvious of the DeclSpace.  The
7090         ec.TypeContainer.TypeBuilder is now only used to pull the
7091         TypeBuilder for it.
7092
7093         My theory is that I can get rid of the TypeBuilder completely from
7094         the EmitContext, and have typecasts where it is used (from
7095         DeclSpace to where it matters).  
7096
7097         The only pending problem is that the code that implements Aliases
7098         is on TypeContainer, and probably should go in DeclSpace.
7099
7100         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
7101         lookups here, instead of doing that at parse time.  This means
7102         that our grammar will not introduce `LocalVariableReferences' as
7103         expressions at this point.  That solves the problem of code like
7104         this:
7105
7106         class X {
7107            static void Main ()
7108            { int X = 1;
7109             { X x = null }}}
7110
7111         This is only half the fix.  The full fix requires parameters to
7112         also be handled in this way.
7113
7114         * class.cs (Property.DefineMethod): When implementing an interface
7115         method, set newslot, when implementing an abstract method, do not
7116         set the flag (before we tried never setting it, or always setting
7117         it, which is the difference).
7118         (Indexer.DefineMethod): same.
7119         (Method.DefineMethod): same.
7120
7121         * ecore.cs: Only set the status used flag if we get back a Field.
7122
7123         * attribute.cs: Temporary hack, so Paolo can keep working.
7124
7125 2002-03-08  Ravi Pratap  <ravi@ximian.com>
7126
7127         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
7128         the unmanaged type in the case we have a MarshalAs attribute.
7129
7130         (Resolve): Handle the case when we are parsing the special MarshalAs
7131         attribute [we need to store the unmanaged type to use later]
7132         
7133         * typemanager.cs (marshal_as_attr_type): Built in type for the 
7134         MarshalAs Attribute.
7135
7136         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
7137         on parameters and accordingly set the marshalling info.
7138         
7139 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
7140
7141         * class.cs: Optimizing slightly by removing redundant code after
7142         we switched to the `NoTypes' return value.
7143         (Property.DefineMethod): use NoTypes here too.
7144
7145         This fixes the bug I introduced in my last batch of changes.
7146
7147 2002-03-05  Ravi Pratap  <ravi@ximian.com>
7148
7149         * tree.cs (RecordEnum): Add. We now keep track of enums too.
7150
7151         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
7152         Enums since those are types too. 
7153
7154         * cs-parser.jay (enum_declaration): Record enums as we parse them.
7155         
7156         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
7157         thanks to a call during the lookup process.
7158
7159 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
7160
7161         * statement.cs (Foreach): Lots of work to accomodate a particular
7162         kind of foreach statement that I had not kept in mind.  It is
7163         possible to have foreachs on classes that provide a GetEnumerator
7164         method that return objects that implement the "pattern" for using
7165         a foreach, there is no need to support GetEnumerator
7166         specifically. 
7167
7168         This is needed to compile nant.
7169
7170         * decl.cs: Only report 114 if the member is not `Finalize' and if
7171         the warning level is at least 2.
7172
7173         * class.cs: Moved the compare function from Method to
7174         MethodSignature. 
7175
7176         (MethodSignature.InheritableMemberSignatureCompare): Add new
7177         filter function that is used to extract inheritable methods from a
7178         class. 
7179
7180         (Method.Define): Use the new `inheritable_method_signature_filter'
7181         delegate
7182
7183         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
7184         command. 
7185
7186 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
7187
7188         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
7189
7190         * cs-parser.jay: Add opt_semicolon to the interface declaration.
7191
7192         * expression.cs: Pass location information to
7193         ConvertImplicitStandard. 
7194
7195         * class.cs: Added debugging code to track return values from
7196         interfaces. 
7197
7198 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
7199
7200         * expression.cs (Is.DoResolve): If either side of the `is' is an
7201         interface, do not flag the warning.
7202
7203         * ecore.cs (ImplicitReferenceConversion): We need a separate test
7204         for interfaces
7205
7206         * report.cs: Allow for --fatal to be used with --probe.
7207         
7208         * typemanager.cs (NoTypes): Move the definition for the empty Type
7209         array here. 
7210
7211         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
7212         properties. 
7213         (TypeContainer.DefineProxy): New function used to proxy to parent
7214         implementations when implementing interfaces.
7215         (TypeContainer.ParentImplements): used to lookup if our parent
7216         implements a public function that is required by an interface.
7217         (TypeContainer.VerifyPendingMethods): Hook this up.
7218
7219         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
7220         `modules' and `assemblies' arraylists into arrays.  We only grow
7221         these are the very early start up of the program, so this improves
7222         the speedof LookupType (nicely measured).
7223
7224         * expression.cs (MakeByteBlob): Replaced unsafe code with
7225         BitConverter, as suggested by Paolo.
7226
7227         * cfold.cs (ConstantFold.Binary): Special case: perform constant
7228         folding of string concatenation, but if either side is a string,
7229         and the other is not, then return null, and let the runtime use
7230         the concatenation on the string plus the object (using
7231         `Object.ToString'). 
7232
7233 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
7234
7235         Constant Folding has been implemented now.
7236         
7237         * expression.cs (Unary.Reduce): Do not throw an exception, catch
7238         the error instead on types that are not supported in one's
7239         complement. 
7240
7241         * constant.cs (Constant and all children): New set of functions to
7242         perform implict and explicit conversions.
7243         
7244         * ecore.cs (EnumConstant): Implement the new functions to perform
7245         conversion by proxying to the child expression.
7246
7247         * codegen.cs: (ConstantCheckState): Constant evaluation has its
7248         own separate setting that can not be turned off from the command
7249         line using --unchecked or --checked and is only controlled using
7250         the checked/unchecked statements and expressions.  This setting is
7251         used by the constant folder to flag errors.
7252
7253         * expression.cs (CheckedExpr, UncheckedExpr): Set the
7254         ConstantCheckState as well.   
7255
7256         During Resolve, they also have to flag the state, because the
7257         constant folder runs completely in the Resolve phase.
7258
7259         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
7260         well.
7261
7262 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
7263
7264         * cfold.cs: New file, this file contains the constant folder.
7265         
7266         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
7267         argument to track whether we are using the resulting address to
7268         load or store a value and provide better error messages. 
7269
7270         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
7271         new AddressOf arguments.
7272
7273         * statement.cs (Foreach.EmitCollectionForeach): Update
7274
7275         * expression.cs (Argument.Emit): Call AddressOf with proper
7276         arguments to track usage.
7277
7278         (New.DoEmit): Call AddressOf with new arguments.
7279
7280         (Unary.Emit): Adjust AddressOf call.
7281
7282 2002-03-01  Ravi Pratap  <ravi@ximian.com>
7283
7284         * cs-parser.jay (member_access): Change the case for pre-defined types
7285         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
7286         this suggestion.
7287
7288         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
7289         a method body.
7290
7291         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
7292         essentially like methods and apply attributes like MethodImplOptions to them too.
7293
7294         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
7295         not being null.
7296
7297         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
7298         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
7299         is the DeclSpace.
7300
7301         * Update code everywhere accordingly.
7302
7303         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
7304
7305         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
7306
7307 2002-02-28  Ravi Pratap  <ravi@ximian.com>
7308
7309         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
7310         try performing lookups against those instead of jumping straight into using
7311         the 'using' clauses.
7312
7313         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
7314
7315         (LookupType): Perform lookups in implicit parents too.
7316
7317         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
7318         sequence as RootContext.LookupType. 
7319
7320         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
7321         the various cases of namespace lookups into this method.
7322
7323 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
7324
7325         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
7326         in positional arguments)
7327
7328         * class.cs (Operator): Update the AllowedModifiers to contain
7329         extern. 
7330
7331         * cs-parser.jay: Update operator declaration to allow for the
7332         operator body to be empty.
7333
7334         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
7335         values. 
7336
7337 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
7338
7339         * class.cs (Method.Emit): Label parameters.
7340
7341         * driver.cs: Return 1 or 0 as the program exit code.
7342
7343 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
7344
7345         * expression.cs: Special case the `null' object when trying to
7346         auto-compute the type, as anything can be explicitly converted to
7347         that. 
7348
7349         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
7350         spotting this Paolo.
7351
7352         (Expression.ImplicitNumericConversion): Perform comparissions of
7353         the type using the underlying type in the case of an enumeration
7354         rather than using the enumeration type for the compare.
7355
7356         Cope with the underlying == type case, which is not possible to
7357         catch before. 
7358
7359         (Expression.ConvertNumericExplicit): Perform comparissions of
7360         the type using the underlying type in the case of an enumeration
7361         rather than using the enumeration type for the compare.
7362
7363         * driver.cs: If the user does not supply an extension, assume .exe
7364
7365         * cs-parser.jay (if_statement): Rewrote so that we can track the
7366         location for the if statement.
7367
7368         * expression.cs (Binary.ConstantFold): Only concat strings when
7369         the operation is "+", not everything ;-)
7370
7371         * statement.cs (Statement.EmitBoolExpression): Take a location
7372         argument. 
7373         (If, While, Do): Track location.
7374
7375         * expression.cs (Binary.ResolveOperator): In the object + string
7376         case, I was missing a call to ConvertImplicit
7377
7378 2002-02-25  Ravi Pratap  <ravi@ximian.com>
7379
7380         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
7381         Location arguments. Ensure we use RootContext.LookupType to do our work
7382         and not try to do a direct Type.GetType and ModuleBuilder.GetType
7383
7384         * interface.cs (PopulateMethod): Handle the type of the parameter being
7385         null gracefully.
7386
7387         * expression.cs (Invocation.BetterFunction): Handle the case when we 
7388         have a params method with no fixed arguments and a call is made with no
7389         arguments.
7390
7391 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
7392
7393         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
7394         the verbatim-string-literal
7395
7396         * support.cs (InternalParameters.ParameterModifier): handle null
7397         fixed parameters.
7398         (InternalParameters.ParameterType): ditto.
7399
7400         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
7401         duplicating the name of the variable parameter.
7402         (GetParameterByName): Fix bug where we were not looking up array
7403         paramters if they were the only present (thanks Paolo!).
7404         (GetParameterInfo): We only have an empty set of types if both
7405         fixed and array are set to null.
7406         (GetParameterInfo-idx): Handle FixedParameter == null
7407
7408         * cs-parser.jay: Handle the case where there is no catch
7409         statements (missing null test).
7410
7411 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
7412
7413         * driver.cs (MainDriver): Be conservative on our command line
7414         handling.
7415
7416         Catch DirectoryNotFoundException when calling GetFiles.
7417         
7418         (SplitPathAndPattern): Used to split the input specification into
7419         a path and a pattern that we can feed to Directory.GetFiles.
7420
7421 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
7422
7423         * statement.cs (Fixed): Implement the last case of the Fixed
7424         statement (string handling).
7425
7426         * expression.cs (StringPtr): New class used to return a char * to
7427         a string;  Used by the Fixed statement.
7428
7429         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
7430
7431         * expression.cs (Binary.ResolveOperator): Remove redundant
7432         MemberLookup pn parent type.
7433         Optimize union call, we do not need a union if the types are the same.
7434         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
7435         type.
7436
7437         Specialize the use of MemberLookup everywhere, instead of using
7438         the default settings. 
7439
7440         (StackAlloc): Implement stackalloc keyword.
7441
7442         * cs-parser.jay: Add rule to parse stackalloc.
7443         
7444         * driver.cs: Handle /h, /help, /?
7445
7446         * expression.cs (MakeByteBlob): Removed the hacks we had in place
7447         before we supported unsafe code.
7448         
7449         * makefile: add --unsafe to the self compilation of mcs.
7450
7451 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
7452
7453         * expression.cs (PointerArithmetic): New class that is used to
7454         perform pointer arithmetic.
7455         (Binary.Resolve): Handle pointer arithmetic
7456         Handle pointer comparission.
7457         (ArrayPtr): Utility expression class that is used to take the
7458         address of an array.
7459
7460         (ElementAccess): Implement array access for pointers
7461         
7462         * statement.cs (Fixed): Implement fixed statement for arrays, we
7463         are missing one more case before we are done.
7464
7465         * expression.cs (Indirection): Implement EmitAssign and set the
7466         ExprClass to Variable.  This allows pointer dereferences to be
7467         treated as variables, and to have values assigned to them.
7468         
7469         * ecore.cs (Expression.StoreFromPtr): New utility function to
7470         store values dereferencing.
7471
7472 2002-02-20  Ravi Pratap  <ravi@ximian.com>
7473
7474         * expression.cs (Binary.ResolveOperator): Ensure that we are
7475         not trying to operate on a void type - this fixes the reported
7476         bug.
7477
7478         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
7479         the parent implementation is sealed.
7480
7481         * ../errors/cs0239.cs : Add.
7482
7483         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
7484
7485         * typemanager.cs (unverifiable_code_type): Corresponds to 
7486         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
7487         which have unsafe code in them.
7488
7489         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
7490         unsafe context.
7491
7492 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
7493
7494         * cs-tokenizer.cs: Add support for @"litreal strings"
7495
7496         Make tokenizer accept pre-processor directives
7497         on any column (remove the old C-like limitation). 
7498
7499         * rootcontext.cs (EmitCode): Emit any global attributes.
7500         (AddGlobalAttributes): Used to keep track of assembly attributes. 
7501
7502         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
7503
7504         * cs-parser.jay: Add support for global attributes.  
7505
7506 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
7507
7508         * expression.cs (Indirection): New helper class.  Unary will
7509         create Indirection classes to be able to implement the
7510         IMemoryLocation interface on it.
7511
7512 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
7513
7514         * cs-parser.jay (fixed_statement): reference the right statement.
7515
7516         * statement.cs (Fixed.Emit): Finish implementing the fixed
7517         statement for the &x case.
7518
7519 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
7520
7521         * class.cs (Property.Define, Method.Define): Remove newslot when
7522         `implementing'.  
7523
7524         * modifiers.cs: My use of NewSlot when `Abstract' was set was
7525         wrong.  NewSlot should only be used if the `new' keyword is present.
7526
7527         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
7528         locating our system dir.  Sorry about this.
7529
7530 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
7531
7532         * driver.cs (GetSystemDir): Compute correctly the location of our
7533         system assemblies.  I was using the compiler directory instead of
7534         the library directory.
7535
7536 2002-02-13  Ravi Pratap  <ravi@ximian.com>
7537
7538         * expression.cs (BetterFunction): Put back in what Miguel commented out
7539         since it is the correct fix. The problem is elsewhere ;-)
7540
7541         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
7542         parameters of the parms method are themselves compatible or not !
7543
7544         (StandardConversionExists): Fix very dangerous bug where we were forgetting
7545         to check that a class implements an interface before saying that an implicit
7546         conversion was allowed. Use ImplementsInterface to do the checking.
7547
7548 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
7549
7550         * class.cs (Method.Define): Track whether we are an explicit
7551         implementation or not.  And only call DefineMethodOverride if we
7552         are an explicit implementation.
7553
7554         (Property.DefineMethod): Ditto.
7555
7556 2002-02-11  Ravi Pratap  <ravi@ximian.com>
7557
7558         * expression.cs (BetterFunction): Catch hideous bug which was
7559          preventing us from detecting ambiguous calls due to implicit casts i.e
7560         cs0121.
7561
7562 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
7563
7564         * support.cs (Pair): Remove un-needed method.  I figured why I was
7565         getting the error in cs-parser.jay, the variable in a foreach loop
7566         is readonly, and the compiler does not really treat this as a variable.
7567
7568         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
7569         instead of EQUALS in grammar.  
7570
7571         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
7572
7573         * expression.cs (Unary.DoResolve): Check whether the argument is
7574         managed or not.
7575
7576 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
7577
7578         * support.cs: Api for Pair to set a value.  Despite the fact that
7579         the variables are public the MS C# compiler refuses to compile
7580         code that accesses the field if the variable is part of a foreach
7581         statement. 
7582
7583         * statement.cs (Fixed): Begin implementation of the fixed
7584         statement.
7585
7586         (Block.AddVariable): Return the VariableInfo on success and null
7587         on failure instead of true/false. 
7588
7589         * cs-parser.jay (foreach): Catch errors on variables already
7590         defined (we were ignoring this value before) and properly unwind
7591         the block hierarchy
7592
7593         (fixed_statement): grammar for the fixed statement.
7594
7595 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
7596
7597         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
7598         pointer types to be incretemented.
7599
7600         (SizeOf): Implement.
7601
7602         * cs-parser.jay (pointer_member_access): Implement
7603         expr->IDENTIFIER production.
7604
7605         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
7606         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
7607         on safe contexts.
7608
7609         (Unary): Implement indirection.
7610
7611         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
7612         use in non-unsafe context).
7613
7614         (SimpleName.DoResolve): Check for pointers in field access on safe
7615         contexts. 
7616
7617         (Expression.LoadFromPtr): Factor the load-indirect code in this
7618         function.  This was duplicated in UnboxCast and ParameterReference
7619
7620 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
7621
7622         * expression.cs (ComposedCast): report an error if a pointer cast
7623         is used in a safe region.
7624
7625         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
7626         pointer type casts in unsafe context.
7627
7628         * codegen.cs (EmitContext): Set up IsUnsafe.
7629
7630         * cs-parser.jay (non_expression_type): Add productions for pointer
7631         casts. 
7632
7633         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
7634         code.  We should not use force into static mode if the method is
7635         not virtual.  Fixes bug in MIS
7636
7637         * statement.cs (Do.Emit, While.Emit, For.Emit,
7638         Statement.EmitBoolExpression): Add support to Do and While to
7639         propagate infinite loop as `I do return' semantics.
7640
7641         Improve the For case to also test for boolean constants.
7642
7643         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
7644         to the list of attributes we can add.
7645
7646         Remove `EmitContext' argument.
7647
7648         * class.cs (Method.Define): Apply parameter attributes.
7649         (Constructor.Define): Apply parameter attributes.
7650         (MethodCore.LabelParameters): Move here the core of labeling
7651         parameters. 
7652
7653         * support.cs (ReflectionParameters.ParameterModifier,
7654         InternalParameters.ParameterModifier): Use IsByRef on the type and
7655         only return the OUT bit for these parameters instead of in/out/ref
7656         flags.
7657
7658         This is because I miss-understood things.  The ParameterInfo.IsIn
7659         and IsOut represent whether the parameter has the [In] and [Out]
7660         attributes set.  
7661
7662 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
7663
7664         * ecore.cs (FieldExpr.Emit): Release temporaries.
7665
7666         * assign.cs (LocalTemporary.Release): new function.
7667
7668         * codegen.cs (EmitContext.GetTemporaryStorage,
7669         EmitContext.FreeTemporaryStorage): Rework the way we deal with
7670         temporary storage.  Now we can "put back" localbuilders when we
7671         are done with them
7672
7673 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
7674
7675         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
7676         need to make a copy of the variable to generate verifiable code.
7677
7678 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
7679
7680         * driver.cs: Compute dynamically the system directory.
7681
7682         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
7683         Slower, but more generally useful.  Used by the abstract
7684         registering implementation. 
7685
7686         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
7687         the rules for the special rule on Type/instances.  First check if
7688         we have the same name, and if so, try that special static path
7689         rather than the instance path.
7690         
7691 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
7692
7693         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
7694         for, while and if.
7695
7696         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
7697         Enum, ValueType, Delegate or Array for non-corlib compiles.
7698
7699         * cs-tokenizer.cs: Catch long identifiers (645)
7700
7701         * typemanager.cs (IndexerPropetyName): Ravi never tested this
7702         piece of code.
7703
7704         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
7705         fix, we were returning too early, so we were not registering
7706         pending methods from abstract classes.
7707
7708         Do not register pending methods if the class is abstract.
7709
7710         * expression.cs (Conditional.DoResolve): Report circular implicit
7711         conversions when we neecd to compute it for conditional
7712         expressions. 
7713
7714         (Is.DoResolve): If the expression is always of the provided type,
7715         flag warning 183.  If the expression can not ever be of the
7716         provided type flag warning 184.
7717
7718         * class.cs: Catch 169 as well.
7719
7720         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
7721         read. 
7722
7723 2002-01-18  Nick Drochak  <ndrochak@gol.com>
7724
7725         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
7726
7727 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
7728
7729         * interface.cs: (PopulateMethod): Check for pointers being defined
7730         only if the unsafe context is active.
7731         (PopulateProperty): ditto.
7732         (PopulateIndexer): ditto.
7733
7734         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
7735         specified.  If pointers are present, make sure that they are
7736         present in an unsafe context.
7737         (Constructor, Constructor.Define): ditto.
7738         (Field, Field.Define): ditto.
7739         (Property, Property.Define): ditto.
7740         (Event, Event.Define): ditto.
7741
7742         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
7743         hashtable if there are classes or structs defined.
7744
7745         * expression.cs (LocalVariableReference.DoResolve): Simplify this
7746         code, as the constant resolution moved.
7747
7748         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
7749         the metadata, so we can flag error 133. 
7750
7751         * decl.cs (MemberCore.UnsafeOK): New function to test that a
7752         pointer is being declared in an unsafe context.
7753
7754 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
7755
7756         * modifiers.cs (Modifiers.Check): Require a Location argument.
7757         Report error 227 for Unsafe use.
7758
7759         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
7760
7761         * statement.cs (For.Emit): If the test is null, then report that
7762         we do `return', as we wont reach anything afterwards.
7763
7764         (Switch.SwitchGoverningType): Track the expression that matched
7765         the conversion.
7766
7767         * driver.cs: Allow negative numbers as an error code to flag.
7768
7769         * cs-parser.jay: Handle 1551.
7770
7771         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
7772
7773 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
7774
7775         * cs-parser.jay: Report 1518 (type declaration can only contain
7776         class, struct, interface, enum or delegate)
7777
7778         (switch_label): Report 1523 (keywords `case' or `default' must
7779         preced code)
7780
7781         (opt_switch_sections): Report 1522 (empty switch)
7782
7783         * driver.cs: Report 1515 (response file specified multiple times)
7784         Report 1516 (Source file specified multiple times).
7785
7786         * expression.cs (Argument.Resolve): Signal 1510
7787
7788         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
7789         access not allowed in static code)
7790
7791 2002-01-11  Ravi Pratap  <ravi@ximian.com>
7792
7793         * typemanager.cs (IsPointerType): Utility method which we are going
7794         to need a lot.
7795
7796         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
7797         the object type, so we take care of that.
7798
7799         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
7800         
7801         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
7802         added to non-params parameters :-)
7803
7804         * typemanager.cs (CSharpName): Include 'void' type too. 
7805
7806         (void_ptr_type): Include in the set of core types.
7807
7808         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
7809         duplicating code.
7810
7811         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
7812         an unsafe context.
7813
7814         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
7815         completely forgotten about it.
7816
7817 2002-01-10  Ravi Pratap  <ravi@ximian.com>
7818
7819         * cs-parser.jay (pointer_type): Add. This begins our implementation
7820         of parsing rules for unsafe code.
7821
7822         (unsafe_statement): Implement.
7823
7824         (embedded_statement): Modify to include the above.
7825
7826         * statement.cs (Unsafe): Implement new class for unsafe blocks.
7827
7828         * codegen.cs (EmitContext.InUnsafe): Add. This determines
7829         if the current context is an unsafe one.
7830
7831         * cs-parser.jay (local_variable_pointer_type): Since local variable types
7832         are handled differently, we need separate rules for them.
7833
7834         (local_variable_declaration): Update to use local_variable_pointer_type
7835         to allow variable declarations of unmanaged pointer types.
7836
7837         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
7838         in unsafe contexts.
7839
7840         * ../errors/cs0214.cs : Add.
7841
7842 2002-01-16  Nick Drochak  <ndrochak@gol.com>
7843
7844         * makefile: remove 'response' file when cleaning.
7845
7846 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
7847
7848         * cs-parser.jay: Report 1524.
7849
7850 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
7851
7852         * typemanager.cs (RegisterMethod): drop checking if we have
7853         registered this from here
7854
7855 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
7856
7857         * class.cs (Method.EmitDestructor): Implement calling our base
7858         destructor. 
7859
7860         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
7861         value of InFinally.
7862
7863         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
7864         this routine and will wrap the call in a try/catch block.  Deal
7865         with the case.
7866
7867 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
7868
7869         * ecore.cs (Expression.MemberLookup): instead of taking a
7870         parameter `same_type' that was used to tell whether we could
7871         access private members we compute our containing type from the
7872         EmitContext.
7873
7874         (FieldExpr): Added partial support for volatile fields.  This does
7875         not work for volatile fields exposed from assemblies, as I can not
7876         figure out how to extract the modreq from it.
7877
7878         Updated all the source files to use this.
7879
7880         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
7881         because it is referenced by MemberLookup very often. 
7882
7883 2002-01-09  Ravi Pratap  <ravi@ximian.com>
7884
7885         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
7886         TypeBuilder.GetCustomAttributes to retrieve what we need.
7887
7888         Get rid of redundant default_member_attr_type as this is the same as
7889         default_member_type which already exists.
7890
7891         * interface.cs, attribute.cs : Update accordingly.
7892         
7893 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
7894
7895         * typemanager.cs: Enable IndexerPropertyName again.  It does not
7896         work for TYpeBuilders though.  Ravi, can you please fix this?
7897
7898         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
7899
7900         * expression.cs (Argument.Emit): Handle the case of ref objects
7901         being passed to ref functions;  
7902
7903         (ParameterReference.EmitLoad): Loads the content of the pointer
7904         without dereferencing.
7905
7906 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
7907
7908         * cs-tokenizer.cs: Implemented the pre-processing expressions.
7909
7910 2002-01-08  Ravi Pratap  <ravi@ximian.com>
7911
7912         * class.cs (Indexer.DefineMethod): Incorporate the interface
7913         type in the name of the method if we are doing explicit interface
7914         implementation.
7915
7916         * expression.cs (ConversionExists): Remove as it is completely obsolete.
7917
7918         (BetterConversion): Fix extremely trivial bug where we were referring to
7919         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
7920         again !
7921
7922         * ../errors/bug16.cs : Add although we have fixed it.
7923
7924 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
7925
7926         * expression.cs (BaseIndexer): Begin implementation.
7927
7928         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
7929
7930         * cs-parser.jay (indexer_declarator): Use qualified_identifier
7931         production directly to remove a shift/reduce, and implement
7932         explicit interface implementation.
7933
7934         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
7935         after a floating point suffix.
7936
7937         * expression.cs (DoNumericPromotions): Improved the conversion for
7938         uint/uint.  If we have a constant, we avoid doing a typecast to a
7939         larger type.
7940
7941         * class.cs (Indexer): Implement explicit interface implementation
7942         for indexers.
7943         
7944 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
7945
7946         * class.cs: make the default instance constructor public and hidebysig.
7947
7948 2001-01-03  Ravi Pratap  <ravi@ximian.com>
7949
7950         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
7951         so we can call it from elsewhere.
7952
7953         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
7954         we emit it internally if the class has a defined indexer; otherwise the user
7955         emits it by decorating the class definition with the DefaultMemberAttribute.
7956
7957         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
7958         attribute is not used on a type which defines an indexer.
7959
7960         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
7961         character when we skip whitespace.
7962
7963         * ../errors/cs0646.cs : Add.
7964
7965 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
7966
7967         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
7968         again. 
7969
7970         * makefile: Add practical target `mcs3.exe' which builds the third
7971         generation compiler. 
7972
7973         * expression.cs (New): Fix structures constructor calling.
7974
7975         * class.cs (Property, Method, Indexer): Emit Final flag on the
7976         method if we are an interface implementation and we are not
7977         abstract. 
7978
7979         * ecore.cs (PropertyExpr): New public field `IsBase', tells
7980         whether this property is referencing a `base' method.
7981
7982         * expression.cs (Invocation.EmitCall): take an extra argument:
7983         is_base, this is used to determine whether the `call' or
7984         `callvirt' opcode should be used.
7985
7986         
7987         * delegate.cs: update EmitCall.
7988
7989         * class.cs (Method.Define): Set NewSlot for the cases where we are
7990         not implementing an interface method.
7991
7992         (Property.Define): ditto.
7993
7994 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
7995
7996         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
7997         'r'.  Allows mcs to parse itself fully.
7998
7999 2002-01-02  Ravi Pratap  <ravi@ximian.com>
8000
8001         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
8002         of the number of initializers that require the InitializeArray method.
8003
8004         (CheckIndices): Store the Expression in all cases - not the plain value. Also
8005         update the above field where necessary.
8006
8007         (MakeByteBlob): Update accordingly.
8008
8009         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
8010         greater than 2.
8011
8012         (EmitDynamicInitializers): Update in accordance with the new optimization.
8013
8014         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
8015         same OpCode applies.
8016
8017         * cs-parser.jay : Fix some glaring errors I introduced.
8018
8019 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
8020
8021         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
8022         so that we can check for name clashes there too.
8023
8024         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
8025         for interface indexers.
8026
8027         * interfaces.cs (Define): Emit the default member attribute.
8028
8029         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
8030         variable was being referred to while setting the value ;-)
8031
8032 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
8033
8034         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
8035         byte-by-byte information when we know the data is zero.
8036
8037         Make the block always a multiple of 4, because
8038         DefineInitializedData has a bug.
8039
8040         * assign.cs: Fix, we should assign from the temporary, not from
8041         the source. 
8042
8043         * expression.cs (MakeByteBlob): Fix my incorrect code.
8044
8045 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
8046
8047         * typemanager.cs (EnumToUnderlying): This function is used to get
8048         the underlying type from an enumeration, because it does not
8049         always work. 
8050
8051         * constant.cs: Use the I4_S form for values between -128 and 127.
8052
8053         * statement.cs (Block.LookupLabel): Looks up a label.
8054         (Block): Drop support for labeled blocks.
8055
8056         (LabeledStatement): New kind of statement that represents a label
8057         only.
8058
8059         (Goto): Finally implement this bad boy.
8060         
8061         * cs-parser.jay: Update to reflect new mechanism to implement
8062         labels.
8063
8064 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
8065
8066         * codegen.cs (EmitContext.This): a codegen property that keeps the
8067         a single instance of this instead of creating many different this
8068         instances. 
8069
8070         * delegate.cs (Delegate.DoResolve): Update to use the property;
8071
8072         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
8073
8074         * expression.cs (BaseAccess.DoResolve): Ditto.
8075
8076 2001-12-29  Ravi Pratap  <ravi@ximian.com>
8077
8078         * typemanager.cs (methodimpl_attr_type): Add to hold the type
8079         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
8080
8081         (InitCoreTypes): Update accordingly.
8082
8083         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
8084         so we can quickly store the state.
8085
8086         (ApplyAttributes): Set the correct implementation flags
8087         for InternalCall methods.
8088
8089 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
8090
8091         * expression.cs (EmitCall): if a method is not virtual, then do
8092         not use callvirt on it.
8093
8094         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
8095         user defined stuff) requires the use of stobj, which takes an
8096         address on the stack instead of an array and an index.  So emit
8097         the Ldelema operation for it.
8098
8099         (EmitStoreOpcode): Use stobj for valuetypes.
8100
8101         (UnaryMutator.EmitCode): Use the right 1 value depending on
8102         whether we are dealing with int64/uint64, float or doubles.
8103
8104         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
8105         constructors that I implemented last night.
8106
8107         (Constructor.IsDefault): Fix to work properly for static
8108         constructors.
8109
8110         * cs-parser.jay (CheckDef): report method signature errors.
8111         Update error number 103 to be 132.
8112
8113         * decl.cs: New AdditionResult enumeration value: MethodExists.
8114         Although we do this check for methods later on in the semantic
8115         analysis, catching repeated default constructors is so easy that
8116         we catch these here. 
8117         
8118         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
8119         promotions code.
8120
8121         (ParameterReference.EmitAssign, Emit): handle
8122         bools as bytes.
8123
8124         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
8125         (ArrayAccess.EmitStoreOpcode): ditto.
8126
8127         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
8128
8129         * expression.cs (MakeByteBlob): Complete all the missing types
8130         (uint, short, ushort, byte, sbyte)
8131
8132         * class.cs: Only init instance field initializers on instance
8133         constructors. 
8134
8135         Rename `constructors' to instance_constructors. 
8136
8137         (TypeContainer.AddConstructor): Only add constructors to the list
8138         if it is not static.
8139
8140         Make sure that we handle default_static_constructor independently
8141         everywhere where we handle instance_constructors
8142
8143 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
8144
8145         * class.cs: Do not lookup or create a base initializer for a
8146         static constructor.
8147
8148         (ConstructorInitializer.Resolve): use the proper type to lookup
8149         for constructors.
8150
8151         * cs-parser.jay: Report error 1585 (modifiers between type and name).
8152
8153         * enum.cs, interface.cs: Remove CloseType, this is taken care by
8154         in DeclSpace. 
8155
8156         * decl.cs: CloseType is now an virtual method, the default
8157         implementation just closes this type.
8158         
8159 2001-12-28  Ravi Pratap  <ravi@ximian.com>
8160
8161         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
8162         to PreserveSig by default. Also emit HideBySig on such methods.
8163
8164         Basically, set the defaults to standard values.
8165
8166         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
8167         argument, if candidate is better, it can't be worse than the best !
8168
8169         (Invocation): Re-write bits to differentiate between methods being
8170         applicable in their expanded form and their normal form - for params
8171         methods of course.
8172
8173         Get rid of use_standard everywhere as only standard conversions are allowed
8174         in overload resolution. 
8175
8176         More spec conformance.
8177         
8178 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
8179
8180         * driver.cs: Add --timestamp, to see where the compiler spends
8181         most of its time.
8182
8183         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
8184         `this' in static code.
8185
8186         (SimpleName.DoResolve): Implement in terms of a helper function
8187         that allows static-references to be passed upstream to
8188         MemberAccess.
8189
8190         (Expression.ResolveWithSimpleName): Resolve specially simple
8191         names when called by MemberAccess to implement the special
8192         semantics. 
8193
8194         (Expression.ImplicitReferenceConversion): Handle conversions from
8195         Null to reference types before others, as Null's type is
8196         System.Object. 
8197
8198         * expression.cs (Invocation.EmitCall): Handle the special case of
8199         calling methods declared on a reference type from a ValueType
8200         (Base classes System.Object and System.Enum)
8201
8202         (MemberAccess.Resolve): Only perform lookups on Enumerations if
8203         the left hand side is a TypeExpr, not on every enumeration. 
8204
8205         (Binary.Resolve): If types are reference types, then do a cast to
8206         object on operators != and == of both arguments.
8207         
8208         * typemanager.cs (FindMembers): Extract instance and static
8209         members if requested.
8210
8211         * interface.cs (PopulateProperty): Use void_type instead of null
8212         as the return type for the setter method.
8213
8214         (PopulateIndexer): ditto.
8215
8216 2001-12-27  Ravi Pratap  <ravi@ximian.com>
8217
8218         * support.cs (ReflectionParameters): Fix minor bug where we
8219         were examining the wrong parameter for the ParamArray attribute.
8220
8221         Cope with requests for the type of the parameter at position
8222         greater than the params parameter's. We now return the element
8223         type of the params array as that makes more sense.
8224
8225         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
8226         accordingly as we no longer have to extract the element type
8227         ourselves.
8228
8229         (Invocation.OverloadResolve): Update.
8230
8231 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
8232
8233         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
8234         against IEnumerator, test whether the return value is a descendant
8235         of the IEnumerator interface.
8236
8237         * class.cs (Indexer.Define): Use an auxiliary method to implement
8238         the other bits of the method definition.  Begin support for
8239         explicit interface implementation.
8240
8241         (Property.DefineMethod): Use TypeManager.void_type instead of null
8242         for an empty return value.
8243
8244 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
8245
8246         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
8247         dealing with a FieldExpr which is composed of a FieldBuilder, in
8248         the code path we did extract the constant, but we should have
8249         obtained the underlying value to be able to cast it (otherwise we
8250         end up in an infinite loop, this is what Ravi was running into).
8251
8252         (ArrayCreation.UpdateIndices): Arrays might be empty.
8253
8254         (MemberAccess.ResolveMemberAccess): Add support for section
8255         14.5.4.1 that deals with the special case of E.I when E is a type
8256         and something else, that I can be a reference to a static member.
8257
8258         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
8259         handle a particular array type to create byte blobs, it is just
8260         something we dont generate byteblobs for.
8261
8262         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
8263         arguments. 
8264
8265         * location.cs (Push): remove the key from the hashtable that we
8266         are about to add.   This happens for empty files.
8267
8268         * driver.cs: Dispose files after we have parsed them.
8269
8270         (tokenize): new function that only runs the tokenizer on its
8271         input, for speed testing.
8272
8273 2001-12-26  Ravi Pratap  <ravi@ximian.com>
8274
8275         * class.cs (Event.Define): Define the private field only if there
8276         are no accessors defined.
8277
8278         * expression.cs (ResolveMemberAccess): If there is no associated
8279         field with the event, that means we have an event defined with its
8280         own accessors and we should flag error cs0070 since transforming
8281         ourselves into a field is not valid in that case.
8282
8283         * ecore.cs (SimpleName.DoResolve): Same as above.
8284
8285         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
8286         and charset to sane values.
8287
8288 2001-12-25  Ravi Pratap  <ravi@ximian.com>
8289
8290         * assign.cs (DoResolve): Perform check on events only if they 
8291         are being accessed outside the declaring type.
8292
8293         * cs-parser.jay (event_declarations): Update rules to correctly
8294         set the type of the implicit parameter etc.
8295
8296         (add_accessor, remove_accessor): Set current local parameters.
8297
8298         * expression.cs (Binary): For delegate addition and subtraction,
8299         cast the return value from the method into the appropriate delegate
8300         type.
8301
8302 2001-12-24  Ravi Pratap  <ravi@ximian.com>
8303
8304         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
8305         of these as the workaround is unnecessary.
8306
8307         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
8308         delegate data - none of that is needed at all.
8309
8310         Re-write bits to extract the instance expression and the delegate method
8311         correctly.
8312
8313         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
8314         on delegates too.
8315
8316         * attribute.cs (ApplyAttributes): New method to take care of common tasks
8317         of attaching attributes instead of duplicating code everywhere.
8318
8319         * everywhere : Update code to do attribute emission using the above method.
8320
8321 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
8322
8323         * expression.cs (IsParamsMethodApplicable): if there are not
8324         parameters, return immediately.
8325
8326         * ecore.cs: The 0 literal can be implicity converted to an enum
8327         type. 
8328
8329         (SimpleName.DoResolve): First lookup the type, then lookup the
8330         members. 
8331
8332         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
8333         want to get its address.  If the InstanceExpression is not
8334         addressable, store the result in a temporary variable, then get
8335         the address of it.
8336
8337         * codegen.cs: Only display 219 errors on warning level or above. 
8338
8339         * expression.cs (ArrayAccess): Make it implement the
8340         IMemoryLocation interface.
8341
8342         (Binary.DoResolve): handle the operator == (object a, object b)
8343         and operator != (object a, object b) without incurring into a
8344         BoxedCast (because 5 != o should never be performed).
8345
8346         Handle binary enumerator operators.
8347
8348         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
8349         value type, otherwise use Ldelem_ref.
8350
8351         Use precomputed names;
8352
8353         (AddressOf): Implement address of
8354
8355         * cs-parser.jay (labeled_statement): Fix recursive block
8356         addition by reworking the production.
8357
8358         * expression.cs (New.DoEmit): New has a special case:
8359                 
8360                  If we are dealing with a ValueType, we have a few
8361                  situations to deal with:
8362                 
8363                     * The target of New is a ValueType variable, that is
8364                       easy, we just pass this as the variable reference
8365                 
8366                     * The target of New is being passed as an argument,
8367                       to a boxing operation or a function that takes a
8368                       ValueType.
8369                 
8370                       In this case, we need to create a temporary variable
8371                       that is the argument of New.
8372
8373
8374 2001-12-23  Ravi Pratap  <ravi@ximian.com>
8375
8376         * rootcontext.cs (LookupType): Check that current_type is not null before
8377         going about looking at nested types.
8378
8379         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
8380         not implement the IAssignMethod interface any more.
8381
8382         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
8383         where we tranform them into FieldExprs if they are being resolved from within
8384         the declaring type.
8385
8386         * ecore.cs (SimpleName.DoResolve): Do the same here.
8387
8388         * assign.cs (DoResolve, Emit): Clean up code considerably. 
8389
8390         * ../errors/bug10.cs : Add.
8391
8392         * ../errors/cs0070.cs : Add.
8393
8394         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
8395
8396         * assign.cs : Get rid of EventIsLocal everywhere.
8397         
8398 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
8399
8400         * ecore.cs (ConvertIntLiteral): finished the implementation.
8401
8402         * statement.cs (SwitchLabel): Convert the value we are using as a
8403         key before looking up the table.
8404
8405 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
8406
8407         * codegen.cs (EmitTopBlock): Require a Location argument now.
8408
8409         * cs-parser.jay (constructor_declarator): We need to setup
8410         current_local_parameters before we parse the
8411         opt_constructor_initializer, to allow the variables to be bound
8412         to the constructor arguments.
8413
8414         * rootcontext.cs (LookupType): First lookup nested classes in our
8415         class and our parents before we go looking outside our class.
8416
8417         * expression.cs (ConstantFold): Extract/debox the values at the
8418         beginnning. 
8419
8420         * rootcontext.cs (EmitCode): Resolve the constants first before we
8421         resolve the types.  This is not really needed, but it helps debugging.
8422
8423         * statement.cs: report location.
8424         
8425         * cs-parser.jay: pass location to throw statement.
8426
8427         * driver.cs: Small bug fix.
8428
8429         * report.cs: Updated format to be 4-zero filled digits.
8430
8431 2001-12-22  Ravi Pratap  <ravi@ximian.com>
8432
8433         * expression.cs (CheckIndices): Fix minor bug where the wrong
8434         variable was being referred to ;-)
8435
8436         (DoEmit): Do not call EmitStaticInitializers when the 
8437         underlying type is System.Object.
8438
8439 2001-12-21  Ravi Pratap  <ravi@ximian.com>
8440
8441         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
8442         and do the usual workaround for SRE.
8443
8444         * class.cs (MyEventBuilder.EventType): New member to get at the type
8445         of the event, quickly.
8446
8447         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
8448
8449         * assign.cs (Assign.DoResolve): Handle the case when the target
8450         is an EventExpr and perform the necessary checks.
8451
8452         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
8453         interface.
8454
8455         (SimpleName.MemberStaticCheck): Include check for EventExpr.
8456
8457         (EventExpr): Set the type in the constructor itself since we 
8458         are meant to be born fully resolved.
8459
8460         (EventExpr.Define): Revert code I wrote earlier.
8461                 
8462         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
8463         instance expression is null. The instance expression is a This in that case
8464         or a null, depending on whether it is a static method or not.
8465
8466         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
8467         refers to more than one method.
8468
8469         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
8470         and accordingly flag errors.
8471
8472 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
8473
8474         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
8475
8476 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
8477
8478         * location.cs (ToString): Provide useful rutine.
8479
8480 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
8481
8482         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
8483         objects, return the actual integral boxed.
8484
8485         * statement.cs (SwitchLabel): define an ILLabel for each
8486         SwitchLabel. 
8487         
8488         (Switch.CheckSwitch): If the value is a Literal, extract
8489         the underlying literal.
8490         
8491         Also in the unused hashtable we had, add the SwitchLabel so we can
8492         quickly look this value up.
8493
8494         * constant.cs: Implement a bunch of new constants.  Rewrite
8495         Literal based on this.  Made changes everywhere to adapt to this.
8496         
8497         * expression.cs (Expression.MakeByteBlob): Optimize routine by
8498         dereferencing array only once, and also copes with enumrations.
8499
8500         bytes are two bytes wide, not one.
8501
8502         (Cast): Perform constant conversions.
8503         
8504         * ecore.cs (TryImplicitIntConversion): Return literals instead of
8505         wrappers to the literals here.
8506
8507         * expression.cs (DoNumericPromotions): long literals can converted
8508         to ulong implicity (this is taken care of elsewhere, but I was
8509         missing this spot).
8510
8511         * ecore.cs (Expression.Literalize): Make the return type Literal,
8512         to improve type checking.
8513
8514         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
8515
8516 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
8517
8518         * literal.cs: Revert code from ravi that checked the bounds.  The
8519         bounds are sane by the definition of the type itself. 
8520
8521         * typemanager.cs: Fix implementation of ImplementsInterface.  We
8522         need to actually look up in our parent hierarchy for interfaces
8523         implemented. 
8524
8525         * const.cs: Use the underlying type for enumerations
8526
8527         * delegate.cs: Compute the basename for the delegate creation,
8528         that should fix the delegate test case, and restore the correct
8529         Type Lookup semantics in rootcontext
8530
8531         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
8532         referencing a nested type with the Reflection API is using the "+"
8533         sign. 
8534
8535         * cs-parser.jay: Do not require EOF token at the end.
8536
8537 2001-12-20  Ravi Pratap  <ravi@ximian.com>
8538
8539         * rootcontext.cs (LookupType): Concatenate type names with
8540         a '.' instead of a '+' The test suite passes again.
8541
8542         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
8543         field of the enumeration.
8544
8545         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
8546         the case when the member is an EventExpr.
8547
8548         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
8549         static has an associated instance expression.
8550
8551         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
8552
8553         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
8554
8555         * class.cs (Event.Define): Register event and perform appropriate checks
8556         for error #111.
8557
8558         We define the Add and Remove methods even if the use provides none because
8559         in that case, we provide default implementations ourselves.
8560
8561         Define a private field of the type of the event. This is done by the CSC compiler
8562         and we should be doing it too ;-)
8563
8564         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
8565         More methods we use in code we generate.
8566
8567         (multicast_delegate_type, delegate_type): Two separate types since the distinction
8568         is important.
8569
8570         (InitCoreTypes): Update accordingly for the above.
8571
8572         * class.cs (Event.Emit): Generate code for default accessors that we provide
8573
8574         (EmitDefaultMethod): Do the job in the above.
8575
8576         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
8577         appropriate place.
8578
8579 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
8580
8581         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
8582         builders even if we were missing one.
8583
8584         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
8585         pass the Basename as our class name instead of the Name.  The
8586         basename will be correctly composed for us.
8587
8588         * parameter.cs (Paramters): Now takes a Location argument.
8589
8590         * decl.cs (DeclSpace.LookupType): Removed convenience function and
8591         make all the code call directly LookupType in RootContext and take
8592         this chance to pass the Location information everywhere.
8593
8594         * Everywhere: pass Location information.
8595
8596 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
8597
8598         * class.cs (Constructor.Define): Updated way of detecting the
8599         length of the parameters.
8600
8601         (TypeContainer.DefineType): Use basename as the type name for
8602         nested types.
8603
8604         (TypeContainer.Define): Do not recursively define types here, as
8605         definition is taken care in order by the RootContext.
8606
8607         * tree.cs: Keep track of namespaces in a per-file basis.
8608
8609         * parameter.cs (Parameter.ComputeSignature): Update to use
8610         DeclSpace. 
8611
8612         (Parameters.GetSignature): ditto.
8613
8614         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
8615         instead of a TypeContainer.
8616
8617         (Interface.SemanticAnalysis): Use `this' instead of our parent to
8618         resolve names.  Because we need to be resolve in our context, not
8619         our parents.
8620         
8621         * driver.cs: Implement response files.
8622
8623         * class.cs (TypeContainer.DefineType): If we are defined, do not
8624         redefine ourselves.
8625         
8626         (Event.Emit): Emit the code for add/remove handlers.
8627         (Event.Define): Save the MethodBuilders for add/remove.
8628
8629         * typemanager.cs: Use pair here too.
8630
8631         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
8632         DictionaryEntry requires the first argument to be non-null.  
8633         
8634         (enum_declaration): Compute full name for registering the
8635         enumeration.
8636         
8637         (delegate_declaration): Instead of using
8638         formal_parameter_list, use opt_formal_parameter_list as the list
8639         can be empty.
8640
8641         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
8642         (EventParsing): New property that controls whether `add' and
8643         `remove' are returned as tokens or identifiers (for events);
8644
8645 2001-12-19  Ravi Pratap  <ravi@ximian.com>
8646
8647         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
8648         use MyEventBuilder only and let it wrap the real builder for us.
8649
8650         (MyEventBuilder): Revamp constructor etc.
8651
8652         Implement all operations that we perform on EventBuilder in precisely the same
8653         way here too.
8654
8655         (FindMembers): Update to use the EventBuilder member.
8656
8657         (Event.Emit): Update accordingly.
8658
8659 2001-12-18  Ravi Pratap  <ravi@ximian.com>
8660
8661         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
8662         by calling the appropriate methods.
8663
8664         (GetCustomAttributes): Make stubs as they cannot possibly do anything
8665         useful.
8666
8667         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
8668
8669 2001-12-17  Ravi Pratap  <ravi@ximian.com>
8670
8671         * delegate.cs (Delegate.Populate): Check that the return type
8672         and various parameters types are indeed accessible.
8673
8674         * class.cs (Constructor.Define): Same here.
8675
8676         (Field.Define): Ditto.
8677
8678         (Event.Define): Ditto.
8679
8680         (Operator.Define): Check that the underlying Method defined itself
8681         correctly - so it's MethodBuilder should not be null.
8682
8683         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
8684         expression happens to be null.
8685
8686         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
8687         members but as of now we don't seem to be able to do anything really useful with it.
8688
8689         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
8690         not the EventBuilder.
8691
8692 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
8693
8694         * cs-tokenizer.cs: Add support for defines.
8695         Add support for #if, #elif, #else, #endif
8696         
8697         (eval_var): evaluates a variable.
8698         (eval): stubbed for evaluating functions.
8699
8700         * cs-parser.jay: Pass the defines information
8701
8702         * driver.cs: Add --define command line option.
8703
8704         * decl.cs: Move MemberCore here.
8705
8706         Make it the base class for DeclSpace.  This allows us to catch and
8707         report 108 and 109 for everything now.
8708
8709         * class.cs (TypeContainer.Define): Extract all the members
8710         before populating and emit the warning 108 (new keyword required
8711         to override) instead of having each member implement this.
8712
8713         (MemberCore.Define): New abstract method, we will be using this in
8714         the warning reporting engine in Populate.
8715         
8716         (Operator.Define): Adjust to new MemberCore protocol. 
8717
8718         * const.cs (Const): This does not derive from Expression, it is a
8719         temporary object we use to create fields, it is a MemberCore. 
8720
8721         * class.cs (Method.Define): Allow the entry point to be in a
8722         specific class.
8723
8724         * driver.cs: Rewrite the argument handler to clean it up a bit.
8725
8726         * rootcontext.cs: Made it just an auxiliary namespace feature by
8727         making everything static.
8728
8729         * driver.cs: Adapt code to use RootContext type name instead of
8730         instance variable.
8731
8732         * delegate.cs: Remove RootContext argument.
8733
8734         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
8735         argument. 
8736
8737         * class.cs (Event.Define): The lookup can fail.
8738         
8739         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
8740
8741         * expression.cs: Resolve the this instance before invoking the code.
8742
8743 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
8744
8745         * cs-parser.jay: Add a production in element_access that allows
8746         the thing to become a "type" reference.  This way we can parse
8747         things like "(string [])" as a type.
8748
8749         Note that this still does not handle the more complex rules of
8750         casts. 
8751         
8752
8753         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
8754
8755         * ecore.cs: (CopyNewMethods): new utility function used to
8756         assemble the list of methods from running FindMembers.
8757
8758         (MemberLookup): Rework FindMembers so that 
8759
8760 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
8761
8762         * class.cs (TypeContainer): Remove Delegates who fail to be
8763         defined.
8764
8765         * delegate.cs (Populate): Verify that we dont get null return
8766         values.   TODO: Check for AsAccessible.
8767
8768         * cs-parser.jay: Use basename to emit error 574 (destructor should
8769         have the same name as container class), not the full name.
8770
8771         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
8772         possible representation.  
8773
8774         Also implements integer type suffixes U and L.
8775
8776 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
8777
8778         * expression.cs (ArrayCreation.DoResolve): We need to do the
8779         argument resolution *always*.
8780
8781         * decl.cs: Make this hold the namespace.  Hold the root context as
8782         well.
8783         (LookupType): Move here.
8784
8785         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
8786
8787         * location.cs (Row, Name): Fixed the code, it was always returning
8788         references to the first file.
8789
8790         * interface.cs: Register properties defined through interfaces.
8791
8792         * driver.cs: Add support for globbing on the command line
8793
8794         * class.cs (Field): Make it derive from MemberCore as well.
8795         (Event): ditto.
8796
8797 2001-12-15  Ravi Pratap  <ravi@ximian.com>
8798
8799         * class.cs (Event::Define): Check that the type of the event is a delegate
8800         type else flag error #66.
8801
8802         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
8803         same.
8804
8805         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
8806         values of EntryPoint, CharSet etc etc.
8807
8808         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
8809
8810         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
8811         be null and we should ignore this. I am not sure if this is really clean. Apparently,
8812         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
8813         which needs this to do its work.
8814
8815         * ../errors/cs0066.cs : Add.
8816
8817 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
8818
8819         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
8820         helper functions.
8821
8822         * class.cs: (MethodSignature.MethodSignature): Removed hack that
8823         clears out the parameters field.
8824         (MemberSignatureCompare): Cleanup
8825
8826         (MemberCore): New base class used to share code between MethodCore
8827         and Property.
8828
8829         (RegisterRequiredImplementations) BindingFlags.Public requires
8830         either BindingFlags.Instace or Static.  Use instance here.
8831
8832         (Property): Refactored code to cope better with the full spec.
8833
8834         * parameter.cs (GetParameterInfo): Return an empty array instead
8835         of null on error.
8836
8837         * class.cs (Property): Abstract or extern properties have no bodies.
8838
8839         * parameter.cs (GetParameterInfo): return a zero-sized array.
8840
8841         * class.cs (TypeContainer.MethodModifiersValid): Move all the
8842         method modifier validation to the typecontainer so we can reuse
8843         this on properties.
8844
8845         (MethodCore.ParameterTypes): return an empty sized array of types.
8846
8847         (Property.Define): Test property modifier validity.
8848
8849         Add tests for sealed/override too.
8850
8851         (Method.Emit): abstract or extern methods have no bodies.
8852
8853 2001-12-14  Ravi Pratap  <ravi@ximian.com>
8854
8855         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
8856         thing.
8857
8858         (Method::Define, ::Emit): Modify accordingly.
8859
8860         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
8861
8862         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
8863
8864         * makefile: Pass in /unsafe.
8865
8866 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
8867
8868         * class.cs (MakeKey): Kill routine.
8869         
8870         * class.cs (TypeContainer.Define): Correctly define explicit
8871         method implementations (they require the full interface name plus
8872         the method name).
8873
8874         * typemanager.cs: Deply the PtrHashtable here and stop using the
8875         lame keys.  Things work so much better.
8876
8877         This of course broke everyone who depended on `RegisterMethod' to
8878         do the `test for existance' test.  This has to be done elsewhere.
8879
8880         * support.cs (PtrHashtable): A hashtable that avoid comparing with
8881         the object stupid Equals method (because, that like fails all over
8882         the place).  We still do not use it.
8883
8884         * class.cs (TypeContainer.SetRequiredInterface,
8885         TypeContainer.RequireMethods): Killed these two routines and moved
8886         all the functionality to RegisterRequiredImplementations.
8887
8888         (TypeContainer.RegisterRequiredImplementations): This routine now
8889         registers all the implementations required in an array for the
8890         interfaces and abstract methods.  We use an array of structures
8891         which can be computed ahead of time to reduce memory usage and we
8892         also assume that lookups are cheap as most classes will not
8893         implement too many interfaces.
8894
8895         We also avoid creating too many MethodSignatures.
8896
8897         (TypeContainer.IsInterfaceMethod): Update and optionally does not
8898         clear the "pending" bit if we find that there are problems with
8899         the declaration.
8900
8901         (TypeContainer.VerifyPendingMethods): Update to report errors of
8902         methods that look like implementations but are not.
8903
8904         (TypeContainer.Define): Add support for explicit interface method
8905         implementation. 
8906         
8907 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
8908
8909         * typemanager.cs: Keep track of the parameters here instead of
8910         being a feature of the TypeContainer.
8911
8912         * class.cs: Drop the registration of parameters here, as
8913         InterfaceMethods are also interface declarations.
8914
8915         * delegate.cs: Register methods with the TypeManager not only with
8916         the TypeContainer.  This code was buggy.
8917
8918         * interface.cs: Full registation here.
8919
8920 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
8921
8922         * expression.cs: Remove reducer for binary expressions, it can not
8923         be done this way.
8924
8925         * const.cs: Put here the code that used to go into constant.cs
8926
8927         * constant.cs: Put here the code for constants, this is a new base
8928         class for Literals.
8929
8930         * literal.cs: Make Literal derive from Constant.
8931
8932 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
8933
8934         * statement.cs (Return.Emit): Report error 157 if the user
8935         attempts to return from a finally block.
8936
8937         (Return.Emit): Instead of emitting a return, jump to the end of
8938         the function.
8939
8940         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
8941         LocalBuilder to store the result of the function.  ReturnLabel is
8942         the target where we jump.
8943         
8944
8945 2001-12-09  Radek Doulik  <rodo@ximian.com>
8946
8947         * cs-parser.jay: remember alias in current namespace
8948
8949         * ecore.cs (SimpleName::DoResolve): use aliases for types or
8950         namespaces
8951
8952         * class.cs (LookupAlias): lookup alias in my_namespace
8953
8954         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
8955         aliases hashtable
8956         (LookupAlias): lookup alias in this and if needed in parent
8957         namespaces
8958
8959 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
8960
8961         * support.cs: 
8962
8963         * rootcontext.cs: (ModuleBuilder) Made static, first step into
8964         making things static.  I need this to avoid passing the
8965         TypeContainer when calling ParameterType.
8966
8967         * support.cs (InternalParameters.ParameterType): Remove ugly hack
8968         that did string manipulation to compute the type and then call
8969         GetType.  Use Parameter.ParameterType instead.
8970
8971         * cs-tokenizer.cs: Consume the suffix for floating values.
8972
8973         * expression.cs (ParameterReference): figure out whether this is a
8974         reference parameter or not.  Kill an extra variable by computing
8975         the arg_idx during emission.
8976
8977         * parameter.cs (Parameters.GetParameterInfo): New overloaded
8978         function that returns whether a parameter is an out/ref value or not.
8979
8980         (Parameter.ParameterType): The type of the parameter (base,
8981         without ref/out applied).
8982         
8983         (Parameter.Resolve): Perform resolution here.
8984         (Parameter.ExternalType): The full type (with ref/out applied).
8985
8986         * statement.cs (Using.Emit, Using.EmitExpression): Implement
8987         support for expressions on the using statement.
8988
8989 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
8990
8991         * statement.cs (Using.EmitLocalVariableDecls): Split the
8992         localvariable handling of the using statement.
8993
8994         (Block.EmitMeta): Keep track of variable count across blocks.  We
8995         were reusing slots on separate branches of blocks.
8996
8997         (Try.Emit): Emit the general code block, we were not emitting it. 
8998
8999         Check the type of the declaration to be an IDisposable or
9000         something that can be implicity converted to it. 
9001
9002         Emit conversions if required.
9003
9004         * ecore.cs (EmptyExpression): New utility class.
9005         (Expression.ImplicitConversionExists): New utility function.
9006
9007 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
9008
9009         * statement.cs (Using): Implement.
9010
9011         * expression.cs (LocalVariableReference): Support read only variables.
9012
9013         * statement.cs: Remove the explicit emit for the Leave opcode.
9014         (VariableInfo): Add a readonly field.
9015
9016 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
9017
9018         * ecore.cs (ConvCast): new class used to encapsulate the various
9019         explicit integer conversions that works in both checked and
9020         unchecked contexts.
9021
9022         (Expression.ConvertNumericExplicit): Use new ConvCast class to
9023         properly generate the overflow opcodes.
9024
9025 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
9026
9027         * statement.cs: The correct type for the EmptyExpression is the
9028         element_type, not the variable type.  Ravi pointed this out.
9029
9030 2001-12-04  Ravi Pratap  <ravi@ximian.com>
9031
9032         * class.cs (Method::Define): Handle PInvoke methods specially
9033         by using DefinePInvokeMethod instead of the usual one.
9034
9035         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
9036         above to do the task of extracting information and defining the method.
9037         
9038 2001-12-04  Ravi Pratap  <ravi@ximian.com>
9039
9040         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
9041         of the condition for string type.
9042
9043         (Emit): Move that here. 
9044
9045         (ArrayCreation::CheckIndices): Keep string literals in their expression
9046         form.
9047
9048         (EmitDynamicInitializers): Handle strings appropriately.
9049
9050 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
9051
9052         * codegen.cs (EmitContext): Replace multiple variables with a
9053         single pointer to the current Switch statement.
9054
9055         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
9056         EmitContext.
9057
9058 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
9059
9060         * statement.cs 
9061
9062         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
9063         default'.
9064         
9065         (Foreach.Emit): Foreach on arrays was not setting
9066         up the loop variables (for break/continue).
9067
9068         (GotoCase): Semi-implented.
9069         
9070 2001-12-03  Ravi Pratap  <ravi@ximian.com>
9071
9072         * attribute.cs (CheckAttribute): Handle system attributes by using
9073         Attribute.GetAttributes to examine information we need.
9074
9075         (GetValidPlaces): Same here.
9076
9077         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
9078
9079         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
9080
9081         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
9082
9083         (Method::Define): Set appropriate flags if we have a DllImport attribute.
9084
9085         (Method::Emit): Handle the case when we are a PInvoke method.
9086
9087 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
9088
9089         * expression.cs: Use ResolveWithSimpleName on compound names.
9090
9091 2001-12-02  Ravi Pratap  <ravi@ximian.com>
9092
9093         * constant.cs (EmitConstant): Make sure we resolve the associated expression
9094         before trying to reduce it.
9095
9096         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
9097
9098         * constant.cs (LookupConstantValue): Implement.
9099
9100         (EmitConstant): Use the above in emitting the constant.
9101
9102         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
9103         that are user-defined by doing a LookupConstantValue on them.
9104
9105         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
9106         too, like above.
9107
9108 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
9109
9110         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
9111
9112         (BaseAccess.DoResolve): Implement.
9113
9114         (MemberAccess.DoResolve): Split this routine into a
9115         ResolveMemberAccess routine that can be used independently
9116
9117 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
9118
9119         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
9120         As that share bits of the implementation.  Is returns a boolean,
9121         while As returns the Type that is being probed.
9122
9123 2001-12-01  Ravi Pratap  <ravi@ximian.com>
9124
9125         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
9126         instead of a Literal - much easier.
9127
9128         (EnumInTransit): Remove - utterly useless :-)
9129
9130         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
9131
9132         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
9133
9134         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
9135         chain when we have no associated expression.
9136
9137 2001-11-30  Ravi Pratap  <ravi@ximian.com>
9138
9139         * constant.cs (Define): Use Location while reporting the errror.
9140
9141         Also emit a warning when 'new' is used and there is no inherited
9142         member to hide.
9143
9144         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
9145         populated.
9146
9147         (LookupEnumValue): Implement to lookup an enum member's value and define it
9148         if necessary.
9149
9150         (Populate): Re-write accordingly to use the above routine.
9151
9152 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
9153
9154         * expression.cs (This): Fix prototype for DoResolveLValue to
9155         override the base class DoResolveLValue.
9156
9157         * cs-parser.cs: Report errors cs574 and cs575 (destructor
9158         declarations) 
9159
9160         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
9161         (we need to load the address of the field here).  This fixes
9162         test-22. 
9163         
9164         (FieldExpr.DoResolveLValue): Call the DoResolve
9165         function to initialize the Instance expression.
9166         
9167         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
9168         correctly the GetEnumerator operation on a value type.
9169
9170         * cs-parser.jay: Add more simple parsing error catches.
9171
9172         * statement.cs (Switch): Add support for string switches.
9173         Handle null specially.
9174
9175         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
9176
9177 2001-11-28  Ravi Pratap  <ravi@ximian.com>
9178
9179         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
9180
9181         (declare_local_constant): New helper function.
9182
9183         * statement.cs (AddConstant): Keep a separate record of constants
9184
9185         (IsConstant): Implement to determine if a variable is a constant.
9186
9187         (GetConstantExpression): Implement.
9188
9189         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
9190
9191         * statement.cs (IsVariableDefined): Re-write.
9192
9193 2001-11-27  Ravi Pratap  <ravi@ximian.com>
9194
9195         * class.cs (TypeContainer::FindMembers): Look for constants
9196         in the case when we are looking for MemberTypes.Field
9197
9198         * expression.cs (MemberAccess::DoResolve): Check that in the
9199         case we are a FieldExpr and a Literal, we are not being accessed
9200         by an instance reference.
9201
9202         * cs-parser.jay (local_constant_declaration): Implement.
9203
9204         (declaration_statement): Implement for constant declarations.
9205
9206 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
9207
9208         * statement.cs (Switch): Catch double defaults.
9209
9210         (Switch): More work on the switch() statement
9211         implementation.  It works for integral values now, need to finish
9212         string support.
9213
9214
9215 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
9216
9217         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
9218         integer literals into other integer literals.  To be used by
9219         switch. 
9220
9221 2001-11-24  Ravi Pratap  <ravi@ximian.com>
9222
9223         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
9224         some memory.
9225
9226         (EmitDynamicInitializers): Cope with the above since we extract data
9227         directly from ArrayData now.
9228
9229         (ExpectInitializers): Keep track of whether initializers are mandatory
9230         or not.
9231
9232         (Bounds): Make it a hashtable to prevent the same dimension being 
9233         recorded for every element in that dimension.
9234
9235         (EmitDynamicInitializers): Fix bug which prevented the Set array method
9236         from being found.
9237
9238         Also fix bug which was causing the indices to be emitted in the reverse
9239         order.
9240
9241 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
9242
9243         * expression.cs (ArrayCreation): Implement the bits that Ravi left
9244         unfinished.  They do not work, because the underlying code is
9245         sloppy.
9246
9247 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9248
9249         * cs-parser.jay: Remove bogus fixme.
9250
9251         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
9252         on Switch statement.
9253         
9254 2001-11-23  Ravi Pratap  <ravi@ximian.com>
9255
9256         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
9257         the same. 
9258         
9259         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
9260         parameter. Apparently, any expression is allowed. 
9261
9262         (ValidateInitializers): Update accordingly.
9263
9264         (CheckIndices): Fix some tricky bugs thanks to recursion.
9265
9266         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
9267         I was being completely brain-dead.
9268
9269         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
9270         and re-write acordingly.
9271
9272         (DelegateInvocation): Re-write accordingly.
9273
9274         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
9275
9276         (MakeByteBlob): Handle types more correctly.
9277
9278         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
9279         initialization from expressions but it is incomplete because I am a complete
9280         Dodo :-|
9281
9282 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9283
9284         * statement.cs (If.Emit): Fix a bug that generated incorrect code
9285         on If.  Basically, we have to return `true' (ie, we do return to
9286         our caller) only if both branches of the if return.
9287
9288         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
9289         short-circuit operators, handle them as short circuit operators. 
9290
9291         (Cast.DoResolve): Resolve type.
9292         (Cast.Cast): Take an expression as the target type.
9293
9294         * cs-parser.jay (cast_expression): Remove old hack that only
9295         allowed a limited set of types to be handled.  Now we take a
9296         unary_expression and we resolve to a type during semantic
9297         analysis.
9298
9299         Use the grammar productions from Rhys to handle casts (this is
9300         not complete like Rhys syntax yet, we fail to handle that corner
9301         case that C# has regarding (-x), but we will get there.
9302         
9303 2001-11-22  Ravi Pratap  <ravi@ximian.com>
9304
9305         * class.cs (EmitFieldInitializer): Take care of the case when we have a
9306         field which is an array type.
9307
9308         * cs-parser.jay (declare_local_variables): Support array initialization too.
9309
9310         * typemanager.cs (MakeKey): Implement.
9311
9312         (everywhere): Use the above appropriately.
9313
9314         * cs-parser.jay (for_statement): Update for array initialization while
9315         declaring variables.
9316
9317         * ecore.cs : The error message was correct, it's the variable's names that
9318         were misleading ;-) Make the code more readable.
9319
9320         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
9321         the correct type etc.
9322
9323         (ConvertExplicit): Handle Enum types by examining the underlying type.
9324
9325 2001-11-21  Ravi Pratap  <ravi@ximian.com>
9326
9327         * parameter.cs (GetCallingConvention): Always return
9328         CallingConventions.Standard for now.
9329
9330 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9331
9332         * expression.cs (Binary.ResolveOperator): Update the values of `l'
9333         and `r' after calling DoNumericPromotions.
9334
9335         * ecore.cs: Fix error message (the types were in the wrong order).
9336
9337         * statement.cs (Foreach.ProbeCollectionType): Need to pass
9338         BindingFlags.Instance as well 
9339
9340         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
9341         implicit int literal conversion in an empty cast so that we
9342         propagate the right type upstream.
9343
9344         (UnboxCast): new class used to unbox value types.
9345         (Expression.ConvertExplicit): Add explicit type conversions done
9346         by unboxing.
9347
9348         (Expression.ImplicitNumericConversion): Oops, forgot to test for
9349         the target type before applying the implicit LongLiterals to ULong
9350         literal cast.
9351
9352 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
9353
9354         * cs-parser.jay (for_statement): Reworked the way For works: now
9355         we declare manually any variables that are introduced in
9356         for_initializer to solve the problem of having out-of-band code
9357         emition (that is what got for broken).
9358
9359         (declaration_statement): Perform the actual variable declaration
9360         that used to be done in local_variable_declaration here.
9361
9362         (local_variable_declaration): Do not declare anything, just pass
9363         the information on a DictionaryEntry
9364
9365 2001-11-20  Ravi Pratap  <ravi@ximian.com>
9366
9367         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
9368         re-write of the logic to now make it recursive.
9369
9370         (UpdateIndices): Re-write accordingly.
9371
9372         Store element data in a separate ArrayData list in the above methods.
9373
9374         (MakeByteBlob): Implement to dump the array data into a byte array.
9375
9376 2001-11-19  Ravi Pratap  <ravi@ximian.com>
9377
9378         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
9379         into CheckIndices.
9380
9381         * constant.cs (Define): Implement.
9382
9383         (EmitConstant): Re-write fully.
9384
9385         Pass in location info.
9386
9387         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
9388         respectively.
9389
9390         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
9391         DictionaryEntry since we need location info too.
9392
9393         (constant_declaration): Update accordingly.
9394
9395         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
9396         code into another method : UpdateIndices.
9397
9398 2001-11-18  Ravi Pratap  <ravi@ximian.com>
9399
9400         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
9401         some type checking etc.
9402
9403 2001-11-17  Ravi Pratap  <ravi@ximian.com>
9404
9405         * expression.cs (ArrayCreation::ValidateInitializers): Implement
9406         bits to provide dimension info if the user skips doing that.
9407
9408         Update second constructor to store the rank correctly.
9409
9410 2001-11-16  Ravi Pratap  <ravi@ximian.com>
9411
9412         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
9413         and try to implement.
9414
9415         * ../errors/cs0150.cs : Add.
9416
9417         * ../errors/cs0178.cs : Add.
9418
9419 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
9420
9421         * statement.cs: Implement foreach on multi-dimensional arrays. 
9422
9423         * parameter.cs (Parameters.GetParameterByName): Also lookup the
9424         name of the params argument.
9425
9426         * expression.cs: Use EmitStoreOpcode to get the right opcode while
9427         initializing the array.
9428
9429         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
9430         we can use this elsewhere.
9431
9432         * statement.cs: Finish implementation of foreach for single
9433         dimension arrays.
9434
9435         * cs-parser.jay: Use an out-of-band stack to pass information
9436         around, I wonder why I need this.
9437
9438         foreach_block: Make the new foreach_block the current_block.
9439
9440         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
9441         function used to return a static Parameters structure.  Used for
9442         empty parameters, as those are created very frequently.
9443
9444         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
9445
9446 2001-11-15  Ravi Pratap  <ravi@ximian.com>
9447
9448         * interface.cs : Default modifier is private, not public. The
9449         make verify test passes again.
9450
9451 2001-11-15  Ravi Pratap  <ravi@ximian.com>
9452
9453         * support.cs (ReflectionParameters): Fix logic to determine
9454         whether the last parameter is a params one. Test 9 passes again.
9455
9456         * delegate.cs (Populate): Register the builders we define with
9457         RegisterParameterForBuilder. Test 19 passes again.
9458
9459         * cs-parser.jay (property_declaration): Reference $6 instead
9460         of $$ to get at the location.
9461
9462         (indexer_declaration): Similar stuff.
9463
9464         (attribute): Ditto.
9465
9466         * class.cs (Property): Register parameters for the Get and Set methods
9467         if they exist. Test 23 passes again.
9468
9469         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
9470         call to EmitArguments as we are sure there aren't any params arguments. 
9471         Test 32 passes again.
9472
9473         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
9474         IndexOutOfRangeException. 
9475
9476         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
9477         Test 33 now passes again.
9478         
9479 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
9480
9481         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
9482         broke a bunch of things.  Will have to come up with a better way
9483         of tracking locations.
9484
9485         * statement.cs: Implemented foreach for single dimension arrays.
9486
9487 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
9488
9489         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
9490         an error.  This removes the lookup from the critical path.
9491
9492         * cs-parser.jay: Removed use of temporary_loc, which is completely
9493         broken. 
9494
9495 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
9496
9497         * support.cs (ReflectionParameters.ParameterModifier): Report
9498         whether the argument is a PARAMS argument or not.
9499
9500         * class.cs: Set the attribute `ParamArrayAttribute' on the
9501         parameter argument.
9502
9503         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
9504         and cons_param_array_attribute (ConstructorInfo for
9505         ParamArrayAttribute)., 
9506
9507         * codegen.cs: Emit the return using the `Return' statement, that
9508         way we can report the error correctly for missing return values. 
9509
9510         * class.cs (Method.Emit): Clean up.
9511
9512         * expression.cs (Argument.Resolve): Take another argument: the
9513         location where this argument is used.  Notice that this is not
9514         part of the "Argument" class as to reduce the size of the
9515         structure (we know the approximate location anyways).
9516
9517         Test if the argument is a variable-reference, if not, then
9518         complain with a 206.
9519
9520         (Argument.Emit): Emit addresses of variables.
9521
9522         (Argument.FullDesc): Simplify.
9523
9524         (Invocation.DoResolve): Update for Argument.Resolve.
9525
9526         (ElementAccess.DoResolve): ditto.
9527
9528         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
9529         method should be virtual, as this method is always virtual.
9530
9531         (NewDelegate.DoResolve): Update for Argument.Resolve.
9532
9533         * class.cs (ConstructorInitializer.DoResolve): ditto.
9534         
9535         * attribute.cs (Attribute.Resolve): ditto.
9536
9537 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
9538
9539         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
9540
9541         * expression.cs (ParameterReference): Drop IStackStorage and implement
9542         IAssignMethod instead. 
9543
9544         (LocalVariableReference): ditto.
9545         
9546         * ecore.cs (FieldExpr): Drop IStackStorage and implement
9547         IAssignMethod instead. 
9548
9549 2001-11-13  Miguel de Icaza <miguel@ximian.com>
9550
9551         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
9552         enumerations that are used in heavily used structures derive from
9553         byte in a laughable and pathetic attempt to reduce memory usage.
9554         This is the kind of pre-optimzations that you should not do at
9555         home without adult supervision.
9556
9557         * expression.cs (UnaryMutator): New class, used to handle ++ and
9558         -- separatedly from the other unary operators.  Cleans up the
9559         code, and kills the ExpressionStatement dependency in Unary.
9560
9561         (Unary): Removed `method' and `Arguments' from this class, making
9562         it smaller, and moving it all to SimpleCall, so I can reuse this
9563         code in other locations and avoid creating a lot of transient data
9564         strucutres when not required.
9565
9566         * cs-parser.jay: Adjust for new changes.
9567
9568 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
9569
9570         * enum.cs (Enum.Populate): If there is a failure during
9571         definition, return
9572
9573         * cs-parser.jay (opt_enum_base): we used to catch type errors
9574         here, but this is really incorrect.  The type error should be
9575         catched during semantic analysis.
9576
9577 2001-12-11  Ravi Pratap  <ravi@ximian.com>
9578
9579         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
9580         current_local_parameters as expected since I, in my stupidity, had forgotten
9581         to do this :-)
9582
9583         * attribute.cs (GetValidPlaces): Fix stupid bug.
9584
9585         * class.cs (Method::Emit): Perform check on applicability of attributes.
9586
9587         (Constructor::Emit): Ditto.
9588
9589         (Field::Emit): Ditto.
9590
9591         (Field.Location): Store location information.
9592
9593         (Property, Event, Indexer, Operator): Ditto.
9594
9595         * cs-parser.jay (field_declaration): Pass in location for each field.
9596
9597         * ../errors/cs0592.cs : Add.
9598
9599 2001-11-12  Ravi Pratap  <ravi@ximian.com>
9600
9601         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
9602
9603         (InitCoreTypes): Update accordingly.
9604
9605         (RegisterAttrType, LookupAttr): Implement.
9606
9607         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
9608         info about the same.
9609
9610         (Resolve): Update to populate the above as necessary.
9611
9612         (Error592): Helper.
9613
9614         (GetValidPlaces): Helper to the above.
9615
9616         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
9617
9618         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
9619
9620 2001-11-12  Ravi Pratap  <ravi@ximian.com>
9621
9622         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
9623
9624         * ../errors/cs0617.cs : Add.
9625
9626 2001-11-11  Ravi Pratap  <ravi@ximian.com>
9627
9628         * enum.cs (Emit): Rename to Populate to be more consistent with what
9629         we expect it to do and when exactly it is called.
9630
9631         * class.cs, rootcontext.cs : Update accordingly.
9632
9633         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
9634         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
9635
9636         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
9637
9638         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
9639         of a fieldinfo using the above, when dealing with a FieldBuilder.
9640
9641 2001-11-10  Ravi Pratap  <ravi@ximian.com>
9642
9643         * ../errors/cs0031.cs : Add.
9644
9645         * ../errors/cs1008.cs : Add.
9646
9647         * ../errrors/cs0543.cs : Add.
9648
9649         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
9650         enum type.
9651
9652         (FindMembers): Implement.
9653
9654         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
9655         enums and delegates too.
9656
9657         (enum_types): Rename to builder_to_enum.
9658
9659         (delegate_types): Rename to builder_to_delegate.
9660
9661         * delegate.cs (FindMembers): Implement.
9662
9663 2001-11-09  Ravi Pratap  <ravi@ximian.com>
9664
9665         * typemanager.cs (IsEnumType): Implement.
9666
9667         * enum.cs (Emit): Re-write parts to account for the underlying type
9668         better and perform checking etc.
9669
9670         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
9671         of the underlying type.
9672
9673         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
9674         value
9675
9676         * enum.cs (error31): Helper to report error #31.
9677
9678         * cs-parser.jay (enum_declaration): Store location of each member too.
9679
9680         * enum.cs (member_to_location): New hashtable. 
9681
9682         (AddEnumMember): Update location hashtable.
9683
9684         (Emit): Use the location of each member while reporting errors.
9685
9686 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
9687
9688         * cs-parser.jay: A for_initializer if is a
9689         local_variable_declaration really ammount to have an implicit
9690         block with the variable declaration and no initializer for for.
9691
9692         * statement.cs (For.Emit): Cope with null initializers.
9693
9694         This fixes the infinite loop on for initializers.
9695
9696 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
9697
9698         * enum.cs: More cleanup.
9699
9700         * ecore.cs: Remove dead code.
9701
9702         * class.cs (Property.Emit): More simplification.
9703         (Event.Emit): ditto.
9704
9705         Reworked to have less levels of indentation.
9706         
9707 2001-11-08  Ravi Pratap  <ravi@ximian.com>
9708
9709         * class.cs (Property): Emit attributes.
9710
9711         (Field): Ditto.
9712         
9713         (Event): Ditto.
9714
9715         (Indexer): Ditto.
9716
9717         (Operator): Ditto.
9718
9719         * enum.cs (Emit): Ditto.
9720
9721         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
9722         Enums too.
9723
9724         * class.cs (Field, Event, etc.): Move attribute generation into the
9725         Emit method everywhere.
9726
9727         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
9728         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
9729         as we had no way of defining nested enums !
9730
9731         * rootcontext.cs : Adjust code accordingly.
9732
9733         * typemanager.cs (AddEnumType): To keep track of enum types separately.
9734
9735 2001-11-07  Ravi Pratap  <ravi@ximian.com>
9736
9737         * expression.cs (EvalConstantExpression): Move into ecore.cs
9738         
9739         * enum.cs (Enum): Rename some members and make them public and readonly
9740         according to our convention.
9741
9742         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
9743         nothing else.
9744
9745         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
9746
9747         (Enum::Emit): Write a simple version for now which doesn't try to compute
9748         expressions. I shall modify this to be more robust in just a while.
9749
9750         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
9751
9752         (TypeContainer::CloseType): Create the Enum types too.
9753
9754         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
9755
9756         * expression.cs (EvalConstantExpression): Get rid of completely.
9757
9758         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
9759         user-defined values and other cases.
9760
9761         (IsValidEnumLiteral): Helper function.
9762
9763         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
9764         out there in the case we had a literal FieldExpr.
9765
9766         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
9767
9768         (Literalize): Revamp a bit to take two arguments.
9769         
9770         (EnumLiteral): New class which derives from Literal to wrap enum literals.
9771         
9772 2001-11-06  Ravi Pratap  <ravi@ximian.com>
9773
9774         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
9775
9776         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
9777
9778         (Resolve): Use the above to ensure we have proper initializers.
9779
9780 2001-11-05  Ravi Pratap  <ravi@ximian.com>
9781
9782         * expression.cs (Expression::EvalConstantExpression): New method to 
9783         evaluate constant expressions.
9784
9785         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
9786
9787 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
9788
9789         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
9790         in an array.
9791
9792         (Binary.ResolveOperator): Handle operator != (object a, object b)
9793         and operator == (object a, object b);
9794
9795         (Binary.DoNumericPromotions): Indicate whether the numeric
9796         promotion was possible.
9797
9798         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
9799         Implement.  
9800
9801         Made the ArrayAccess implement interface IAssignMethod instead of
9802         IStackStore as the order in which arguments are passed reflects
9803         this.
9804
9805         * assign.cs: Instead of using expr.ExprClass to select the way of
9806         assinging, probe for the IStackStore/IAssignMethod interfaces.
9807
9808         * typemanager.cs: Load InitializeArray definition.
9809
9810         * rootcontext.cs (RootContext.MakeStaticData): Used to define
9811         static data that can be used to initialize arrays. 
9812
9813 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
9814
9815         * expression.cs: Handle operator== and operator!= for booleans.
9816
9817         (Conditioal.Reduce): Implement reducer for the ?: operator.
9818
9819         (Conditional.Resolve): Implement dead code elimination.
9820
9821         (Binary.Resolve): Catch string literals and return a new
9822         concatenated string.
9823
9824         (Unary.Reduce): Implement reduction of unary expressions.
9825
9826         * ecore.cs: Split out the expression core handling here.
9827
9828         (Expression.Reduce): New method used to perform constant folding
9829         and CSE.  This is needed to support constant-expressions. 
9830         
9831         * statement.cs (Statement.EmitBoolExpression): Pass true and false
9832         targets, and optimize for !x.
9833
9834 2001-11-04  Ravi Pratap  <ravi@ximian.com>
9835
9836         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
9837         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
9838         set custom atttributes.
9839
9840         * literal.cs (Literal::GetValue): New abstract method to return the actual
9841         value of the literal, cast as an object.
9842
9843         (*Literal): Implement GetValue method.
9844
9845         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
9846         expressions to the arraylist but objects of type Argument.
9847
9848         * class.cs (TypeContainer::Emit): Emit our attributes too.
9849
9850         (Method::Emit, Constructor::Emit): Ditto.
9851
9852         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
9853         to be ignoring earlier.
9854
9855 2001-11-03  Ravi Pratap  <ravi@ximian.com>
9856
9857         * attribute.cs (AttributeSection::Define): Implement to do the business
9858         of constructing a CustomAttributeBuilder.
9859
9860         (Attribute): New trivial class. Increases readability of code.  
9861
9862         * cs-parser.jay : Update accordingly.
9863
9864         (positional_argument_list, named_argument_list, named_argument): New rules
9865
9866         (attribute_arguments): Use the above so that we are more correct.
9867         
9868 2001-11-02  Ravi Pratap  <ravi@ximian.com>
9869         
9870         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
9871         to perform all checks for a method with a params parameter.
9872
9873         (Invocation::OverloadResolve): Update to use the above method and therefore
9874         cope correctly with params method invocations.
9875
9876         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
9877         params too.
9878
9879         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
9880         constructors in our parent too because we can't afford to miss out on 
9881         protected ones ;-)
9882
9883         * attribute.cs (AttributeSection): New name for the class Attribute
9884
9885         Other trivial changes to improve readability.
9886
9887         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
9888         use the new class names.
9889         
9890 2001-11-01  Ravi Pratap  <ravi@ximian.com>
9891
9892         * class.cs (Method::Define): Complete definition for params types too
9893
9894         (Indexer::Define): Ditto.
9895
9896         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
9897         Cope everywhere with a request for info about the array parameter.
9898
9899 2001-11-01  Ravi Pratap  <ravi@ximian.com>
9900
9901         * tree.cs (RecordNamespace): Fix up to check for the correct key.
9902
9903         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
9904         local_variable_type to extract the string corresponding to the type.
9905
9906         (local_variable_type): Fixup the action to use the new helper method.
9907
9908         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
9909         go.
9910
9911         * expression.cs : Clean out code which uses the above.
9912
9913 2001-10-31  Ravi Pratap  <ravi@ximian.com>
9914         
9915         * typemanager.cs (RegisterMethod): Check if we already have an existing key
9916         and bale out if necessary by returning a false.
9917
9918         (RegisterProperty): Ditto.
9919
9920         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
9921         and print out appropriate error messages.
9922
9923         * interface.cs (everywhere): Ditto.
9924
9925         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
9926         location to constructor.
9927
9928         * class.cs (Property, Event, Indexer): Update accordingly.
9929
9930         * ../errors/cs111.cs : Added.
9931
9932         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
9933         of a method, as laid down by the spec.
9934
9935         (Invocation::OverloadResolve): Use the above method.
9936
9937 2001-10-31  Ravi Pratap  <ravi@ximian.com>
9938
9939         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
9940         now take a TypeContainer and a Parameters object.
9941
9942         (ParameterData): Modify return type of ParameterModifier method to be 
9943         Parameter.Modifier and not a string.
9944
9945         (ReflectionParameters, InternalParameters): Update accordingly.
9946
9947         * expression.cs (Argument::GetParameterModifier): Same here.
9948
9949         * support.cs (InternalParameters::ParameterType): Find a better way of determining
9950         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
9951         symbol in it at all so maybe this is only for now.
9952
9953 2001-10-30  Ravi Pratap  <ravi@ximian.com>
9954
9955         * support.cs (InternalParameters): Constructor now takes an extra argument 
9956         which is the actual Parameters class.
9957
9958         (ParameterDesc): Update to provide info on ref/out modifiers.
9959
9960         * class.cs (everywhere): Update call to InternalParameters to pass in
9961         the second argument too.
9962
9963         * support.cs (ParameterData): Add ParameterModifier, which is a method 
9964         to return the modifier info [ref/out etc]
9965
9966         (InternalParameters, ReflectionParameters): Implement the above.
9967
9968         * expression.cs (Argument::ParameterModifier): Similar function to return
9969         info about the argument's modifiers.
9970
9971         (Invocation::OverloadResolve): Update to take into account matching modifiers 
9972         too.
9973
9974         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
9975         a new SetFormalParameters object which we pass to InternalParameters.
9976
9977 2001-10-30  Ravi Pratap  <ravi@ximian.com>
9978
9979         * expression.cs (NewArray): Merge into the ArrayCreation class.
9980
9981 2001-10-29  Ravi Pratap  <ravi@ximian.com>
9982
9983         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
9984         NewUserdefinedArray into one as there wasn't much of a use in having
9985         two separate ones.
9986
9987         * expression.cs (Argument): Change field's name to ArgType from Type.
9988
9989         (Type): New readonly property which returns the proper type, taking into 
9990         account ref/out modifiers.
9991
9992         (everywhere): Adjust code accordingly for the above.
9993
9994         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
9995         whether we are emitting for a ref or out parameter.
9996
9997         * expression.cs (Argument::Emit): Use the above field to set the state.
9998
9999         (LocalVariableReference::Emit): Update to honour the flag and emit the
10000         right stuff.
10001
10002         * parameter.cs (Attributes): Set the correct flags for ref parameters.
10003
10004         * expression.cs (Argument::FullDesc): New function to provide a full desc.
10005
10006         * support.cs (ParameterData): Add method ParameterDesc to the interface.
10007
10008         (ReflectionParameters, InternalParameters): Implement the above method.
10009
10010         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
10011         reporting errors.
10012
10013         (Invocation::FullMethodDesc): Ditto. 
10014
10015 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
10016
10017         * cs-parser.jay: Add extra production for the second form of array
10018         creation. 
10019
10020         * expression.cs (ArrayCreation): Update to reflect the above
10021         change. 
10022
10023         * Small changes to prepare for Array initialization.
10024
10025 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
10026
10027         * typemanager.cs (ImplementsInterface): interface might be null;
10028         Deal with this problem;
10029
10030         Also, we do store negative hits on the cache (null values), so use
10031         this instead of calling t.GetInterfaces on the type everytime.
10032
10033 2001-10-28  Ravi Pratap  <ravi@ximian.com>
10034
10035         * typemanager.cs (IsBuiltinType): New method to help determine the same.
10036
10037         * expression.cs (New::DoResolve): Get rid of array creation code and instead
10038         split functionality out into different classes.
10039
10040         (New::FormArrayType): Move into NewBuiltinArray.
10041
10042         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
10043         quite useless.
10044
10045         (NewBuiltinArray): New class to handle creation of built-in arrays.
10046
10047         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
10048         account creation of one-dimensional arrays.
10049
10050         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
10051
10052         (NewUserdefinedArray::DoResolve): Implement.
10053
10054         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
10055
10056         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
10057         we maintain inside the TypeManager. This is necessary to perform lookups on the
10058         module builder.
10059
10060         (LookupType): Update to perform GetType on the module builders too.     
10061
10062         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
10063
10064         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
10065
10066 2001-10-23  Ravi Pratap  <ravi@ximian.com>
10067
10068         * expression.cs (New::DoResolve): Implement guts of array creation.
10069
10070         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
10071         
10072 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
10073
10074         * expression.cs: Fix bug I introduced lsat night that broke
10075         Delegates. 
10076
10077         (Expression.Resolve): Report a 246 error (can not resolve name)
10078         if we find a SimpleName in the stream.
10079         
10080         (Expression.ResolveLValue): Ditto.
10081         
10082         (Expression.ResolveWithSimpleName): This function is a variant of
10083         ResolveName, this one allows SimpleNames to be returned without a
10084         warning.  The only consumer of SimpleNames is MemberAccess
10085
10086 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
10087
10088         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
10089         might arrive here.  I have my doubts that this is correct.
10090
10091         * statement.cs (Lock): Implement lock statement.
10092
10093         * cs-parser.jay: Small fixes to support `lock' and `using'
10094
10095         * cs-tokenizer.cs: Remove extra space
10096
10097         * driver.cs: New flag --checked, allows to turn on integer math
10098         checking. 
10099
10100         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
10101         Threading.Monitor.Exit 
10102         
10103 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
10104
10105         * expression.cs (IndexerAccess::DoResolveLValue): Set the
10106         Expression Class to be IndexerAccess.
10107
10108         Notice that Indexer::DoResolve sets the eclass to Value.
10109
10110 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
10111
10112         * class.cs (TypeContainer::Emit): Emit code for indexers.
10113
10114         * assign.cs (IAssignMethod): New interface implemented by Indexers
10115         and Properties for handling assignment.
10116
10117         (Assign::Emit): Simplify and reuse code. 
10118         
10119         * expression.cs (IndexerAccess, PropertyExpr): Implement
10120         IAssignMethod, clean up old code. 
10121
10122 2001-10-22  Ravi Pratap  <ravi@ximian.com>
10123
10124         * typemanager.cs (ImplementsInterface): New method to determine if a type
10125         implements a given interface. Provides a nice cache too.
10126
10127         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
10128         method.
10129
10130         (ConvertReferenceExplicit): Ditto.
10131
10132         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
10133         various methods, with correct names etc.
10134
10135         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
10136         Operator.UnaryNegation.
10137
10138         * cs-parser.jay (operator_declarator): Be a little clever in the case where
10139         we have a unary plus or minus operator.
10140
10141         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
10142         UnaryMinus.
10143
10144         * everywhere : update accordingly.
10145
10146         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
10147         respectively.
10148
10149         * class.cs (Method::Define): For the case where we are implementing a method
10150         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
10151         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
10152         
10153 2001-10-21  Ravi Pratap  <ravi@ximian.com>
10154
10155         * interface.cs (FindMembers): Implement to work around S.R.E
10156         lameness.
10157
10158         * typemanager.cs (IsInterfaceType): Implement.
10159
10160         (FindMembers): Update to handle interface types too.
10161
10162         * expression.cs (ImplicitReferenceConversion): Re-write bits which
10163         use IsAssignableFrom as that is not correct - it doesn't work.
10164
10165         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
10166         and accordingly override EmitStatement.
10167
10168         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
10169         using the correct logic :-)
10170
10171 2001-10-19  Ravi Pratap  <ravi@ximian.com>
10172
10173         * ../errors/cs-11.cs : Add to demonstrate error -11 
10174
10175 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
10176
10177         * assign.cs (Assign::Resolve): Resolve right hand side first, and
10178         then pass this as a hint to ResolveLValue.
10179         
10180         * expression.cs (FieldExpr): Add Location information
10181
10182         (FieldExpr::LValueResolve): Report assignment to readonly
10183         variable. 
10184         
10185         (Expression::ExprClassFromMemberInfo): Pass location information.
10186
10187         (Expression::ResolveLValue): Add new method that resolves an
10188         LValue. 
10189
10190         (Expression::DoResolveLValue): Default invocation calls
10191         DoResolve. 
10192
10193         (Indexers): New class used to keep track of indexers in a given
10194         Type. 
10195
10196         (IStackStore): Renamed from LValue, as it did not really describe
10197         what this did.  Also ResolveLValue is gone from this interface and
10198         now is part of Expression.
10199
10200         (ElementAccess): Depending on the element access type
10201         
10202         * typemanager.cs: Add `indexer_name_type' as a Core type
10203         (System.Runtime.CompilerServices.IndexerNameAttribute)
10204
10205         * statement.cs (Goto): Take a location.
10206         
10207 2001-10-18  Ravi Pratap  <ravi@ximian.com>
10208
10209         * delegate.cs (Delegate::VerifyDelegate): New method to verify
10210         if two delegates are compatible.
10211
10212         (NewDelegate::DoResolve): Update to take care of the case when
10213         we instantiate a delegate from another delegate.
10214
10215         * typemanager.cs (FindMembers): Don't even try to look up members
10216         of Delegate types for now.
10217
10218 2001-10-18  Ravi Pratap  <ravi@ximian.com>
10219
10220         * delegate.cs (NewDelegate): New class to take care of delegate
10221         instantiation.
10222
10223         * expression.cs (New): Split the delegate related code out into 
10224         the NewDelegate class.
10225
10226         * delegate.cs (DelegateInvocation): New class to handle delegate 
10227         invocation.
10228
10229         * expression.cs (Invocation): Split out delegate related code into
10230         the DelegateInvocation class.
10231
10232 2001-10-17  Ravi Pratap  <ravi@ximian.com>
10233
10234         * expression.cs (New::DoResolve): Implement delegate creation fully
10235         and according to the spec.
10236
10237         (New::DoEmit): Update to handle delegates differently.
10238
10239         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
10240         because of which we were printing out arguments in reverse order !
10241
10242         * delegate.cs (VerifyMethod): Implement to check if the given method
10243         matches the delegate.
10244
10245         (FullDelegateDesc): Implement.
10246
10247         (VerifyApplicability): Implement.
10248
10249         * expression.cs (Invocation::DoResolve): Update to accordingly handle
10250         delegate invocations too.
10251
10252         (Invocation::Emit): Ditto.
10253
10254         * ../errors/cs1593.cs : Added.
10255
10256         * ../errors/cs1594.cs : Added.
10257
10258         * delegate.cs (InstanceExpression, TargetMethod): New properties.
10259
10260 2001-10-16  Ravi Pratap  <ravi@ximian.com>
10261
10262         * typemanager.cs (intptr_type): Core type for System.IntPtr
10263
10264         (InitCoreTypes): Update for the same.
10265
10266         (iasyncresult_type, asynccallback_type): Ditto.
10267
10268         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
10269         correct.
10270
10271         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
10272         too.
10273
10274         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
10275         the builders for the 4 members of a delegate type :-)
10276
10277         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
10278         type.
10279
10280         * expression.cs (New::DoResolve): Implement guts for delegate creation.
10281
10282         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
10283
10284 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
10285
10286         * statement.cs (Break::Emit): Implement.   
10287         (Continue::Emit): Implement.
10288
10289         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10290         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10291         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10292         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
10293         end loop
10294         
10295         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
10296         properties that track the label for the current loop (begin of the
10297         loop and end of the loop).
10298
10299 2001-10-15  Ravi Pratap  <ravi@ximian.com>
10300
10301         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
10302         use of emitting anything at all.
10303
10304         * class.cs, rootcontext.cs : Get rid of calls to the same.
10305
10306         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
10307
10308         (Populate): Define the constructor correctly and set the implementation
10309         attributes.
10310
10311         * typemanager.cs (delegate_types): New hashtable to hold delegates that
10312         have been defined.
10313
10314         (AddDelegateType): Implement.
10315
10316         (IsDelegateType): Implement helper method.
10317
10318         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
10319
10320         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
10321         and accordingly handle it.
10322
10323         * delegate.cs (Populate): Take TypeContainer argument.
10324         Implement bits to define the Invoke method. However, I still haven't figured out
10325         how to take care of the native int bit :-(
10326
10327         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
10328         Qualify the name of the delegate, not its return type !
10329
10330         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
10331         conversion.
10332
10333         (StandardConversionExists): Checking for array types turns out to be recursive.
10334
10335         (ConvertReferenceExplicit): Implement array conversion.
10336
10337         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
10338         
10339 2001-10-12  Ravi Pratap  <ravi@ximian.com>
10340
10341         * cs-parser.jay (delegate_declaration): Store the fully qualified
10342         name as it is a type declaration.
10343
10344         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
10345         readonly.
10346
10347         (DefineDelegate): Renamed from Define. Does the same thing essentially,
10348         as TypeContainer::DefineType.
10349
10350         (Populate): Method in which all the definition of the various methods (Invoke)
10351         etc is done.
10352
10353         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
10354         see.
10355         
10356         (CloseDelegate): Finally creates the delegate.
10357
10358         * class.cs (TypeContainer::DefineType): Update to define delegates.
10359         (Populate, Emit and CloseType): Do the same thing here too.
10360
10361         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
10362         delegates in all these operations.
10363
10364 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
10365
10366         * expression.cs: LocalTemporary: a new expression used to
10367         reference a temporary that has been created.
10368
10369         * assign.cs: Handle PropertyAccess back here, so that we can
10370         provide the proper semantic access to properties.
10371
10372         * expression.cs (Expression::ConvertReferenceExplicit): Implement
10373         a few more explicit conversions. 
10374
10375         * modifiers.cs: `NEW' modifier maps to HideBySig.
10376
10377         * expression.cs (PropertyExpr): Make this into an
10378         ExpressionStatement, and support the EmitStatement code path. 
10379
10380         Perform get/set error checking, clean up the interface.
10381
10382         * assign.cs: recognize PropertyExprs as targets, and if so, turn
10383         them into toplevel access objects.
10384
10385 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
10386
10387         * expression.cs: PropertyExpr::PropertyExpr: use work around the
10388         SRE.
10389
10390         * typemanager.cs: Keep track here of our PropertyBuilders again to
10391         work around lameness in SRE.
10392
10393 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
10394
10395         * expression.cs (LValue::LValueResolve): New method in the
10396         interface, used to perform a second resolution pass for LValues. 
10397         
10398         (This::DoResolve): Catch the use of this in static methods.
10399
10400         (This::LValueResolve): Implement.
10401
10402         (This::Store): Remove warning, assigning to `this' in structures
10403         is 
10404
10405         (Invocation::Emit): Deal with invocation of
10406         methods on value types.  We need to pass the address to structure
10407         methods rather than the object itself.  (The equivalent code to
10408         emit "this" for structures leaves the entire structure on the
10409         stack instead of a pointer to it). 
10410
10411         (ParameterReference::DoResolve): Compute the real index for the
10412         argument based on whether the method takes or not a `this' pointer
10413         (ie, the method is static).
10414
10415         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
10416         value types returned from functions when we need to invoke a
10417         method on the sturcture.
10418         
10419
10420 2001-10-11  Ravi Pratap  <ravi@ximian.com>
10421
10422         * class.cs (TypeContainer::DefineType): Method to actually do the business of
10423         defining the type in the Modulebuilder or Typebuilder. This is to take
10424         care of nested types which need to be defined on the TypeBuilder using
10425         DefineNestedMethod.
10426
10427         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
10428         methods in RootContext, only ported to be part of TypeContainer.
10429
10430         (TypeContainer::GetInterfaceOrClass): Ditto.
10431
10432         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
10433
10434         * interface.cs (Interface::DefineInterface): New method. Does exactly
10435         what RootContext.CreateInterface did earlier, only it takes care of nested types 
10436         too.
10437
10438         (Interface::GetInterfaces): Move from RootContext here and port.
10439
10440         (Interface::GetInterfaceByName): Same here.
10441
10442         * rootcontext.cs (ResolveTree): Re-write.
10443
10444         (PopulateTypes): Re-write.
10445
10446         * class.cs (TypeContainer::Populate): Populate nested types too.
10447         (TypeContainer::Emit): Emit nested members too.
10448
10449         * typemanager.cs (AddUserType): Do not make use of the FullName property,
10450         instead just use the name argument passed in as it is already fully
10451         qualified.
10452
10453         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
10454         to TypeContainer mapping to see if a type is user-defined.
10455
10456         * class.cs (TypeContainer::CloseType): Implement. 
10457
10458         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
10459         the default constructor.
10460         
10461         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
10462         twice.
10463
10464         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
10465
10466         * interface.cs (CloseType): Create the type here.
10467         
10468         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
10469         the hierarchy.
10470
10471         Remove all the methods which are now in TypeContainer.
10472
10473 2001-10-10  Ravi Pratap  <ravi@ximian.com>
10474
10475         * delegate.cs (Define): Re-write bits to define the delegate
10476         correctly.
10477
10478 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
10479
10480         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
10481
10482         * expression.cs (ImplicitReferenceConversion): handle null as well
10483         as a source to convert to any reference type.
10484
10485         * statement.cs (Return): Perform any implicit conversions to
10486         expected return type.  
10487
10488         Validate use of return statement.  
10489
10490         * codegen.cs (EmitContext): Pass the expected return type here.
10491
10492         * class.cs (Method, Constructor, Property): Pass expected return
10493         type to EmitContext.
10494
10495 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
10496
10497         * expression.cs: Make DoResolve take an EmitContext instead of a
10498         TypeContainer.
10499
10500         Replaced `l' and `location' for `loc', for consistency.
10501         
10502         (Error, Warning): Remove unneeded Tc argument.
10503
10504         * assign.cs, literal.cs, constant.cs: Update to new calling
10505         convention. 
10506         
10507         * codegen.cs: EmitContext now contains a flag indicating whether
10508         code is being generated in a static method or not.
10509
10510         * cs-parser.jay: DecomposeQI, new function that replaces the old
10511         QualifiedIdentifier.  Now we always decompose the assembled
10512         strings from qualified_identifier productions into a group of
10513         memberaccesses.
10514
10515 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
10516
10517         * rootcontext.cs: Deal with field-less struct types correctly now
10518         by passing the size option to Define Type.
10519
10520         * class.cs: Removed hack that created one static field. 
10521
10522 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
10523
10524         * statement.cs: Moved most of the code generation here. 
10525
10526 2001-10-09  Ravi Pratap  <ravi@ximian.com>
10527
10528         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
10529         seem very right.
10530
10531         (ElementAccess): Remove useless bits for now - keep checks as the spec
10532         says.
10533
10534 2001-10-08  Ravi Pratap  <ravi@ximian.com>
10535
10536         * expression.cs (ElementAccess::DoResolve): Remove my crap code
10537         and start performing checks according to the spec.
10538
10539 2001-10-07  Ravi Pratap  <ravi@ximian.com>
10540
10541         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
10542         rank_specifiers instead.
10543
10544         (rank_specifiers): Change the order in which the rank specifiers are stored
10545
10546         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
10547
10548         * expression.cs (ElementAccess): Implement the LValue interface too.
10549         
10550 2001-10-06  Ravi Pratap  <ravi@ximian.com>
10551         
10552         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
10553         except that user defined conversions are not included.
10554
10555         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
10556         perform the conversion of the return type, if necessary.
10557
10558         (New::DoResolve): Check whether we are creating an array or an object
10559         and accordingly do the needful.
10560
10561         (New::Emit): Same here.
10562
10563         (New::DoResolve): Implement guts of array creation.
10564
10565         (New::FormLookupType): Helper function.
10566
10567 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
10568
10569         * codegen.cs: Removed most of the code generation here, and move the
10570         corresponding code generation bits to the statement classes. 
10571
10572         Added support for try/catch/finalize and throw.
10573         
10574         * cs-parser.jay: Added support for try/catch/finalize.
10575
10576         * class.cs: Catch static methods having the flags override,
10577         virtual or abstract.
10578
10579         * expression.cs (UserCast): This user cast was not really doing
10580         what it was supposed to do.  Which is to be born in fully resolved
10581         state.  Parts of the resolution were being performed at Emit time! 
10582
10583         Fixed this code.
10584
10585 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
10586
10587         * expression.cs: Implicity convert the result from UserCast.
10588
10589 2001-10-05  Ravi Pratap  <ravi@ximian.com>
10590
10591         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
10592         prevented it from working correctly. 
10593
10594         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
10595         merely ConvertImplicit.
10596
10597 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
10598
10599         * typemanager.cs: Make the LookupTypeContainer function static,
10600         and not per-instance.  
10601
10602         * class.cs: Make static FindMembers (the one that takes a Type
10603         argument). 
10604
10605         * codegen.cs: Add EmitForeach here.
10606
10607         * cs-parser.jay: Make foreach a toplevel object instead of the
10608         inline expansion, as we need to perform semantic analysis on it. 
10609
10610 2001-10-05  Ravi Pratap  <ravi@ximian.com>
10611
10612         * expression.cs (Expression::ImplicitUserConversion): Rename to
10613         UserDefinedConversion.
10614
10615         (Expression::UserDefinedConversion): Take an extra argument specifying 
10616         whether we look for explicit user conversions too.
10617
10618         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
10619
10620         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
10621
10622         (ExplicitUserConversion): Make it a call to UserDefinedConversion
10623         with the appropriate arguments.
10624
10625         * cs-parser.jay (cast_expression): Record location too.
10626
10627         * expression.cs (Cast): Record location info.
10628
10629         (Expression::ConvertExplicit): Take location argument.
10630
10631         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
10632         to determine if we are doing explicit conversions.
10633
10634         (UserCast::Emit): Update accordingly.
10635
10636         (Expression::ConvertExplicit): Report an error if everything fails.
10637
10638         * ../errors/cs0030.cs : Add.
10639
10640 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
10641
10642         * modifiers.cs: If the ABSTRACT keyword is present, also set the
10643         virtual and newslot bits. 
10644
10645         * class.cs (TypeContainer::RegisterRequiredImplementations):
10646         Record methods we need.
10647
10648         (TypeContainer::MakeKey): Helper function to make keys for
10649         MethodBases, since the Methodbase key is useless.
10650
10651         (TypeContainer::Populate): Call RegisterRequiredImplementations
10652         before defining the methods.   
10653
10654         Create a mapping for method_builders_to_methods ahead of time
10655         instead of inside a tight loop.
10656
10657         (::RequireMethods):  Accept an object as the data to set into the
10658         hashtable so we can report interface vs abstract method mismatch.
10659
10660 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
10661
10662         * report.cs: Make all of it static.
10663
10664         * rootcontext.cs: Drop object_type and value_type computations, as
10665         we have those in the TypeManager anyways.
10666
10667         Drop report instance variable too, now it is a global.
10668
10669         * driver.cs: Use try/catch on command line handling.
10670
10671         Add --probe option to debug the error reporting system with a test
10672         suite. 
10673
10674         * report.cs: Add support for exiting program when a probe
10675         condition is reached.
10676
10677 2001-10-03  Ravi Pratap  <ravi@ximian.com>
10678
10679         * expression.cs (Binary::DoNumericPromotions): Fix the case when
10680         we do a forcible conversion regardless of type, to check if 
10681         ForceConversion returns a null.
10682
10683         (Binary::error19): Use location to report error.
10684
10685         (Unary::error23): Use location here too.
10686
10687         * ../errors/cs0019.cs : Check in.
10688
10689         * ../errors/cs0023.cs : Check in.
10690
10691         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
10692         case of a non-null MethodInfo object with a length of 0 !
10693
10694         (Binary::ResolveOperator): Flag error if overload resolution fails to find
10695         an applicable member - according to the spec :-)
10696         Also fix logic to find members in base types.
10697
10698         (Unary::ResolveOperator): Same here.
10699
10700         (Unary::report23): Change name to error23 and make first argument a TypeContainer
10701         as I was getting thoroughly confused between this and error19 :-)
10702         
10703         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
10704         (::FindMostEncompassedType): Implement.
10705         (::FindMostEncompassingType): Implement.
10706         (::StandardConversionExists): Implement.
10707
10708         (UserImplicitCast): Re-vamp. We now need info about most specific
10709         source and target types so that we can do the necessary conversions.
10710
10711         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
10712         mathematical union with no duplicates.
10713
10714 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
10715
10716         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
10717         in order from base classes to child classes, so that we can in
10718         child classes look up in our parent for method names and
10719         attributes (required for handling abstract, virtual, new, override
10720         constructs: we need to instrospect our base class, and if we dont
10721         populate the classes in order, the introspection might be
10722         incorrect.  For example, a method could query its parent before
10723         the parent has any methods and would determine that the parent has
10724         no abstract methods (while it could have had them)).
10725
10726         (RootContext::CreateType): Record the order in which we define the
10727         classes.
10728
10729 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
10730
10731         * class.cs (TypeContainer::Populate): Also method definitions can
10732         fail now, keep track of this.
10733
10734         (TypeContainer::FindMembers): Implement support for
10735         DeclaredOnly/noDeclaredOnly flag.
10736
10737         (Constructor::Emit) Return the ConstructorBuilder.
10738
10739         (Method::Emit) Return the MethodBuilder. 
10740         Check for abstract or virtual methods to be public.
10741
10742         * rootcontext.cs (RootContext::CreateType): Register all the
10743         abstract methods required for the class to be complete and the
10744         interface methods that must be implemented. 
10745
10746         * cs-parser.jay: Report error 501 (method requires body if it is
10747         not marked abstract or extern).
10748
10749         * expression.cs (TypeOf::Emit): Implement.
10750
10751         * typemanager.cs: runtime_handle_type, new global type.
10752
10753         * class.cs (Property::Emit): Generate code for properties.
10754
10755 2001-10-02  Ravi Pratap  <ravi@ximian.com>
10756
10757         * expression.cs (Unary::ResolveOperator): Find operators on base type
10758         too - we now conform exactly to the spec.
10759
10760         (Binary::ResolveOperator): Same here.
10761
10762         * class.cs (Operator::Define): Fix minor quirk in the tests.
10763
10764         * ../errors/cs0215.cs : Added.
10765
10766         * ../errors/cs0556.cs : Added.
10767
10768         * ../errors/cs0555.cs : Added.
10769
10770 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
10771
10772         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
10773         single integer which is really efficient
10774
10775 2001-10-01  Ravi Pratap  <ravi@ximian.com>
10776
10777         *  expression.cs (Expression::ImplicitUserConversion): Use location
10778         even in the case when we are examining True operators.
10779  
10780         * class.cs (Operator::Define): Perform extensive checks to conform
10781         with the rules for operator overloading in the spec.
10782
10783         * expression.cs (Expression::ImplicitReferenceConversion): Implement
10784         some of the other conversions mentioned in the spec.
10785
10786         * typemanager.cs (array_type): New static member for the System.Array built-in
10787         type.
10788
10789         (cloneable_interface): For System.ICloneable interface.
10790
10791         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
10792         we start resolving the tree and populating types.
10793
10794         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
10795  
10796 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
10797
10798         * expression.cs (Expression::ExprClassFromMemberInfo,
10799         Expression::Literalize): Create literal expressions from
10800         FieldInfos which are literals.
10801
10802         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
10803         type casts, because they were wrong.  The test suite in tests
10804         caught these ones.
10805
10806         (ImplicitNumericConversion): ushort to ulong requires a widening
10807         cast. 
10808
10809         Int32 constant to long requires widening cast as well.
10810
10811         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
10812         for integers because the type on the stack is not i4.
10813
10814 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
10815
10816         * expression.cs (report118): require location argument. 
10817
10818         * parameter.cs: Do not dereference potential null value.
10819
10820         * class.cs: Catch methods that lack the `new' keyword when
10821         overriding a name.  Report warnings when `new' is used without
10822         anything being there to override.
10823
10824         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
10825
10826         * class.cs: Only add constructor to hashtable if it is non-null
10827         (as now constructors can fail on define).
10828
10829         (TypeManager, Class, Struct): Take location arguments.
10830
10831         Catch field instance initialization in structs as errors.
10832
10833         accepting_filter: a new filter for FindMembers that is static so
10834         that we dont create an instance per invocation.
10835
10836         (Constructor::Define): Catch errors where a struct constructor is
10837         parameterless 
10838
10839         * cs-parser.jay: Pass location information for various new
10840         constructs. 
10841         
10842         * delegate.cs (Delegate): take a location argument.
10843
10844         * driver.cs: Do not call EmitCode if there were problesm in the
10845         Definition of the types, as many Builders wont be there. 
10846
10847         * decl.cs (Decl::Decl): Require a location argument.
10848
10849         * cs-tokenizer.cs: Handle properly hex constants that can not fit
10850         into integers, and find the most appropiate integer for it.
10851
10852         * literal.cs: Implement ULongLiteral.
10853
10854         * rootcontext.cs: Provide better information about the location of
10855         failure when CreateType fails.
10856         
10857 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
10858
10859         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
10860         as well.
10861
10862         * expression.cs (Binary::CheckShiftArguments): Add missing type
10863         computation.
10864         (Binary::ResolveOperator): Add type to the logical and and logical
10865         or, Bitwise And/Or and Exclusive Or code paths, it was missing
10866         before.
10867
10868         (Binary::DoNumericPromotions): In the case where either argument
10869         is ulong (and most signed types combined with ulong cause an
10870         error) perform implicit integer constant conversions as well.
10871
10872 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
10873
10874         * expression.cs (UserImplicitCast): Method should always be
10875         non-null. 
10876         (Invocation::BetterConversion): Simplified test for IntLiteral.
10877
10878         (Expression::ImplicitNumericConversion): Split this routine out.
10879         Put the code that performs implicit constant integer conversions
10880         here. 
10881
10882         (Expression::Resolve): Become a wrapper around DoResolve so we can
10883         check eclass and type being set after resolve.
10884
10885         (Invocation::Badness): Remove this dead function
10886
10887         (Binary::ResolveOperator): Do not compute the expensive argumnets
10888         unless we have a union for it.
10889
10890         (Probe::Emit): Is needs to do an isinst and then
10891         compare against null.
10892
10893         (::CanConvert): Added Location argument.  If the Location argument
10894         is null (Location.Null), then we do not report errors.  This is
10895         used by the `probe' mechanism of the Explicit conversion.  We do
10896         not want to generate an error for something that the user
10897         explicitly requested to be casted.  But the pipeline for an
10898         explicit cast first tests for potential implicit casts.
10899
10900         So for now, if the Location is null, it means `Probe only' to
10901         avoid adding another argument.   Might have to revise this
10902         strategy later.
10903
10904         (ClassCast): New class used to type cast objects into arbitrary
10905         classes (used in Explicit Reference Conversions).
10906
10907         Implement `as' as well.
10908
10909         Reverted all the patches from Ravi below: they were broken:
10910
10911                 * The use of `level' as a mechanism to stop recursive
10912                   invocations is wrong.  That was there just to catch the
10913                   bug with a strack trace but not as a way of addressing
10914                   the problem.
10915
10916                   To fix the problem we have to *understand* what is going
10917                   on and the interactions and come up with a plan, not
10918                   just get things going.
10919
10920                 * The use of the type conversion cache that I proposed
10921                   last night had an open topic: How does this work across
10922                   protection domains.  A user defined conversion might not
10923                   be public in the location where we are applying the
10924                   conversion, a different conversion might be selected
10925                   (ie, private A->B (better) but public B->A (worse),
10926                   inside A, A->B applies, but outside it, B->A will
10927                   apply).
10928
10929                 * On top of that (ie, even if the above is solved),
10930                   conversions in a cache need to be abstract.  Ie, `To
10931                   convert from an Int to a Short use an OpcodeCast', not
10932                   `To convert from an Int to a Short use the OpcodeCast on
10933                   the variable 5' (which is what this patch was doing).
10934         
10935 2001-09-28  Ravi Pratap  <ravi@ximian.com>
10936
10937         * expression.cs (Invocation::ConversionExists): Re-write to use
10938         the conversion cache
10939         
10940         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
10941         cache all conversions done, not just user-defined ones.
10942
10943         (Invocation::BetterConversion): The real culprit. Use ConversionExists
10944         to determine if a conversion exists instead of acutually trying to 
10945         perform the conversion. It's faster too.
10946
10947         (Expression::ConvertExplicit): Modify to use ConversionExists to check
10948         and only then attempt the implicit conversion.
10949
10950 2001-09-28  Ravi Pratap  <ravi@ximian.com>
10951
10952         * expression.cs (ConvertImplicit): Use a cache for conversions
10953         already found. Check level of recursion and bail out if necessary.
10954         
10955 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
10956
10957         * typemanager.cs (string_concat_string_string, string_concat_object_object):
10958         Export standard methods that we expect for string operations.
10959         
10960         * statement.cs (Block::UsageWarning): Track usage of variables and
10961         report the errors for not used variables.
10962
10963         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
10964         operator. 
10965
10966 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
10967
10968         * codegen.cs: remove unnneded code 
10969
10970         * expression.cs: Removed BuiltinTypeAccess class
10971
10972         Fix the order in which implicit conversions are
10973         done.  
10974
10975         The previous fixed dropped support for boxed conversions (adding a
10976         test to the test suite now)
10977
10978         (UserImplicitCast::CanConvert): Remove test for source being null,
10979         that code is broken.  We should not feed a null to begin with, if
10980         we do, then we should track the bug where the problem originates
10981         and not try to cover it up here.
10982
10983         Return a resolved expression of type UserImplicitCast on success
10984         rather than true/false.  Ravi: this is what I was talking about,
10985         the pattern is to use a static method as a "constructor" for
10986         objects. 
10987
10988         Also, do not create arguments until the very last minute,
10989         otherwise we always create the arguments even for lookups that
10990         will never be performed. 
10991
10992         (UserImplicitCast::Resolve): Eliminate, objects of type
10993         UserImplicitCast are born in a fully resolved state. 
10994         
10995         * typemanager.cs (InitCoreTypes): Init also value_type
10996         (System.ValueType). 
10997
10998         * expression.cs (Cast::Resolve): First resolve the child expression.
10999
11000         (LValue): Add new method AddressOf to be used by
11001         the `&' operator.  
11002
11003         Change the argument of Store to take an EmitContext instead of an
11004         ILGenerator, because things like FieldExpr need to be able to call
11005         their children expression to generate the instance code. 
11006
11007         (Expression::Error, Expression::Warning): Sugar functions for
11008         reporting errors.
11009
11010         (Expression::MemberLookup): Accept a TypeContainer instead of a
11011         Report as the first argument.
11012
11013         (Expression::ResolvePrimary): Killed.  I still want to improve
11014         this as currently the code is just not right.
11015
11016         (Expression::ResolveMemberAccess): Simplify, but it is still
11017         wrong. 
11018
11019         (Unary::Resolve): Catch errors in AddressOf operators.
11020
11021         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
11022         index to a byte for the short-version, or the compiler will choose
11023         the wrong Emit call, which generates the wrong data.
11024
11025         (ParameterReference::Emit, ::Store): same.
11026
11027         (FieldExpr::AddressOf): Implement.
11028         
11029         * typemanager.cs: TypeManager: made public variable instead of
11030         property.
11031         
11032         * driver.cs: document --fatal.
11033
11034         * report.cs (ErrorMessage, WarningMessage): new names for the old
11035         Error and Warning classes.
11036
11037         * cs-parser.jay (member_access): Turn built-in access to types
11038         into a normal simplename
11039
11040 2001-09-27  Ravi Pratap  <ravi@ximian.com>
11041
11042         * expression.cs (Invocation::BetterConversion): Fix to cope
11043         with q being null, since this was introducing a bug.
11044
11045         * expression.cs (ConvertImplicit): Do built-in conversions first.
11046
11047 2001-09-27  Ravi Pratap  <ravi@ximian.com>
11048
11049         * expression.cs (UserImplicitCast::Resolve): Fix bug.
11050
11051 2001-09-27  Ravi Pratap  <ravi@ximian.com>
11052
11053         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
11054         I had introduced long ago (what's new ?).
11055
11056         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
11057         the work of all the checking. 
11058         (ConvertImplicit): Call CanConvert and only then create object if necessary.
11059         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
11060
11061         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
11062         that is the right way. 
11063
11064         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
11065         overloading resolution. Use everywhere instead of cutting and pasting code.
11066
11067         (Binary::ResolveOperator): Use MakeUnionSet.
11068
11069         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
11070         we have to convert to bool types. Not complete yet.
11071         
11072 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
11073
11074         * typemanager.cs (TypeManager::CSharpName): support ushort.
11075
11076         * expression.cs (Expression::TryImplicitIntConversion): Attempts
11077         to provide an expression that performsn an implicit constant int
11078         conversion (section 6.1.6).
11079         (Expression::ConvertImplicitRequired): Reworked to include
11080         implicit constant expression conversions.
11081
11082         (Expression::ConvertNumericExplicit): Finished.
11083
11084         (Invocation::Emit): If InstanceExpression is null, then it means
11085         that we perform a call on this.
11086         
11087 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
11088
11089         * expression.cs (Unary::Emit): Remove some dead code.
11090         (Probe): Implement Resolve and Emit for `is'.
11091         (Expression::ConvertImplicitRequired): Attempt to do constant
11092         expression conversions here.  Maybe should be moved to
11093         ConvertImplicit, but I am not sure.
11094         (Expression::ImplicitLongConstantConversionPossible,
11095         Expression::ImplicitIntConstantConversionPossible): New functions
11096         that tell whether is it possible to apply an implicit constant
11097         expression conversion.
11098
11099         (ConvertNumericExplicit): Started work on explicit numeric
11100         conversions.
11101
11102         * cs-parser.jay: Update operator constants.
11103
11104         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
11105         (Parameters::GetSignature): Hook up VerifyArgs here.
11106         (Parameters::VerifyArgs): Verifies that no two arguments have the
11107         same name. 
11108
11109         * class.cs (Operator): Update the operator names to reflect the
11110         ones that the spec expects (as we are just stringizing the
11111         operator names).
11112         
11113         * expression.cs (Unary::ResolveOperator): Fix bug: Use
11114         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
11115         previous usage did only work for our methods.
11116         (Expression::ConvertImplicit): Handle decimal implicit numeric
11117         conversions as well.
11118         (Expression::InternalTypeConstructor): Used to invoke constructors
11119         on internal types for default promotions.
11120
11121         (Unary::Emit): Implement special handling for the pre/post
11122         increment/decrement for overloaded operators, as they need to have
11123         the same semantics as the other operators.
11124
11125         (Binary::ResolveOperator): ditto.
11126         (Invocation::ConversionExists): ditto.
11127         (UserImplicitCast::Resolve): ditto.
11128         
11129 2001-09-26  Ravi Pratap  <ravi@ximian.com>
11130
11131         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
11132         operator, return after emitting body. Regression tests pass again !
11133
11134         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
11135         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
11136         (Invocation::OverloadResolve): Ditto.
11137         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
11138
11139         * everywhere : update calls to the above methods accordingly.
11140
11141 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
11142
11143         * assign.cs (Assign): Make it inherit from ExpressionStatement.
11144
11145         * expression.cs (ExpressionStatement): New base class used for
11146         expressions that can appear in statements, so that we can provide
11147         an alternate path to generate expression that do not leave a value
11148         on the stack.
11149
11150         (Expression::Emit, and all the derivatives): We no longer return
11151         whether a value is left on the stack or not.  Every expression
11152         after being emitted leaves a single value on the stack.
11153
11154         * codegen.cs (EmitContext::EmitStatementExpression): Use the
11155         facilties of ExpressionStatement if possible.
11156
11157         * cs-parser.jay: Update statement_expression.
11158
11159 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
11160
11161         * driver.cs: Change the wording of message
11162
11163 2001-09-25  Ravi Pratap  <ravi@ximian.com>
11164
11165         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
11166         the type of the expression to the return type of the method if
11167         we have an overloaded operator match ! The regression tests pass again !
11168         (Unary::ResolveOperator): Ditto.
11169
11170         * expression.cs (Invocation::ConversionExists): Correct the member lookup
11171         to find "op_Implicit", not "implicit" ;-)
11172         (UserImplicitCast): New class to take care of user-defined implicit conversions.
11173         (ConvertImplicit, ForceConversion): Take TypeContainer argument
11174
11175         * everywhere : Correct calls to the above accordingly.
11176
11177         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
11178         (ConvertImplicit): Do user-defined conversion if it exists.
11179
11180 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
11181
11182         * assign.cs: track location.
11183         (Resolve): Use implicit conversions on assignment.
11184
11185         * literal.cs: Oops.  Not good, Emit of short access values should
11186         pass (Bytes) or the wrong argument will be selected.
11187
11188         * expression.cs (Unary::Emit): Emit code for -expr.
11189         
11190         (Unary::ResolveOperator): Handle `Substract' for non-constants
11191         (substract from zero from the non-constants).
11192         Deal with Doubles as well. 
11193         
11194         (Expression::ConvertImplicitRequired): New routine that reports an
11195         error if no implicit conversion exists. 
11196
11197         (Invocation::OverloadResolve): Store the converted implicit
11198         expressions if we make them
11199         
11200 2001-09-24  Ravi Pratap  <ravi@ximian.com>
11201
11202         * class.cs (ConstructorInitializer): Take a Location argument.
11203         (ConstructorBaseInitializer): Same here.
11204         (ConstructorThisInitializer): Same here.
11205
11206         * cs-parser.jay : Update all calls accordingly.
11207
11208         * expression.cs (Unary, Binary, New): Take location argument.
11209         Update accordingly everywhere.
11210
11211         * cs-parser.jay : Update all calls to the above to take a location
11212         argument.
11213
11214         * class.cs : Ditto.
11215
11216 2001-09-24  Ravi Pratap  <ravi@ximian.com>
11217
11218         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
11219         (Invocation::BetterConversion): Same here
11220         (Invocation::ConversionExists): Ditto.
11221
11222         (Invocation::ConversionExists): Implement.
11223
11224 2001-09-22  Ravi Pratap  <ravi@ximian.com>
11225
11226         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
11227         Also take an additional TypeContainer argument.
11228
11229         * All over : Pass in TypeContainer as argument to OverloadResolve.
11230
11231         * typemanager.cs (CSharpName): Update to check for the string type and return
11232         that too.
11233
11234         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
11235         a given method.
11236         
11237 2001-09-21  Ravi Pratap  <ravi@ximian.com>
11238
11239         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
11240         (Invocation::BetterFunction): Implement.
11241         (Invocation::BetterConversion): Implement.
11242         (Invocation::ConversionExists): Skeleton, no implementation yet.
11243
11244         Okay, things work fine !
11245
11246 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
11247
11248         * typemanager.cs: declare and load enum_type, delegate_type and
11249         void_type. 
11250
11251         * expression.cs (Expression::Emit): Now emit returns a value that
11252         tells whether a value is left on the stack or not.  This strategy
11253         might be reveted tomorrow with a mechanism that would address
11254         multiple assignments.
11255         (Expression::report118): Utility routine to report mismatches on
11256         the ExprClass.
11257
11258         (Unary::Report23): Report impossible type/operator combination
11259         utility function.
11260
11261         (Unary::IsIncrementableNumber): Whether the type can be
11262         incremented or decremented with add.
11263         (Unary::ResolveOperator): Also allow enumerations to be bitwise
11264         complemented. 
11265         (Unary::ResolveOperator): Implement ++, !, ~,
11266
11267         (Invocation::Emit): Deal with new Emit convetion.
11268         
11269         * All Expression derivatives: Updated their Emit method to return
11270         whether they leave values on the stack or not.
11271         
11272         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
11273         stack for expressions that are statements. 
11274
11275 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
11276
11277         * expression.cs (LValue): New interface.  Must be implemented by
11278         LValue objects.
11279         (LocalVariableReference, ParameterReference, FieldExpr): Implement
11280         LValue interface.
11281         
11282         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
11283         interface for generating code, simplifies the code.
11284
11285 2001-09-20  Ravi Pratap  <ravi@ximian.com>
11286
11287         * expression.cs (everywhere): Comment out return statements in ::Resolve
11288         methods to avoid the warnings.
11289
11290 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
11291
11292         * driver.cs (parse): Report error 2001 if we can not open the
11293         source file.
11294
11295         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
11296         not resolve it.
11297
11298         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
11299         object. 
11300
11301         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
11302         otherwise nested blocks end up with the same index.
11303
11304         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
11305
11306         * expression.cs:  Instead of having FIXMEs in the Resolve
11307         functions, throw exceptions so it is obvious that we are facing a
11308         bug. 
11309
11310         * cs-parser.jay (invocation_expression): Pass Location information.
11311
11312         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
11313         Use a basename for those routines because .NET does not like paths
11314         on them. 
11315
11316         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
11317         already defined.
11318
11319 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
11320
11321         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
11322         are loading the correct data types (throws an exception if not).
11323         (TypeManager::InitCoreTypes): Use CoreLookupType
11324
11325         * expression.cs (Unary::ResolveOperator): return the child
11326         expression for expressions which are just +expr.
11327         (Unary::ResolveOperator): Return negative literals for -LITERAL
11328         expressions (otherwise they are Unary {Literal}).
11329         (Invocation::Badness): Take into account `Implicit constant
11330         expression conversions'.
11331
11332         * literal.cs (LongLiteral): Implement long literal class.
11333         (IntLiteral): export the `Value' of the intliteral. 
11334
11335 2001-09-19  Ravi Pratap  <ravi@ximian.com>
11336
11337         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
11338
11339         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
11340         instead of 'Operator'
11341
11342         * expression.cs (Binary::ResolveOperator): Update accordingly.
11343         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
11344         and 'Minus'
11345
11346         * cs-parser.jay (unary_expression): Update to use the new names.
11347
11348         * gen-treedump.cs (GetUnary): Same here.
11349
11350         * expression.cs (Unary::Resolve): Implement.
11351         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
11352         operators are found instead of making noise ;-)
11353         (Unary::ResolveOperator): New method to do precisely the same thing which
11354         Binary::ResolveOperator does for Binary expressions.
11355         (Unary.method, .Arguments): Add.
11356         (Unary::OperName): Implement.   
11357         (Unary::ForceConversion): Copy and Paste !
11358
11359         * class.cs (Operator::Define): Fix a small bug for the case when we have 
11360         a unary operator.
11361
11362         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
11363         for the inbuilt operators. Only overloading works for now ;-)
11364
11365 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
11366
11367         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
11368         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
11369
11370         * expression.cs (This::Emit): Implement. 
11371         (This::Resolve): Implement.
11372         (TypeOf:Resolve): Implement.
11373         (Expression::ResolveSimpleName): Add an implicit this to instance
11374         field references. 
11375         (MemberAccess::Resolve): Deal with Parameters and Fields. 
11376         Bind instance variable to Field expressions.
11377         (FieldExpr::Instance): New field used to track the expression that
11378         represents the object instance.
11379         (FieldExpr::Resolve): Track potential errors from MemberLookup not
11380         binding 
11381         (FieldExpr::Emit): Implement.
11382
11383         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
11384         the last instruction contains a return opcode to avoid generating
11385         the last `ret' instruction (this generates correct code, and it is
11386         nice to pass the peverify output).
11387
11388         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
11389         initializer for static and instance variables.
11390         (Constructor::Emit): Allow initializer to be null in the case of
11391         static constructors.  Only emit initializer for instance
11392         constructors. 
11393
11394         (TypeContainer::FindMembers): Return a null array if there are no
11395         matches.
11396
11397         Also fix the code for the MemberTypes.Method branch, as it was not
11398         scanning that for operators (or tried to access null variables before).
11399
11400         * assign.cs (Assign::Emit): Handle instance and static fields. 
11401
11402         * TODO: Updated.
11403
11404         * driver.cs: Stop compilation if there are parse errors.
11405
11406         * cs-parser.jay (constructor_declaration): Provide default base
11407         initializer for non-static constructors.
11408         (constructor_declarator): Do not provide a default base
11409         initializers if none was specified.
11410         Catch the fact that constructors should not have parameters.
11411
11412         * class.cs: Do not emit parent class initializers for static
11413         constructors, that should be flagged as an error.
11414
11415 2001-09-18  Ravi Pratap  <ravi@ximian.com>
11416
11417         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
11418         Move back code into TypeContainer::Populate.
11419
11420 2001-09-18  Ravi Pratap  <ravi@ximian.com>
11421
11422         * class.cs (TypeContainer::AddConstructor): Fix the check to
11423         compare against Name, not Basename. 
11424         (Operator::OpType): Change Plus and Minus to Add and Subtract.
11425
11426         * cs-parser.jay : Update accordingly.
11427
11428         * class.cs (TypeContainer::FindMembers): For the case where we are searching
11429         for methods, don't forget to look into the operators too.
11430         (RegisterMethodBuilder): Helper method to take care of this for
11431         methods, constructors and operators.
11432         (Operator::Define): Completely revamp.
11433         (Operator.OperatorMethod, MethodName): New fields.
11434         (TypeContainer::Populate): Move the registering of builders into
11435         RegisterMethodBuilder.
11436         (Operator::Emit): Re-write.
11437
11438         * expression.cs (Binary::Emit): Comment out code path to emit method
11439         invocation stuff for the case when we have a user defined operator. I am
11440         just not able to get it right !
11441         
11442 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
11443
11444         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
11445         argument. 
11446
11447         (Expression::MemberLookup): Provide a version that allows to
11448         specify the MemberTypes and BindingFlags. 
11449
11450         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
11451         so it was not fetching variable information from outer blocks.
11452
11453         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
11454         Beforefieldinit as it was buggy.
11455
11456         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
11457         that Ravi put here.  
11458
11459         * class.cs (Constructor::Emit): Only emit if block is not null.
11460         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
11461         deal with this by semantically definining it as if the user had
11462         done it.
11463
11464         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
11465         constructors as we now "emit" them at a higher level.
11466
11467         (TypeContainer::DefineDefaultConstructor): Used to define the
11468         default constructors if none was provided.
11469
11470         (ConstructorInitializer): Add methods Resolve and Emit. 
11471         
11472         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
11473
11474 2001-09-17  Ravi Pratap  <ravi@ximian.com>
11475
11476         * class.cs (TypeContainer::EmitDefaultConstructor): Register
11477         the default constructor builder with our hashtable for methodbuilders
11478         to methodcores.
11479
11480         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
11481         and argument_count is 0 in which case we have a match.
11482         (Binary::ResolveOperator): More null checking and miscellaneous coding
11483         style cleanup.
11484
11485 2001-09-17  Ravi Pratap  <ravi@ximian.com>
11486
11487         * rootcontext.cs (IsNameSpace): Compare against null.
11488
11489         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
11490
11491         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
11492         and Unary::Operator.
11493
11494         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
11495         accordingly.
11496
11497         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
11498         we have overloaded operators.
11499         (Binary::ResolveOperator): Implement the part which does the operator overload
11500         resolution.
11501
11502         * class.cs (Operator::Emit): Implement.
11503         (TypeContainer::Emit): Emit the operators we have too.
11504
11505         * expression.cs (Binary::Emit): Update to emit the appropriate code for
11506         the case when we have a user-defined operator.
11507         
11508 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
11509
11510         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
11511
11512 2001-09-16  Ravi Pratap  <ravi@ximian.com>
11513
11514         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
11515         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
11516         (Constructor::Emit): Implement.
11517         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
11518         if we have no work to do. 
11519         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
11520         Emit method.
11521
11522         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
11523         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
11524
11525         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
11526         of parent.parent.
11527
11528 2001-09-15  Ravi Pratap  <ravi@ximian.com>
11529
11530         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
11531         in the source.
11532         (Tree::RecordNamespace): Method to do what the name says ;-)
11533         (Tree::Namespaces): Property to get at the namespaces hashtable.
11534
11535         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
11536         keep track.
11537
11538         * rootcontext.cs (IsNamespace): Fixed it :-)
11539
11540 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
11541
11542         * class.cs (TypeContainer::FindMembers): Add support for
11543         constructors. 
11544         (MethodCore): New class that encapsulates both the shared aspects
11545         of a Constructor and a Method.  
11546         (Method, Constructor): Factored pieces into MethodCore.
11547
11548         * driver.cs: Added --fatal which makes errors throw exceptions.
11549         Load System assembly as well as part of the standard library.
11550
11551         * report.cs: Allow throwing exceptions on errors for debugging.
11552
11553         * modifiers.cs: Do not use `parent', instead use the real type
11554         container to evaluate permission settings.
11555
11556         * class.cs: Put Ravi's patch back in.  He is right, and we will
11557         have to cope with the
11558
11559 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11560
11561         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
11562         FamORAssem, not FamANDAssem.
11563         
11564 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
11565
11566         * driver.cs: Added --parse option that only parses its input files
11567         and terminates.
11568
11569         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
11570         incorrect.  IsTopLevel is not used to tell whether an object is
11571         root_types or not (that can be achieved by testing this ==
11572         root_types).  But to see if this is a top-level *class* (not
11573         necessarly our "toplevel" container). 
11574
11575 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11576
11577         * enum.cs (Enum::Define): Modify to call the Lookup method on the
11578         parent instead of a direct call to GetType.
11579
11580 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11581
11582         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
11583         Modifiers.TypeAttr. This should just be a call to that method.
11584
11585         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
11586         object so that we can determine if we are top-level or not.
11587
11588         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
11589         TypeContainer too.
11590
11591         * enum.cs (Enum::Define): Ditto.
11592
11593         * modifiers.cs (FieldAttr): Re-write.
11594
11595         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
11596         (TypeContainer::HaveStaticConstructor): New property to provide access
11597         to precisely that info.
11598
11599         * modifiers.cs (MethodAttr): Re-write.
11600         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
11601
11602         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
11603         of top-level types as claimed.
11604         
11605 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
11606
11607         * expression.cs (MemberLookup): Fruitless attempt to lookup
11608         constructors.  Maybe I need to emit default constructors?  That
11609         might be it (currently .NET emits this for me automatically).
11610         (Invocation::OverloadResolve): Cope with Arguments == null.
11611         (Invocation::EmitArguments): new function, shared by the new
11612         constructor and us.
11613         (Invocation::Emit): Handle static and instance methods.  Emit
11614         proper call instruction for virtual or non-virtual invocations.
11615         (New::Emit): Implement.
11616         (New::Resolve): Implement.
11617         (MemberAccess:Resolve): Implement.
11618         (MethodGroupExpr::InstanceExpression): used conforming to the spec
11619         to track instances.
11620         (FieldExpr::Resolve): Set type.
11621
11622         * support.cs: Handle empty arguments.
11623                 
11624         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
11625         SimpleLookup): Auxiliary routines to help parse a qualifier
11626         identifier.  
11627
11628         Update qualifier_identifier rule.
11629
11630         * codegen.cs: Removed debugging messages.
11631
11632         * class.cs: Make this a global thing, this acts just as a "key" to
11633         objects that we might have around.
11634
11635         (Populate): Only initialize method_builders_to_methods once.
11636
11637         * expression.cs (PropertyExpr): Initialize type from the
11638         PropertyType. 
11639
11640         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
11641         Resolve pattern.  Attempt to implicitly convert value to boolean.
11642         Emit code.
11643
11644         * expression.cs: Set the type for the int32/int32 argument case.
11645         (Binary::ResolveOperator): Set the return type to boolean for
11646         comparission operators
11647
11648         * typemanager.cs: Remove debugging print code.
11649
11650         (Invocation::Resolve): resolve type.
11651
11652         * class.cs: Allocate a MemberInfo of the correct size, as the code
11653         elsewhere depends on the test to reflect the correct contents.
11654
11655         (Method::) Keep track of parameters, due to System.Reflection holes
11656
11657         (TypeContainer::Populate): Keep track of MethodBuilders to Method
11658         mapping here.
11659
11660         (TypeContainer::FindMembers): Use ArrayList and then copy an array
11661         of the exact size and return that.
11662
11663         (Class::LookupMethodByBuilder): New function that maps
11664         MethodBuilders to its methods.  Required to locate the information
11665         on methods because System.Reflection bit us again.
11666
11667         * support.cs: New file, contains an interface ParameterData and
11668         two implementations: ReflectionParameters and InternalParameters
11669         used to access Parameter information.  We will need to grow this
11670         as required.
11671
11672         * expression.cs (Invocation::GetParameterData): implement a cache
11673         and a wrapper around the ParameterData creation for methods. 
11674         (Invocation::OverloadResolve): Use new code.
11675
11676 2001-09-13  Ravi Pratap  <ravi@ximian.com>
11677
11678         * class.cs (TypeContainer::EmitField): Remove and move into 
11679         (Field::Define): here and modify accordingly.
11680         (Field.FieldBuilder): New member.
11681         (TypeContainer::Populate): Update accordingly.
11682         (TypeContainer::FindMembers): Implement.
11683
11684 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
11685
11686         * statement.cs: (VariableInfo::VariableType): New field to be
11687         initialized with the full type once it is resolved. 
11688
11689 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
11690
11691         * parameter.cs (GetParameterInfo): Use a type cache to compute
11692         things only once, and to reuse this information
11693
11694         * expression.cs (LocalVariableReference::Emit): Implement.
11695         (OpcodeCast::Emit): fix.
11696
11697         (ParameterReference::Resolve): Implement.
11698         (ParameterReference::Emit): Implement.
11699
11700         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
11701         that are expressions need to stay as Expressions.
11702
11703         * typemanager.cs (CSharpName): Returns the C# name of a type if
11704         possible. 
11705
11706         * expression.cs (Expression::ConvertImplicit): New function that
11707         implements implicit type conversions.
11708
11709         (Expression::ImplicitReferenceConversion): Implements implicit
11710         reference conversions.
11711
11712         (EmptyCast): New type for transparent casts.
11713
11714         (OpcodeCast): New type for casts of types that are performed with
11715         a sequence of bytecodes.
11716         
11717         (BoxedCast): New type used for casting value types into reference
11718         types.  Emits a box opcode.
11719
11720         (Binary::DoNumericPromotions): Implements numeric promotions of
11721         and computation of the Binary::Type.
11722
11723         (Binary::EmitBranchable): Optimization.
11724
11725         (Binary::Emit): Implement code emission for expressions.
11726         
11727         * typemanager.cs (TypeManager): Added two new core types: sbyte
11728         and byte.
11729
11730 2001-09-12  Ravi Pratap  <ravi@ximian.com>
11731
11732         * class.cs (TypeContainer::FindMembers): Method which does exactly
11733         what Type.FindMembers does, only we don't have to use reflection. No
11734         implementation yet.
11735
11736         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
11737         typecontainer objects as we need to get at them.
11738         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
11739
11740         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
11741         typecontainer object.
11742
11743         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
11744         of just a Report object.
11745
11746 2001-09-11  Ravi Pratap  <ravi@ximian.com>
11747
11748         * class.cs (Event::Define): Go back to using the prefixes "add_" and
11749         "remove_"
11750         (TypeContainer::Populate): Now define the delegates of the type too.
11751         (TypeContainer.Delegates): Property to access the list of delegates defined
11752         in the type.
11753
11754         * delegates.cs (Delegate::Define): Implement partially.
11755
11756         * modifiers.cs (TypeAttr): Handle more flags.
11757
11758 2001-09-11  Ravi Pratap  <ravi@ximian.com>
11759
11760         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
11761         and not <=
11762         (Operator::Define): Re-write logic to get types by using the LookupType method
11763         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
11764         (Indexer::Define): Ditto.
11765         (Event::Define): Ditto.
11766         (Property::Define): Ditto.
11767         
11768 2001-09-10  Ravi Pratap  <ravi@ximian.com>
11769
11770         * class.cs (TypeContainer::Populate): Now define operators too. 
11771         (TypeContainer.Operators): New property to access the list of operators
11772         in a type.
11773         (Operator.OperatorMethodBuilder): New member to hold the method builder
11774         for the operator we are defining.
11775         (Operator::Define): Implement.
11776
11777 2001-09-10  Ravi Pratap  <ravi@ximian.com>
11778
11779         * class.cs (Event::Define): Make the prefixes of the accessor methods
11780         addOn_ and removeOn_ 
11781
11782         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
11783         of the location being passed in too. Ideally, this should go later since all
11784         error reporting should be done through the Report object.
11785
11786         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
11787         (Populate): Iterate thru the indexers we have and define them too.
11788         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
11789         for the get and set accessors.
11790         (Indexer::Define): Implement.
11791         
11792 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
11793
11794         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
11795         my previous implementation, did not work.
11796
11797         * typemanager.cs: Add a couple of missing types (the longs).
11798
11799         * literal.cs: Use TypeManager.bool_type instead of getting it.
11800
11801         * expression.cs (EventExpr): New kind of expressions.
11802         (Expressio::ExprClassFromMemberInfo): finish
11803
11804 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
11805
11806         * assign.cs: Emit stores to static fields differently.
11807
11808 2001-09-08  Ravi Pratap  <ravi@ximian.com>
11809
11810         * Merge in changes and adjust code to tackle conflicts. Backed out my
11811         code in Assign::Resolve ;-) 
11812
11813 2001-09-08  Ravi Pratap  <ravi@ximian.com>
11814
11815         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
11816         instead Report.Error and also pass in the location.
11817         (CSharpParser::Lexer): New readonly property to return the reference
11818         to the Tokenizer object.
11819         (declare_local_variables): Use Report.Error with location instead of plain 
11820         old error.
11821         (CheckDef): Ditto.
11822
11823         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
11824         (Operator.CheckBinaryOperator): Ditto.
11825
11826         * cs-parser.jay (operator_declarator): Update accordingly.
11827
11828         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
11829         (CheckBinaryOperator): Same here.
11830
11831         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
11832         on the name without any prefixes of namespace names etc. This is because we
11833         already might have something already fully qualified like 
11834         'System.Console.WriteLine'
11835
11836         * assign.cs (Resolve): Begin implementation. Stuck ;-)
11837
11838 2001-09-07  Ravi Pratap  <ravi@ximian.com>
11839
11840         * cs-tokenizer.cs (location): Return a string which also contains
11841         the file name.
11842
11843         * expression.cs (ElementAccess): New class for expressions of the
11844         type 'element access.'
11845         (BaseAccess): New class for expressions of the type 'base access.'
11846         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
11847         respectively.
11848         
11849         * cs-parser.jay (element_access): Implement action.
11850         (base_access): Implement actions.
11851         (checked_expression, unchecked_expression): Implement.
11852
11853         * cs-parser.jay (local_variable_type): Correct and implement.
11854         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
11855
11856         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
11857
11858         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
11859         name and the specifiers.
11860
11861         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
11862         
11863         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
11864         making them all public ;-)
11865
11866         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
11867         class anyways.
11868         
11869 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
11870
11871         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
11872         PropertyExprs.
11873         (FieldExpr, PropertyExprs): New resolved expressions.
11874         (SimpleName::MemberStaticCheck): Perform static checks for access
11875         to non-static fields on static methods. Maybe this should be
11876         generalized for MemberAccesses. 
11877         (SimpleName::ResolveSimpleName): More work on simple name
11878         resolution. 
11879
11880         * cs-parser.jay (primary_expression/qualified_identifier): track
11881         the parameter index.
11882
11883         * codegen.cs (CodeGen::Save): Catch save exception, report error.
11884         (EmitContext::EmitBoolExpression): Chain to expression generation
11885         instead of temporary hack.
11886         (::EmitStatementExpression): Put generic expression code generation.
11887
11888         * assign.cs (Assign::Emit): Implement variable assignments to
11889         local variables, parameters and fields.
11890
11891 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
11892
11893         * statement.cs (Block::GetVariableInfo): New method, returns the
11894         VariableInfo for a variable name in a block.
11895         (Block::GetVariableType): Implement in terms of GetVariableInfo
11896
11897         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
11898         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
11899
11900 2001-09-06  Ravi Pratap  <ravi@ximian.com>
11901
11902         * cs-parser.jay (operator_declaration): Continue on my quest : update
11903         to take attributes argument.
11904         (event_declaration): Ditto.
11905         (enum_declaration): Ditto.
11906         (indexer_declaration): Ditto.
11907         
11908         * class.cs (Operator::Operator): Update constructor accordingly.
11909         (Event::Event): Ditto.
11910
11911         * delegate.cs (Delegate::Delegate): Same here.
11912
11913         * enum.cs (Enum::Enum): Same here.
11914         
11915 2001-09-05  Ravi Pratap  <ravi@ximian.com>
11916
11917         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
11918
11919         * ../tests/cs0658.cs : New file to demonstrate error 0658.
11920
11921         * attribute.cs (Attributes): New class to encapsulate all attributes which were
11922         being passed around as an arraylist.
11923         (Attributes::AddAttribute): Method to add attribute sections.
11924
11925         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
11926         (struct_declaration): Update accordingly.
11927         (constant_declaration): Update.
11928         (field_declaration): Update.
11929         (method_header): Update.
11930         (fixed_parameter): Update.
11931         (parameter_array): Ditto.
11932         (property_declaration): Ditto.
11933         (destructor_declaration): Ditto.
11934         
11935         * class.cs (Struct::Struct): Update constructors accordingly.
11936         (Class::Class): Ditto.
11937         (Field::Field): Ditto.
11938         (Method::Method): Ditto.
11939         (Property::Property): Ditto.
11940         (TypeContainer::OptAttribute): update property's return type.
11941         
11942         * interface.cs (Interface.opt_attributes): New member.
11943         (Interface::Interface): Update to take the extra Attributes argument.
11944
11945         * parameter.cs (Parameter::Parameter): Ditto.
11946
11947         * constant.cs (Constant::Constant): Ditto.
11948
11949         * interface.cs (InterfaceMemberBase): New OptAttributes field.
11950         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
11951         the attributes as a parameter.
11952         (InterfaceProperty): Update constructor call.
11953         (InterfaceEvent): Ditto.
11954         (InterfaceMethod): Ditto.
11955         (InterfaceIndexer): Ditto.
11956
11957         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
11958         pass the attributes too.
11959         (interface_event_declaration): Ditto.
11960         (interface_property_declaration): Ditto.
11961         (interface_method_declaration): Ditto.
11962         (interface_declaration): Ditto.
11963
11964 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
11965
11966         * class.cs (Method::Define): Track the "static Main" definition to
11967         create an entry point. 
11968
11969         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
11970         EntryPoint if we find it. 
11971
11972         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
11973         (EmitContext::ig): Make this variable public.
11974
11975         * driver.cs: Make the default output file be the first file name
11976         with the .exe extension.  
11977
11978         Detect empty compilations
11979
11980         Handle various kinds of output targets.  Handle --target and
11981         rename -t to --dumper.
11982
11983         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
11984         methods inherited from Expression return now an Expression.  This
11985         will is used during the tree rewriting as we resolve them during
11986         semantic analysis.
11987
11988         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
11989         the spec.  Missing entirely is the information about
11990         accessability of elements of it.
11991
11992         (Expression::ExprClassFromMemberInfo): New constructor for
11993         Expressions that creates a fully initialized Expression based on
11994         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
11995         a Type.
11996
11997         (Invocation::Resolve): Begin implementing resolution of invocations.
11998         
11999         * literal.cs (StringLiteral):  Implement Emit.
12000
12001 2001-09-05  Ravi Pratap  <ravi@ximian.com>
12002
12003         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
12004         member.
12005         
12006 2001-09-04  Ravi Pratap  <ravi@ximian.com>
12007
12008         * cs-parser.jay (attribute_arguments): Implement actions.
12009         (attribute): Fix bug in production. Implement action.
12010         (attribute_list): Implement.
12011         (attribute_target): Implement.
12012         (attribute_target_specifier, opt_target_specifier): Implement
12013         (CheckAttributeTarget): New method to check if the attribute target
12014         is valid.
12015         (attribute_section): Implement.
12016         (opt_attributes): Implement.
12017
12018         * attribute.cs : New file to handle attributes.
12019         (Attribute): Class to hold attribute info.
12020
12021         * cs-parser.jay (opt_attribute_target_specifier): Remove production
12022         (attribute_section): Modify production to use 2 different rules to 
12023         achieve the same thing. 1 s/r conflict down !
12024         Clean out commented, useless, non-reducing dimension_separator rules.
12025         
12026         * class.cs (TypeContainer.attributes): New member to hold list
12027         of attributes for a type.
12028         (Struct::Struct): Modify to take one more argument, the attribute list.
12029         (Class::Class): Ditto.
12030         (Field::Field): Ditto.
12031         (Method::Method): Ditto.
12032         (Property::Property): Ditto.
12033         
12034         * cs-parser.jay (struct_declaration): Update constructor call to
12035         pass in the attributes too.
12036         (class_declaration): Ditto.
12037         (constant_declaration): Ditto.
12038         (field_declaration): Ditto.
12039         (method_header): Ditto.
12040         (fixed_parameter): Ditto.
12041         (parameter_array): Ditto.
12042         (property_declaration): Ditto.
12043
12044         * constant.cs (Constant::Constant): Update constructor similarly.
12045         Use System.Collections.
12046
12047         * parameter.cs (Parameter::Parameter): Update as above.
12048
12049 2001-09-02  Ravi Pratap  <ravi@ximian.com>
12050
12051         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
12052         (TypeContainer.delegates): New member to hold list of delegates.
12053
12054         * cs-parser.jay (delegate_declaration): Implement the action correctly 
12055         this time as I seem to be on crack ;-)
12056
12057 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
12058
12059         * rootcontext.cs (RootContext::IsNamespace): new function, used to
12060         tell whether an identifier represents a namespace.
12061
12062         * expression.cs (NamespaceExpr): A namespace expression, used only
12063         temporarly during expression resolution.
12064         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
12065         utility functions to resolve names on expressions.
12066
12067 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
12068
12069         * codegen.cs: Add hook for StatementExpressions. 
12070
12071         * class.cs: Fix inverted test for static flag in methods.
12072
12073 2001-09-02  Ravi Pratap  <ravi@ximian.com>
12074
12075         * class.cs (Operator::CheckUnaryOperator): Correct error number used
12076         to make it coincide with MS' number.
12077         (Operator::CheckBinaryOperator): Ditto.
12078
12079         * ../errors/errors.txt : Remove error numbers added earlier.
12080
12081         * ../errors/cs1019.cs : Test case for error # 1019
12082
12083         * ../errros/cs1020.cs : Test case for error # 1020
12084
12085         * cs-parser.jay : Clean out commented cruft.
12086         (dimension_separators, dimension_separator): Comment out. Ostensibly not
12087         used anywhere - non-reducing rule.
12088         (namespace_declarations): Non-reducing rule - comment out.
12089
12090         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
12091         with TypeContainer::AddEnum.
12092
12093         * delegate.cs : New file for delegate handling classes.
12094         (Delegate): Class for declaring delegates.
12095
12096         * makefile : Update.
12097
12098         * cs-parser.jay (delegate_declaration): Implement.
12099
12100 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
12101
12102         * class.cs (Event::Define): Implement.
12103         (Event.EventBuilder): New member.
12104
12105         * class.cs (TypeContainer::Populate): Update to define all enums and events
12106         we have.
12107         (Events): New property for the events arraylist we hold. Shouldn't we move to using
12108         readonly fields for all these cases ?
12109
12110 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
12111
12112         * class.cs (Property): Revamp to use the convention of making fields readonly.
12113         Accordingly modify code elsewhere.
12114
12115         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
12116         the Define method of the Property class.
12117
12118         * class.cs : Clean up applied patch and update references to variables etc. Fix 
12119         trivial bug.
12120         (TypeContainer::Populate): Update to define all the properties we have. Also
12121         define all enumerations.
12122
12123         * enum.cs (Define): Implement.
12124         
12125 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
12126
12127         * cs-parser.jay (overloadable_operator): The semantic value is an
12128         enum of the Operator class.
12129         (operator_declarator): Implement actions.
12130         (operator_declaration): Implement.
12131
12132         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
12133         validity of definitions.
12134         (Operator::CheckBinaryOperator): Static method to check for binary operators
12135         (TypeContainer::AddOperator): New method to add an operator to a type.
12136
12137         * cs-parser.jay (indexer_declaration): Added line to actually call the
12138         AddIndexer method so it gets added ;-)
12139
12140         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
12141         already taken care of by the MS compiler ?  
12142
12143 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
12144
12145         * class.cs (Operator): New class for operator declarations.
12146         (Operator::OpType): Enum for the various operators.
12147
12148 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
12149
12150         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
12151         ostensibly handle this in semantic analysis.
12152
12153         * cs-parser.jay (general_catch_clause): Comment out
12154         (specific_catch_clauses, specific_catch_clause): Ditto.
12155         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
12156         (catch_args, opt_catch_args): New productions.
12157         (catch_clause): Rewrite to use the new productions above
12158         (catch_clauses): Modify accordingly.
12159         (opt_catch_clauses): New production to use in try_statement
12160         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
12161         and re-write the code in the actions to extract the specific and
12162         general catch clauses by being a little smart ;-)
12163
12164         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
12165         Hooray, try and catch statements parse fine !
12166         
12167 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12168
12169         * statement.cs (Block::GetVariableType): Fix logic to extract the type
12170         string from the hashtable of variables.
12171
12172         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
12173         I end up making that mistake ;-)
12174         (catch_clauses): Fixed gross error which made Key and Value of the 
12175         DictionaryEntry the same : $1 !!
12176
12177 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12178
12179         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
12180
12181         * cs-parser.jay (event_declaration): Correct to remove the semicolon
12182         when the add and remove accessors are specified. 
12183
12184 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12185
12186         * cs-parser.jay (IndexerDeclaration): New helper class to hold
12187         information about indexer_declarator.
12188         (indexer_declarator): Implement actions.
12189         (parsing_indexer): New local boolean used to keep track of whether
12190         we are parsing indexers or properties. This is necessary because 
12191         implicit_parameters come into picture even for the get accessor in the 
12192         case of an indexer.
12193         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
12194
12195         * class.cs (Indexer): New class for indexer declarations.
12196         (TypeContainer::AddIndexer): New method to add an indexer to a type.
12197         (TypeContainer::indexers): New member to hold list of indexers for the
12198         type.
12199
12200 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
12201
12202         * cs-parser.jay (add_accessor_declaration): Implement action.
12203         (remove_accessor_declaration): Implement action.
12204         (event_accessors_declaration): Implement
12205         (variable_declarators): swap statements for first rule - trivial.
12206
12207         * class.cs (Event): New class to hold information about event
12208         declarations.
12209         (TypeContainer::AddEvent): New method to add an event to a type
12210         (TypeContainer::events): New member to hold list of events.
12211
12212         * cs-parser.jay (event_declaration): Implement actions.
12213
12214 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
12215
12216         * cs-parser.jay (dim_separators): Implement. Make it a string
12217         concatenating all the commas together, just as they appear.
12218         (opt_dim_separators): Modify accordingly
12219         (rank_specifiers): Update accordingly. Basically do the same
12220         thing - instead, collect the brackets here.
12221         (opt_rank_sepcifiers): Modify accordingly.
12222         (array_type): Modify to actually return the complete type string
12223         instead of ignoring the rank_specifiers.
12224         (expression_list): Implement to collect the expressions
12225         (variable_initializer): Implement. We make it a list of expressions
12226         essentially so that we can handle the array_initializer case neatly too.
12227         (variable_initializer_list): Implement.
12228         (array_initializer): Make it a list of variable_initializers
12229         (opt_array_initializer): Modify accordingly.
12230
12231         * expression.cs (New::NType): Add enumeration to help us
12232         keep track of whether we have an object/delegate creation
12233         or an array creation.
12234         (New:NewType, New::Rank, New::Indices, New::Initializers): New
12235         members to hold data about array creation.
12236         (New:New): Modify to update NewType
12237         (New:New): New Overloaded contructor for the array creation
12238         case.
12239
12240         * cs-parser.jay (array_creation_expression): Implement to call
12241         the overloaded New constructor.
12242         
12243 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
12244
12245         * class.cs (TypeContainer::Constructors): Return member
12246         constructors instead of returning null.
12247
12248 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
12249
12250         * typemanager.cs (InitCoreTypes): Initialize the various core
12251         types after we have populated the type manager with the user
12252         defined types (this distinction will be important later while
12253         compiling corlib.dll)
12254
12255         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
12256         on Expression Classification.  Now all expressions have a method
12257         `Resolve' and a method `Emit'.
12258
12259         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
12260         generation from working.     Also add some temporary debugging
12261         code. 
12262         
12263 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
12264
12265         * codegen.cs: Lots of code generation pieces.  This is only the
12266         beginning, will continue tomorrow with more touches of polish.  We
12267         handle the fundamentals of if, while, do, for, return.  Others are
12268         trickier and I need to start working on invocations soon.
12269         
12270         * gen-treedump.cs: Bug fix, use s.Increment here instead of
12271         s.InitStatement. 
12272
12273         * codegen.cs (EmitContext): New struct, used during code
12274         emission to keep a context.   Most of the code generation will be
12275         here. 
12276
12277         * cs-parser.jay: Add embedded blocks to the list of statements of
12278         this block.  So code generation proceeds in a top down fashion.
12279
12280 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
12281
12282         * statement.cs: Add support for multiple child blocks.
12283
12284 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
12285
12286         * codegen.cs (EmitCode): New function, will emit the code for a
12287         Block of code given a TypeContainer and its ILGenerator. 
12288
12289         * statement.cs (Block): Standard public readonly optimization.
12290         (Block::Block constructors): Link children. 
12291         (Block::Child): Child Linker.
12292         (Block::EmitVariables): Emits IL variable declarations.
12293
12294         * class.cs: Drop support for MethodGroups here, delay until
12295         Semantic Analysis.
12296         (Method::): Applied the same simplification that I did before, and
12297         move from Properties to public readonly fields.
12298         (Method::ParameterTypes): Returns the parameter types for the
12299         function, and implements a cache that will be useful later when I
12300         do error checking and the semantic analysis on the methods is
12301         performed.
12302         (Constructor::GetCallingConvention): Renamed from CallingConvetion
12303         and made a method, optional argument tells whether this is a class
12304         or a structure to apply the `has-this' bit.
12305         (Method::GetCallingConvention): Implement, returns the calling
12306         convention. 
12307         (Method::Define): Defines the type, a second pass is performed
12308         later to populate the methods.
12309
12310         (Constructor::ParameterTypes): implement a cache similar to the
12311         one on Method::ParameterTypes, useful later when we do semantic
12312         analysis. 
12313
12314         (TypeContainer::EmitMethod):  New method.  Emits methods.
12315
12316         * expression.cs: Removed MethodGroup class from here.
12317         
12318         * parameter.cs (Parameters::GetCallingConvention): new method.
12319
12320 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
12321
12322         * class.cs (TypeContainer::Populate): Drop RootContext from the
12323         argument. 
12324
12325         (Constructor::CallingConvention): Returns the calling convention.
12326         (Constructor::ParameterTypes): Returns the constructor parameter
12327         types. 
12328         
12329         (TypeContainer::AddConstructor): Keep track of default constructor
12330         and the default static constructor.
12331
12332         (Constructor::) Another class that starts using `public readonly'
12333         instead of properties. 
12334
12335         (Constructor::IsDefault): Whether this is a default constructor. 
12336
12337         (Field::) use readonly public fields instead of properties also.
12338
12339         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
12340         track of static constructors;  If none is used, turn on
12341         BeforeFieldInit in the TypeAttributes. 
12342
12343         * cs-parser.jay (opt_argument_list): now the return can be null
12344         for the cases where there are no arguments. 
12345
12346         (constructor_declarator): If there is no implicit `base' or
12347         `this', then invoke the default parent constructor. 
12348         
12349         * modifiers.cs (MethodAttr): New static function maps a set of
12350         modifiers flags into a MethodAttributes enum
12351         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
12352         MethodAttr, TypeAttr to represent the various mappings where the
12353         modifiers are used.
12354         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
12355
12356 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
12357
12358         * parameter.cs (GetParameterInfo): Fix bug where there would be no
12359         method arguments.
12360
12361         * interface.cs (PopulateIndexer): Implemented the code generator
12362         for interface indexers.
12363
12364 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
12365
12366         * interface.cs (InterfaceMemberBase): Now we track the new status
12367         here.  
12368
12369         (PopulateProperty): Implement property population.  Woohoo!  Got
12370         Methods and Properties going today. 
12371
12372         Removed all the properties for interfaces, and replaced them with
12373         `public readonly' fields. 
12374
12375 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
12376
12377         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
12378         initialize their hashtables/arraylists only when they are needed
12379         instead of doing this always.
12380
12381         * parameter.cs: Handle refs and out parameters.
12382
12383         * cs-parser.jay: Use an ArrayList to construct the arguments
12384         instead of the ParameterCollection, and then cast that to a
12385         Parameter[] array.
12386
12387         * parameter.cs: Drop the use of ParameterCollection and use
12388         instead arrays of Parameters.
12389
12390         (GetParameterInfo): Use the Type, not the Name when resolving
12391         types. 
12392
12393 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
12394
12395         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
12396         and instead use public readonly fields.
12397
12398         * class.cs: Put back walking code for type containers.
12399
12400 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
12401
12402         * class.cs (MakeConstant): Code to define constants.
12403
12404         * rootcontext.cs (LookupType): New function.  Used to locate types 
12405
12406         
12407 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
12408
12409         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
12410         this System.Reflection code is.  Kudos to Microsoft
12411         
12412         * typemanager.cs: Implement a type cache and avoid loading all
12413         types at boot time.  Wrap in LookupType the internals.  This made
12414         the compiler so much faster.  Wow.  I rule!
12415         
12416         * driver.cs: Make sure we always load mscorlib first (for
12417         debugging purposes, nothing really important).
12418
12419         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
12420         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
12421
12422         * rootcontext.cs: Lookup types on their namespace;  Lookup types
12423         on namespaces that have been imported using the `using' keyword.
12424
12425         * class.cs (TypeContainer::TypeAttr): Virtualize.
12426         (Class::TypeAttr): Return attributes suitable for this bad boy.
12427         (Struct::TypeAttr): ditto.
12428         Handle nested classes.
12429         (TypeContainer::) Remove all the type visiting code, it is now
12430         replaced with the rootcontext.cs code
12431
12432         * rootcontext.cs (GetClassBases): Added support for structs. 
12433
12434 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
12435
12436         * interface.cs, statement.cs, class.cs, parameter.cs,
12437         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
12438         Drop use of TypeRefs, and use strings instead.
12439
12440 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
12441
12442         * rootcontext.cs: 
12443
12444         * class.cs (Struct::Struct): set the SEALED flags after
12445         checking the modifiers.
12446         (TypeContainer::TypeAttr): new property, returns the
12447         TypeAttributes for a class.  
12448
12449         * cs-parser.jay (type_list): Oops, list production was creating a
12450         new list of base types.
12451
12452         * rootcontext.cs (StdLib): New property.
12453         (GetInterfaceTypeByName): returns an interface by type name, and
12454         encapsulates error handling here.
12455         (GetInterfaces): simplified.
12456         (ResolveTree): Encapsulated all the tree resolution here.
12457         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
12458         types. 
12459         
12460         * driver.cs: Add support for --nostdlib, to avoid loading the
12461         default assemblies.
12462         (Main): Do not put tree resolution here. 
12463
12464         * rootcontext.cs: Beginning of the class resolution.
12465
12466 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
12467
12468         * rootcontext.cs: Provide better error reporting. 
12469
12470         * cs-parser.jay (interface_base): set our $$ to be interfaces.
12471
12472         * rootcontext.cs (CreateInterface): Handle the case where there
12473         are no parent interfaces.
12474         
12475         (CloseTypes): Routine to flush types at the end.
12476         (CreateInterface): Track types.
12477         (GetInterfaces): Returns an array of Types from the list of
12478         defined interfaces.
12479
12480         * typemanager.c (AddUserType): Mechanism to track user types (puts
12481         the type on the global type hash, and allows us to close it at the
12482         end). 
12483         
12484 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
12485
12486         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
12487         RecordInterface instead.
12488
12489         * cs-parser.jay: Updated to reflect changes above.
12490
12491         * decl.cs (Definition): Keep track of the TypeBuilder type that
12492         represents this type here.  Not sure we will use it in the long
12493         run, but wont hurt for now.
12494
12495         * driver.cs: Smaller changes to accomodate the new code.
12496
12497         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
12498         when done. 
12499
12500         * rootcontext.cs (CreateInterface):  New method, used to create
12501         the System.TypeBuilder type for interfaces.
12502         (ResolveInterfaces): new entry point to resolve the interface
12503         hierarchy. 
12504         (CodeGen): Property, used to keep track of the code generator.
12505
12506 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
12507
12508         * cs-parser.jay: Add a second production for delegate_declaration
12509         with `VOID'.
12510
12511         (enum_body): Put an opt_comma here instead of putting it on
12512         enum_body or enum_member_declarations so we can handle trailing
12513         commas on enumeration members.  Gets rid of a shift/reduce.
12514         
12515         (type_list): Need a COMMA in the middle.
12516
12517         (indexer_declaration): Tell tokenizer to recognize get/set
12518
12519         * Remove old targets.
12520
12521         * Re-add the parser target.
12522
12523 2001-07-13  Simon Cozens <simon@simon-cozens.org>
12524
12525         * cs-parser.jay: Add precendence rules for a number of operators
12526         ot reduce the number of shift/reduce conflicts in the grammar.
12527         
12528 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
12529
12530         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
12531         and put it here.
12532
12533         Get rid of old crufty code.
12534
12535         * rootcontext.cs: Use this to keep track of the parsed
12536         representation and the defined types available to the program. 
12537
12538         * gen-treedump.cs: adjust for new convention.
12539
12540         * type.cs: Split out the type manager, and the assembly builder
12541         from here. 
12542
12543         * typemanager.cs: the type manager will live here now.
12544
12545         * cil-codegen.cs: And the code generator here. 
12546
12547 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
12548
12549         * makefile: Fixed up for easy making.
12550
12551 2001-07-13  Simon Cozens <simon@simon-cozens.org>
12552
12553         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
12554         the 
12555
12556         (unary_expression): Expand pre_increment_expression and
12557         post_decrement_expression to reduce a shift/reduce.
12558
12559 2001-07-11  Simon Cozens
12560
12561         * cs-tokenizer.cs: Hex numbers should begin with a 0.
12562
12563         Improve allow_keyword_as_indent name.
12564
12565 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
12566
12567         * Adjustments for Beta2. 
12568
12569 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
12570
12571         * decl.cs: Added `Define' abstract method.
12572         (InTransit): new property, used to catch recursive definitions. 
12573
12574         * interface.cs: Implement `Define'. 
12575
12576         * modifiers.cs: Map Modifiers.constants to
12577         System.Reflection.TypeAttribute flags.
12578
12579         * class.cs: Keep track of types and user-defined types.
12580         (BuilderInit): New method for creating an assembly
12581         (ResolveType): New function to launch the resolution process, only
12582         used by interfaces for now.
12583
12584         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
12585         that are inserted into the name space. 
12586
12587 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
12588
12589         * ARGH.  I have screwed up my tree so many times due to the use of
12590         rsync rather than using CVS.  Going to fix this at once. 
12591
12592         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
12593         load types.
12594
12595 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
12596
12597         * Experiment successful: Use System.Type rather that our own
12598         version of Type.  
12599
12600 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
12601
12602         * cs-parser.jay: Removed nsAliases from here.
12603
12604         Use new namespaces, handle `using XXX;' 
12605
12606         * namespace.cs: Reimplemented namespace handling, use a recursive
12607         definition of the class.  Now we can keep track of using clauses
12608         and catch invalid using clauses.
12609
12610 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
12611
12612         * gen-treedump.cs: Adapted for all the renaming.
12613
12614         * expression.cs (Expression): this class now has a Type property
12615         which returns an expression Type.
12616
12617         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
12618         `Type', as this has a different meaning now in the base
12619
12620 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
12621
12622         * interface.cs, class.cs: Removed from all the sources the
12623         references to signature computation, as we can not do method
12624         signature computation during the parsing time, as we are not
12625         trying to solve at that point distinguishing:
12626
12627         class X {
12628                 void a (Blah x) {}
12629                 void a (NS.Blah x) {}
12630         }
12631
12632         Which depending on the context might be valid or not, as we do not
12633         know if Blah is the same thing as NS.Blah at that point.
12634
12635         * Redid everything so the code uses TypeRefs now instead of
12636         Types.  TypeRefs are just temporary type placeholders, that need
12637         to be resolved.  They initially have a pointer to a string and the
12638         current scope in which they are used.  This is used later by the
12639         compiler to resolve the reference to an actual Type. 
12640
12641         * DeclSpace is no longer a CIR.Type, and neither are
12642         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
12643         are all DeclSpaces, but no Types. 
12644
12645         * type.cs (TypeRefManager): This implements the TypeRef manager,
12646         which keeps track of all the types that need to be resolved after
12647         the parsing has finished. 
12648
12649 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
12650
12651         * ARGH.  We are going to have to store `foreach' as a class rather
12652         than resolving it, as we need to verify error 1579 after name
12653         resolution.   *OR* we could keep a flag that says `This request to
12654         IEnumerator comes from a foreach statement' which we can then use
12655         to generate the error.
12656
12657 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
12658
12659         * class.cs (TypeContainer.AddMethod): we now add methods to the
12660         MethodGroup instead of the method hashtable.  
12661
12662         * expression.cs: Add MethodGroup abstraction, which gets us one
12663         step closer to the specification in the way we handle method
12664         declarations.  
12665
12666         * cs-parser.jay (primary_expression): qualified_identifier now
12667         tried to match up an identifier to a local variable reference or
12668         to a parameter reference.
12669
12670         current_local_parameters is now a parser global variable that
12671         points to the current parameters for the block, used during name
12672         lookup.
12673
12674         (property_declaration): Now creates an implicit `value' argument to
12675         the set accessor.
12676
12677 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
12678
12679         * parameter.cs: Do not use `param' arguments as part of the
12680         signature, per the spec.
12681
12682 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
12683
12684         * decl.cs: Base class for classes, structs and interfaces.  This
12685         is the "Declaration Space" 
12686
12687         * cs-parser.jay: Use CheckDef for checking declaration errors
12688         instead of having one on each function.
12689
12690         * class.cs: Factor out some code for handling error handling in
12691         accordance to the "Declarations" section in the "Basic Concepts"
12692         chapter in the ECMA C# spec.
12693
12694         * interface.cs: Make all interface member classes derive from
12695         InterfaceMemberBase.
12696
12697 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
12698
12699         * Many things: all interfaces are parsed and generated in
12700         gen-treedump.  Support for member variables, constructors,
12701         destructors, properties, constants is there.
12702
12703         Beginning of the IL backend, but very little done, just there for
12704         testing purposes. 
12705
12706 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
12707
12708         * cs-parser.jay: Fix labeled statement.
12709
12710         * cs-tokenizer.cs (escape): Escape " and ' always.
12711         ref_line, ref_name: keep track of the line/filename as instructed
12712         by #line by the compiler.
12713         Parse #line.
12714
12715 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
12716
12717         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
12718         to match the values in System.CodeDOM.
12719
12720         Divid renamed to Divide.
12721
12722         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
12723         statements. 
12724         (Statements.set): remove.
12725
12726         * System.CodeDOM/CodeCatchClause.cs: always have a valid
12727         statements. 
12728
12729         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
12730         falseStatements always have valid values. 
12731
12732         * cs-parser.jay: Use System.CodeDOM now.
12733