4690a860f13b6ebaeb4afb9594c1772b5461e6bb
[mono.git] / mcs / mcs / ChangeLog
1 2003-09-07  Martin Baulig  <martin@ximian.com>
2
3         * report.cs (Error, Warning): Added overloaded versions which take
4         a `params object[] args' and call String.Format().
5
6 2003-09-07  Martin Baulig  <martin@ximian.com>
7
8         * decl.cs (DeclSpace..ctor): Don't call
9         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11         (DeclSpace.RecordDecl): New method.
12
13         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14
15 2003-09-02  Ravi Pratap  <ravi@ximian.com>
16
17         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
18         value attributes to be applied to ParameterBuilders.
19
20         * class.cs (MethodCore.LabelParameters): Make static and more
21         generic so that it can be used from other places - like interface
22         methods, for instance.
23
24         * interface.cs (Interface.Emit): Call LabelParameters before
25         emitting attributes on the InterfaceMethod.
26
27 2003-08-26  Martin Baulig  <martin@ximian.com>
28
29         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
30         resolving aliases; fixes #47927.
31
32 2003-08-26  Martin Baulig  <martin@ximian.com>
33
34         * statement.cs (Using.DoResolve): This is internally emitting a
35         try/finally clause, so we need to set ec.NeedExplicitReturn if we
36         do not always return.  Fixes #47681.
37
38 2003-08-26  Martin Baulig  <martin@ximian.com>
39
40         * decl.cs (MemberCore): Moved WarningNotHiding(),
41         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
42         into MemberBase.
43         (AdditionResult): Make this nested in DeclSpace.
44         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
45         argument; call NamespaceEntry.Define() unless we're nested in a
46         class or struct.
47
48         * namespace.cs (Namespace.DefineName): New public function.  This
49         is called from DeclSpace's .ctor to add 
50         (Namespace.Lookup): Include DeclSpaces in the lookup.
51
52         * class.cs (Operator): Derive from MemberBase, not MemberCore.
53
54         * const.cs (Const): Derive from MemberBase, not MemberCore.     
55
56 2003-08-25  Martin Baulig  <martin@ximian.com>
57
58         * convert.cs (Convert.ExplicitReferenceConversion): When
59         converting from an interface type to a class, unbox if the target
60         type is a struct type.  Fixes #47822.
61
62 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
63
64         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
65         #47854.
66
67 2003-08-22  Martin Baulig  <martin@ximian.com>
68
69         * class.cs (TypeManager.DefineType): When defining a nested type,
70         call DefineType() on our parent; fixes #47801.
71
72 2003-08-22  Martin Baulig  <martin@ximian.com>
73
74         * class.cs (MethodData.Define): While checking if a method is an
75         interface implementation, improve the test a bit more to fix #47654.
76
77 2003-08-22  Martin Baulig  <martin@ximian.com>
78
79         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
80         correctly; fixes #47722.
81
82 2003-08-22  Martin Baulig  <martin@ximian.com>
83
84         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
85         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
86
87         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
88
89 2003-08-22  Martin Baulig  <martin@ximian.com>
90
91         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
92         can only be assigned in static constructors.  Fixes #47161.
93
94 2003-08-22  Martin Baulig  <martin@ximian.com>
95
96         Rewrote and improved the flow analysis code.
97
98         * flowbranching.cs (FlowBranching): Make this class abstract.
99         (FlowBranching.CreateBranching): New static function to create a
100         new flow branching.
101         (FlowBranchingBlock, FlowBranchingException): New classes.
102         (FlowBranching.UsageVector.Type): New public readonly field.
103         (FlowBranching.UsageVector.Breaks): Removed the setter.
104         (FlowBranching.UsageVector.Returns): Removed the setter.
105         (FlowBranching.UsageVector): Added Break(), Return(),
106         NeverReachable() and Throw() methods to modify the reachability.
107         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
108         done by FlowBranching.Merge().
109         (FlowBranching.UsageVector.MergeChild): New method; merges the
110         merge result into the current vector.
111         (FlowBranching.Merge): New abstract method to merge a branching.
112
113 2003-08-12  Martin Baulig  <martin@ximian.com>
114
115         * expression.cs (Indirection.CacheTemporaries): Create the
116         LocalTemporary with the pointer type, not its element type.
117
118 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
119
120         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
121         token was a keyword or not.
122
123         Add `error' options where an IDENTIFIER was expected;  Provide
124         CheckToken and CheckIdentifierToken convenience error reporting
125         functions. 
126
127         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
128
129         * decl.cs: Rename `NamespaceEntry Namespace' public field into
130         NameSpaceEntry NameSpaceEntry.
131
132         (LookupInterfaceOrClass): Avoid creating a full qualified name
133         from namespace and name: avoid doing lookups when we know the
134         namespace is non-existant.   Use new Tree.LookupByNamespace which
135         looks up DeclSpaces based on their namespace, name pair.
136
137         * driver.cs: Provide a new `parser verbose' to display the
138         exception thrown during parsing.  This is turned off by default
139         now, so the output of a failure from mcs is more graceful.
140
141         * namespace.cs: Track all the namespaces defined in a hashtable
142         for quick lookup.
143         
144         (IsNamespace): New method
145
146 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
147
148         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
149         we know that we need to concatenate (full typename can never be
150         null). 
151
152         * class.cs: ditto.
153
154         * statement.cs: Use a bitfield;  Do not initialize to null things
155         which are done by the constructor by default.
156
157         * cs-parser.jay: bug fix, parameter was 4, not 3.
158
159         * expression.cs: Just use the property;
160
161         * statement.cs: No need for GetVariableInfo method.
162
163 2003-08-08  Martin Baulig  <martin@ximian.com>
164
165         * flowanalysis.cs (FlowReturns): This is now nested in the
166         `FlowBranching' class.
167         (MyBitVector): Moved this here from statement.cs.
168         (FlowBranching.SiblingType): New enum type.
169         (FlowBranching.CreateSibling): Added `SiblingType' argument.
170
171 2003-08-07  Martin Baulig  <martin@ximian.com>
172
173         * flowanalysis.cs (FlowBranchingType): This is now nested in the
174         `FlowBranching' class and called `BranchingType'.
175
176 2003-08-07  Martin Baulig  <martin@ximian.com>
177
178         * flowanalysis.cs: Moved all the control flow analysis code into
179         its own file.
180
181 2003-08-07  Martin Baulig  <martin@ximian.com>
182
183         * assign.cs (Assign.DoResolve): `target' must either be an
184         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
185         #37319.
186
187 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
188
189         * expression.cs (BinaryMethod): This kind of expression is created by the
190         Binary class if it determines that the operator has to be handled
191         by a method.
192
193         (BinaryDelegate): This kind of expression is created if we are
194         dealing with a + or - operator on delegates.
195
196         (Binary): remove method, argumetns, and DelegateOperator: when
197         dealing with methods, 
198         
199         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
200
201         * statement.cs (Block): use bitfields for the three extra booleans
202         we had in use.   Remove unused topblock parameter.
203
204         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
205
206         * assign.cs: Drop extra unneeded tests.
207
208 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
209
210         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
211
212         * statement.cs (Foreach): Use VariableStorage instead of
213         LocalBuilders.   
214
215         * codegen.cs (VariableStorage): New class used by clients that
216         require a variable stored: locals or fields for variables that
217         need to live across yield.
218
219         Maybe provide a convenience api for EmitThis+EmitLoad?
220
221         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
222         these bad boys.
223
224 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
225
226         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
227         RemapParameterLValue): New methods that are used to turn a
228         precomputed FieldInfo into an expression like this:
229
230                 instance.FieldInfo
231
232         The idea is to use this instead of making LocalVariableReference
233         have more than one meaning.
234
235         * cs-parser.jay: Add error production to BASE.
236
237         * ecore.cs: Deal with TypeManager.GetField returning null, which
238         is now a valid return value.
239
240         (FieldExprNoAddress): New expression for Fields whose address can
241         not be taken.
242
243         * expression.cs (LocalVariableReference): During the resolve
244         phases, create new expressions if we are in a remapping context.
245         Remove code that dealt with remapping here.
246
247         (ParameterReference): same.
248
249         (ProxyInstance): New expression, like the `This' expression, but
250         it is born fully resolved.  We know what we are doing, so remove
251         the errors that are targeted to user-provided uses of `this'.
252
253         * statement.cs (Foreach): our variable is now stored as an
254         Expression;  During resolution, follow the protocol, dont just
255         assume it will return this.
256         
257 2003-08-06  Martin Baulig  <martin@ximian.com>
258
259         * support.cs (SeekableStreamReader.cs): New public class.
260
261         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
262         SeekableStreamReader instead of the normal StreamReader.
263
264 2003-08-04  Martin Baulig  <martin@ximian.com>
265
266         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
267         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
268         deambiguate casts and delegate invocations.
269         (parenthesized_expression): Use the new tokens to ensure this is
270         not a cast of method invocation.
271
272         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
273         when reading a `)' and Deambiguate_CloseParens () was previously
274         called.
275
276         * expression.cs (ParenthesizedExpression): New class.  This is
277         just used for the CS0075 test.
278         (Binary.DoResolve): Check for CS0075.   
279
280 2003-07-29  Ravi Pratap  <ravi@ximian.com>
281
282         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
283         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
284         reference comparison.
285
286         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
287         examine the ReturnType for equality - this is necessary in the
288         cases of implicit and explicit operators whose signature also
289         includes the return type.
290
291 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
292
293         * namespace.cs: Cache the result of the namespace computation,
294         instead of computing it every time.
295
296 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
297
298         * decl.cs: Use a global arraylist that we reuse over invocations
299         to avoid excesive memory consumption.  Reduces memory usage on an
300         mcs compile by one meg (45 average).
301
302         * typemanager.cs (LookupTypeReflection): In .NET pointers are
303         private, work around that.
304
305 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
306
307         * literal.cs (IntLiteral): Define Zero and One static literals. 
308
309         * cs-parser.jay (integer_literal): use static literals to reduce
310         memory usage for the most used literals (0, 1 and -1).  211kb
311         reduced in memory usage.
312
313         Replace all calls to `new ArrayList' with `new
314         ArrayList(4)' which is a good average number for most allocations,
315         and also requires only 16 bytes of memory for its buffer by
316         default. 
317
318         This reduced MCS memory usage in seven megabytes for the RSS after
319         bootstrapping.
320
321 2003-07-28  Ravi Pratap  <ravi@ximian.com>
322
323         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
324         handle params methods the correct way by forming only one
325         applicable set with params and normal methods in them. Earlier we
326         were looking at params methods only if we found no normal methods
327         which was not the correct thing to do.
328
329         (Invocation.BetterFunction): Take separate arguments indicating
330         when candidate and the best method are params methods in their
331         expanded form.
332
333         This fixes bugs #43367 and #46199.
334
335         * attribute.cs: Documentation updates.
336
337         (CheckAttribute): Rename to CheckAttributeTarget.
338         (GetValidPlaces): Rename to GetValidTargets.
339
340         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
341         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
342
343         Fixes bug #44468.
344
345 2003-07-28  Martin Baulig  <martin@ximian.com>
346
347         * class.cs (TypeContainer.DefineMembers): Use the base type's full
348         name when looking up the base class of a nested class.  Fixes #46977.
349
350 2003-07-26  Martin Baulig  <martin@ximian.com>
351
352         * expression.cs (Indexers.Indexer): New nested struct; contains
353         getter, setter and the indexer's type.
354         (Indexers.Properties): This is now an ArrayList of
355         Indexers.Indexer's.
356         (IndexerAccess.DoResolveLValue): Correctly set the type if the
357         indexer doesn't have any getters.
358
359         * assign.cs (Assign.DoResolve): Also do the implicit conversions
360         for embedded property and indexer assignments.
361
362 2003-07-26  Martin Baulig  <martin@ximian.com>
363
364         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
365         preprocessor directive is not the first non-whitespace character
366         on a line.
367
368 2003-07-26  Martin Baulig  <martin@ximian.com>
369
370         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
371         namespace parsing, follow the spec more closely.
372
373         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
374         NamespaceEntry.Lookup().
375
376 2003-07-25  Martin Baulig  <martin@ximian.com>
377
378         * MethodCore.cs (OverridesSomething): New public field; it's set
379         from TypeContainer.DefineMembers if this method overrides
380         something (which doesn't need to be a method).  Fix #39462.
381
382 2003-07-25  Ravi Pratap  <ravi@ximian.com>
383
384         * typemanager.cs (GetMembers): Ensure that the list of members is
385         reversed. This keeps things in sync.
386
387         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
388         find an AttributeUsage attribute.
389
390         * expression.cs (Invocation.OverloadResolve): Perform the check
391         which disallows Invoke to be directly called on a Delegate.
392
393         (Error_InvokeOnDelegate): Report error cs1533.
394         
395 2003-07-25  Martin Baulig  <martin@ximian.com>
396
397         * expression.cs (Indexers.GetIndexersForType): Only look in the
398         interface hierarchy if the requested type is already an
399         interface.  Fixes #46788 while keeping #46502 fixed.
400
401 2003-07-25  Martin Baulig  <martin@ximian.com>
402
403         * class.cs (TypeContainer.DefineMembers): Check whether all
404         readonly fields have been assigned and report warning CS0649 if
405         not.
406
407         * statement.cs (LocalInfo.IsFixed): Always return true if this is
408         a valuetype.
409
410 2003-07-24  Ravi Pratap  <ravi@ximian.com>
411
412         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
413         returned from GetMethods to make things consistent with the
414         assumptions MCS makes about ordering of methods.
415
416         This should comprehensively fix bug #45127 and it does :-)
417
418         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
419         ordering is actually reverse.
420
421         * Clean up some debug messages I left lying around.
422
423         * interface.cs (Populate*): Get rid of code which emits attributes
424         since the stage in which we emit attributes is the 'Emit' stage,
425         not the define stage.
426
427         (Emit): Move attribute emission for interface members here.
428         
429 2003-07-22  Ravi Pratap  <ravi@ximian.com>
430
431         * expression.cs (Invocation.OverloadResolve): Follow the spec more
432         closely: we eliminate methods in base types when we have an
433         applicable method in a top-level type.
434
435         Please see section 14.5.5.1 for an exact description of what goes
436         on. 
437
438         This fixes bug #45127 and a host of other related to corlib compilation.
439
440         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
441         array is the method corresponding to the top-level type (this is
442         because of the changes made to icall.c) so we change this
443         accordingly.
444
445         (MethodGroupExpr.Name): This too.
446
447         * typemanager.cs (GetElementType): New method which does the right
448         thing when compiling corlib. 
449
450         * everywhere: Make use of the above in the relevant places.
451
452 2003-07-22  Martin Baulig  <martin@ximian.com>
453
454         * cs-parser.jay (invocation_expression): Moved
455         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
456         `cast_expression', but create a InvocationOrCast which later
457         resolves to either an Invocation or a Cast.
458
459         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
460         method; call this before EmitStatement() to make sure that this
461         expression can be used as a statement.
462
463         * expression.cs (InvocationOrCast): New class; resolves to either
464         an Invocation or a Cast.
465
466         * statement.cs (StatementExpression): Call ResolveStatement() on
467         the ExpressionStatement before emitting it.
468
469 2003-07-21  Martin Baulig  <martin@ximian.com>
470
471         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
472         `ref' and `out' attributes match; fixes #46220.
473         (MemberAccess.ResolveMemberAccess): You can't reference a type
474         through an expression; fixes #33180.
475         (Indexers.GetIndexersForType): Don't return the indexers from
476         interfaces the class implements; fixes #46502.
477
478 2003-07-21  Martin Baulig  <martin@ximian.com>
479
480         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
481         CS0661 checks; fixes bug #30442.
482
483 2003-07-21  Martin Baulig  <martin@ximian.com>
484
485         * decl.cs (AdditionResult): Added `Error'.
486
487         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
488
489         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
490         makes cs0031.cs actually work.
491
492 2003-07-20  Martin Baulig  <martin@ximian.com>
493
494         * namespace.cs: Fixed that bug which caused a crash when compiling
495         the debugger's GUI.
496
497 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
498
499         * typemanager.cs (LookupTypeReflection): Never expose types which
500         are NotPublic, NestedPrivate, NestedAssembly, or
501         NestedFamANDAssem.  We used to return these, and later do a check
502         that would report a meaningful error, but the problem is that we
503         would not get the real match, if there was a name override.
504
505 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
506
507         * namespace.cs (Namespace, Name): Do not compute the namespace
508         name dynamically, compute it in the constructor.  This reduced
509         memory usage by 1697 KB.
510
511         * driver.cs: Use --pause to pause at the end.
512
513 2003-07-17  Peter Williams  <peter@newton.cx>
514
515         * Makefile: Change the name of the test target so that it doesn't
516         conflict with the recursive test target.
517
518 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
519
520         * expression.cs (LocalVariableReference.Emit, EmitAssign,
521         AddressOf): Do not use EmitThis, that was wrong, use the actual
522         this pointer.
523
524 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
525
526         * class.cs (MethodData.Define): While checking if a method is an
527         interface implementation, improve the test: If we are not public
528         (use new test here: use the computed MethodAttributes directly,
529         instead of the parsed modifier flags) check if the `implementing'
530         method comes from an interface or not.
531
532         * pending.cs (VerifyPendingMethods): Slightly better error
533         message.
534
535         * makefile: add test target that does the mcs bootstrap.
536
537 2003-07-16  Ravi Pratap  <ravi@ximian.com>
538
539         * interface.cs (Define): Do nothing here since there are no
540         members to populate etc. Move the attribute emission out of here
541         since this was just totally the wrong place to put it. Attribute
542         application happens during the 'Emit' phase, not in the 'Define'
543         phase.
544
545         (Emit): Add this method and move the attribute emission here
546
547         * rootcontext.cs (EmitCode): Call the Emit method on interface
548         types too.
549
550 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
551
552         * expression.cs (OverloadResolve): Report error only if Location
553         is not 'Null' which means that there was a probe going on.
554
555 2003-07-14  Martin Baulig  <martin@ximian.com>
556
557         * expression.cs (ConditionalLogicalOperator): New public class to
558         implement user defined conditional logical operators.
559         This is section 14.11.2 in the spec and bug #40505.
560
561 2003-07-14  Martin Baulig  <martin@ximian.com>
562
563         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
564
565 2003-07-14  Martin Baulig  <martin@ximian.com>
566
567         * codegen.cs (EmitContext.InFixedInitializer): New public field.
568
569         * ecore.cs (IVariable.VerifyFixed): New interface method.
570
571         * expression.cs (Unary.ResolveOperator): When resolving the `&'
572         operator, check whether the variable is actually fixed.  Fixes bug
573         #36055.  Set a variable definitely assigned when taking its
574         address as required by the spec.
575
576         * statement.cs (LocalInfo.IsFixed): New field.
577         (LocalInfo.MakePinned): Set `IsFixed' to true.
578
579 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
580
581         * attribute.cs (Attribute.Resolve): While doing a Member lookup
582         for .ctors, ensure that we only ask for members declared in the
583         attribute type (BindingFlags.DeclaredOnly).
584
585         Fixes bug #43632.
586
587         * expression.cs (Error_WrongNumArguments): Report error 1501
588         correctly the way CSC does.
589
590 2003-07-13  Martin Baulig  <martin@ximian.com>
591
592         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
593         lookup on the fully qualified name, to make things like "X.X" work
594         where "X.X" is a fully qualified type name, but we also have a
595         namespace "X" in the using list.  Fixes #41975.
596
597 2003-07-13  Martin Baulig  <martin@ximian.com>
598
599         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
600         function. If we're a CompoundAssign, we need to create an embedded
601         CompoundAssign, not an embedded Assign.
602         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
603         Fixes #45854.
604
605 2003-07-13  Martin Baulig  <martin@ximian.com>
606
607         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
608         work to fix bug #46088.
609
610 2003-07-13  Ravi Pratap <ravi@ximian.com>
611
612         * class.cs (Operator.Emit): Do not emit attributes here - it is
613         taken care of by the Method class that we delegate too. This takes
614         care of bug #45876.
615         
616 2003-07-10  Martin Baulig  <martin@ximian.com>
617
618         * expression.cs (TypeOfVoid): New class.
619         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
620
621 2003-07-10  Martin Baulig  <martin@ximian.com>
622
623         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
624         bug #35957.
625
626 2003-07-10  Martin Baulig  <martin@ximian.com>
627
628         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
629         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
630
631         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
632
633         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
634
635 2003-07-10  Martin Baulig  <martin@ximian.com>
636
637         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
638         of decimal.  Fixes #42850.
639
640         NOTE: I also fixed the created byte blob, but this doesn't work on
641         the MS runtime and csc never produces any byte blobs for decimal
642         arrays.
643
644 2003-07-10  Martin Baulig  <martin@ximian.com>
645
646         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
647         structs; fixes #32068.
648         (Block.AddChildVariableNames): Fixed #44302.
649
650 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
651
652         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
653         
654 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
655
656         * attribute.cs: And this test is onger needed.
657
658 2003-07-08  Martin Baulig  <martin@ximian.com>
659
660         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
661         inaccessible types.  Fixes #36313.
662
663         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
664
665         * namespace.cs (NamespaceEntry): Create implicit entries for all
666         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
667         implicit entries for N1.N2 and N1.
668
669 2003-07-08  Martin Baulig  <martin@ximian.com>
670
671         Rewrote the handling of namespaces to fix a lot of the issues
672         wrt. `using' aliases etc.
673
674         * namespace.cs (Namespace): Splitted this class into a
675         per-assembly `Namespace' and a per-file `NamespaceEntry'.
676
677         * typemanager.cs (TypeManager.IsNamespace): Removed.
678         (TypeManager.ComputeNamespaces): Only compute namespaces from
679         loaded assemblies here, not the namespaces from the assembly we're
680         currently compiling.
681
682 2003-07-08  Martin Baulig  <martin@ximian.com>
683
684         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
685
686 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
687
688         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
689         already fixed it.  
690
691         I thought about the memory savings here, but LookupTypeReflection
692         is used under already very constrained scenarios.  Compiling
693         corlib or mcs only exposes one hit, so it would not really reduce
694         any memory consumption.
695
696 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
697
698         * typemanager.cs: fixes bug #45889 by only adding public types from
699         other assemblies to the list of known types.
700
701 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
702
703         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
704         on the type we resolved.
705
706 2003-07-05  Martin Baulig  <martin@ximian.com>
707
708         * pending.cs (PendingImplementation.ParentImplements): Don't
709         create the proxy if the parent is abstract.
710
711         * class.cs (TypeContainer.DefineIndexers): Process explicit
712         interface implementations first.  Fixes #37714.
713
714 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
715
716         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
717         defined recursively;  but since we modify the input parameters
718         (left is set to `this' temporarily), we reset this value if the
719         left_is_explicit is false, which gives the original semantics to
720         the code.  
721
722         * literal.cs (NullPointer): new class used to represent a null
723         literal in a pointer context.
724
725         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
726         type is a pointer, use a NullPointer object instead of a
727         NullLiteral.   Closes 43687
728
729         (ExplicitConversion): Convert pointer values using
730         the conv opcode to the proper type.
731
732         * ecore.cs (New): change ValueTypeVariable property into a method,
733         that returns whether the valuetype is suitable for being used.
734
735         * expression.cs (Binary.DoNumericPromotions): Only return if we
736         the int constant was a valid uint, and we can return both left and
737         right as uints.  If not, we continue processing, to trigger the
738         type conversion.  This fixes 39018.
739
740         * statement.cs (Block.EmitMeta): During constant resolution, set
741         the CurrentBlock property on the emitcontext, so that we resolve
742         constants propertly.
743
744 2003-07-02  Martin Baulig  <martin@ximian.com>
745
746         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
747         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
748
749         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
750         than emitting it here.
751
752         * statement.cs: Fixed some more flow analysis bugs.
753
754 2003-07-02  Martin Baulig  <martin@ximian.com>
755
756         * class.cs (MethodData.Define): When implementing interface
757         methods, set Final unless we're Virtual.
758
759         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
760         check work for interface methods.
761
762 2003-07-01  Martin Baulig  <martin@ximian.com>
763
764         * ecore.cs (EmitContext.This): Replaced this property with a
765         GetThis() method which takes a Location argument.  This ensures
766         that we get the correct error location for a CS0188.
767
768 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
769
770         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
771         ImplicitStandardConversion.
772
773         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
774
775 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
776
777         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
778         optimization.
779
780 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
781
782         * class.cs (Constructor.Define): Turn off initlocals for unsafe
783         constructors.
784
785         (MethodData.Define): Turn off initlocals for unsafe methods.
786
787 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
788
789         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
790         complete;  Fixes #37521.
791
792         * delegate.cs: Use Modifiers.TypeAttr to compute the
793         TypeAttributes, instead of rolling our own.  This makes the flags
794         correct for the delegates.
795
796 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
797
798         * class.cs (Constructor.Define): Set the private flag for static
799         constructors as well.
800
801         * cs-parser.jay (statement_expression): Set the return value to
802         null, to avoid a crash when we catch an error.
803
804 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
805
806         * cs-parser.jay: Applied patch from Jackson that adds support for
807         extern and unsafe modifiers to destructor declarations.
808
809         * expression.cs: Report error 21 if the user is trying to index a
810         System.Array.
811
812         * driver.cs: Add an error message, suggested by the bug report.
813
814         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
815         if we do not have a ": this ()" constructor initializer.  Fixes 45149
816
817 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
818
819         * namespace.cs: Add some information to reduce FAQs.
820
821 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
822
823         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
824         underlying enumeration types.  Fixes #43915.
825
826         * expression.cs: Treat ushort/short as legal values to be used in
827         bitwise operations.
828
829 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
830
831         * delegate.cs: transfer custom attributes for paramenters from
832         the delegate declaration to Invoke and BeginInvoke.
833
834 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
835
836         * attribute.cs: handle custom marshalers and emit marshal info
837         for fields, too.
838
839 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
840
841         * makefile.gnu: Added anonymous.cs to the compiler sources.
842
843 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
844
845         * iterators.cs: Change the name of the proxy class to include two
846         underscores.
847
848         * cs-parser.jay: Update grammar to include anonymous methods.
849         
850         * anonymous.cs: new file.
851
852 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
853
854         * class.cs (Field.Define): Add missing test for pointers and
855         safety. 
856
857 2003-05-27  Ravi Pratap  <ravi@ximian.com>
858
859         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
860         we use the stobj opcode.
861
862         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
863         since it wasn't the correct fix. 
864
865         It still is puzzling that we are required to use stobj for IntPtr
866         which seems to be a ValueType.
867
868 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
869
870         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
871         during regular simple name resolution.   Now, the trick is that
872         instead of returning for processing the simplename, we do a
873         TypeManager.LookupType (ie, a rooted lookup as opposed to a
874         contextual lookup type).   If a match is found, return that, if
875         not, return for further composition.
876
877         This fixes long-standing 30485.
878
879         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
880         using the address to initialize an object, do an Stobj instead of
881         using the regular Stelem.
882
883         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
884         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
885         Because if we are a BaseIndexerAccess that value will be true.
886         Fixes 43643.
887
888         * statement.cs (GotoCase.Resolve): Return after reporting an
889         error, do not attempt to continue. 
890
891         * expression.cs (PointerArithmetic.Emit): If our operand is a
892         long, convert our constants to match the operand before
893         multiplying.  Convert to I type before adding.   Fixes 43670.
894         
895 2003-05-14  Ravi Pratap  <ravi@ximian.com>
896
897         * enum.cs (ImplicitConversionExists) : Rename to
898         ImplicitEnumConversionExists to remove ambiguity. 
899
900         * ecore.cs (NullCast): New type of cast expression class which
901         basically is very similar to EmptyCast with the difference being
902         it still is a constant since it is used only to cast a null to
903         something else
904         (eg. (string) null)
905
906         * convert.cs (ImplicitReferenceConversion): When casting a null
907         literal, we return a NullCast.
908
909         * literal.cs (NullLiteralTyped): Remove - I don't see why this
910         should be around anymore.
911
912         The renaming (reported was slightly wrong). Corrections:
913
914         ConvertImplicitStandard -> ImplicitConversionStandard
915         ConvertExplicitStandard -> ExplicitConversionStandard
916
917         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
918         before passing them in !
919
920         * convert.cs (ImplicitConversionStandard): When comparing for
921         equal expr and target types, ensure that expr is not a
922         NullLiteral.
923
924         In general, we must not be checking (expr_type ==
925         target_type) in the top level conversion methods
926         (ImplicitConversion, ExplicitConversion etc). This checking is
927         done in the methods that they delegate to.
928
929 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
930
931         * convert.cs: Move Error_CannotConvertType,
932         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
933         ImplicitNumericConversion, ImplicitConversionExists,
934         ImplicitUserConversionExists, StandardConversionExists,
935         FindMostEncompassedType, FindMostSpecificSource,
936         FindMostSpecificTarget, ImplicitUserConversion,
937         ExplicitUserConversion, GetConversionOperators,
938         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
939         TryImplicitIntConversion, Error_CannotConvertImplicit,
940         ConvertImplicitRequired, ConvertNumericExplicit,
941         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
942         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
943         its own file.
944
945         Perform the following renames:
946         
947         StandardConversionExists -> ImplicitStandardConversionExists
948         ConvertImplicit -> ImplicitConversion
949         ConvertImplicitStandard -> ImplicitStandardConversion
950         TryImplicitIntConversion -> ImplicitIntConversion
951         ConvertImplicitRequired -> ImplicitConversionRequired
952         ConvertNumericExplicit -> ExplicitNumericConversion
953         ConvertReferenceExplicit -> ExplicitReferenceConversion
954         ConvertExplicit -> ExplicitConversion
955         ConvertExplicitStandard -> ExplicitStandardConversion
956
957 2003-05-19  Martin Baulig  <martin@ximian.com>
958
959         * statement.cs (TypeInfo.StructInfo): Made this type protected.
960         (TypeInfo): Added support for structs having structs as fields.
961
962         * ecore.cs (FieldExpr): Implement IVariable.
963         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
964         VariableInfo for the field.
965
966 2003-05-18  Martin Baulig  <martin@ximian.com>
967
968         * expression.cs (This.DoResolve): Report a CS0027 if we're
969         emitting a field initializer.
970
971 2003-05-18  Martin Baulig  <martin@ximian.com>
972
973         * expression.cs (This.ResolveBase): New public function.
974         (This.DoResolve): Check for CS0188.
975
976         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
977         This.Resolve().
978
979         * ecore.cs (MethodGroupExpr.DoResolve): Set the
980         `instance_expression' to null if we don't have any non-static
981         methods.
982
983 2003-05-18  Martin Baulig  <martin@ximian.com>
984
985         Reworked the way how local variables and parameters are handled by
986         the flow analysis code.
987
988         * statement.cs (TypeInfo, VariableMap): New public classes.
989         (VariableInfo): New public class.  This is now responsible for
990         checking whether a variable has been assigned.  It is used for
991         parameters and local variables.
992         (Block.EmitMeta): Take the InternalParameters as argument; compute
993         the layout of the flow vectors here.
994         (Block.LocalMap, Block.ParameterMap): New public properties.
995         (FlowBranching): The .ctor doesn't get the InternalParameters
996         anymore since Block.EmitMeta() now computes the layout of the flow
997         vector.
998         (MyStructInfo): This class is now known as `StructInfo' and nested
999         in `TypeInfo'; we don't access this directly anymore.
1000
1001         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
1002         property and removed IsAssigned(), IsFieldAssigned(),
1003         SetAssigned() and SetFieldAssigned(); we now call them on the
1004         VariableInfo so we don't need to duplicate this code everywhere.
1005
1006         * expression.cs (ParameterReference): Added `Block block' argument
1007         to the .ctor.
1008         (LocalVariableReference, ParameterReference, This): The new
1009         VariableInfo class is now responsible for all the definite
1010         assignment stuff.
1011
1012         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
1013         IsParameterAssigned, SetParameterAssigned): Removed.
1014
1015 2003-05-18  Martin Baulig  <martin@ximian.com>
1016
1017         * typemanager.cs (InitCoreTypes): Try calling
1018         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
1019         the 3-args-version.  Corlib now also needs our `void_type'.
1020         (GetMethod): Added overloaded version which takes an optional
1021         `bool report_errors' to allow lookups of optional methods.
1022
1023 2003-05-12  Martin Baulig  <martin@ximian.com>
1024
1025         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
1026         only used for locals and not for parameters.
1027
1028 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
1029
1030         * support.cs (InternalParameters.ParameterType): Return the
1031         ExternalType of the parameter.
1032
1033         * parameter.cs (Parameter.ExternalType): drop the two arguments,
1034         they were unused.
1035
1036 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
1037
1038         * class.cs (MethodData.Define): Do not set the `newslot' on
1039         interface members, if they are also flagged as "override".
1040
1041         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
1042         better code for ++i and i++.  This only works for static fields
1043         and local variables.
1044
1045         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
1046         want to pull the DeclSpace out of the builder_to_declspace instead
1047         of the TypeBuilder (like in TypeContainer.FindMembers).
1048
1049         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
1050         instead of LookupTypeContainer.  Fixes the crash on .NET for
1051         looking up interface members.
1052
1053         * const.cs: Create our own emit context during the Definition
1054         stage, so that constants are evaluated in the proper context, when
1055         a recursive definition happens.
1056
1057 2003-05-11  Martin Baulig  <martin@ximian.com>
1058
1059         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
1060         new block for a switch section.
1061         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
1062         the adding/lookup in the switch block.  Fixes #39828.
1063
1064 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
1065
1066         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
1067         functionality: I needed to convert the data after I had performed
1068         the add/sub operation into the operands type size.
1069
1070         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
1071         pass the type for the box operation, otherwise the resulting
1072         object would have been of type object.
1073
1074         (BoxedCast): Add constructor to specify the type to box as.
1075
1076 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
1077
1078         * iterators.cs: I was reusing the `count' variable inadvertently,
1079         take steps to not allow this to happen.
1080
1081 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
1082
1083         * attribute.cs (Attribute.Resolve): Params attributes are encoded
1084         by creating an array at the point where the params starts and
1085         putting all those arguments there, then adjusting the size of the
1086         array.
1087
1088 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
1089
1090         * expression.cs (New.AddressOf): Implement interface
1091         IMemoryLocation.  This is used when the `new' operator is used in
1092         the context of an invocation to a method on a value type.
1093
1094         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
1095         example. 
1096
1097         * namespace.cs: Also check the using aliases here.
1098
1099         * driver.cs: Move the test for using validity after the types have
1100         been entered, so we do a single pass that also includes the using
1101         aliases. 
1102
1103         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
1104         in the regular case.   CreateSiblingForFinally is doing extra
1105         error checking.
1106
1107         * attribute.cs (GetAttributeArgumentExpression): Store the result
1108         on an out value, and use the return value to indicate failure
1109         instead of using null (which is a valid return for Constant.GetValue).
1110
1111         * statement.cs: Perform the analysis flow for the increment
1112         portion after the statement, because this will be the real flow of
1113         execution.  Fixes #42385
1114
1115         * codegen.cs (EmitContext.EmitArgument,
1116         EmitContext.EmitStoreArgument): New helper functions when the
1117         RemapToProxy flag is set.
1118
1119         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
1120         function.
1121
1122         Add support for remapping parameters. 
1123
1124         * iterators.cs: Propagate parameter values;  Store parameter
1125         values in the proxy classes.
1126         
1127 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
1128
1129         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
1130         need a proxy reference;  I do not know what I was thinking
1131
1132         * cs-parser.jay (constructor_initializer): catch another error,
1133         and display nice message.
1134         
1135         (field_declaration): catch void field declaration
1136         to flag a better error. 
1137
1138         * class.cs (MemberBase.CheckBase): Report an error instead of a
1139         warning if a new protected member is declared in a struct. 
1140         (Field.Define): catch the error of readonly/volatile.
1141
1142         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
1143
1144         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
1145         volatile variable is taken
1146
1147 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
1148
1149         * statement.cs (Fixed.Resolve): Report an error if we are not in
1150         an unsafe context.
1151
1152 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
1153
1154         * typemanager.cs: reuse the code that handles type clashes for
1155         delegates and enumerations.
1156
1157         * class.cs (Report28): Always report.
1158
1159         * expression.cs (EncodeAsAttribute): Allow nulls here.
1160
1161 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
1162
1163         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
1164         the functionality for testing whether an expression is valid for
1165         an attribute here.  Also handle the case of arrays of elements
1166         being stored. 
1167
1168         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
1169         encoding a linear array into an array of objects that are suitable
1170         to be passed to an CustomAttributeBuilder.
1171
1172         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
1173
1174         * ecore.cs: (FieldExpr): Handle field remapping here.
1175
1176         * iteratators.cs: Pass the instance variable (if the method is an
1177         instance method) to the constructors, so we can access the field
1178         variables on the class.
1179
1180         TODO: Test this with structs.  I think the THIS variable on
1181         structs might have to be a pointer, and not a refenrece
1182
1183 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
1184
1185         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
1186         local variables to fields in a proxy class.
1187
1188         * iterators.cs (PopulateProxy): Rename our internal fields to
1189         <XXX>.  
1190         Create a <THIS> field if we are an instance method, so we can
1191         reference our parent container variables.
1192         (MapVariable): Called back from the EmitContext code to enter a
1193         new variable to field mapping into the proxy class (we just create
1194         a FieldBuilder).
1195
1196         * expression.cs
1197         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
1198         for using the remapped locals to fields.
1199
1200         I placed the code here, because that gives the same semantics to
1201         local variables, and only changes the Emit code.
1202
1203         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
1204         statements inside iterators.
1205         (VariableInfo): Add a FieldBuilder for the cases when we are
1206         remapping local variables to fields in a proxy class
1207
1208         * ecore.cs (SimpleNameResolve): Avoid testing two times for
1209         current_block != null.
1210
1211         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
1212         not cope with strings, as it has been moved to the
1213         TableSwitchEmit.  Fixed bug in switch generation.
1214
1215         * expression.cs (New.DoResolve): Provide more context for the user
1216         when reporting an error.
1217
1218         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
1219         pointers. 
1220
1221         * expression.cs (MemberAccess.DoResolve): When we get a type back,
1222         check the permissions for it.  Note than in a type-resolution
1223         context the check was already present in DeclSpace.ResolveType,
1224         but was missing from the MemberAccess.
1225
1226         (ArrayCreation.CheckIndices): warn if the user has
1227         more nested levels of expressions, but there are no more
1228         dimensions specified.  Avoids crash on bug 41906.
1229
1230 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
1231
1232         * statement.cs (Block): replace Implicit bool, for a generic
1233         flags.   
1234         New flag: `Unchecked'.  This is used during the EmitMeta phase
1235         (which is out-of-line with the regular Resolve/Emit process for a
1236         statement, as this is done ahead of time, but still gets a chance
1237         to call constant resolve).
1238         
1239         (Block.Flags): new enum for adding a new flag.
1240
1241         (Block.EmitMeta): track the state of unchecked.
1242         
1243         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
1244         to enable constant resolution to work there as well.
1245
1246 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
1247
1248         * typemanager.cs (ienumerable_type): Also look up
1249         System.Collections.IEnumerable. 
1250
1251 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
1252
1253         TODO: Test more than one conditional per method.
1254         
1255         * class.cs (Indexer.Define): Report the location where the user is
1256         referencing the unsupported feature.
1257
1258         (MethodData): Overload the use of `conditionals' to
1259         minimize the creation of needless ArrayLists.   This saves roughly
1260         212kb on my machine.
1261
1262         (Method): Implement the new IIteratorContainer interface.
1263         (Method.SetYields): Implement the method by setting the ModFlags
1264         to contain METHOD_YIELDS.
1265         
1266         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
1267         which just got set to null.
1268
1269         * iterators.cs: New file.
1270
1271         (Yield, YieldBreak): New statements.
1272
1273         * statement.cs (Return.Resolve): Flag an error if we are used in
1274         an iterator method.
1275
1276         * codegen.cs (InIterator): New flag set if the code is being
1277         compiled in an iterator method.
1278
1279         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
1280         internal modifier, and we just use it to avoid adding extra
1281         fields, as this is seldom used.  
1282
1283         * cs-parser.jay: Add yield_statement (yield and yield break).
1284
1285         * driver.cs: New flag -v2 to turn on version 2 features. 
1286
1287         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
1288         hashtable when v2 is enabled.
1289
1290 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
1291
1292         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
1293         there is already a namespace defined with this name.
1294
1295         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
1296         people upgraded their corlibs.
1297
1298         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
1299         always use fully qualified types, no need to use the compiler
1300         front end.
1301
1302         (TypeManager.IsNamespace): Use binarysearch.
1303         
1304         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
1305         AddDelegate): I did not quite use the new IsValid API properly: I
1306         have to pass the short-name and the fullname.  I was passing only
1307         the basename instead of the fullname sometimes. 
1308
1309         (TypeContainer.DefineType): call NamespaceClash.
1310
1311         * interface.cs (Interface.DefineType): use NamespaceClash before
1312         defining the type.
1313
1314         * delegate.cs (Delegate.DefineType): use NamespaceClash before
1315         defining the type.
1316
1317         * enum.cs: (Enum.DefineType): use NamespaceClash before
1318         defining the type.
1319
1320         * typemanager.cs (: 3-line patch that gives us some tasty 11%
1321         speed increase.  First, use the negative_hits cache when we get a
1322         negative.  Second, add the type with its full original name
1323         instead of the new . and + encoded name (reflection uses + to
1324         separate type from a nested type).  Use LookupTypeReflection
1325         directly which bypasses the type->name hashtable (that we already
1326         know does not contain the type.
1327         
1328         * decl.cs (DeclSpace.ResolveTypeExpr): track the
1329         location/container type. 
1330
1331         * driver.cs: When passing utf8, use directly the UTF8Encoding.
1332
1333 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
1334
1335         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
1336
1337         * delegate.cs (NewDelegate.Resolve): Test whether an instance
1338         method is being referenced in the method group from a static
1339         context, and report error 120 if so.
1340
1341         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
1342         Error118. 
1343
1344         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
1345         is created, we create the A namespace).
1346
1347         * cs-parser.jay: A namespace also introduces a DeclarationFound.
1348         Fixes #41591
1349
1350 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
1351
1352         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
1353         invocation to ModuleBuilder.GetType with the same values will
1354         return a new type instance, so we need to cache its return
1355         values. 
1356
1357         * expression.cs (Binary.ResolveOperator): Only allow the compare
1358         operators on enums if they are of the same type.
1359
1360         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
1361         types of ValueType on their own case.  Before we were giving them
1362         the same treatment as objects.
1363
1364         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
1365         fullname.  Short name is used to compare against container name.
1366         Fullname is used to check against defined namespace names.
1367         
1368         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
1369         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
1370
1371         (Method.CheckBase): Call parent.
1372         (MemberBase.CheckBase): Check for protected members on sealed
1373         classes.
1374         (PropertyBase.CheckBase): Call parent.
1375         (Field.Define): Call parent.
1376
1377         * report.cs: Negative error codes are now mapped to 8000 - code,
1378         so that the display is render more nicely.
1379
1380         * typemanager.cs: Do not use try/catch, instead report a regular
1381         error. 
1382
1383         (GetPointerType, GetReferenceType): These methods provide
1384         mechanisms to obtain the T* and T& from a T.  We had the code
1385         previously scattered around the code base, and it also used
1386         TypeManager.LookupType that would go through plenty of caches.
1387         This one goes directly to the type source.
1388
1389         In some places we did the Type.GetType followed by
1390         ModuleBuilder.GetType, but not in others, so this unifies the
1391         processing as well.
1392
1393         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
1394         statements now that we have namespace information.
1395
1396         * typemanager.cs (IsNamespace): New method, returns whether the
1397         string presented is a namespace or not.
1398
1399         (ComputeNamespaces): New public entry point, computes the list of
1400         available namespaces, using the GetNamespaces API call in Mono, or
1401         the slower version in MS.NET.   
1402
1403         Now before we start the semantic analysis phase, we have a
1404         complete list of namespaces including everything that the user has
1405         provided.
1406
1407         Deleted old code to cache namespaces in .nsc files.
1408
1409 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
1410
1411         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
1412         class/struct location definition Location for the implicit
1413         constructor location.
1414
1415         (Operator.Define): Use the location of the operator for the
1416         implicit Method definition.
1417
1418         (Constructor.Emit): use the constructor location for the implicit
1419         base initializer constructor.
1420
1421         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
1422         and the Expression class now contains two new methods:
1423
1424         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
1425         isolate type lookup from the rest of the resolution process.
1426
1427         Since we use Expressions to hold type definitions due to the way
1428         we parse the input we have historically overloaded Resolve to
1429         perform the Type lookups if a special flag is passed.  Now this is
1430         eliminated and two methods take their place. 
1431         
1432         The differences in the two methods between xStep and xTerminal is
1433         that xStep is involved in our current lookup system that uses
1434         SimpleNames to compose a name, while xTerminal is used just to
1435         catch the case where the simplename lookup failed.
1436         
1437 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
1438
1439         * expression.cs (ResolveMemberAccess): Remove redundant code.
1440         TypeExpr expressions are always born fully resolved.
1441
1442         * interface.cs (PopulateMethod): Do not lookup the types twice.
1443         We were doing it once during SemanticAnalysis and once during
1444         PopulateMethod.
1445
1446         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
1447         in local variable type definitions, were being returned as a
1448         SimpleName (we decomposed everything into a string), that is
1449         because primary_expression was being used instead of a type in the
1450         grammar (reduce/reduce conflicts).
1451
1452         The part that was wrong is that we converted the expression into a
1453         string (an oversimplification in one hand, compounded with primary
1454         expressions doing string concatenation).
1455
1456         So things like:
1457
1458         A.B.C [] x;
1459
1460         Would return "A.B.C[]" as a SimpleName.  This stopped things like
1461         using clauses from working on this particular context.  And a type
1462         was being matched directly against "A.B.C[]".
1463
1464         We now use the correct approach, and allow for ComposedCast to be
1465         part of the unary expression.  So the "A.B.C []" become a composed
1466         cast of "A.B.C" (as a nested group of MemberAccess with a
1467         SimpleName at the end) plus the rank composition "[]". 
1468
1469         Also fixes 35567
1470         
1471 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
1472
1473         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
1474         for the access level checking.
1475
1476         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
1477         `TypeContainer container', because I kept getting confused when I
1478         was debugging this code.
1479
1480         * expression.cs (Indexers): Instead of tracking getters/setters,
1481         we now track them in parallel.  We create one arraylist less, but
1482         most importantly it is possible now for the LValue code to find a
1483         matching get for a set.
1484
1485         (IndexerAccess.DoResolveLValue): Update the code.
1486         GetIndexersForType has been modified already to extract all the
1487         indexers from a type.  The code assumed it did not.
1488
1489         Also make the code set the correct return type for the indexer.
1490         This was fixed a long time ago for properties, but was missing for
1491         indexers.  It used to be void_type.
1492
1493         (Binary.Emit): Test first for doubles instead of
1494         floats, as they are more common.
1495
1496         (Binary.EmitBranchable): Use the .un version of the branch opcodes
1497         when dealing with floats and the <=, >= operators.  This fixes bug
1498         #39314 
1499
1500         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
1501         to load the array value by emitting a load on the foreach variable
1502         type.  This was incorrect.  
1503
1504         We now emit the code to load an element using the the array
1505         variable type, and then we emit the conversion operator.
1506
1507         Fixed #40176
1508
1509 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
1510
1511         * attribute.cs: Avoid allocation of ArrayLists in the common case.
1512
1513 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
1514
1515         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
1516         test for protection before we test for signatures. 
1517
1518         (MethodSignature.ToString): implement.
1519
1520         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
1521         to the case where we reduced into a LongConstant.
1522
1523         * decl.cs (CheckAccessLevel): If the type is an array, we can not
1524         depend on whether the information is acurrate, because the
1525         Microsoft runtime will always claim that the array type is public,
1526         regardless of the real state.
1527
1528         If the type is a pointer, another problem happens: the type is
1529         reported as non-public in Microsoft.  
1530
1531         In both cases we have to call CheckAccessLevel recursively with
1532         the underlying type as the argument to be tested.
1533
1534 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
1535
1536         * assign.cs (Assign.Emit): If we are dealing with a compound
1537         assignment expression, we should use the code path that stores the
1538         intermediate result in a temporary value.  This fixes #40903.
1539
1540         *expression.cs (Indirection.ToString): Provide ToString method for
1541         debugging. 
1542         
1543 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
1544
1545         * class.cs: Null out fields holding references to Block objects so
1546         they can be garbage collected.
1547
1548         * expression.cs (OverloadResolve): Remove unused local.
1549
1550 2003-04-07  Martin Baulig  <martin@ximian.com>
1551
1552         * codegen.cs (EmitContext.CurrentFile): New public field.
1553         (EmitContext.Mark): Use the CurrentFile to check whether the
1554         location is in the correct file.
1555         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
1556
1557 2003-04-07  Martin Baulig  <martin@ximian.com>
1558
1559         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
1560
1561         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
1562         location.  [FIXME: The location argument which gets passed to this
1563         method is sometimes wrong!]
1564
1565 2003-04-07  Nick Drochak <ndrochak@gol.com>
1566
1567         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
1568
1569 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
1570
1571         * expression.cs (Indirection.EmitAssign): We were using the
1572         temporary, but returning immediately instead of continuing the
1573         EmitAssing flow.
1574
1575 2003-04-06  Martin Baulig  <martin@ximian.com>
1576
1577         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
1578         if it's a nested child, but also deriving from the outer class.
1579         See test 190.cs.
1580
1581         * typemanager.cs (IsNestedChildOf): Make this work if it's a
1582         nested child, but also deriving from the outer class.  See
1583         test-190.cs.
1584         (FilterWithClosure): We may access private members of the outer
1585         class if we're a nested child and deriving from the outer class.
1586         (RealMemberLookup): Only set `closure_private_ok' if the
1587         `original_bf' contained BindingFlags.NonPublic.
1588
1589 2003-04-05  Martin Baulig  <martin@ximian.com>
1590
1591         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
1592
1593 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
1594
1595         * class.cs (Event.Define): Do not allow abstract events to have
1596         initializers. 
1597
1598 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
1599
1600         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
1601         block in event declarations.
1602
1603         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
1604         value type, get its address.
1605
1606         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
1607         leaving a class on the stack instead of a boolean value (int
1608         0/1).  Change the code so we compare against null, and then the
1609         result against zero.
1610
1611         * class.cs (TypeContainer.GetClassBases): We were checking for the
1612         parent class being sealed too late.
1613
1614         * expression.cs (Binary.Emit): For <= and >= when dealing with
1615         floating point values, use cgt.un and clt.un instead of cgt and
1616         clt alone.
1617
1618 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
1619
1620         * statement.cs: Apply the same optimization as MS: skip the 
1621         GetEnumerator returning an IEnumerator, and use the one returning a 
1622         CharEnumerator instead. This allows us to avoid the try-finally block 
1623         and the boxing.
1624
1625 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
1626
1627         * cs-parser.jay: Attributes cannot be applied to
1628                          namespaces. Fixes #40473
1629
1630 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1631
1632         * class.cs:
1633         (Add*): check if the name is valid using the full name for constants,
1634         fields, properties and events.
1635
1636 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
1637
1638         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
1639         char constants to be part of the enumeration.
1640
1641         * expression.cs (Conditional.DoResolve): Add support for operator
1642         true. Implements the missing functionality from 14.12
1643
1644         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
1645         operator true/false as required by the spec.
1646
1647         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
1648         implicit conversion to boolean.
1649
1650         * statement.cs (Statement.ResolveBoolean): A boolean expression is
1651         also one where the type implements `operator true'. 
1652
1653         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
1654         get an expression that will invoke operator true based on an
1655         expression.  
1656
1657         (GetConversionOperators): Removed the hack that called op_True
1658         here.  
1659
1660         (Expression.ResolveBoolean): Move this from Statement.
1661
1662 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
1663
1664         * ecore.cs (FieldExpr): do not allow initialization of initonly
1665         fields on derived classes
1666
1667 2003-03-13  Martin Baulig  <martin@ximian.com>
1668
1669         * statement.cs (Block.Emit): Call ig.BeginScope() and
1670         ig.EndScope() when compiling with debugging info; call
1671         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
1672
1673 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
1674
1675         * expression.cs (Indexers): Do not construct immediately, allow
1676         for new members to be appended as we go.  Fixes 38143
1677
1678 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1679
1680         * expression.cs: save/restore context when resolving an unchecked
1681         expression.
1682
1683 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
1684
1685         * cfold.cs: Catch division by zero in modulus operator during
1686         constant folding.
1687
1688 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
1689
1690         * interface.cs (Interface.DefineMembers): Avoid defining members
1691         twice. 
1692
1693 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
1694
1695         * driver.cs: handle the +/- options for -noconfig
1696
1697         * statement.cs (Unckeched.Resolve): Also track the state of
1698         unchecked in the Resolve phase.
1699
1700 2003-02-27  Martin Baulig  <martin@ximian.com>
1701
1702         * ecore.cs (Expression.MemberLookup): Don't create a
1703         MethodGroupExpr for something which is not a method.  Fixes #38291.
1704
1705 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
1706
1707         * class.cs (MemberBase.CheckParameters): Also check that the type
1708         is unmanaged if it is a pointer.
1709
1710         * expression.cs (SizeOf.Resolve): Add location information.
1711
1712         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
1713         a managed type is declared.
1714
1715         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
1716         parameter modifiers as well.  Fixes bug 38606
1717
1718         * class.cs: Very sad.  Am backing out the speed up changes
1719         introduced by the ArrayList -> Array in the TypeContainer, as they
1720         were not actually that much faster, and introduced a bug (no error
1721         reports on duplicated methods).
1722
1723         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
1724         source first, this will guarantee that we have a valid expression
1725         before calling in lower levels functions that will require a
1726         resolved object.  Then use this original_source in the
1727         target.ResolveLValue instead of the original source that was
1728         passed to us.
1729
1730         Another change.  Use target.Resolve instead of LValueResolve.
1731         Although we are resolving for LValues, we will let the Assign code
1732         take care of that (it will be called again from Resolve).  This
1733         basically allows code like this:
1734
1735         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
1736         class Y { void A (X x) { x [0] += o; }
1737
1738         The problem was that the indexer was trying to resolve for
1739         set_Item (idx, object o) and never finding one.  The real set_Item
1740         was set_Item (idx, X).  By delaying the process we get the right
1741         semantics. 
1742
1743         Fixes bug 36505
1744         
1745 2003-02-23  Martin Baulig  <martin@ximian.com>
1746
1747         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
1748         while calling DoEmit ().
1749
1750         * codegen.cs (EmitContext.Mark): Don't mark locations in other
1751         source files; if you use the #line directive inside a method, the
1752         compiler stops emitting line numbers for the debugger until it
1753         reaches the end of the method or another #line directive which
1754         restores the original file.
1755
1756 2003-02-23  Martin Baulig  <martin@ximian.com>
1757
1758         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
1759
1760 2003-02-23  Martin Baulig  <martin@ximian.com>
1761
1762         * statement.cs (Block.AddChildVariableNames): We need to call this
1763         recursively, not just for our immediate children.
1764
1765 2003-02-23  Martin Baulig  <martin@ximian.com>
1766
1767         * class.cs (Event.Define): Always make the field private, like csc does.
1768
1769         * typemanager.cs (TypeManager.RealMemberLookup): Make events
1770         actually work, fixes bug #37521.
1771
1772 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
1773
1774         * delegate.cs: When creating the various temporary "Parameters"
1775         classes, make sure that we call the ComputeAndDefineParameterTypes
1776         on those new parameters (just like we do with the formal ones), to
1777         allow them to be resolved in the context of the DeclSpace.
1778
1779         This fixes the bug that Dick observed in Bugzilla #38530.
1780
1781 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
1782
1783         * expression.cs (ResolveMemberAccess): When resolving a constant,
1784         do not attempt to pull a constant if the value was not able to
1785         generate a valid constant.
1786
1787         * const.cs (LookupConstantValue): Do not report more errors than required.
1788
1789 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1790
1791         * expression.cs: fixes bug #38328.
1792
1793 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
1794
1795         * class.cs: Changed all the various members that can be part of a
1796         class from being an ArrayList to be an Array of the right type.
1797         During the DefineType type_list, interface_list, delegate_list and
1798         enum_list are turned into types, interfaces, delegates and enums
1799         arrays.  
1800
1801         And during the member population, indexer_list, event_list,
1802         constant_list, field_list, instance_constructor_list, method_list,
1803         operator_list and property_list are turned into their real arrays.
1804
1805         Although we could probably perform this operation earlier, for
1806         good error reporting we need to keep the lists and remove the
1807         lists for longer than required.
1808
1809         This optimization was triggered by Paolo profiling the compiler
1810         speed on the output of `gen-sample-program.pl' perl script. 
1811
1812         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
1813         not crash in methods like MemberLookupFailed that use this field.  
1814
1815         This problem arises when the compiler fails to resolve a type
1816         during interface type definition for example.
1817
1818 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
1819
1820         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
1821         inherit from System.Object, so we have to stop at null, not only
1822         when reaching System.Object.
1823
1824 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
1825
1826         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
1827         DeclaredOnly because the parent indexer might have had a different
1828         name, but did not loop until the top of the hierarchy was reached.
1829
1830         The problem this one fixes is 35492: when a class implemented an
1831         indexer from an interface, we were getting the interface method
1832         (which was abstract) and we were flagging an error (can not invoke
1833         abstract method).
1834
1835         This also keeps bug 33089 functioning, and test-148 functioning.
1836
1837         * typemanager.cs (IsSpecialMethod): The correct way of figuring
1838         out if a method is special is to see if it is declared in a
1839         property or event, or whether it is one of the predefined operator
1840         names.   This should fix correctly #36804.
1841
1842 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
1843
1844         The goal here is to remove the dependency on EmptyCast.Peel ().
1845         Killing it completely.
1846         
1847         The problem is that currently in a number of places where
1848         constants are expected, we have to "probe" for an EmptyCast, and
1849         Peel, which is not the correct thing to do, as this will be
1850         repetitive and will likely lead to errors. 
1851
1852         The idea is to remove any EmptyCasts that are used in casts that
1853         can be reduced to constants, so we only have to cope with
1854         constants. 
1855
1856         This bug hunt was triggered by Bug 37363 and the desire to remove
1857         the duplicate pattern where we were "peeling" emptycasts to check
1858         whether they were constants.  Now constants will always be
1859         constants.
1860         
1861         * ecore.cs: Use an enumconstant here instead of wrapping with
1862         EmptyCast.  
1863
1864         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
1865         throwing me off.  By handling this we can get rid of a few hacks.
1866         
1867         * statement.cs (Switch): Removed Peel() code.
1868
1869 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
1870
1871         * class.cs: Location information for error 508
1872
1873         * expression.cs (New.DoResolve): Add a guard against double
1874         resolution of an expression.  
1875
1876         The New DoResolve might be called twice when initializing field
1877         expressions (see EmitFieldInitializers, the call to
1878         GetInitializerExpression will perform a resolve on the expression,
1879         and later the assign will trigger another resolution
1880
1881         This leads to bugs (#37014)
1882
1883         * delegate.cs: The signature for EndInvoke should contain any ref
1884         or out parameters as well.  We were not doing this in the past. 
1885
1886         * class.cs (Field.Define): Do not overwrite the type definition
1887         inside the `volatile' group.  Turns out that volatile enumerations
1888         were changing the type here to perform a validity test, which
1889         broke conversions. 
1890
1891 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
1892
1893         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
1894         and structs, we do not want to load the instance variable
1895
1896         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
1897         enum_type has to be handled like an object reference (implicit
1898         conversions exists from this to object), but the regular IsClass
1899         and IsValueType tests will never return true for this one.
1900
1901         Also we use TypeManager.IsValueType instead of type.IsValueType,
1902         just for consistency with the rest of the code (this is only
1903         needed if we ever use the construct exposed by test-180.cs inside
1904         corlib, which we dont today).
1905
1906 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
1907
1908         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
1909         just InternalCall.
1910
1911 2003-02-09  Martin Baulig  <martin@ximian.com>
1912
1913         * namespace.cs (Namespace..ctor): Added SourceFile argument.
1914         (Namespace.DefineNamespaces): New static public method; this is
1915         called when we're compiling with debugging to add all namespaces
1916         to the symbol file.
1917
1918         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
1919         pass it to the Namespace's .ctor.
1920
1921         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
1922         and MethodBase arguments; pass the namespace ID to the symwriter;
1923         pass the MethodBase instead of the token to the symwriter.
1924         (SymbolWriter.DefineNamespace): New method to add a namespace to
1925         the symbol file.
1926
1927 2003-02-09  Martin Baulig  <martin@ximian.com>
1928
1929         * symbolwriter.cs: New file.  This is a wrapper around
1930         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
1931         methods here in near future.
1932
1933 2003-02-09  Martin Baulig  <martin@ximian.com>
1934
1935         * codegen.cs (EmitContext.Mark): Just pass the arguments to
1936         ILGenerator.MarkSequencePoint() which are actually used by the
1937         symbol writer.
1938
1939 2003-02-09  Martin Baulig  <martin@ximian.com>
1940
1941         * location.cs (SourceFile): New public sealed class.  This
1942         contains the name and an index which is used in the location's token.
1943         (Location): Reserve an appropriate number of bits in the token for
1944         the source file instead of walking over that list, this gives us a
1945         really huge performance improvement when compiling with debugging.
1946
1947         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
1948         `SourceFile' argument instead of a string.
1949         (Driver.ProcessFile): Add all the files via Location.AddFile(),
1950         but don't parse/tokenize here, we need to generate the list of all
1951         source files before we do that.
1952         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
1953         the files.
1954
1955         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
1956         instead of a string.
1957
1958         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
1959         of a string.
1960
1961 2003-02-09  Martin Baulig  <martin@ximian.com>
1962
1963         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
1964         filename on `#line default'.
1965
1966 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
1967
1968         * statement.cs: don't clear the pinned var when the fixed statement
1969         returns from the method (fixes bug#37752).
1970
1971 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
1972
1973         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
1974         to IsValueType.
1975
1976 2003-02-07  Martin Baulig  <martin@ximian.com>
1977
1978         * driver.cs: Removed the `--debug-args' command line argument.
1979
1980         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
1981         automatically by the AsssemblyBuilder.
1982         (CodeGen.InitializeSymbolWriter): We don't need to call any
1983         initialization function on the symbol writer anymore.  This method
1984         doesn't take any arguments.
1985
1986 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
1987
1988         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
1989         from referenced assemblies as well.
1990
1991 2003-02-02  Martin Baulig  <martin@ximian.com>
1992
1993         * class.cs (MethodData.Emit): Generate debugging info for external methods.
1994
1995 2003-02-02  Martin Baulig  <martin@ximian.com>
1996
1997         * class.cs (Constructor.Emit): Open the symbol writer before
1998         emitting the constructor initializer.
1999         (ConstructorInitializer.Emit): Call ec.Mark() to allow
2000         single-stepping through constructor initializers.
2001
2002 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
2003
2004         * class.cs: Handle error 549: do not allow virtual methods in
2005         sealed classes. 
2006
2007 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
2008
2009         * decl.cs: Check access levels when resolving types
2010         
2011 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
2012
2013         * statement.cs: Add parameters and locals set in catch blocks that might 
2014         return to set vector
2015
2016 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
2017
2018         * class.cs (Operator): Set the SpecialName flags for operators.
2019         
2020         * expression.cs (Invocation.DoResolve): Only block calls to
2021         accessors and operators on SpecialName methods.
2022
2023         (Cast.TryReduce): Handle conversions from char constants.
2024
2025
2026 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
2027
2028         * statement.cs: small memory and time optimization in FlowBranching.
2029         
2030 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
2031
2032         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
2033         problem that the last fix but in the other sid (Set).
2034
2035         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
2036         access when there is no indexer in the hierarchy.
2037         
2038 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
2039
2040         * class.cs: Combine some if statements.
2041
2042 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2043
2044         * driver.cs: fixed bug #37187.
2045
2046 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
2047
2048         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
2049         any indexer, it's needed to build a list with all the indexers in the
2050         hierarchy (AllGetters), else we have problems. Fixes #35653.
2051
2052 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
2053
2054         * class.cs (MethodData.Define): It is wrong for an interface
2055         implementation to be static in both cases: explicit and implicit.
2056         We were only handling this in one case.
2057
2058         Improve the if situation there to not have negations.
2059         
2060         * class.cs (Field.Define): Turns out that we do not need to check
2061         the unsafe bit on field definition, only on usage.  Remove the test.
2062
2063 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2064
2065         * driver.cs: use assembly.Location instead of Codebase (the latest
2066         patch made mcs fail when using MS assemblies).
2067
2068 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
2069
2070         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
2071         get the path to *corlib.dll.
2072
2073 2003-01-21  Nick Drochak <ndrochak@gol.com>
2074
2075         * cs-tokenizer.cs:
2076         * pending.cs:
2077         * typemanager.cs: Remove compiler warnings
2078
2079 2003-01-20  Duncan Mak  <duncan@ximian.com>
2080
2081         * AssemblyInfo.cs: Bump the version number to 0.19.
2082         
2083 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2084
2085         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
2086
2087 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
2088
2089         * class.cs (Constructor::Emit): Emit debugging info for constructors.
2090
2091 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
2092
2093         * cs-parser.jay: Small fix: we were not comparing the constructor
2094         name correctly.   Thanks to Zoltan for the initial pointer.
2095
2096 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
2097
2098         * cs-tokenizer.cs: Set file name when specified with #line
2099
2100 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
2101
2102         * cs-parser.jay: Only perform the constructor checks here if we
2103         are named like the class;  This will help provider a better
2104         error.  The constructor path is taken when a type definition is
2105         not found, but most likely the user forgot to add the type, so
2106         report that rather than the constructor error.
2107
2108 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
2109
2110         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
2111         allocations.
2112
2113 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
2114
2115         * cs-parser.jay: Add cleanup call.
2116
2117 2003-01-13  Duncan Mak  <duncan@ximian.com>
2118
2119         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
2120         consistent with other methods.
2121
2122 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
2123
2124         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
2125         
2126 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
2127
2128         * attribute.cs: only set GuidAttr to true when we have a
2129         GuidAttribute.
2130
2131 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2132
2133         * ecore.cs:
2134         * expression.cs:
2135         * typemanager.cs: fixes to allow mcs compile corlib with the new
2136         Type.IsSubclassOf fix.
2137
2138 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
2139
2140         * expression.cs (LocalVariableReference.DoResolve): Classify a
2141         constant as a value, not as a variable.   Also, set the type for
2142         the variable.
2143
2144         * cs-parser.jay (fixed_statement): take a type instead of a
2145         pointer_type, so we can produce a better error message later.
2146         
2147         * statement.cs (Fixed.Resolve): Flag types that are not pointers
2148         as an error.  
2149         
2150         (For.DoEmit): Make inifinite loops have a
2151         non-conditional branch back.
2152
2153         (Fixed.DoEmit): First populate the pinned variables, then emit the
2154         statement, then clear the variables.  Before I was emitting the
2155         code once for each fixed piece.
2156
2157
2158 2003-01-08  Martin Baulig  <martin@ximian.com>
2159
2160         * statement.cs (FlowBranching.MergeChild): A break in a
2161         SWITCH_SECTION does not leave a loop.  Fixes #36155.
2162
2163 2003-01-08  Martin Baulig  <martin@ximian.com>
2164
2165         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
2166         lives in the same number space than `param_map'.  Fixes #36154.
2167
2168 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
2169
2170         * cs-parser.jay (constructor_declaration): Set the
2171         Constructor.ModFlags before probing for it.  This makes the
2172         compiler report 514, 515 and 132 (the code was there, but got
2173         broken). 
2174
2175         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
2176         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
2177         (GotoCase.Resolve): Set `Returns' to ALWAYS.
2178
2179 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
2180
2181         * enum.cs: create the enum static fields using the enum type.
2182
2183 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
2184
2185         * class.cs: don't try to create the ParamBuilder for the return
2186         type if it's not needed (and handle it breaking for the ms runtime
2187         anyway).
2188
2189 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
2190
2191         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
2192
2193 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
2194
2195         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
2196         the command.   This showed up while compiling the JANET source
2197         code, which used \r as its only newline separator.
2198
2199 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
2200
2201         * class.cs (Method.Define): If we are an operator (because it
2202         reuses our code), then set the SpecialName and HideBySig.  #36128
2203
2204 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
2205
2206         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
2207         exception, report error 120 `object reference required'.
2208
2209         * driver.cs: Add --pause option, used during to measure the size
2210         of the process as it goes with --timestamp.
2211
2212         * expression.cs (Invocation.DoResolve): Do not allow methods with
2213         SpecialName to be invoked.
2214
2215 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
2216
2217         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
2218         number before adding it.
2219
2220 2002-12-21  Ravi Pratap  <ravi@ximian.com>
2221
2222         * ecore.cs (StandardImplicitConversion): When in an unsafe
2223         context, we allow conversion between void * to any other pointer
2224         type. This fixes bug #35973.
2225
2226 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
2227
2228         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
2229         is not thrown when extensionless outputs are used 
2230
2231 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2232
2233         * rootcontext.cs: fixed compilation of corlib.
2234
2235 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
2236
2237         * attribute.cs (Attributes.Contains): Add new method.
2238
2239         * class.cs (MethodCore.LabelParameters): if the parameter is an
2240         `out' parameter, check that no attribute `[In]' has been passed.
2241
2242         * enum.cs: Handle the `value__' name in an enumeration.
2243
2244 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
2245
2246         * decl.cs: Added special case to allow overrides on "protected
2247         internal" methods
2248         
2249 2002-12-18  Ravi Pratap  <ravi@ximian.com>
2250
2251         * attribute.cs (Attributes.AddAttributeSection): Rename to this
2252         since it makes much more sense.
2253
2254         (Attributes.ctor): Don't require a Location parameter.
2255         
2256         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
2257
2258         * attribute.cs (ApplyAttributes): Remove extra Location parameters
2259         since we already have that information per attribute.
2260
2261         * everywhere : make appropriate changes.
2262
2263         * class.cs (LabelParameters): Write the code which actually
2264         applies attributes to the return type. We can't do this on the MS
2265         .NET runtime so we flag a warning in the case an exception is
2266         thrown.
2267
2268 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
2269
2270         * const.cs: Handle implicit null conversions here too.
2271
2272 2002-12-17  Ravi Pratap  <ravi@ximian.com>
2273
2274         * class.cs (MethodCore.LabelParameters): Remove the extra
2275         Type [] parameter since it is completely unnecessary. Instead
2276         pass in the method's attributes so that we can extract
2277         the "return" attribute.
2278
2279 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
2280
2281         * cs-parser.jay (parse): Use Report.Error to flag errors instead
2282         of ignoring it and letting the compile continue.
2283
2284         * typemanager.cs (ChangeType): use an extra argument to return an
2285         error condition instead of throwing an exception.
2286
2287 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
2288
2289         * expression.cs (Unary.TryReduce): mimic the code for the regular
2290         code path.  Perform an implicit cast in the cases where we can
2291         implicitly convert to one of the integral types, and then reduce
2292         based on that constant.   This fixes bug #35483.
2293
2294 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2295
2296         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
2297
2298 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2299
2300         * namespace.cs: fixed bug #35489.
2301
2302 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
2303
2304         * class.cs: Remove some dead code.
2305
2306         * cs-parser.jay: Estimate the number of methods needed
2307         (RootContext.MethodCount);
2308
2309         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
2310         numbers instead of StringBuilders.
2311
2312         * support.cs (PtrHashtable): Add constructor with initial size;
2313         We can now reduce reallocations of the method table.
2314
2315 2002-12-10  Ravi Pratap  <ravi@ximian.com>
2316
2317         * attribute.cs (ApplyAttributes): Keep track of the emitted
2318         attributes on a per-target basis. This fixes bug #35413.
2319
2320 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
2321
2322         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
2323         default to the Windows 1252 encoding.
2324
2325         (UnixParseOption): Support version, thanks to Alp for the missing
2326         pointer. 
2327
2328         * AssemblyInfo.cs: Add nice assembly information.
2329
2330         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
2331         (bug 35169).
2332
2333         * cs-parser.jay: Allow a trailing comma before the close bracked
2334         in the attribute_section production.
2335
2336         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
2337         address of the instance was being taken, I will take this out,
2338         because we take the address of the object immediately here.
2339
2340 2002-12-09  Ravi Pratap  <ravi@ximian.com>
2341
2342         * typemanager.cs (AreMultipleAllowed): Take care of the most
2343         obvious case where attribute type is not in the current assembly -
2344         stupid me ;-)
2345
2346 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
2347
2348         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
2349         definitions, instead of doing that afterwards.  
2350
2351         Also we use a nice little hack, depending on the constructor, we
2352         know if we are a "composed" name or a simple name.  Hence, we
2353         avoid the IndexOf test, and we avoid 
2354
2355         * codegen.cs: Add code to assist in a bug reporter to track down
2356         the source of a compiler crash. 
2357
2358 2002-12-07  Ravi Pratap  <ravi@ximian.com>
2359
2360         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
2361         types have been emitted for a given element and flag an error
2362         if something which does not have AllowMultiple set is used more
2363         than once.
2364
2365         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
2366         attribute types and their corresponding AllowMultiple properties
2367
2368         (AreMultipleAllowed): Check the property for a given type.
2369
2370         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
2371         property in the case we have a TypeContainer.
2372
2373         (Attributes.AddAttribute): Detect duplicates and just skip on
2374         adding them. This trivial fix catches a pretty gross error in our
2375         attribute emission - global attributes were being emitted twice!
2376
2377         Bugzilla bug #33187 is now fixed.
2378
2379 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
2380
2381         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
2382         instead of pp_and).
2383
2384         * expression.cs (Binary.ResolveOperator): I can only use the
2385         Concat (string, string, string) and Concat (string, string,
2386         string, string) if the child is actually a concatenation of
2387         strings. 
2388
2389 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
2390
2391         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
2392         context where we need a 2-character lookahead.
2393
2394         * pending.cs (PendingImplementation): Rework so we can keep track
2395         of interface types all the time, and flag those which were
2396         implemented by parents as optional.
2397
2398 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
2399
2400         * expression.cs (Binary.ResolveOperator): Use
2401         String.Concat(string,string,string) or
2402         String.Concat(string,string,string,string) when possible. 
2403
2404         * typemanager: More helper methods.
2405
2406
2407 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
2408
2409         * pending.cs: remove the bogus return from GetMissingInterfaces()
2410         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
2411
2412 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2413
2414         * namespace.cs: avoid duplicated 'using xxx' being added to
2415         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
2416         when we get more than one 'using' statement for the same namespace.
2417         Report a CS0105 warning for it.
2418
2419 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
2420
2421         * cs-tokenizer.cs (consume_identifier): use read directly, instead
2422         of calling getChar/putback, uses internal knowledge of it.    
2423
2424         (xtoken): Reorder tokenizer so most common patterns are checked
2425         first.  This reduces the compilation time in another 5% (from 8.11s
2426         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
2427
2428         The parsing time is 22% of the compilation in mcs, and from that
2429         64% is spent on the tokenization process.  
2430
2431         I tried using a binary search for keywords, but this is slower
2432         than the hashtable.  Another option would be to do a couple of
2433         things:
2434
2435                 * Not use a StringBuilder, instead use an array of chars,
2436                   with a set value.  Notice that this way we could catch
2437                   the 645 error without having to do it *afterwards*.
2438
2439                 * We could write a hand-parser to avoid the hashtable
2440                   compares altogether.
2441
2442         The identifier consumption process takes 37% of the tokenization
2443         time.  Another 15% is spent on is_number.  56% of the time spent
2444         on is_number is spent on Int64.Parse:
2445
2446                 * We could probably choose based on the string length to
2447                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
2448                   computations. 
2449
2450         Another 3% is spend on wrapping `xtoken' in the `token' function.
2451
2452         Handle 0xa0 as whitespace (#34752)
2453         
2454 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
2455
2456         * typemanager.cs (IsCLRType): New routine to tell whether a type
2457         is one of the builtin types.  
2458
2459         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
2460         typecode in more places instead of doing pointer comparissions.
2461         We could leverage some knowledge about the way the typecodes are
2462         laid out.
2463
2464         New code to cache namespaces in assemblies, it is currently not
2465         invoked, to be used soon.
2466
2467         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
2468
2469         * expression.cs (Binary.ResolveOperator): specially handle
2470         strings, and do not perform user-defined operator overloading for
2471         built-in types.
2472
2473 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
2474
2475         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
2476         internalcall as it is a pretty simple operation;  Avoid whenever
2477         possible to call Char.IsLetter.
2478
2479         (consume_identifier): Cut by half the number of
2480         hashtable calls by merging the is_keyword and GetKeyword behavior.
2481
2482         Do not short-circuit, because if we do, we
2483         report errors (ie, #if false && true would produce an invalid
2484         directive error);
2485         
2486
2487 2002-11-24  Martin Baulig  <martin@ximian.com>
2488
2489         * expression.cs (Cast.TryReduce): If we're in checked syntax,
2490         check constant ranges and report a CS0221.  Fixes #33186.
2491
2492 2002-11-24  Martin Baulig  <martin@ximian.com>
2493
2494         * cs-parser.jay: Make this work for uninitialized variable
2495         declarations in the `for' initializer.  Fixes #32416.
2496
2497 2002-11-24  Martin Baulig  <martin@ximian.com>
2498
2499         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
2500         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
2501
2502 2002-11-24  Martin Baulig  <martin@ximian.com>
2503
2504         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
2505         argument; if true, we also check for user-defined conversions.
2506         This is only needed if both arguments are of a user-defined type.
2507         Fixes #30443, added test-175.cs.
2508         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
2509
2510         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
2511
2512 2002-11-24  Martin Baulig  <martin@ximian.com>
2513
2514         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
2515         function to get the store opcode.
2516         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
2517         only emit the Ldelema if the store opcode is Stobj.  You must run
2518         both test-34 and test-167 to test this.  Fixes #34529.
2519
2520 2002-11-23  Martin Baulig  <martin@ximian.com>
2521
2522         * ecore.cs (Expression.MemberLookup): Added additional
2523         `qualifier_type' argument which is used when we're being called
2524         from MemberAccess.DoResolve() and null if we're called from a
2525         SimpleName lookup.
2526         (Expression.MemberLookupFailed): New method to report errors; this
2527         does the CS1540 check and reports the correct error message.
2528
2529         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
2530         argument for the CS1540 check and redone the way how we're dealing
2531         with private members.  See the comment in the source code for details.
2532         (FilterWithClosure): Reverted this back to revision 1.197; renamed
2533         `closure_start_type' to `closure_qualifier_type' and check whether
2534         it's not null.  It was not this filter being broken, it was just
2535         being called with the wrong arguments.
2536
2537         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
2538         and pass it the correct `qualifier_type'; this also does the error
2539         handling for us.
2540
2541 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
2542
2543         * expression.cs (Invocation.EmitParams): If the we are dealing
2544         with a non-built-in value type, load its address as well.
2545
2546         (ArrayCreation): Use a a pretty constant instead
2547         of the hardcoded value 2.   Use 6 instead of 2 for the number of
2548         static initializers.  
2549
2550         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
2551         because they are not really value types, just glorified integers. 
2552
2553         * driver.cs: Do not append .exe, the CSC compiler does not do it.
2554
2555         * ecore.cs: Remove redundant code for enumerations, make them use
2556         the same code path as everything else, fixes the casting issue
2557         with enumerations in Windows.Forms.
2558
2559         * attribute.cs: Do only cast to string if it is a string, the
2560         validation happens later.
2561
2562         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
2563         people upgrade their corlibs.
2564
2565         * ecore.cs: Oops, enumerations were not following the entire code path
2566
2567 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
2568
2569         * typemanager.cs (FilterWithClosure): Commented out the test for
2570         1540 in typemanager.cs, as it has problems when accessing
2571         protected methods from a parent class (see test-174.cs). 
2572
2573         * attribute.cs (Attribute.ValidateGuid): new method.
2574         (Attribute.Resolve): Use above.
2575
2576 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
2577
2578         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
2579
2580         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
2581         handling for enumerations, as we only needed the TypeContainer
2582         functionality to begin with (this is required for the fix below to
2583         work for enums that reference constants in a container class for
2584         example). 
2585
2586         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
2587
2588         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
2589         a valid TypeBuilder to perform lookups on.o
2590
2591         * class.cs (InheritableMemberSignatureCompare): Use true in the
2592         call to GetGetMethod and GetSetMethod, because we are comparing
2593         the signature, and we need to get the methods *even* if they are
2594         private. 
2595
2596         (PropertyBase.CheckBase): ditto.
2597
2598         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
2599         GotoCase.Resolve): Use Peel on EmpytCasts.
2600
2601         * ecore.cs (EmptyCast): drop child, add Peel method.
2602
2603 2002-11-17  Martin Baulig  <martin@ximian.com>
2604
2605         * ecore.cs (EmptyCast.Child): New public property.
2606
2607         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
2608         label resolved to an EmptyCast.  Fixes #34162.
2609         (GotoCase.Resolve): Likewise.
2610         (Block.EmitMeta): Likewise.
2611
2612 2002-11-17  Martin Baulig  <martin@ximian.com>
2613
2614         * expression.cs (Invocation.BetterConversion): Prefer int over
2615         uint; short over ushort; long over ulong for integer literals.
2616         Use ImplicitConversionExists instead of StandardConversionExists
2617         since we also need to check for user-defined implicit conversions.
2618         Fixes #34165.  Added test-173.cs.
2619
2620 2002-11-16  Martin Baulig  <martin@ximian.com>
2621
2622         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
2623         with the `true' and `false' literals.  Fixes #33151.
2624
2625 2002-11-16  Martin Baulig  <martin@ximian.com>
2626
2627         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
2628         October 22nd; don't do the cs1540 check for static members.
2629
2630         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
2631         now using our own filter here and doing the cs1540 check again.
2632
2633 2002-11-16  Martin Baulig  <martin@ximian.com>
2634
2635         * support.cs (InternalParameters): Don't crash if we don't have
2636         any fixed parameters.  Fixes #33532.
2637
2638 2002-11-16  Martin Baulig  <martin@ximian.com>
2639
2640         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
2641         when looking up static methods to make this work on Windows.
2642         Fixes #33773.
2643
2644 2002-11-16  Martin Baulig  <martin@ximian.com>
2645
2646         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
2647         a setter rather than using PropertyInfo.CanWrite.
2648
2649 2002-11-15  Nick Drochak  <ndrochak@gol.com>
2650
2651         * class.cs: Allow acces to block member by subclasses. Fixes build
2652         breaker.
2653
2654 2002-11-14  Martin Baulig  <martin@ximian.com>
2655
2656         * class.cs (Constructor.Emit): Added the extern/block check.
2657         Fixes bug #33678.
2658
2659 2002-11-14  Martin Baulig  <martin@ximian.com>
2660
2661         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
2662         iteration while looking for indexers, this is needed because the
2663         indexer may have a different name in our base classes.  Fixed the
2664         error reporting (no indexers at all, not get accessor, no
2665         overloaded match).  Fixes bug #33089.
2666         (IndexerAccess.DoResolveLValue): Likewise.
2667
2668 2002-11-14  Martin Baulig  <martin@ximian.com>
2669
2670         * class.cs (PropertyBase.CheckBase): Make this work for multiple
2671         indexers.  Fixes the first part of bug #33089.
2672         (MethodSignature.InheritableMemberSignatureCompare): Added support
2673         for properties.
2674
2675 2002-11-13  Ravi Pratap  <ravi@ximian.com>
2676
2677         * attribute.cs (Attribute.Resolve): Catch the
2678         NullReferenceException and report it since it isn't supposed to
2679         happen. 
2680         
2681 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
2682
2683         * expression.cs (Binary.EmitBranchable): Also handle the cases for
2684         LogicalOr and LogicalAnd that can benefit from recursively
2685         handling EmitBranchable.  The code now should be nice for Paolo.
2686
2687 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
2688
2689         * typemanager.cs (LookupType): Added a negative-hit hashtable for
2690         the Type lookups, as we perform quite a number of lookups on
2691         non-Types.  This can be removed once we can deterministically tell
2692         whether we have a type or a namespace in advance.
2693
2694         But this might require special hacks from our corlib.
2695
2696         * TODO: updated.
2697
2698         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
2699         and double which avoids a conversion from an integer to a double.
2700
2701         * expression.cs: tiny optimization, avoid calling IsConstant,
2702         because it effectively performs the lookup twice.
2703
2704 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
2705
2706         But a bogus return here to keep the semantics of the old code
2707         until the Mono runtime is fixed.
2708         
2709         * pending.cs (GetMissingInterfaces): New method used to remove all
2710         the interfaces that are already implemented by our parent
2711         classes from the list of pending methods. 
2712
2713         * interface.cs: Add checks for calls after ResolveTypeExpr.
2714
2715 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
2716
2717         * class.cs (Class.Emit): Report warning 67: event not used if the
2718         warning level is beyond 3.
2719
2720         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
2721         being a NullLiteral.
2722
2723         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
2724         specifiers. 
2725
2726         * class.cs (TypeContainer.GetClassBases): Cover a missing code
2727         path that might fail if a type can not be resolved.
2728
2729         * expression.cs (Binary.Emit): Emit unsigned versions of the
2730         operators. 
2731
2732         * driver.cs: use error 5.
2733         
2734 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
2735
2736         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
2737
2738 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
2739
2740         * cs-parser.jay (switch_section): A beautiful patch from Martin
2741         Baulig that fixed 33094.
2742
2743 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
2744
2745         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
2746         Check whether the base is abstract and report an error if so.
2747
2748         * expression.cs (IndexerAccess.DoResolveLValue,
2749         IndexerAccess.DoResolve): ditto. 
2750
2751         (Invocation.DoResolve): ditto.
2752         
2753         (Invocation.FullMethodDesc): Improve the report string.
2754
2755         * statement.cs (Block): Eliminate IsVariableDefined as it is
2756         basically just a wrapper for GetVariableInfo.
2757
2758         * ecore.cs (SimpleName): Use new 
2759
2760         * support.cs (ReflectionParamter.ParameterType): We unwrap the
2761         type, as we return the actual parameter ref/unref state on a
2762         different call.
2763
2764 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
2765
2766         * support.cs: Return proper flags REF/OUT fixing the previous
2767         commit.  
2768
2769         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
2770         not used to mean `ref' but `ref or out' in ParameterReference
2771         
2772         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
2773         full type signature instead of calling TypeManger.CSharpName
2774         ourselves. 
2775
2776         * support.cs (InternalParameters.ParameterDesc): Do not compare
2777         directly to the modflags, because REF/OUT will actually be bitsets
2778         if set. 
2779
2780         * delegate.cs (VerifyMethod): Check also the modifiers.
2781
2782         * cs-tokenizer.cs: Fix bug where floating point values with an
2783         exponent where a sign was missing was ignored.
2784
2785         * driver.cs: Allow multiple assemblies to be specified in a single
2786         /r: argument
2787
2788 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
2789
2790         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
2791         because identifiers after a parenthesis would end up in this kind
2792         of production, and we needed to desamiguate it for having casts
2793         like:
2794
2795                 (UserDefinedType *) xxx
2796
2797 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
2798
2799         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
2800         we should set on the Bindingflags.NonPublic, but not turn on
2801         private_ok.  private_ok controls whether a Private member is
2802         returned (this is chekced on the filter routine), while the
2803         BindingFlags.NonPublic just controls whether private/protected
2804         will be allowed.   This fixes the problem part of the problem of
2805         private properties being allowed to be used in derived classes.
2806
2807         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
2808         so we can call the children DoResolveLValue method (this will
2809         properly signal errors on lvalue assignments to base properties)
2810         
2811         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
2812         getter are null, and we have a property info, we know that this
2813         happened because the lookup failed, so we report an error 122 for
2814         protection level violation.
2815
2816         We also silently return if setter and getter are null in the
2817         resolve functions, this condition only happens if we have flagged
2818         the error before.  This is the other half of the problem. 
2819
2820         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
2821         not have accessibility information, that is why we were returning
2822         true in the filter function in typemanager.cs.
2823
2824         To properly report 122 (property is inaccessible because of its
2825         protection level) correctly, we report this error in ResolveAccess
2826         by failing if both the setter and the getter are lacking (ie, the
2827         lookup failed). 
2828
2829         DoResolve and DoLResolve have been modified to check for both
2830         setter/getter being null and returning silently, the reason being
2831         that I did not want to put the knowledge about this error in upper
2832         layers, like:
2833
2834         int old = Report.Errors;
2835         x = new PropertyExpr (...);
2836         if (old != Report.Errors)
2837                 return null;
2838         else
2839                 return x;
2840
2841         So the property expr is returned, but it is invalid, so the error
2842         will be flagged during the resolve process. 
2843
2844         * class.cs: Remove InheritablePropertySignatureCompare from the
2845         class, as we no longer depend on the property signature to compute
2846         whether it is possible to implement a method or not.
2847
2848         The reason is that calling PropertyInfo.GetGetMethod will return
2849         null (in .NET, in Mono it works, and we should change this), in
2850         cases where the Get Method does not exist in that particular
2851         class.
2852
2853         So this code:
2854
2855         class X { public virtual int A { get { return 1; } } }
2856         class Y : X { }
2857         class Z : Y { public override int A { get { return 2; } } }
2858
2859         Would fail in Z because the parent (Y) would not have the property
2860         defined.  So we avoid this completely now (because the alternative
2861         fix was ugly and slow), and we now depend exclusively on the
2862         method names.
2863
2864         (PropertyBase.CheckBase): Use a method-base mechanism to find our
2865         reference method, instead of using the property.
2866
2867         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
2868         routines are gone now.
2869
2870         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
2871         names, they were incorrectly named.
2872
2873         * cs-tokenizer.cs: Return are more gentle token on failure. 
2874
2875         * pending.cs (PendingImplementation.InterfaceMethod): This routine
2876         had an out-of-sync index variable, which caused it to remove from
2877         the list of pending methods the wrong method sometimes.
2878
2879 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
2880
2881         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
2882         CanWrite, because those refer to this particular instance of the
2883         property, and do not take into account the fact that we can
2884         override single members of a property.
2885
2886         Constructor requires an EmitContext.  The resolution process does
2887         not happen here, but we need to compute the accessors before,
2888         because the resolution does not always happen for properties.
2889         
2890         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
2891         subclass, before we did not update this flag, but we did update
2892         bindingflags. 
2893
2894         (GetAccessors): Drop this routine, as it did not work in the
2895         presence of partially overwritten set/get methods. 
2896
2897         Notice that this broke the cs1540 detection, but that will require
2898         more thinking. 
2899         
2900 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2901
2902         * class.cs:
2903         * codegen.cs:
2904         * driver.cs: issue a warning instead of an error if we don't support
2905         debugging for the platform. Also ignore a couple of errors that may
2906         arise when trying to write the symbols. Undo my previous patch.
2907
2908 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2909
2910         * driver.cs: ignore /debug switch except for Unix platforms.
2911
2912 2002-10-23  Nick Drochak  <ndrochak@gol.com>
2913
2914         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
2915
2916 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
2917
2918         * driver.cs: Do not make mcs-debug conditional, so we do not break
2919         builds that use it.
2920
2921         * statement.cs (UsageVector.MergeChildren): I would like Martin to
2922         review this patch.  But basically after all the children variables
2923         have been merged, the value of "Breaks" was not being set to
2924         new_breaks for Switch blocks.  I think that it should be set after
2925         it has executed.  Currently I set this to the value of new_breaks,
2926         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
2927         conservative, but I do not understand this code very well.
2928
2929         I did not break anything in the build, so that is good ;-)
2930
2931         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
2932
2933 2002-10-20  Mark Crichton  <crichton@gimp.org>
2934
2935         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
2936
2937 2002-10-20  Nick Drochak  <ndrochak@gol.com>
2938
2939         * cfold.cs: Fixed compile blocker.
2940
2941 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
2942
2943         * driver.cs: I was chekcing the key, not the file.
2944
2945 2002-10-19  Ravi Pratap  <ravi@ximian.com>
2946
2947         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
2948         message that we were generating - we just need to silently return
2949         a null.
2950
2951 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
2952
2953         * class.cs (Event.Define): Change my previous commit, as this
2954         breaks the debugger.  This is a temporary hack, as it seems like
2955         the compiler is generating events incorrectly to begin with.
2956
2957         * expression.cs (Binary.ResolveOperator): Added support for 
2958         "U operator - (E x, E y)"
2959
2960         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
2961         y)".
2962
2963         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
2964         init-only variables, but this path did not take into account that
2965         there might be also instance readonly variables.  Correct this
2966         problem. 
2967
2968         This fixes bug 32253
2969
2970         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
2971         delegates as well.
2972
2973         * driver.cs: Change the extension for modules to `netmodule'
2974
2975         * cs-parser.jay: Improved slightly the location tracking for
2976         the debugger symbols.
2977
2978         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
2979         modifiers that were specified instead of the hardcoded value
2980         (FamAndAssem).  This was basically ignoring the static modifier,
2981         and others.  Fixes 32429.
2982
2983         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
2984         fixed a bug in the process (32476)
2985
2986         * expression.cs (ArrayAccess.EmitAssign): Patch from
2987         hwang_rob@yahoo.ca that fixes bug 31834.3
2988
2989 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
2990
2991         * driver.cs: Make the module extension .netmodule.
2992
2993 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
2994
2995         * driver.cs: Report an error if the resource file is not found
2996         instead of crashing.
2997
2998         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
2999         false, like Emit does.
3000
3001 2002-10-16  Nick Drochak  <ndrochak@gol.com>
3002
3003         * typemanager.cs: Remove unused private member.  Also reported mcs
3004         bug to report this as a warning like csc.
3005
3006 2002-10-15  Martin Baulig  <martin@gnome.org>
3007
3008         * statement.cs (Statement.Emit): Made this a virtual method; emits
3009         the line number info and calls DoEmit().
3010         (Statement.DoEmit): New protected abstract method, formerly knows
3011         as Statement.Emit().
3012
3013         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
3014
3015 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
3016
3017         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
3018         have fixed a remaining problem: not every AddXXXX was adding a
3019         fully qualified name.  
3020
3021         Now everyone registers a fully qualified name in the DeclSpace as
3022         being defined instead of the partial name.  
3023
3024         Downsides: we are slower than we need to be due to the excess
3025         copies and the names being registered this way.  
3026
3027         The reason for this is that we currently depend (on the corlib
3028         bootstrap for instance) that types are fully qualified, because
3029         we dump all the types in the namespace, and we should really have
3030         types inserted into the proper namespace, so we can only store the
3031         basenames in the defined_names array.
3032
3033 2002-10-10  Martin Baulig  <martin@gnome.org>
3034
3035         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
3036         from bug #31834, see the bug report for a testcase which is
3037         miscompiled.
3038
3039 2002-10-10  Martin Baulig  <martin@gnome.org>
3040
3041         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
3042         flow analysis code for this.
3043
3044         * statement.cs (Do, While, For): Tell the flow analysis code about
3045         infinite loops.
3046         (FlowBranching.UsageVector): Added support for infinite loops.
3047         (Block.Resolve): Moved the dead code elimination here and use flow
3048         analysis to do it.
3049
3050 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
3051
3052         * class.cs (Field.Define): Catch cycles on struct type
3053         definitions. 
3054
3055         * typemanager.cs (IsUnmanagedtype): Do not recursively check
3056         fields if the fields are static.  We only need to check instance
3057         fields. 
3058
3059         * expression.cs (As.DoResolve): Test for reference type.
3060
3061         * statement.cs (Using.ResolveExpression): Use
3062         ConvertImplicitRequired, not ConvertImplicit which reports an
3063         error on failture
3064         (Using.ResolveLocalVariableDecls): ditto.
3065
3066         * expression.cs (Binary.ResolveOperator): Report errors in a few
3067         places where we had to.
3068
3069         * typemanager.cs (IsUnmanagedtype): Finish implementation.
3070
3071 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
3072
3073         * expression.cs: Use StoreFromPtr instead of extracting the type
3074         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
3075
3076         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
3077         an enumeration value to a System.Enum, but System.Enum is not a
3078         value type, but an class type, so we need to box.
3079
3080         (Expression.ConvertExplicit): One codepath could return
3081         errors but not flag them.  Fix this.  Fixes #31853
3082
3083         * parameter.cs (Resolve): Do not allow void as a parameter type.
3084
3085 2002-10-06  Martin Baulig  <martin@gnome.org>
3086
3087         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
3088         if it's a class type and not a struct.  Fixes #31815.
3089
3090 2002-10-06  Martin Baulig  <martin@gnome.org>
3091
3092         * statement.cs: Reworked the flow analysis code a bit to make it
3093         usable for dead code elimination.
3094
3095 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3096
3097         * cs-parser.jay: allow empty source files. Fixes bug #31781.
3098
3099 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
3100
3101         * expression.cs (ComposedCast.DoResolveType): A quick workaround
3102         to fix the test 165, will investigate deeper.
3103
3104 2002-10-04  Martin Baulig  <martin@gnome.org>
3105
3106         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
3107         finally blocks actually work.
3108         (Try.Resolve): We don't need to create a sibling for `finally' if
3109         there is no finally block.
3110
3111 2002-10-04  Martin Baulig  <martin@gnome.org>
3112
3113         * class.cs (Constructor.Define): The default accessibility for a
3114         non-default constructor is private, not public.
3115
3116 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
3117
3118         * class.cs (Constructor): Make AllowedModifiers public, add
3119         EXTERN.
3120
3121         * cs-parser.jay: Perform the modifiers test here, as the
3122         constructor for the Constructor class usually receives a zero
3123         because of the way we create it (first we create, later we
3124         customize, and we were never checking the modifiers).
3125
3126         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
3127         is a version of LookupTypeReflection that includes the type-name
3128         cache.  This can be used as a fast path for functions that know
3129         the fully qualified name and are only calling into *.GetType() to
3130         obtain a composed type.
3131
3132         This is also used by TypeManager.LookupType during its type
3133         composition.
3134
3135         (LookupType): We now also track the real type name, as sometimes
3136         we can get a quey for the real type name from things like
3137         ComposedCast.  This fixes bug 31422.
3138         
3139         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
3140         complete type fullname, it does not have to go through the type
3141         resolution system to obtain the composed version of the type (for
3142         obtaining arrays or pointers).
3143         
3144         (Conditional.Emit): Use the EmitBoolExpression to
3145         generate nicer code, as requested by Paolo.
3146
3147         (ArrayCreation.CheckIndices): Use the patch from
3148         hwang_rob@yahoo.ca to validate the array initializers. 
3149
3150 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
3151
3152         * class.cs (ConstructorInitializer.Emit): simplify code by using
3153         Invocation.EmitCall, and at the same time, fix the bugs in calling
3154         parent constructors that took variable arguments. 
3155
3156         * ecore.cs (Expression.ConvertNumericExplicit,
3157         Expression.ImplicitNumericConversion): Remove the code that
3158         manually wrapped decimal (InternalTypeConstructor call is now gone
3159         as well).
3160
3161         * expression.cs (Cast.TryReduce): Also handle decimal types when
3162         trying to perform a constant fold on the type.
3163
3164         * typemanager.cs (IsUnmanagedtype): Partially implemented.
3165
3166         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
3167         that only turned off an error report, and did nothing else. 
3168
3169 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
3170
3171         * driver.cs: Handle and ignore /fullpaths
3172
3173 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
3174
3175         * expression.cs (Binary.ResolveOperator): Catch the case where
3176         DoNumericPromotions returns true, 
3177
3178         (Binary.DoNumericPromotions): Simplify the code, and the tests.
3179
3180 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
3181
3182         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
3183         report error 70.
3184
3185 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
3186
3187         * ecore.cs (ConvertNumericExplicit): It is not enough that the
3188         conversion exists, but it is also required that the conversion be
3189         performed.  This manifested in "(Type64Enum) 2".  
3190
3191         * class.cs (TypeManager.AddMethod): The fix is not to change
3192         AddEnum, because that one was using a fully qualified name (every
3193         DeclSpace derivative does), but to change the AddMethod routine
3194         that was using an un-namespaced name.  This now correctly reports
3195         the duplicated name.
3196
3197         Revert patch until I can properly fix it.  The issue
3198         is that we have a shared Type space across all namespaces
3199         currently, which is wrong.
3200
3201         Options include making the Namespace a DeclSpace, and merge
3202         current_namespace/current_container in the parser.
3203
3204 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
3205
3206         * cs-parser.jay: Improve error reporting when we get a different
3207         kind of expression in local_variable_type and
3208         local_variable_pointer_type. 
3209
3210         Propagate this to avoid missleading errors being reported.
3211
3212         * ecore.cs (ImplicitReferenceConversion): treat
3213         TypeManager.value_type as a target just like object_type.   As
3214         code like this:
3215
3216         ValueType v = 1;
3217
3218         Is valid, and needs to result in the int 1 being boxed before it
3219         is assigned to the value type v.
3220
3221         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
3222         to validate the enumeration name.
3223
3224         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
3225         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
3226         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
3227
3228         * ecore.cs (TryImplicitIntConversion): When doing an
3229         implicit-enumeration-conversion, check if the type is 64-bits and
3230         perform a conversion before passing to EnumConstant.
3231
3232 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
3233
3234         * decl.cs (Error_AmbiguousTypeReference); New routine used to
3235         report ambiguous type references.  Unlike the MS version, we
3236         report what the ambiguity is.   Innovation at work ;-)
3237
3238         (DeclSpace.FindType): Require a location argument to
3239         display when we display an ambiguous error.
3240
3241         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
3242
3243         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
3244
3245         * expression.cs (EmitDynamicInitializers): Apply patch from
3246         hwang_rob@yahoo.ca that fixes the order in which we emit our
3247         initializers. 
3248
3249 2002-09-21  Martin Baulig  <martin@gnome.org>
3250
3251         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
3252         delegate takes no arguments.
3253
3254 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
3255
3256         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
3257         from integers.
3258
3259         * expression.cs: Extract the underlying type.
3260
3261         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
3262
3263         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
3264
3265 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
3266
3267         * class.cs (TypeContainer.DefineType): We can not use the nice
3268         PackingSize with the size set to 1 DefineType method, because it
3269         will not allow us to define the interfaces that the struct
3270         implements.
3271
3272         This completes the fixing of bug 27287
3273
3274         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
3275         means also structs.  This fixes part of the problem. 
3276         (Expresion.ImplicitReferenceConversionExists): ditto.
3277
3278         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
3279         error if there were no errors reported during the type lookup
3280         process, to avoid duplicates or redundant errors.  Without this
3281         you would get an ambiguous errors plus a type not found.  We have
3282         beaten the user enough with the first error.  
3283
3284         (DeclSparce.FindType): Emit a warning if we have an ambiguous
3285         reference. 
3286
3287         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
3288         during the resolution process, stop the lookup, this avoids
3289         repeated error reports (same error twice).
3290
3291         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
3292
3293         * typemanager.cs (LookupType): Redo the type lookup code to match
3294         the needs of System.Reflection.  
3295
3296         The issue is that System.Reflection requires references to nested
3297         types to begin with a "+" sign instead of a dot.  So toplevel
3298         types look like: "NameSpace.TopLevelClass", and nested ones look
3299         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
3300         levels. 
3301
3302 2002-09-19  Martin Baulig  <martin@gnome.org>
3303
3304         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
3305         says that a method always returns or always throws an exception,
3306         don't report the CS0161.
3307
3308         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
3309         set `Returns = new_returns'.
3310
3311 2002-09-19  Martin Baulig  <martin@gnome.org>
3312
3313         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
3314         to an enum constant, check for a CS0176.
3315
3316 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
3317
3318         * class.cs (TypeContainer.CheckPairedOperators): Now we check
3319         for operators that must be in pairs and report errors.
3320
3321         * ecore.cs (SimpleName.DoResolveType): During the initial type
3322         resolution process, when we define types recursively, we must
3323         check first for types in our current scope before we perform
3324         lookups in the enclosing scopes.
3325
3326         * expression.cs (MakeByteBlob): Handle Decimal blobs.
3327
3328         (Invocation.VerifyArgumentsCompat): Call
3329         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
3330         I thought we were supposed to always call this, but there are a
3331         few places in the code where we dont do it.
3332
3333 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
3334
3335         * driver.cs: Add support in -linkres and -resource to specify the
3336         name of the identifier.
3337
3338 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
3339
3340         * ecore.cs (StandardConversionExists): Sync with the conversion
3341         code: allow anything-* to void* conversions.
3342
3343         (FindMostSpecificSource): Use an Expression argument
3344         instead of a Type, because we might be handed over a Literal which
3345         gets a few more implicit conversions that plain types do not.  So
3346         this information was being lost.
3347
3348         Also, we drop the temporary type-holder expression when not
3349         required.
3350
3351 2002-09-17  Martin Baulig  <martin@gnome.org>
3352
3353         * class.cs (PropertyBase.CheckBase): Don't check the base class if
3354         this is an explicit interface implementation.
3355
3356 2002-09-17  Martin Baulig  <martin@gnome.org>
3357
3358         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
3359         different `IndexerName' attributes.
3360
3361         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
3362         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
3363         virtual CommonResolve().
3364
3365 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
3366
3367         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
3368         and convert that to the UnderlyingType.
3369
3370         * statement.cs (Foreach.Resolve): Indexers are just like variables
3371         or PropertyAccesses.
3372
3373         * cs-tokenizer.cs (consume_string): Track line numbers and columns
3374         inside quoted strings, we were not doing this before.
3375
3376 2002-09-16  Martin Baulig  <martin@gnome.org>
3377
3378         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
3379         resolve it.  This is needed for the definite assignment check of the
3380         instance expression, fixes bug #29846.
3381         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
3382
3383 2002-09-16  Nick Drochak  <ndrochak@gol.com>
3384
3385         * parameter.cs: Fix compile error.  Cannot reference static member
3386         from an instance object.  Is this an mcs bug?
3387
3388 2002-09-14  Martin Baulig  <martin@gnome.org>
3389
3390         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
3391         multiple times.  Fixes bug #30295, added test-166.cs.
3392
3393 2002-09-14  Martin Baulig  <martin@gnome.org>
3394
3395         * statement.cs (Block.Emit): Don't emit unreachable code.
3396         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
3397         `break' statements.
3398         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
3399
3400 2002-09-14  Martin Baulig  <martin@gnome.org>
3401
3402         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
3403         is set.
3404
3405 2002-09-14  Martin Baulig  <martin@gnome.org>
3406
3407         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
3408         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
3409         be false on the ms runtime.
3410
3411 2002-09-13  Martin Baulig  <martin@gnome.org>
3412
3413         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
3414         the CS0038 error message.
3415
3416 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
3417
3418         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
3419         constant inside, return it.
3420
3421 2002-09-12  Martin Baulig  <martin@gnome.org>
3422
3423         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
3424         implicit conversion can be done between enum types.
3425
3426         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
3427         check whether an implicit conversion to the current enum's UnderlyingType
3428         exists and report an error if not.
3429
3430         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
3431         without debugging support.
3432
3433         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
3434         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
3435
3436 2002-09-12  Martin Baulig  <martin@gnome.org>
3437
3438         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
3439
3440         * ecore.cs (IMemberExpr.DeclaringType): New property.
3441         (SimpleName.SimpleNameResolve): Check whether we're accessing a
3442         nonstatic member of an outer type (CS0038).
3443
3444 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
3445
3446         * driver.cs: Activate the using-error detector at warning level
3447         4 (at least for MS-compatible APIs).
3448
3449         * namespace.cs (VerifyUsing): Small buglett fix.
3450
3451         * pending.cs (PendingImplementation): pass the container pointer. 
3452
3453         * interface.cs (GetMethods): Allow for recursive definition.  Long
3454         term, I would like to move every type to support recursive
3455         definitions, not the current ordering mechanism that we have right
3456         now.
3457
3458         The situation is this: Attributes are handled before interfaces,
3459         so we can apply attributes to interfaces.  But some attributes
3460         implement interfaces, we will now handle the simple cases
3461         (recursive definitions will just get an error).  
3462
3463         * parameter.cs: Only invalidate types at the end if we fail to
3464         lookup all types.  
3465
3466 2002-09-09  Martin Baulig  <martin@gnome.org>
3467
3468         * ecore.cs (PropertyExpr.Emit): Also check for
3469         TypeManager.system_int_array_get_length so this'll also work when
3470         compiling corlib.  Fixes #30003.
3471
3472 2002-09-09  Martin Baulig  <martin@gnome.org>
3473
3474         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
3475         and throw an exception if we can't get the type's size.  Fixed #30040,
3476         added test-165.cs.
3477
3478 2002-09-09  Martin Baulig  <martin@gnome.org>
3479
3480         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
3481
3482         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
3483         context.  Fixes bug #30027.
3484
3485         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
3486         virtual functions.  Fixes bug #30043, added test-164.cs.
3487
3488 2002-09-08  Ravi Pratap  <ravi@ximian.com>
3489
3490         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
3491
3492 2002-09-08  Nick Drochak  <ndrochak@gol.com>
3493
3494         * driver.cs: Use an object to get the windows codepage since it's not a
3495         static property.
3496
3497 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
3498
3499         * statement.cs (For.Emit): for infinite loops (test == null)
3500         return whether there is a break inside, not always "true".
3501
3502         * namespace.cs (UsingEntry): New struct to hold the name of the
3503         using definition, the location where it is defined, and whether it
3504         has been used in a successful type lookup.
3505         
3506         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
3507         strings.
3508
3509         * decl.cs: ditto.
3510
3511 2002-09-06  Ravi Pratap  <ravi@ximian.com>
3512
3513         * attribute.cs : Fix incorrect code which relied on catching
3514         a NullReferenceException to detect a null being passed in
3515         where an object was expected.
3516
3517 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
3518
3519         * statement.cs (Try): flag the catch variable as assigned
3520
3521         * expression.cs (Cast): Simplified by using ResolveType instead of
3522         manually resolving.
3523
3524         * statement.cs (Catch): Fix bug by using ResolveType.
3525
3526 2002-09-06  Ravi Pratap  <ravi@ximian.com>
3527
3528         * expression.cs (BetterConversion): Special case for when we have
3529         a NullLiteral as the argument and we have to choose between string
3530         and object types - we choose string the way csc does.
3531
3532         * attribute.cs (Attribute.Resolve): Catch the
3533         NullReferenceException and report error #182 since the Mono
3534         runtime no more has the bug and having this exception raised means
3535         we tried to select a constructor which takes an object and is
3536         passed a null.
3537
3538 2002-09-05  Ravi Pratap  <ravi@ximian.com>
3539
3540         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
3541         message (1502, 1503) when we can't locate a method after overload
3542         resolution. This is much more informative and closes the bug
3543         Miguel reported.
3544
3545         * interface.cs (PopulateMethod): Return if there are no argument
3546         types. Fixes a NullReferenceException bug.
3547
3548         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
3549         expressions too. Previously we were checking only in one place for
3550         positional arguments leaving out named arguments.
3551
3552         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
3553         type to the enum type is not allowed. Remove code corresponding to
3554         that.
3555
3556         (ConvertNumericExplicit): Allow explicit conversions from
3557         the underlying type to enum type. This precisely follows the spec
3558         and closes a bug filed by Gonzalo.
3559         
3560 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3561
3562         * compiler.csproj:
3563         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
3564
3565 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
3566
3567         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
3568         it was important that we stored the right value after the
3569         reduction in `converted'.
3570
3571 2002-09-04  Martin Baulig  <martin@gnome.org>
3572
3573         * location.cs (Location.SymbolDocument): Use full pathnames for the
3574         source files.
3575
3576 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
3577
3578         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
3579         of the expression resolve mechanism, because that will catch the
3580         SimpleName error failures.
3581
3582         (Conditional): If we can not resolve the
3583         expression, return, do not crash.
3584
3585 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3586
3587         * cs-tokenizer.cs:
3588         (location): display token name instead of its number.
3589
3590 2002-08-28  Martin Baulig  <martin@gnome.org>
3591
3592         * expression.cs (Binary.ResolveOperator): Don't silently return
3593         but return an error if an operator cannot be applied between two
3594         enum types.
3595
3596 2002-08-28  Martin Baulig  <martin@gnome.org>
3597
3598         * class.cs (Constructor.Define): Set the permission attributes
3599         correctly instead of making all constructors public.
3600
3601 2002-08-28  Martin Baulig  <martin@gnome.org>
3602
3603         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
3604         for private members before reporting a CS0103; if we find anything,
3605         it's a CS0122.
3606
3607 2002-08-28  Martin Baulig  <martin@gnome.org>
3608
3609         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
3610         to check whether `closure_start_type == closure_invocation_type',
3611         we also need to check whether `m.DeclaringType == closure_invocation_type'
3612         before bypassing the permission checks.  We might be accessing
3613         protected/private members from the base class.
3614         (TypeManager.RealMemberLookup): Only set private_ok if private
3615         members were requested via BindingFlags.NonPublic.
3616
3617         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
3618
3619         * expression.cs (MemberAccess.ResolveMemberAccess): Set
3620         MethodGroupExpr.IsExplicitImpl if appropriate.
3621         (Invocation.DoResolve): Don't report the CS0120 for explicit
3622         interface implementations.
3623
3624 2002-08-27  Martin Baulig  <martin@gnome.org>
3625
3626         * expression.cs (Invocation.DoResolve): If this is a static
3627         method and we don't have an InstanceExpression, we must report
3628         a CS0120.
3629
3630 2002-08-25  Martin Baulig  <martin@gnome.org>
3631
3632         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
3633         `==' between a valuetype and an object.
3634
3635 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
3636
3637         * ecore.cs (TypeExpr): Provide a ToString method.
3638
3639 2002-08-24  Martin Baulig  <martin@gnome.org>
3640
3641         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
3642         now called proggie.dbg and it's a binary file.
3643
3644 2002-08-23  Martin Baulig  <martin@gnome.org>
3645
3646         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
3647
3648 2002-08-23  Martin Baulig  <martin@gnome.org>
3649
3650         * struct.cs (MyStructInfo.ctor): Make this work with empty
3651         structs; it's not allowed to use foreach() on null.
3652
3653 2002-08-23  Martin Baulig  <martin@gnome.org>
3654
3655         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
3656         writer the full pathname of the generated assembly.
3657
3658 2002-08-23  Martin Baulig  <martin@gnome.org>
3659
3660         * statements.cs (FlowBranching.UsageVector.MergeChildren):
3661         A `finally' block never returns or breaks; improved handling of
3662         unreachable code.
3663
3664 2002-08-23  Martin Baulig  <martin@gnome.org>
3665
3666         * statement.cs (Throw.Resolve): Allow `throw null'.
3667
3668 2002-08-23  Martin Baulig  <martin@gnome.org>
3669
3670         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
3671         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
3672         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
3673         MemberLookup would return a wrong event if this is an explicit
3674         interface implementation and the class has an event with the same
3675         name.
3676
3677 2002-08-23  Martin Baulig  <martin@gnome.org>
3678
3679         * statement.cs (Block.AddChildVariableNames): New public method.
3680         (Block.AddChildVariableName): Likewise.
3681         (Block.IsVariableNameUsedInChildBlock): Likewise.
3682         (Block.AddVariable): Check whether a variable name has already
3683         been used in a child block.
3684
3685         * cs-parser.jay (declare_local_variables): Mark all variable names
3686         from the current block as being used in a child block in the
3687         implicit block.
3688
3689 2002-08-23  Martin Baulig  <martin@gnome.org>
3690
3691         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
3692         find the symbol writer.
3693
3694         * driver.cs: csc also allows the arguments to /define being
3695         separated by commas, not only by semicolons.
3696
3697 2002-08-23  Martin Baulig  <martin@gnome.org>
3698
3699         * interface.cs (Interface.GetMembers): Added static check for events.
3700
3701 2002-08-15  Martin Baulig  <martin@gnome.org>
3702
3703         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
3704         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
3705
3706         * ecore.cs (Expression.MemberLookup): Added documentation and explained
3707         why the MethodData.EmitDestructor() change was necessary.
3708
3709 2002-08-20  Martin Baulig  <martin@gnome.org>
3710
3711         * class.cs (TypeContainer.FindMembers): Added static check for events.
3712
3713         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
3714
3715         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
3716         use Type.GetEvents(), not Type.FindMembers().
3717
3718 2002-08-20  Martin Baulig  <martin@gnome.org>
3719
3720         * decl.cs (MemberCache): Added a special method cache which will
3721         be used for method-only searched.  This ensures that a method
3722         search will return a MethodInfo with the correct ReflectedType for
3723         inherited methods.      
3724
3725 2002-08-20  Martin Baulig  <martin@gnome.org>
3726
3727         * decl.cs (DeclSpace.FindMembers): Made this public.
3728
3729 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3730
3731         * delegate.cs: fixed build on windows.
3732         [FIXME:  Filed as bug #29150: MCS must report these errors.]
3733
3734 2002-08-19  Ravi Pratap  <ravi@ximian.com>
3735
3736         * ecore.cs (StandardConversionExists): Return a false
3737         if we are trying to convert the void type to anything else
3738         since that is not allowed.
3739
3740         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
3741         we flag error 70 in the event an event is trying to be accessed
3742         directly from outside the declaring type.
3743
3744 2002-08-20  Martin Baulig  <martin@gnome.org>
3745
3746         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
3747         MemberCache from typemanager.cs to decl.cs.
3748
3749 2002-08-19  Martin Baulig  <martin@gnome.org>
3750
3751         * class.cs (TypeContainer): Implement IMemberContainer.
3752         (TypeContainer.DefineMembers): Create the MemberCache.
3753         (TypeContainer.FindMembers): Do better BindingFlags checking; only
3754         return public members if BindingFlags.Public was given, check
3755         whether members are static.
3756
3757 2002-08-16  Martin Baulig  <martin@gnome.org>
3758
3759         * decl.cs (DeclSpace.Define): Splitted this in Define and
3760         DefineMembers.  DefineMembers is called first and initializes the
3761         MemberCache.
3762
3763         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
3764         DefineMembers() on all our DeclSpaces.
3765
3766         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
3767         but call DefineMembers() on all nested interfaces.  We call their
3768         Define() in our new Define() function.
3769
3770         * interface.cs (Interface): Implement IMemberContainer.
3771         (Interface.Define): Moved all code except the attribute stuf to
3772         DefineMembers().
3773         (Interface.DefineMembers): Initialize the member cache.
3774
3775         * typemanager.cs (IMemberFinder): Removed this interface, we don't
3776         need this anymore since we can use MemberCache.FindMembers directly.
3777
3778 2002-08-19  Martin Baulig  <martin@gnome.org>
3779
3780         * typemanager.cs (MemberCache): When creating the cache for an
3781         interface type, add all inherited members.
3782         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
3783         to `out bool used_cache' and documented it.
3784         (TypeManager.MemberLookup): If we already used the cache in the first
3785         iteration, we don't need to do the interfaces check.
3786
3787 2002-08-19  Martin Baulig  <martin@gnome.org>
3788
3789         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
3790         here from IMemberFinder and don't implement this interface anymore.
3791         (DeclSpace.MemberCache): Moved here from IMemberFinder.
3792
3793         * typemanager.cs (IMemberFinder): This interface is now only used by
3794         classes which actually support the member cache.
3795         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
3796         since we only put DeclSpaces into this Hashtable.
3797         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
3798         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
3799
3800 2002-08-16  Martin Baulig  <martin@gnome.org>
3801
3802         * typemanager.cs (ICachingMemberFinder): Removed.
3803         (IMemberFinder.MemberCache): New property.
3804         (TypeManager.FindMembers): Merged this with RealFindMembers().
3805         This function will never be called from TypeManager.MemberLookup()
3806         so we can't use the cache here, just the IMemberFinder.
3807         (TypeManager.MemberLookup_FindMembers): Check whether the
3808         IMemberFinder has a MemberCache and call the cache's FindMembers
3809         function.
3810         (MemberCache): Rewrote larger parts of this yet another time and
3811         cleaned it up a bit.
3812
3813 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
3814
3815         * driver.cs (LoadArgs): Support quoting.
3816
3817         (Usage): Show the CSC-like command line arguments.
3818
3819         Improved a few error messages.
3820
3821 2002-08-15  Martin Baulig  <martin@gnome.org>
3822
3823         * typemanager.cs (IMemberContainer.Type): New property.
3824         (IMemberContainer.IsInterface): New property.
3825
3826         The following changes are conditional to BROKEN_RUNTIME, which is
3827         defined at the top of the file.
3828
3829         * typemanager.cs (MemberCache.MemberCache): Don't add the base
3830         class'es members, but add all members from TypeHandle.ObjectType
3831         if we're an interface.
3832         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
3833         is the current type.
3834         (MemberCache.CacheEntry.Container): Removed this field.
3835         (TypeHandle.GetMembers): Include inherited members.
3836
3837 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3838
3839         * typemanager.cs: fixed compilation and added a comment on a field that
3840         is never used.
3841
3842 2002-08-15  Martin Baulig  <martin@gnome.org>
3843
3844         * class.cs (ConstructorInitializer.Resolve): In the
3845         Expression.MemberLookup call, use the queried_type as
3846         invocation_type.
3847
3848         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
3849         declared' attribute, it's always true.
3850         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
3851         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
3852         temporary wrapper for FindMembers which tells MemberLookup whether
3853         members from the base classes are included in the return value.
3854         This will go away soon.
3855         (TypeManager.MemberLookup): Use this temporary hack here; once the
3856         new MemberCache is completed, we don't need to do the DeclaredOnly
3857         looping here anymore since the MemberCache will take care of this.
3858         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
3859         (MemberCache): When creating the MemberCache for a class, get
3860         members from the current class and all its base classes.
3861         (MemberCache.CacheEntry.Container): New field.  This is a
3862         temporary hack until the Mono runtime is fixed to distinguish
3863         between ReflectedType and DeclaringType.  It allows us to use MCS
3864         with both the MS runtime and the unfixed Mono runtime without
3865         problems and without accecting performance.
3866         (MemberCache.SearchMembers): The DeclaredOnly looping from
3867         TypeManager.MemberLookup is now done here.      
3868
3869 2002-08-14  Martin Baulig  <martin@gnome.org>
3870
3871         * statement.cs (MyStructInfo.MyStructInfo): Don't call
3872         Type.GetFields on dynamic types but get the fields from the
3873         corresponding TypeContainer.
3874         (MyStructInfo.GetStructInfo): Added check for enum types.
3875
3876         * typemanager.cs (MemberList.IsSynchronized): Implemented.
3877         (MemberList.SyncRoot): Implemented.
3878         (TypeManager.FilterWithClosure): No need to check permissions if
3879         closure_start_type == closure_invocation_type, don't crash if
3880         closure_invocation_type is null.
3881
3882 2002-08-13  Martin Baulig  <martin@gnome.org>
3883
3884         Rewrote TypeContainer.FindMembers to use a member cache.  This
3885         gives us a speed increase of about 35% for the self-hosting MCS
3886         build and of about 15-20% for the class libs (both on GNU/Linux).
3887
3888         * report.cs (Timer): New class to get enhanced profiling.  This
3889         whole class is "TIMER" conditional since it remarkably slows down
3890         compilation speed.
3891
3892         * class.cs (MemberList): New class.  This is an IList wrapper
3893         which we're now using instead of passing MemberInfo[]'s around to
3894         avoid copying this array unnecessarily.
3895         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
3896         (ICachingMemberFinder, IMemberContainer): New interface.
3897         (TypeManager.FilterWithClosure): If `criteria' is null, the name
3898         has already been checked, otherwise use it for the name comparision.
3899         (TypeManager.FindMembers): Renamed to RealMemberFinder and
3900         provided wrapper which tries to use ICachingMemberFinder.FindMembers
3901         if possible.  Returns a MemberList, not a MemberInfo [].
3902         (TypeHandle): New class, implements IMemberContainer.  We create
3903         one instance of this class per type, it contains a MemberCache
3904         which is used to do the member lookups.
3905         (MemberCache): New class.  Each instance of this class contains
3906         all members of a type and a name-based hash table.
3907         (MemberCache.FindMembers): This is our new member lookup
3908         function.  First, it looks up all members of the requested name in
3909         the hash table.  Then, it walks this list and sorts out all
3910         applicable members and returns them.
3911
3912 2002-08-13  Martin Baulig  <martin@gnome.org>
3913
3914         In addition to a nice code cleanup, this gives us a performance
3915         increase of about 1.4% on GNU/Linux - not much, but it's already
3916         half a second for the self-hosting MCS compilation.
3917
3918         * typemanager.cs (IMemberFinder): New interface.  It is used by
3919         TypeManager.FindMembers to call FindMembers on a TypeContainer,
3920         Enum, Delegate or Interface.
3921         (TypeManager.finder_to_member_finder): New PtrHashtable.
3922         (TypeManager.finder_to_container): Removed.
3923         (TypeManager.finder_to_delegate): Removed.
3924         (TypeManager.finder_to_interface): Removed.
3925         (TypeManager.finder_to_enum): Removed.
3926
3927         * interface.cs (Interface): Implement IMemberFinder.
3928
3929         * delegate.cs (Delegate): Implement IMemberFinder.
3930
3931         * enum.cs (Enum): Implement IMemberFinder.
3932
3933         * class.cs (TypeContainer): Implement IMemberFinder.
3934
3935 2002-08-12  Martin Baulig  <martin@gnome.org>
3936
3937         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
3938
3939 2002-08-12  Martin Baulig  <martin@gnome.org>
3940
3941         * ecore.cs (ITypeExpression): New interface for expressions which
3942         resolve to a type.
3943         (TypeExpression): Renamed to TypeLookupExpression.
3944         (Expression.DoResolve): If we're doing a types-only lookup, the
3945         expression must implement the ITypeExpression interface and we
3946         call DoResolveType() on it.
3947         (SimpleName): Implement the new ITypeExpression interface.
3948         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
3949         hack, the situation that we're only looking up types can't happen
3950         anymore when this method is called.  Moved the type lookup code to
3951         DoResolveType() and call it.
3952         (SimpleName.DoResolveType): This ITypeExpression interface method
3953         is now doing the types-only lookup.
3954         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
3955         (ResolveFlags): Added MaskExprClass.
3956
3957         * expression.cs (MemberAccess): Implement the ITypeExpression
3958         interface.
3959         (MemberAccess.DoResolve): Added support for a types-only lookup
3960         when we're called via ITypeExpression.DoResolveType().
3961         (ComposedCast): Implement the ITypeExpression interface.
3962
3963         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
3964         Expression.Resolve() with ResolveFlags.Type instead.
3965
3966 2002-08-12  Martin Baulig  <martin@gnome.org>
3967
3968         * interface.cs (Interface.Define): Apply attributes.
3969
3970         * attribute.cs (Attribute.ApplyAttributes): Added support for
3971         interface attributes.
3972
3973 2002-08-11  Martin Baulig  <martin@gnome.org>
3974
3975         * statement.cs (Block.Emit): Only check the "this" variable if we
3976         do not always throw an exception.
3977
3978         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
3979         whether the property has a set accessor.
3980
3981 2002-08-11  Martin Baulig  <martin@gnome.org>
3982
3983         Added control flow analysis support for structs.
3984
3985         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
3986         with control flow analysis turned off.
3987         (IVariable): New interface.
3988         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
3989         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
3990         (FieldExpr.DoResolve): Resolve the instance expression with flow
3991         analysis turned off and do the definite assignment check after the
3992         resolving when we know what the expression will resolve to.
3993
3994         * expression.cs (LocalVariableReference, ParameterReference):
3995         Implement the new IVariable interface, only call the flow analysis
3996         code if ec.DoFlowAnalysis is true.
3997         (This): Added constructor which takes a Block argument.  Implement
3998         the new IVariable interface.
3999         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
4000         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
4001         This does the definite assignment checks for struct members.
4002
4003         * class.cs (Constructor.Emit): If this is a non-static `struct'
4004         constructor which doesn't have any initializer, call
4005         Block.AddThisVariable() to tell the flow analysis code that all
4006         struct elements must be initialized before control returns from
4007         the constructor.
4008
4009         * statement.cs (MyStructInfo): New public class.
4010         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
4011         argument to this indexer.  If non-zero, check an individual struct
4012         member, not the whole struct.
4013         (FlowBranching.CheckOutParameters): Check struct members.
4014         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
4015         overloaded versions of these methods which take an additional
4016         `int field_idx' argument to check struct members.
4017         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
4018         overloaded versions of these methods which take an additional
4019         `string field_name' argument to check struct member.s
4020         (VariableInfo): Implement the IVariable interface.
4021         (VariableInfo.StructInfo): New public property.  Returns the
4022         MyStructInfo instance of the variable if it's a struct or null.
4023         (Block.AddThisVariable): New public method.  This is called from
4024         Constructor.Emit() for non-static `struct' constructor which do
4025         not have any initializer.  It creates a special variable for the
4026         "this" instance variable which will be checked by the flow
4027         analysis code to ensure that all of the struct's fields are
4028         initialized before control returns from the constructor.
4029         (UsageVector): Added support for struct members.  If a
4030         variable/parameter is a struct with N members, we reserve a slot
4031         in the usage vector for each member.  A struct is considered fully
4032         initialized if either the struct itself (slot 0) or all its
4033         members are initialized.
4034
4035 2002-08-08  Martin Baulig  <martin@gnome.org>
4036
4037         * driver.cs (Driver.MainDriver): Only report an error CS5001
4038         if there were no compilation errors.
4039
4040         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
4041         `UnsafeContext' property to determine whether the parent is in
4042         unsafe context rather than checking the parent's ModFlags:
4043         classes nested in an unsafe class are unsafe as well.
4044
4045 2002-08-08  Martin Baulig  <martin@gnome.org>
4046
4047         * statement.cs (UsageVector.MergeChildren): Distinguish between
4048         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
4049         we return.  Added test17() and test18() to test-154.cs.
4050
4051 2002-08-08  Martin Baulig  <martin@gnome.org>
4052
4053         * typemanager.cs (TypeManager.FilterWithClosure): If we have
4054         Family access, make sure the invoking type isn't a subclass of the
4055         queried type (that'd be a CS1540).
4056
4057         * ecore.cs (Expression.MemberLookup): Added overloaded version of
4058         this method which takes an additional `Type invocation_type'.
4059
4060         * expression.cs (BaseAccess.DoResolve): Use the base type as
4061         invocation and query type.
4062         (MemberAccess.DoResolve): If the lookup failed and we're about to
4063         report a CS0122, try a lookup with the ec.ContainerType - if this
4064         succeeds, we must report a CS1540.
4065
4066 2002-08-08  Martin Baulig  <martin@gnome.org>
4067
4068         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
4069         (MethodGroupExpr): Implement the IMemberExpr interface.
4070
4071         * expression (MemberAccess.ResolveMemberAccess): No need to have
4072         any special code for MethodGroupExprs anymore, they're now
4073         IMemberExprs.   
4074
4075 2002-08-08  Martin Baulig  <martin@gnome.org>
4076
4077         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
4078         Family, FamANDAssem and FamORAssem permissions.
4079         (TypeManager.IsSubclassOrNestedChildOf): New public method.
4080
4081 2002-08-08  Martin Baulig  <martin@gnome.org>
4082
4083         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
4084         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
4085         or loop block.
4086
4087 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
4088
4089         * driver.cs: implemented /resource option to embed managed resources.
4090
4091 2002-08-07  Martin Baulig  <martin@gnome.org>
4092
4093         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
4094         (FieldBase.HasFieldInitializer): New public property.
4095         (FieldBase.GetInitializerExpression): New public method.  Resolves and
4096         returns the field initializer and makes sure it is only resolved once.
4097         (TypeContainer.EmitFieldInitializers): Call
4098         FieldBase.GetInitializerExpression to get the initializer, this ensures
4099         that it isn't resolved multiple times.
4100
4101         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
4102         the resolving process (SimpleName/MemberLookup) that we're currently
4103         emitting a field initializer (which must not access any instance members,
4104         this is an error CS0236).
4105
4106         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
4107         argument, if the `IsFieldInitializer' flag is set, we must report and
4108         error CS0236 and not an error CS0120.   
4109
4110 2002-08-07  Martin Baulig  <martin@gnome.org>
4111
4112         * ecore.cs (IMemberExpr): New public interface.
4113         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
4114         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
4115         if the expression is an IMemberExpr.
4116
4117         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
4118         to be null, implicitly default to `this' if we're non-static in
4119         this case.  Simplified the code a lot by using the new IMemberExpr
4120         interface.  Also fixed bug #28176 here.
4121
4122 2002-08-06  Martin Baulig  <martin@gnome.org>
4123
4124         * cs-parser.jay (SimpleLookup): Removed.  We need to create
4125         ParameterReferences during semantic analysis so that we can do a
4126         type-only search when resolving Cast, TypeOf and SizeOf.
4127         (block): Pass the `current_local_parameters' to the Block's
4128         constructor.
4129
4130         * class.cs (ConstructorInitializer): Added `Parameters parameters'
4131         argument to the constructor.
4132         (ConstructorInitializer.Resolve): Create a temporary implicit
4133         block with the parameters.
4134
4135         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
4136         references here if we aren't doing a type-only search.
4137
4138         * statement.cs (Block): Added constructor which takes a
4139         `Parameters parameters' argument.
4140         (Block.Parameters): New public property.
4141
4142         * support.cs (InternalParameters.Parameters): Renamed `parameters'
4143         to `Parameters' and made it public readonly.
4144
4145 2002-08-06  Martin Baulig  <martin@gnome.org>
4146
4147         * ecore.cs (Expression.Warning): Made this public as well.
4148
4149         * report.cs (Report.Debug): Print the contents of collections.
4150
4151 2002-08-06  Martin Baulig  <martin@gnome.org>
4152
4153         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
4154         used to tell Resolve() which kinds of expressions it may return.
4155         (Expression.Resolve): Added overloaded version of this method which
4156         takes a `ResolveFlags flags' argument.  This can be used to tell
4157         Resolve() which kinds of expressions it may return.  Reports a
4158         CS0118 on error.
4159         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
4160         ResolveFlags.SimpleName.
4161         (Expression.Error118): Added overloaded version of this method which
4162         takes a `ResolveFlags flags' argument.  It uses the flags to determine
4163         which kinds of expressions are allowed.
4164
4165         * expression.cs (Argument.ResolveMethodGroup): New public method.
4166         Resolves an argument, but allows a MethodGroup to be returned.
4167         This is used when invoking a delegate.
4168
4169         * TODO: Updated a bit.
4170
4171 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4172
4173         Fixed compilation with csc.
4174
4175         * ecore.cs: Expression.Error made public. Is this correct? Should
4176         Warning be made public too?
4177
4178         * expression.cs: use ea.Location instead of ea.loc.
4179         [FIXME:  Filed as bug #28607: MCS must report these errors.]
4180
4181 2002-08-06  Martin Baulig  <martin@gnome.org>
4182
4183         * ecore.cs (Expression.loc): Moved the location here instead of
4184         duplicating it in all derived classes.
4185         (Expression.Location): New public property.
4186         (Expression.Error, Expression.Warning): Made them non-static and
4187         removed the location argument.
4188         (Expression.Warning): Added overloaded version which takes an
4189         `int level' argument.
4190         (Expression.Error118): Make this non-static and removed the
4191         expression and location arguments.
4192         (TypeExpr): Added location argument to the constructor.
4193
4194         * expression.cs (StaticCallExpr): Added location argument to
4195         the constructor.
4196         (Indirection, PointerArithmetic): Likewise.
4197         (CheckedExpr, UnCheckedExpr): Likewise.
4198         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
4199         (StringPtr): Likewise.
4200
4201
4202 2002-08-05  Martin Baulig  <martin@gnome.org>
4203
4204         * expression.cs (BaseAccess.DoResolve): Actually report errors.
4205
4206         * assign.cs (Assign.DoResolve): Check whether the source
4207         expression is a value or variable.
4208
4209         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
4210         while resolving the corresponding blocks.
4211
4212         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
4213         an error, don't silently return null.
4214
4215         * statement.cs (Block.AddVariable): Do the error reporting here
4216         and distinguish between CS0128 and CS0136.
4217         (Block.DoResolve): Report all unused labels (warning CS0164).
4218         (LabeledStatement): Pass the location to the constructor.
4219         (LabeledStatement.HasBeenReferenced): New property.
4220         (LabeledStatement.Resolve): Set it to true here.
4221
4222         * statement.cs (Return.Emit): Return success even after reporting
4223         a type mismatch error (CS0126 or CS0127), this is what csc does and
4224         it avoids confusing the users with any consecutive errors.
4225
4226 2002-08-05  Martin Baulig  <martin@gnome.org>
4227
4228         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
4229
4230         * const.cs (Const.LookupConstantValue): Catch circular definitions.
4231
4232         * expression.cs (MemberAccess.DoResolve): Silently return if an
4233         error has already been reported.
4234
4235         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
4236         error has already been reported.
4237
4238 2002-08-05  Martin Baulig  <martin@gnome.org>
4239
4240         * statement.cs (UsageVector): Only initialize the `parameters'
4241         vector if we actually have any "out" parameters.
4242
4243 2002-08-05  Martin Baulig  <martin@gnome.org>
4244
4245         * expression.cs (Binary.ResolveOperator): When combining delegates,
4246         they must have the same type.
4247
4248 2002-08-05  Martin Baulig  <martin@gnome.org>
4249
4250         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
4251         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
4252         work with the ms runtime and we also don't need it: if we're a
4253         PropertyBuilder and not in the `indexer_arguments' hash, then we
4254         are a property and not an indexer.
4255
4256         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
4257         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
4258         since the latter one doesn't work with the ms runtime.
4259
4260 2002-08-03  Martin Baulig  <martin@gnome.org>
4261
4262         Fixed bugs #27998 and #22735.
4263
4264         * class.cs (Method.IsOperator): New public field.
4265         (Method.CheckBase): Report CS0111 if there's already a method
4266         with the same parameters in the current class.  Report CS0508 when
4267         attempting to change the return type of an inherited method.
4268         (MethodData.Emit): Report CS0179 if a method doesn't have a body
4269         and it's not marked abstract or extern.
4270         (PropertyBase): New abstract base class for Property and Indexer.
4271         (PropertyBase.CheckBase): Moved here from Property and made it work
4272         for indexers.
4273         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
4274         the same so we can reuse it there.
4275         (Property, Indexer): Derive from PropertyBase.
4276         (MethodSignature.inheritable_property_signature_filter): New delegate
4277         to find properties and indexers.
4278
4279         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
4280         argument and improved error reporting.
4281
4282         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
4283         EmptyReadOnlyParameters and made it a property.
4284
4285         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
4286         version of this method which takes a `PropertyInfo indexer'.
4287         (TypeManager.RegisterIndexer): New method.
4288
4289         * class.cs: Added myself as author of this file :-)
4290
4291 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4292
4293         * class.cs: fixed compilation on windoze.
4294
4295 2002-08-03  Martin Baulig  <martin@gnome.org>
4296
4297         * interface.cs (Interface.GetInterfaceBases): Check whether all
4298         base interfaces are at least as accessible than the current one.
4299
4300         * class.cs (TypeContainer.GetClassBases): Check whether base types
4301         are at least as accessible than the current type.
4302         (TypeContainer.AsAccessible): Implemented and made non-static.
4303         (MemberBase.CheckParameters): Report errors if the accessibility
4304         checks fail.
4305
4306         * delegate.cs (Delegate.Delegate): The default visibility is
4307         internal for top-level types and private for nested types.
4308         (Delegate.Define): Report errors if the accessibility checks fail.
4309
4310         * enum.cs (Enum.Enum): The default visibility is internal for
4311         top-level types and private for nested types.
4312         (Enum.DefineType): Compute the correct visibility.
4313
4314         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
4315         function which takes a `bool is_toplevel' instead of a TypeContainer.
4316
4317         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
4318         builtin type.
4319
4320 2002-08-02  Martin Baulig  <martin@gnome.org>
4321
4322         * expression.cs (LocalVariableReferenc): Added constructor which
4323         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
4324         (LocalVariableReference.IsReadOnly): New property.
4325         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
4326         variable is readonly, use our own readonly flag to do this; you can
4327         use the new constructor to get a writable reference to a read-only
4328         variable.
4329
4330         * cs-parser.jay (foreach_statement, using_statement): Get a writable
4331         reference to the local variable.
4332
4333 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
4334
4335         * rootcontext.cs (ResolveCore): Also include System.Exception
4336
4337         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
4338         we reach an EmptyStatement.
4339
4340         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
4341         is also fine.
4342
4343         * expression.cs (Binary.ResolveOperator): Check error result in
4344         two places.
4345
4346         use brtrue/brfalse directly and avoid compares to null.
4347
4348 2002-08-02  Martin Baulig  <martin@gnome.org>
4349
4350         * class.cs (TypeContainer.Define): Define all nested interfaces here.
4351         Fixes bug #28407, added test-155.cs.
4352
4353 2002-08-01  Martin Baulig  <martin@gnome.org>
4354
4355         * class.cs (Event.EmitDefaultMethod): Make this work with static
4356         events.  Fixes #28311, added verify-3.cs.
4357
4358 2002-08-01  Martin Baulig  <martin@gnome.org>
4359
4360         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
4361         `is_disposable' fields.
4362         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
4363         `hm.is_disposable' if we're using the collection pattern.
4364         (Foreach.EmitCollectionForeach): Use the correct type for the
4365         enumerator's local variable, only emit the try/finally block if
4366         necessary (fixes #27713).
4367
4368 2002-08-01  Martin Baulig  <martin@gnome.org>
4369
4370         * ecore.cs (Expression.report118): Renamed to Error118 and made
4371         it public static.
4372
4373         * statement.cs (Throw.Resolve): Check whether the expression is of
4374         the correct type (CS0118) and whether the type derives from
4375         System.Exception (CS0155).
4376         (Catch.Resolve): New method.  Do the type lookup here and check
4377         whether it derives from System.Exception (CS0155).
4378         (Catch.CatchType, Catch.IsGeneral): New public properties.
4379
4380         * typemanager.cs (TypeManager.exception_type): Added.
4381
4382 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
4383
4384         * driver.cs: Updated About function.
4385
4386 2002-07-31  Martin Baulig  <martin@gnome.org>
4387
4388         Implemented Control Flow Analysis.
4389
4390         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
4391         (EmitContext.CurrentBranching): Added.
4392         (EmitContext.StartFlowBranching): Added.
4393         (EmitContext.EndFlowBranching): Added.
4394         (EmitContext.KillFlowBranching): Added.
4395         (EmitContext.IsVariableAssigned): Added.
4396         (EmitContext.SetVariableAssigned): Added.
4397         (EmitContext.IsParameterAssigned): Added.
4398         (EmitContext.SetParameterAssigned): Added.
4399         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
4400         Added control flow analysis stuff here.
4401
4402         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
4403         resolve the expression as lvalue.
4404         (LocalVariableReference.DoResolve): Check whether the variable has
4405         already been assigned.
4406         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
4407         the parameter as assigned here.
4408         (ParameterReference.DoResolve): Check whether the parameter has already
4409         been assigned.
4410         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
4411         expression as lvalue.
4412
4413         * statement.cs (FlowBranching): New class for the flow analysis code.
4414         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
4415         (LabeledStatement.IsDefined): New public property.
4416         (LabeledStatement.AddUsageVector): New public method to tell flow
4417         analyis that the label may be reached via a forward jump.
4418         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
4419         flow analysis.
4420         (VariableInfo.Number): New public field.  This is used by flow analysis
4421         to number all locals of a block.
4422         (Block.CountVariables): New public property.  This is the number of
4423         local variables in this block (including the locals from all parent
4424         blocks).
4425         (Block.EmitMeta): Number all the variables.
4426
4427         * statement.cs: Added flow analysis support to all classes.
4428
4429 2002-07-31  Martin Baulig  <martin@gnome.org>
4430
4431         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
4432         To get debugging messages, compile mcs with /define:MCS_DEBUG and
4433         then use this argument.
4434
4435         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
4436
4437         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
4438         use this to specify /define options.
4439
4440 2002-07-29  Martin Baulig  <martin@gnome.org>
4441
4442         * statement.cs (Fixed): Moved all code that does variable lookups
4443         and resolvings from Emit to Resolve.
4444
4445         * statement.cs (For): Moved all code that does variable lookups
4446         and resolvings from Emit to Resolve.
4447
4448         * statement.cs (Using): Moved all code that does variable lookups
4449         and resolvings from Emit to Resolve.
4450
4451 2002-07-29  Martin Baulig  <martin@gnome.org>
4452
4453         * attribute.cs (Attribute.Resolve): Explicitly catch a
4454         System.NullReferenceException when creating the
4455         CustromAttributeBuilder and report a different warning message.
4456
4457 2002-07-29  Martin Baulig  <martin@gnome.org>
4458
4459         * support.cs (ParameterData.ParameterName): Added method to
4460         get the name of a parameter.
4461
4462         * typemanager.cs (TypeManager.IsValueType): New public method.
4463
4464 2002-07-29  Martin Baulig  <martin@gnome.org>
4465
4466         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
4467         is a flag which specifies that it's either ref or out.
4468         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
4469         the out parameter to `out Parameter.Modifier mod', also set the
4470         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
4471
4472         * support.cs (InternalParameters.ParameterModifier): Distinguish
4473         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
4474         Parameter.Modifier.ISBYREF flag if it's either ref or out.
4475
4476         * expression.cs (Argument.GetParameterModifier): Distinguish
4477         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
4478         Parameter.Modifier.ISBYREF flag if it's either ref or out.
4479
4480 2002-07-29  Martin Baulig  <martin@gnome.org>
4481
4482         * expression.cs (ParameterReference.ParameterReference): Added
4483         `Location loc' argument to the constructor.
4484
4485         * cs-parser.jay: Pass location to ParameterReference.
4486
4487 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
4488
4489         * statement.cs (Try): Initialize the location.
4490
4491         * cs-parser.jay: pass location to Try.
4492
4493         * expression.cs (Unary.Reduce): Change the prototype to return
4494         whether a constant fold could be performed or not.  The result is
4495         returned in an out parameters.  In the case of Indirection and
4496         AddressOf, we want to perform the full tests.
4497
4498 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
4499
4500         * statement.cs (Statement.Emit): Flag dead code.
4501
4502 2002-07-27  Andrew Birkett  <andy@nobugs.org>
4503
4504         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
4505
4506 2002-07-27  Martin Baulig  <martin@gnome.org>
4507
4508         * class.cs (MethodData.Define): Put back call to
4509         TypeManager.AddMethod(), accidentally commented this out.
4510
4511         * report.cs (Debug): New public method to print debugging information,
4512         this is `[Conditional ("DEBUG")]'.
4513
4514 2002-07-26  Martin Baulig  <martin@gnome.org>
4515
4516         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
4517         (switch_statement): Push the current_block to the switch_stack and
4518         pop it again when we're done with the switch.
4519         (switch_section): The new block is a child of the current_block.
4520         Fixes bug #24007, added test-152.cs.
4521
4522 2002-07-27  Martin Baulig  <martin@gnome.org>
4523
4524         * expression.cs (Invocation.EmitArguments): When calling a varargs
4525         function with only its fixed arguments, we need to pass an empty
4526         array.
4527
4528 2002-07-27  Martin Baulig  <martin@gnome.org>
4529
4530         Mono 0.13 has been released.
4531
4532 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
4533
4534         * driver.cs: Rename --resource to --linkres, because that is what
4535         we do currently, we dont support --resource yet.
4536
4537         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
4538
4539 2002-07-25  Martin Baulig  <martin@gnome.org>
4540
4541         * class.cs (MethodData): New public class.  This is a `method builder'
4542         class for a method or one accessor of a Property/Indexer/Event.
4543         (MethodData.GetMethodFlags): Moved here from MemberBase.
4544         (MethodData.ApplyAttributes): Likewise.
4545         (MethodData.ApplyObsoleteAttribute): Likewise.
4546         (MethodData.ApplyConditionalAttribute): Likewise.
4547         (MethodData.ApplyDllImportAttribute): Likewise.
4548         (MethodData.CheckAbstractAndExternal): Likewise.
4549         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
4550         (MethodData.Emit): Formerly known as Method.Emit().
4551         (MemberBase): Moved everything which was specific to a single
4552         accessor/method to MethodData.
4553         (Method): Create a new MethodData and call Define() and Emit() on it.
4554         (Property, Indexer, Event): Create a new MethodData objects for each
4555         accessor and call Define() and Emit() on them.
4556
4557 2002-07-25  Martin Baulig  <martin@gnome.org>
4558
4559         Made MethodCore derive from MemberBase to reuse the code from there.
4560         MemberBase now also checks for attributes.
4561
4562         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
4563         (MemberBase.GetMethodFlags): Moved here from class Method and marked
4564         as virtual.
4565         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
4566         `CallingConventions cc' and `Attributes opt_attrs' arguments.
4567         (MemberBase.ApplyAttributes): New virtual method; applies the
4568         attributes to a method or accessor.
4569         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
4570         (MemberBase.ApplyConditionalAttribute): Likewise.
4571         (MemberBase.ApplyDllImportAttribute): Likewise.
4572         (MemberBase.CheckAbstractAndExternal): Likewise.
4573         (MethodCore.ParameterTypes): This is now a property instead of a
4574         method, it's initialized from DoDefineParameters().
4575         (MethodCore.ParameterInfo): Removed the set accessor.
4576         (MethodCore.DoDefineParameters): New protected virtual method to
4577         initialize ParameterTypes and ParameterInfo.
4578         (Method.GetReturnType): We can now simply return the MemberType.
4579         (Method.GetMethodFlags): Override the MemberBase version and add
4580         the conditional flags.
4581         (Method.CheckBase): Moved some code from Define() here, call
4582         DoDefineParameters() here.
4583         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
4584         here to avoid some larger code duplication.
4585         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
4586         ensure that abstract and external accessors don't declare a body.
4587
4588         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
4589         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
4590         lookup in the attribute's parent classes, so we need to abort as soon
4591         as we found the first match.
4592         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
4593         the attribute has no arguments.
4594
4595         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
4596         of a Method.
4597
4598 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4599
4600         * cs-parser.jay: reverted previous patch.
4601
4602 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4603
4604         * cs-parser.jay: fixed bug #22119.
4605
4606 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4607
4608         * attribute.cs: fixed compilation. The error was:
4609         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
4610         be assigned to before control leaves the current method."
4611         [FIXME:  Filed as bug #28186: MCS must report this error.]
4612
4613 2002-07-25  Martin Baulig  <martin@gnome.org>
4614
4615         * attribute.cs (Attribute.Conditional_GetConditionName): New static
4616         method to pull the condition name ouf of a Conditional attribute.
4617         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
4618         the obsolete message and error flag out of an Obsolete attribute.
4619
4620         * class.cs (Method.GetMethodFlags): New public method to get the
4621         TypeManager.MethodFlags for this method.
4622         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
4623         private methods.
4624         (Method.Define): Get and apply the Obsolete and Conditional attributes;
4625         if we're overriding a virtual function, set the new private variable
4626         `parent_method'; call the new TypeManager.AddMethod().
4627
4628         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
4629         the MethodBuilder and the Method in a PtrHashtable.
4630         (TypeManager.builder_to_method): Added for this purpose.
4631         (TypeManager.MethodFlags): Added IsObsoleteError.
4632         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
4633         Obsolete and Conditional arguments in MethodBuilders.  If we discover
4634         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
4635         the message from the attribute.
4636
4637 2002-07-24  Martin Baulig  <martin@gnome.org>
4638
4639         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
4640         preprocessor directives, ensure that the argument to #define/#undef is
4641         exactly one identifier and that it's actually an identifier.
4642
4643         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
4644         did not work ....
4645
4646 2002-07-24  Martin Baulig  <martin@gnome.org>
4647
4648         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
4649         initialize it to TypeManager.object_type in the constructor.
4650         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
4651         of the `hm.get_current' method if we're using the collection pattern.
4652         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
4653         for the explicit conversion to make it work when we're using the collection
4654         pattern and the `Current' property has a different return type than `object'.
4655         Fixes #27713.
4656
4657 2002-07-24  Martin Baulig  <martin@gnome.org>
4658
4659         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
4660         does not match, but don't report any errors.  This method is called in
4661         order for all methods in a MethodGroupExpr until a matching method is
4662         found, so we don't want to bail out if the first method doesn't match.
4663         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
4664         matches, report the 123.  Fixes #28070.
4665
4666 2002-07-24  Martin Baulig  <martin@gnome.org>
4667
4668         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
4669         TypeManager.TypeToCoreType() to the top of the method so the
4670         following equality checks will work.  Fixes #28107.
4671
4672 2002-07-24  Martin Baulig  <martin@gnome.org>
4673
4674         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
4675         operand is of type uint, and the other operand is of type sbyte,
4676         short or int, the operands are converted to type long." -
4677         Actually do what this comment already told us.  Fixes bug #28106,
4678         added test-150.cs.
4679
4680 2002-07-24  Martin Baulig  <martin@gnome.org>
4681
4682         * class.cs (MethodBase): New abstract class.  This is now a base
4683         class for Property, Indexer and Event to avoid some code duplication
4684         in their Define() and DefineMethods() methods.
4685         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
4686         generic methods for Define() and DefineMethods().
4687         (FieldBase): Derive from MemberBase, not MemberCore.
4688         (Property): Derive from MemberBase, not MemberCore.
4689         (Property.DefineMethod): Moved all the code from this method to the
4690         new MethodBase.DefineAccessor(), just call it with appropriate
4691         argumetnts.
4692         (Property.Define): Call the new Property.DoDefine(), this does some
4693         sanity checks and we don't need to duplicate the code everywhere.
4694         (Event): Derive from MemberBase, not MemberCore.
4695         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
4696         accessors, this will also make them work with interface events.
4697         (Indexer): Derive from MemberBase, not MemberCore.
4698         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
4699         (Indexer.Define): Use the new MethodBase functions.
4700
4701         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
4702         argument to the constructor.
4703         (Interface.FindMembers): Added support for interface events.
4704         (Interface.PopluateEvent): Implemented.
4705
4706         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
4707
4708 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
4709
4710         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
4711         but this is required to check for a method name being the same as
4712         the containing class.  
4713
4714         Handle this now.
4715
4716 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4717
4718         * interface.cs: initialize variable.
4719
4720 2002-07-23  Martin Baulig  <martin@gnome.org>
4721
4722         Implemented the IndexerName attribute in interfaces.
4723
4724         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
4725         name if this is an explicit interface implementation.
4726         (Indexer.InterfaceIndexerName): New public variable.  If we're
4727         implementing an interface indexer, this is the IndexerName in that
4728         interface.  Otherwise, it's the IndexerName.
4729         (Indexer.DefineMethod): If we're implementing interface indexer,
4730         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
4731         and Pending.ImplementIndexer methods.
4732         (Indexer.Define): Also define the PropertyBuilder if we're
4733         implementing an interface indexer and this is neither an explicit
4734         interface implementation nor do the IndexerName match the one in
4735         the interface.
4736
4737         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
4738         If a method is defined here, then we always need to create a proxy
4739         for it.  This is used when implementing interface indexers.
4740         (Pending.IsInterfaceIndexer): New public method.
4741         (Pending.ImplementIndexer): New public method.
4742         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
4743         This is used when implementing interface indexers to define a proxy
4744         if necessary.
4745         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
4746         define a proxy if necessary.
4747
4748         * interface.cs (Interface.IndexerName): New public variable.
4749         (Interface.PopulateIndexer): Set the IndexerName.
4750         (Interface.DefineIndexers): New private method.  Populate all the
4751         indexers and make sure their IndexerNames match.
4752
4753         * typemanager.cs (IndexerPropertyName): Added support for interface
4754         indexers.
4755
4756 2002-07-22  Martin Baulig  <martin@gnome.org>
4757
4758         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
4759         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
4760         ret if HasReturnLabel.
4761         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
4762         variables.
4763
4764         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
4765         and set the ec.LoopBeginTryCatchLevel.
4766         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
4767         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
4768         the current ec.TryCatchLevel, the branch goes out of an exception
4769         block.  In this case, we need to use Leave and not Br.
4770
4771 2002-07-22  Martin Baulig  <martin@gnome.org>
4772
4773         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
4774         block unless the block does not always return or it is contained in
4775         another try { ... } catch { ... } block.  Fixes bug #26506.
4776         Added verify-1.cs to the test suite.
4777
4778 2002-07-22  Martin Baulig  <martin@gnome.org>
4779
4780         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
4781         then we do not always return.  Fixes bug #24985.
4782
4783 2002-07-22  Martin Baulig  <martin@gnome.org>
4784
4785         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
4786         lookup on a per-class level; ie. walk up the class hierarchy until we
4787         found at least one applicable method, then choose the best among them.
4788         Fixes bug #24463 and test-29.cs.
4789
4790 2002-07-22  Martin Baulig  <martin@gnome.org>
4791
4792         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
4793         return types of the methods.  The return type is not part of the
4794         signature and we must not check it to make the `new' modifier work.
4795         Fixes bug #27999, also added test-147.cs.
4796         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
4797
4798         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
4799         on the method's return type.
4800
4801 2002-07-21  Martin Baulig  <martin@gnome.org>
4802
4803         * assign.cs: Make this work if the rightmost source is a constant and
4804         we need to do an implicit type conversion.  Also adding a few more tests
4805         to test-38.cs which should have caught this.
4806
4807         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
4808         target in the makefile for this.  The makefile.gnu is primarily intended
4809         for end-users who don't want to debug the compiler.
4810
4811 2002-07-21  Martin Baulig  <martin@gnome.org>
4812
4813         * assign.cs: Improved the Assign class so it can now handle embedded
4814         assignments (X = Y = Z = something).  As a side-effect this'll now also
4815         consume less local variables.  test-38.cs now passes with MCS, added
4816         a few new test cases to that test.
4817
4818 2002-07-20  Martin Baulig  <martin@gnome.org>
4819
4820         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
4821         instructions.  Fixes bug #27977, also added test-146.cs.
4822
4823 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4824
4825         * cs-tokenizer.cs: fixed getHex ().
4826
4827 2002-07-19  Martin Baulig  <martin@gnome.org>
4828
4829         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
4830         not Type.GetType() to lookup the array type.  This is needed when
4831         we're constructing an array of a user-defined type.
4832         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
4833         single-dimensional arrays, but also for single-dimensial arrays of
4834         type decimal.
4835
4836 2002-07-19  Martin Baulig  <martin@gnome.org>
4837
4838         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
4839         this function is called, it's not allowed to share LocalBuilders
4840         among ILGenerators.
4841
4842 2002-07-19  Martin Baulig  <martin@gnome.org>
4843
4844         * expression.cs (Argument.Resolve): Report an error 118 when trying
4845         to pass a type as argument.
4846
4847 2002-07-18  Martin Baulig  <martin@gnome.org>
4848
4849         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
4850         Conv_R_Un for the signed `long' type.
4851
4852 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
4853
4854         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
4855         `expr' for the temporary result, as that will fail if we do
4856         multiple resolves on the same expression.
4857
4858 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
4859
4860         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
4861         ec.TypeContainer for looking up aliases. 
4862
4863         * class.cs (TypeContainer): Remove LookupAlias from here.
4864
4865         * decl.cs (DeclSpace); Move here.
4866
4867 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
4868
4869         * class.cs (FindMembers): Only call filter if the constructor
4870         bulider is not null.
4871
4872         Also handle delegates in `NestedTypes' now.  Now we will perform
4873         type lookups using the standard resolution process.  This also
4874         fixes a bug.
4875
4876         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
4877         This uses Expressions (the limited kind that can be parsed by the
4878         tree) instead of strings.
4879
4880         * expression.cs (ComposedCast.ToString): Implement, used to flag
4881         errors since now we have to render expressions.
4882
4883         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
4884         FormArrayType. 
4885
4886         * ecore.cs (SimpleName.ToString): ditto.
4887
4888         * cs-parser.jay: Instead of using strings to assemble types, use
4889         Expressions to assemble the type (using SimpleName, ComposedCast,
4890         MemberAccess).  This should fix the type lookups in declarations,
4891         because we were using a different code path for this.
4892
4893         * statement.cs (Block.Resolve): Continue processing statements
4894         even when there is an error.
4895
4896 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
4897
4898         * class.cs (Event.Define): Also remove the `remove' method from
4899         the list of pending items.
4900
4901         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
4902         generate more compact code. 
4903
4904 2002-07-17  Martin Baulig  <martin@gnome.org>
4905
4906         * const.cs (Const.LookupConstantValue): Add support for constant
4907         `unchecked' and `checked' expressions.
4908         Also adding test case test-140.cs for this.
4909
4910 2002-07-17  Martin Baulig  <martin@gnome.org>
4911
4912         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
4913         check whether mi.ReturnType implements the IEnumerator interface; the
4914         `==' and the IsAssignableFrom() will fail in this situation.
4915
4916 2002-07-16  Ravi Pratap  <ravi@ximian.com>
4917
4918         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
4919         here too.
4920
4921 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4922
4923         * expression.cs: fixed bug #27811.
4924
4925 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
4926
4927         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
4928         Molaro: when we are a ref, the value already contains a pointer
4929         value, do not take the address of it.
4930
4931 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
4932         * removed mb-parser.jay and mb-tokenizer.cs
4933
4934 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
4935
4936         * expression.cs: check against the building corlib void type.
4937
4938 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
4939
4940         * ecore.cs: fix for valuetype static readonly fields: when 
4941         initializing them, we need their address, not the address of a copy.
4942
4943 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
4944
4945         * typemanager.cs: register also enum_type in corlib.
4946
4947 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
4948
4949         * class.cs: allow calling this (but not base) initializers in structs.
4950
4951 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
4952
4953         * ecore.cs: make sure we compare against the building base types
4954         in GetTypeSize ().
4955
4956 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
4957
4958         * typemanager.cs: fix TypeToCoreType() to handle void and object
4959         (corlib gets no more typerefs after this change).
4960
4961 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
4962
4963         * expression.cs (ArrayCreation.EmitArrayArguments): use
4964         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
4965
4966         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
4967         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
4968         array indexes, the runtime actually forbids them.
4969
4970         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
4971         for array arguments here.
4972
4973         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
4974         instead of the default for ValueTypes.
4975
4976         (New.DoEmit): Use IsValueType instead of
4977         IsSubclassOf (value_type)
4978         (New.DoResolve): ditto.
4979         (Invocation.EmitCall): ditto.
4980
4981         * assign.cs (Assign): ditto.
4982
4983         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
4984         Statements *are* currently doing part of their resolution during
4985         Emit.  
4986
4987         Expressions do always resolve during resolve, but statements are
4988         only required to propagate resolution to their children.
4989
4990 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
4991
4992         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
4993
4994         (LoadAssembly): Do not add the dll if it is already specified
4995         
4996         (MainDriver): Add the System directory to the link path at the end,
4997         after all the other -L arguments. 
4998
4999         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
5000         wrong opcode for loading bytes and bools (ldelem.i1 instead of
5001         ldelem.u1) and using the opposite for sbytes.
5002
5003         This fixes Digger, and we can finally run it.
5004
5005         * driver.cs (UnixParseOption): Move the option parsing here.  
5006         (CSCParseOption): Implement CSC-like parsing of options.
5007
5008         We now support both modes of operation, the old Unix way, and the
5009         new CSC-like way.  This should help those who wanted to make cross
5010         platform makefiles.
5011
5012         The only thing broken is that /r:, /reference: and /lib: are not
5013         implemented, because I want to make those have the same semantics
5014         as the CSC compiler has, and kill once and for all the confussion
5015         around this.   Will be doing this tomorrow.
5016
5017         * statement.cs (Unsafe.Resolve): The state is checked during
5018         resolve, not emit, so we have to set the flags for IsUnsfe here.
5019
5020 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
5021
5022         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
5023         not catch the Error_ObjectRefRequired in SimpleName (as it is
5024         possible to have a class/instance variable name that later gets
5025         deambiguated), we have to check this here.      
5026
5027 2002-07-10  Ravi Pratap  <ravi@ximian.com>
5028
5029         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
5030         make static and put into Expression.
5031
5032         (Event.Define): Register the private field of the event with the 
5033         TypeManager so that GetFieldFromEvent can get at it.
5034
5035         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
5036         keep track of the private field associated with an event which
5037         has no accessors.
5038
5039         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
5040         private field.
5041
5042         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
5043         
5044 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
5045
5046         * expression.cs (Binary.EmitBranchable): this routine emits the
5047         Binary expression in a branchable context.  This basically means:
5048         we need to branch somewhere, not just get the value on the stack.
5049
5050         This works together with Statement.EmitBoolExpression.
5051
5052         * statement.cs (Statement.EmitBoolExpression): Use
5053         EmitBranchable. 
5054
5055 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
5056
5057         * statement.cs (For): Reduce the number of jumps in loops.
5058
5059         (For): Implement loop inversion for the For statement.
5060
5061         (Break): We can be breaking out of a Try/Catch controlled section
5062         (foreach might have an implicit try/catch clause), so we need to
5063         use Leave instead of Br.
5064
5065         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
5066         now).  If the instace expression supports IMemoryLocation, we use
5067         the AddressOf method from the IMemoryLocation to extract the
5068         address instead of emitting the instance.
5069
5070         This showed up with `This', as we were emitting the instance
5071         always (Emit) instead of the Address of This.  Particularly
5072         interesting when This is a value type, as we dont want the Emit
5073         effect (which was to load the object).
5074         
5075 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
5076
5077         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
5078
5079         * statement.cs (Checked): Set the CheckedState during the resolve
5080         process too, as the ConvCast operations track the checked state on
5081         the resolve process, and not emit.
5082
5083         * cs-parser.jay (namespace_member_declaration): Flag that we have
5084         found a declaration when we do.  This is used to flag error 1529
5085
5086         * driver.cs: Report ok when we display the help only.
5087
5088 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
5089
5090         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
5091
5092 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
5093
5094         * cs-tokenizer.cs (define): We also have to track locally the
5095         defines.  AllDefines is just used for the Conditional Attribute,
5096         but we also need the local defines for the current source code. 
5097
5098 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
5099
5100         * statement.cs (While, For, Do): These loops can exit through a
5101         Break statement, use this information to tell whether the
5102         statement is the last piece of code.
5103
5104         (Break): Flag that we break.
5105
5106         * codegen.cs (EmitContexts): New `Breaks' state variable.
5107
5108 2002-07-03  Martin Baulig  <martin@gnome.org>
5109
5110         * class.cs (TypeContainer.MethodModifiersValid): Allow override
5111         modifiers in method declarations in structs.  Otherwise, you won't
5112         be able to override things like Object.Equals().
5113
5114 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
5115
5116         * class.cs (Method, Property, Indexer): Do not allow the public
5117         modifier to be used in explicit interface implementations.
5118
5119         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
5120         override modifiers in method declarations in structs
5121
5122 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
5123
5124         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
5125         integer or real overflow, report an error
5126
5127 2002-07-02  Martin Baulig  <martin@gnome.org>
5128
5129         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
5130         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
5131         to tell the runtime about our newly created System.Object and
5132         System.ValueType types.
5133
5134 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
5135
5136         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
5137         struct instead of Ldarg/Starg.
5138
5139 2002-07-02  Martin Baulig  <martin@gnome.org>
5140
5141         * expression.cs (Indirection.Indirection): Call
5142         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
5143
5144 2002-07-02  Martin Baulig  <martin@gnome.org>
5145
5146         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
5147         ValueType, call TypeManager.TypeToCoreType() on it.
5148         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
5149         the OpCodes.Newarr argument.
5150
5151 2002-07-02  Martin Baulig  <martin@gnome.org>
5152
5153         * expression.cs (Invocation.EmitCall): When compiling corlib,
5154         replace all calls to the system's System.Array type to calls to
5155         the newly created one.
5156
5157         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
5158         System.Array methods.
5159         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
5160         from the system's System.Array type which must be replaced.
5161
5162 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
5163
5164         * typemanager.cs: load unverifiable_code_ctor so we can build
5165         corlib using the correct type. Avoid using GetTypeCode() with
5166         TypeBuilders.
5167         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
5168         TypeManager.object_type to allow building corlib.
5169
5170 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
5171
5172         * ecore.cs: handle System.Enum separately in LoadFromPtr().
5173
5174 2002-07-01  Martin Baulig  <martin@gnome.org>
5175
5176         * class.cs: Make the last change actually work, we need to check
5177         whether `ifaces != null' to avoid a crash.
5178
5179 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
5180
5181         * class.cs: when we build structs without fields that implement
5182         interfaces, we need to add the interfaces separately, since there is
5183         no API to both set the size and add the interfaces at type creation
5184         time.
5185
5186 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
5187
5188         * expression.cs: the dimension arguments to the array constructors
5189         need to be converted if they are a long.
5190
5191 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
5192
5193         * class.cs: don't emit ldarg.0 if there is no parent constructor
5194         (fixes showstopper for corlib).
5195
5196 2002-06-29  Martin Baulig  <martin@gnome.org>
5197
5198         MCS now compiles corlib on GNU/Linux :-)
5199
5200         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
5201         ie. check for MethodImplOptions.InternalCall.
5202
5203         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
5204         and TypeManager.attribute_type are null, so we must explicitly check
5205         whether parent is not null to find out whether it's an attribute type.
5206         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
5207         and SetBuilder, not only if the property is neither abstract nor external.
5208         This is necessary to set the MethodImplOptions on the accessor methods.
5209         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
5210         SetBuilder, see Property.Emit().
5211
5212         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
5213         populate "System.Object", "System.ValueType" and "System.Attribute" since
5214         they've already been populated from BootCorlib_PopulateCoreTypes().
5215
5216 2002-06-29  Martin Baulig  <martin@gnome.org>
5217
5218         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
5219         is the NullLiteral, we also need to make sure that target_type is not
5220         an enum type.   
5221
5222 2002-06-29  Martin Baulig  <martin@gnome.org>
5223
5224         * rootcontext.cs (RootContext.ResolveCore): We must initialize
5225         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
5226         before calling BootstrapCorlib_ResolveDelegate ().
5227
5228 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5229
5230         * statement.cs: fixed build-breaker. All tests passed ok.
5231
5232 2002-06-27  Martin Baulig  <martin@gnome.org>
5233
5234         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
5235         for System.Decimal when compiling corlib.
5236
5237 2002-06-27  Martin Baulig  <martin@gnome.org>
5238
5239         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
5240         switch blocks which contain nothing but a default clause.
5241
5242 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
5243
5244        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
5245
5246 2002-06-27  Martin Baulig  <martin@gnome.org>
5247
5248         * ecore.cs (PropertyExpr.PropertyExpr): Call
5249         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
5250
5251         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
5252         is already a TypeBuilder.
5253
5254 2002-06-27  Martin Baulig  <martin@gnome.org>
5255
5256         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
5257         `target_type == TypeManager.array_type', not IsAssignableFrom() in
5258         the "from an array-type to System.Array" case.  This makes it work
5259         when compiling corlib.
5260
5261 2002-06-27  Martin Baulig  <martin@gnome.org>
5262
5263         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
5264         non-static PropertyExpr, set its InstanceExpression.  This makes
5265         the `ICollection.Count' property work in System/Array.cs.
5266
5267 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
5268
5269         * driver.cs: Made error handling more consistent.  Errors now
5270         tracked by Report class, so many methods which used to return int
5271         now return void.  Main() now prints success/failure and 
5272         errors/warnings message.
5273
5274         Renamed '--probe' compiler argument to '--expect-error'.  Removed
5275         the magic number return values (123 and 124).  Now, if the
5276         expected error occurs, the compiler exits with success (exit value
5277         0).  If the compilation completes without seeing that particular
5278         error, the compiler exits with failure (exit value 1).  The
5279         makefile in mcs/errors has been changed to handle the new behaviour.
5280
5281         * report.cs: Made 'expected error' number a property and renamed
5282         it from 'Probe' to 'ExpectedError'.
5283
5284         * genericparser.cs: Removed error handling support, since it is
5285         now all done by Report class.
5286
5287         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
5288         class, so parse() no longer returns an int.
5289
5290         * namespace.cs: Use Report.Error instead of GenericParser.error
5291
5292 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
5293
5294         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
5295         TypeContainer.AddOperator): At the front of the list put the
5296         explicit implementations, so they get resolved/defined first. 
5297
5298 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
5299
5300         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
5301         interface type is implemented by this TypeContainer.  Used during
5302         explicit interface implementation.
5303
5304         (Property.Define, Indexer.Define, Method.Define): Validate that
5305         the given interface in the explicit implementation is one of the
5306         base classes for the containing type.
5307
5308         Also if we are explicitly implementing an interface, but there is
5309         no match in the pending implementation table, report an error.
5310
5311         (Property.Define): Only define the property if we are
5312         not explicitly implementing a property from an interface.  Use the
5313         correct name also for those properties (the same CSC uses,
5314         although that is really not needed).
5315         
5316         (Property.Emit): Do not emit attributes for explicitly implemented
5317         properties, as there is no TypeBuilder.
5318
5319         (Indexer.Emit): ditto.
5320
5321         Hiding then means that we do not really *implement* a pending
5322         implementation, which makes code fail.
5323
5324 2002-06-22  Martin Baulig  <martin@gnome.org>
5325
5326         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
5327         the return value of Object.GetType().  [FIXME: we need to do this whenever
5328         we get a type back from the reflection library].
5329
5330 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
5331
5332         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
5333
5334 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
5335
5336         * attribute.cs: Return null if we can not look up the type.
5337
5338         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
5339         the interface types found.
5340
5341         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
5342         interface types found.
5343
5344         * typemanager.cs (GetInterfaces): Make this routine returns alll
5345         the interfaces and work around the lame differences between
5346         System.Type and System.Reflection.Emit.TypeBuilder in the results
5347         result for GetInterfaces.
5348         
5349         (ExpandInterfaces): Given an array of interface types, expand and
5350         eliminate repeated ocurrences of an interface.  This expands in
5351         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
5352         be IA, IB, IC.
5353         
5354 2002-06-21  Martin Baulig  <martin@gnome.org>
5355
5356         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
5357         on System.Enum.
5358
5359 2002-06-21  Martin Baulig  <martin@gnome.org>
5360
5361         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
5362         and called with one of the core types, return the corresponding typebuilder for
5363         that type.
5364
5365         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
5366         element type.
5367
5368 2002-06-21  Martin Baulig  <martin@gnome.org>
5369
5370         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
5371         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
5372         (Expression.ConvertReferenceExplicit): Likewise.
5373
5374         * expression.cs (ElementAccess.DoResolve): Likewise.
5375         (ElementAccess.DoResolveLValue): Likewise.
5376
5377 2002-06-10  Martin Baulig  <martin@gnome.org>
5378
5379         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
5380         add the "value" parameter to the parameter list.
5381
5382         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
5383         to our caller.
5384
5385 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
5386
5387         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
5388         the argument to an int, uint, long or ulong, per the spec.  Also
5389         catch negative constants in array creation.
5390
5391 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
5392
5393         * class.cs: do not allow the same interface to appear twice in
5394         the definition list.
5395
5396 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
5397
5398         * ecore.cs: don't use ldlen with System.Array.
5399
5400 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
5401
5402         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
5403
5404 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
5405
5406         * modifiers.cs: produce correct field attributes for protected
5407         internal. Easy fix so miguel can work on ther harder stuff:-)
5408
5409 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
5410
5411         * pending.cs: New file.  Move the code from class.cs here.
5412         Support clearning the pending flag for all methods (when not doing
5413         explicit interface implementation).
5414
5415 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
5416
5417         * rootcontext.cs: added a couple more types needed to bootstrap.
5418
5419 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
5420
5421         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
5422         constructor in the type, instead of any constructor in the type
5423         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
5424         a bug in the Mono runtime when applying the params attribute). 
5425
5426 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
5427         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
5428
5429 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
5430
5431         * expression.cs (Unary.ResolveOperator): Use TypeManager
5432         to resolve the type.
5433         
5434 2002-06-13  Ravi Pratap  <ravi@ximian.com>
5435
5436         * cs-parser.jay (enum_member_declaration): Pass in the attributes
5437         attached.
5438
5439         * enum.cs (AddEnumMember): Add support to store the attributes associated 
5440         with each member too.
5441
5442         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
5443         field builders too - this takes care of the enum member case.
5444
5445 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
5446
5447         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
5448         address-of operator on both value types and pointers.
5449         
5450 2002-06-10  Martin Baulig  <martin@gnome.org>
5451
5452         * interface.cs (Interface.PopulateIndexer): Add the indexer's
5453         PropertyBuilder to the `property_builders' list.
5454
5455         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
5456         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
5457         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
5458         find any indexers which are inherited from an interface.
5459
5460 2002-06-09  Martin Baulig  <martin@gnome.org>
5461
5462         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
5463         the same type as the constant if necessary.  There's also a test-130.cs
5464         for this.
5465
5466         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
5467
5468         * typemanager.cs (TypeManager.ChangeType): Previously known as
5469         Enum.ChangeEnumType().
5470
5471 2002-06-09  Martin Baulig  <martin@gnome.org>
5472
5473         * expression.cs (Cast.TryReduce): Added support for consts.
5474
5475 2002-06-08  Ravi Pratap  <ravi@ximian.com>
5476
5477         * class.cs (Accessor): Hold attributes information so we can pass
5478         it along.
5479
5480         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
5481         Modify to pass in attributes attached to the methods.
5482
5483         (add_accessor_declaration, remove_accessor_declaration): Ditto.
5484
5485         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
5486         to handle the Accessor kind :-)
5487
5488         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
5489         
5490 2002-06-08  Martin Baulig  <martin@gnome.org>
5491
5492         * expression.cs (Unary.TryReduceNegative): Added support for
5493         ULongConstants.
5494
5495 2002-06-08  Martin Baulig  <martin@gnome.org>
5496
5497         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
5498         name can't be found in the `defined_names' - the caller will do a
5499         MemberLookup in this case and thus find methods in System.Enum
5500         such as Enum.IsDefined().
5501
5502 2002-06-08  Martin Baulig  <martin@gnome.org>
5503
5504         * enum.cs (Enum.ChangeEnumType): This is a custom version of
5505         Convert.ChangeType() which works with TypeBuilder created types.
5506         (Enum.LookupEnumValue, Enum.Define): Use it here.
5507
5508         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
5509         `TypeBuilder.BaseType != null' check.
5510         (TypeContainer.FindMembers): Only lookup parent members if we
5511         actually have a parent.
5512         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
5513         (ConstructorInitializer.Resolve): Likewise.
5514
5515         * interface.cs (Interface.FindMembers): Added
5516         `TypeBuilder.BaseType != null' check.
5517
5518         * rootcontext.cs (RootContext.ResolveCore): Added
5519         "System.Runtime.CompilerServices.IndexerNameAttribute" to
5520         classes_second_stage.
5521
5522         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
5523         debug_type and trace_type when compiling with --nostdlib.       
5524
5525 2002-06-07  Martin Baulig  <martin@gnome.org>
5526
5527         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
5528         (AddField): Set it to true when adding a non-static field.
5529         (DefineType): Use `have_nonstatic_fields' to find out whether we
5530         have non-static fields, not `Fields != null'.
5531
5532 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
5533
5534         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
5535         dereferencing a null on the static-field code path)
5536
5537 2002-05-30  Martin Baulig  <martin@gnome.org>
5538
5539         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
5540         to take command line arguments.  Use reflection to call the new
5541         custom `Initialize' function on the symbol writer and pass it the
5542         command line arguments.
5543
5544         * driver.cs (--debug-args): New command line argument to pass command
5545         line arguments to the symbol writer.
5546
5547 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
5548
5549         * assign.cs (DoResolve): Forgot to do the implicit conversion to
5550         the target type for indexers and properties.  Thanks to Joe for
5551         catching this.
5552
5553 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
5554
5555         * typemanager.cs (MethodFlags): returns the method flags
5556         (Obsolete/ShouldIgnore) that control warning emission and whether
5557         the invocation should be made, or ignored. 
5558
5559         * expression.cs (Invocation.Emit): Remove previous hack, we should
5560         not do this on matching a base type, we should do this based on an attribute
5561
5562         Only emit calls to System.Diagnostics.Debug and
5563         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
5564         on the command line.
5565
5566         * rootcontext.cs: Global settings for tracing and debugging.
5567
5568         * cs-tokenizer.cs (define): New utility function to track
5569         defines.   Set the global settings for TRACE and DEBUG if found.
5570
5571 2002-05-25  Ravi Pratap  <ravi@ximian.com>
5572
5573         * interface.cs (Populate*): Pass in the TypeContainer as well as
5574         the DeclSpace as parameters so that we can create EmitContexts and
5575         then use that to apply attributes etc.
5576
5577         (PopulateMethod, PopulateEvent, PopulateProperty)
5578         (PopulateIndexer): Apply attributes everywhere.
5579
5580         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
5581         etc.
5582
5583         (ApplyAttributes): Update accordingly.
5584
5585         We now apply interface attributes for all members too.
5586
5587 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
5588
5589         * class.cs (Indexer.Define); Correctly check if we are explicit
5590         implementation (instead of checking the Name for a ".", we
5591         directly look up if the InterfaceType was specified).
5592
5593         Delay the creation of the PropertyBuilder.
5594
5595         Only create the PropertyBuilder if we are not an explicit
5596         interface implementation.   This means that explicit interface
5597         implementation members do not participate in regular function
5598         lookups, and hence fixes another major ambiguity problem in
5599         overload resolution (that was the visible effect).
5600
5601         (DefineMethod): Return whether we are doing an interface
5602         implementation. 
5603         
5604         * typemanager.cs: Temporary hack until we get attributes in
5605         interfaces (Ravi is working on that) and we get IndexerName
5606         support in interfaces.
5607
5608         * interface.cs: Register the indexers as properties.
5609
5610         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
5611         warning, I have verified that this is a bug in the .NET runtime
5612         (JavaScript suffers of the same problem).
5613
5614         * typemanager.cs (MemberLookup): When looking up members for
5615         interfaces, the parent of an interface is the implicit
5616         System.Object (so we succeed in searches of Object methods in an
5617         interface method invocation.  Example:  IEnumerable x;  x.ToString
5618         ()) 
5619
5620 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
5621
5622         * class.cs (Event): Events should also register if they do
5623         implement the methods that an interface requires.
5624
5625         * typemanager.cs (MemberLookup); use the new GetInterfaces
5626         method. 
5627
5628         (GetInterfaces): The code used to lookup interfaces for a type is
5629         used in more than one place, factor it here. 
5630
5631         * driver.cs: Track the errors at the bottom of the file, we kept
5632         on going.
5633
5634         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
5635         instance if the method we are calling is static!
5636
5637 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
5638
5639         * attribute.cs (ApplyAttributes): Make this function filter out
5640         the IndexerName attribute (as that attribute in reality is never
5641         applied) and return the string constant for the IndexerName
5642         attribute. 
5643
5644         * class.cs (TypeContainer.Emit): Validate that all the indexers
5645         have the same IndexerName attribute, and if so, set the
5646         DefaultName attribute on the class. 
5647
5648         * typemanager.cs: The return value might contain other stuff (not
5649         only methods).  For instance, consider a method with an "Item"
5650         property and an Item method.
5651
5652         * class.cs: If there is a problem with the parameter types,
5653         return. 
5654
5655 2002-05-24  Ravi Pratap  <ravi@ximian.com>
5656
5657         * ecore.cs (ImplicitConversionExists): Wrapper function which also
5658         looks at user defined conversion after making a call to 
5659         StandardConversionExists - we need this for overload resolution.
5660
5661         * expression.cs : Update accordingly the various method calls.
5662
5663         This fixes 2 bugs filed against implicit user defined conversions 
5664
5665 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
5666
5667         * statement.cs: Track the result of the assignment.
5668
5669 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
5670
5671         * expression.cs (MemberAccess): Improved error reporting for
5672         inaccessible members.
5673
5674 2002-05-22  Martin Baulig  <martin@gnome.org>
5675
5676         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
5677         itself with debugging support.
5678
5679 2002-05-22  Martin Baulig  <martin@gnome.org>
5680
5681         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
5682         Removed, this isn't needed anymore.
5683
5684 2002-05-20  Martin Baulig  <martin@gnome.org>
5685
5686         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
5687         be underlying type for an enum.
5688
5689 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
5690
5691         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
5692         that splits out the loading of just the core types.
5693
5694         * rootcontext.cs (ResolveCore): Split the struct resolution in
5695         two, so we can load the enumeration underlying types before any
5696         enums are used.
5697
5698         * expression.cs (Is): Bandaid until we fix properly Switch (see
5699         bug #24985 for details).
5700
5701         * typemanager.cs (ImplementsInterface): The hashtable will contain
5702         a null if there are no interfaces implemented.
5703
5704 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
5705
5706         * cs-parser.jay (indexer_declarator): It is fine to have array
5707         parameters
5708
5709 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
5710
5711         * typemanager.cs: (RegisterBuilder): New function used to register
5712         TypeBuilders that implement interfaces.  Since
5713         TypeBuilder.GetInterfaces (as usual) does not work with lame
5714         Reflection.Emit. 
5715         (AddUserType): register interfaces.
5716
5717         (ImplementsInterface): Use the builder_to_ifaces hash if we are
5718         dealing with TypeBuilder.  Also, arrays are showing up as
5719         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
5720         methods can not be invoked on them!
5721
5722         * ecore.cs (ExplicitReferenceConversionExists): Made public.
5723         (ImplicitReferenceConversionExists): Split out from
5724         StandardConversionExists. 
5725
5726         * expression.cs (As): We were only implementing one of the three
5727         cases for the as operator.  We now implement them all.
5728         (Is): Implement the various other cases for Is as well.
5729
5730         * typemanager.cs (CACHE): New define used to control if we want or
5731         not the FindMembers cache.  Seems to have a negative impact on
5732         performance currently
5733
5734         (MemberLookup): Nested types have full acess to
5735         enclosing type members
5736
5737         Remove code that coped with instance/static returns for events, we
5738         now catch this in RealFindMembers.
5739
5740         (RealFindMembers): only perform static lookup if the instance
5741         lookup did not return a type or an event.  
5742
5743 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
5744
5745         * assign.cs (CompoundAssign): We pass more semantic information
5746         now to Compound Assignments than we did before: now we have all
5747         the information at hand, and now we resolve the target *before* we
5748         do the expression expansion, which allows the "CacheValue" method
5749         to have the effect we intended (before, a [x] += 1 would generate
5750         two differen ArrayAccess expressions from the ElementAccess,
5751         during the resolution process).
5752
5753         (CompoundAssign.DoResolve): Resolve target and original_source here.
5754
5755 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
5756
5757         * expression.cs (ArrayAccess): dropped debugging information. 
5758
5759         * typemanager.cs: Small bug fix: I was always returning i_members,
5760         instead of one of i_members or s_members (depending on which had
5761         the content).
5762
5763         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
5764         method is invoked before any code generation takes place, and it
5765         is a mechanism to inform that the expression will be invoked more
5766         than once, and that the method should use temporary values to
5767         avoid having side effects
5768
5769         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
5770         
5771         * ecore.cs (Expression.CacheTemporaries): Provide empty default
5772         implementation.
5773
5774         * expression.cs (Indirection, ArrayAccess): Add support for
5775         CacheTemporaries in these two bad boys. 
5776
5777         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
5778         ldobj or ldind_ref.  
5779         (StoreFromPtr): Handle stobj as well.
5780
5781         * expression.cs (UnaryMutator): Share more code.
5782         
5783         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
5784         down: I was not tracking the Filter function as well, which
5785         was affecting the results of the cache.
5786
5787 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
5788
5789         * attribute.cs: Remove the hack to handle the CharSet property on
5790         StructLayouts. 
5791
5792 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
5793
5794         * attribute.cs (DoResolve): More uglyness, we now only try to
5795         resolve the attribute partially, to extract the CharSet
5796         information (only if we are a StructLayout attribute).  Otherwise 
5797
5798         (GetExtraTypeInfo): Add some code to conditionally kill in the
5799         future this.   I am more and more convinced that the .NET
5800         framework has special code to handle the attribute setting on
5801         certain elements.
5802
5803         * expression.cs (IsParamsMethodApplicable): Revert my previous
5804         foreach change here, it was wrong.
5805
5806 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
5807
5808         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
5809         (pp_expr): do not abort on unknown input, just return.
5810         (eval): abort if there are pending chars.
5811
5812         * attribute.cs (Attribute.Resolve): Positional parameters are
5813         optional.  Deal with that case.
5814
5815         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
5816         the Ansi/Unicode/Auto information for the type.
5817
5818         (TypeContainer.DefineType): instantiate the EmitContext here, as
5819         we will be using it during the type definition (to resolve
5820         attributes) and during the emit phase.
5821
5822         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
5823         to pull type information out of the attributes
5824
5825         (Attribute.Resolve): track the constructor builder, and allow for
5826         multiple invocations (structs and classes will use this).
5827
5828         * ecore.cs (MemberLookupFinal): new version with all the
5829         parameters customizable.
5830
5831         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
5832         constructors.  Return if the result value is null (as the error
5833         would have been flagged already by MemberLookupFinal)
5834
5835         Do not allow instances of abstract classes or interfaces to be
5836         created.
5837         
5838         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
5839         We have to compare the assembly property here when dealing with
5840         FamANDAssem and Assembly access modifiers, because we might be
5841         creating an assembly from *modules* (that means that we are not
5842         getting TypeBuilders for types defined in other modules that are
5843         part of this assembly).
5844
5845         (Method.Emit): If the method is marked abstract and has a body,
5846         emit an error. 
5847
5848         (TypeContainer.DefineMembers): If both the defined member and the
5849         parent name match are methods, then do not emit any warnings: let
5850         the Method.Define routine take care of flagging warnings.  But if
5851         there is a mismatch (method overrides something else, or method is
5852         overriwritten by something, then emit warning).
5853
5854         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
5855         set to null, this means `do not check for the return type on the
5856         signature'. 
5857
5858         (Method.Define): set the return type for the method signature to
5859         null, so that we get methods with the same name and parameters and
5860         different return types.  This is used to flag warning 114 (you are
5861         hiding a method, and you probably want to use the new/override
5862         keywords instead).
5863
5864         * typemanager.cs (MemberLookup): Implemented proper access
5865         control, closing a long standing set of bug reports.  The problem
5866         was that the Framework only has two bits: Public and NonPublic,
5867         and NonPublic includes private and protected methods, but we need
5868         to enforce the FamANDAssem, FamOrAssem and Family. 
5869
5870 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
5871
5872         * statement.cs (GotoCase): Return true: Ammounts to giving up
5873         knowledge on whether we return or not, and letting the other case
5874         be responsible for it.
5875
5876 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
5877
5878         * driver.cs: Do not load directories for each file processed, only
5879         do it if there is a pattern.
5880
5881         * ecore.cs: Report readonly assigns here as well, as we might have
5882         been resolved only by MemberAccess.
5883
5884         (SimpleName.SimpleNameResolve): Also be useful for LValue
5885         resolution.   We need this to propagate assign to local readonly variables
5886
5887         * typemanager.cs: Use a ptrhashtable for the criteria, because we
5888         do not want to reuse potential criteria memory.
5889
5890         * class.cs (MyEventBuilder): Set reflected_type;
5891
5892         * ecore.cs (Constantify): Added support for constifying bools.
5893
5894         (RootContext.LookupType): Added a cache for values looked up in
5895         the declaration space.
5896
5897         * typemanager.cs (FindMembers): Now is a front-end to
5898         RealFindMembers, and provides a two-level hashtable-based cache to
5899         the request.  
5900
5901         15% performance improvement: from 22.5 to 19.2 seconds.
5902
5903         * expression.cs (IsParamsMethodApplicable): use foreach.
5904         (Invocation.DoResolve): ditto.
5905         (New.DoResolve): ditto.
5906         (ArrayCreation.DoResolve): ditto.
5907
5908         * ecore.cs (FindMostEncompassingType): use foreach.
5909
5910         * delegate.cs (NewDelegate.DoResolve): Use foreach
5911
5912         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
5913         (RemoveMethods): use foreach.
5914
5915         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
5916         nested foreach statements instead of for, and also break out of
5917         the inner loop once a match is found.
5918         
5919         (Invocation.OverloadResolve): Use foreach, simplify the code. 
5920
5921 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
5922
5923         * cfold.cs (BinaryFold): During an enumeration evaluation context,
5924         we actually unwrap the expression to allow for extra information
5925         to be extracted. 
5926
5927         * expression.cs: Use Shr_Un on unsigned operations. 
5928
5929 2002-05-08  Ravi Pratap  <ravi@ximian.com>
5930
5931         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
5932         applicable operators was not being considered correctly. This closes
5933         the bug Miguel reported.
5934
5935 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
5936
5937         * attribute.cs: check that the type derives from System.Attribute
5938         and report the correct error in that case (moved the duplicate code to
5939         its own method, too).
5940
5941 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
5942
5943         * attribute.cs: lookup attribute type name as the spec says: first the
5944         bare attribute name and then name + "Attribute" (nant compiles with
5945         mcs after this fix).
5946
5947 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
5948
5949         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
5950         Because of the way we parse things, we should try to see if a
5951         UIntConstant can fit in an integer.
5952
5953 2002-05-07  Ravi Pratap  <ravi@ximian.com>
5954
5955         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
5956         when we are in an explicit context.
5957
5958         (ConvertReferenceExplicit): When converting from Iface type S to Class
5959         T make sure the rules are implemented as an OR.
5960
5961         * parameter.cs (ParameterType): Make it a property for now although the
5962         purpose really isn't anything immediate.
5963         
5964         * expression.cs (Is*Applicable): Do better checking on the parameter type
5965         of a ref/out parameter. The ones from the system assemblies are already 
5966         marked with the correct type so we don't need to do any correction.
5967
5968         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
5969         the object type is standard too so include that.
5970
5971 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
5972
5973         * ecore.cs (StandardConversionExists): Augment with missing code:
5974         deal with IntConstant, LongConstants and Enumerations.
5975
5976         * assign.cs: Report the error, instead of failing silently
5977
5978         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
5979         typecontainer that they are declared, because the
5980         typecontainer/namespace will have the list of using clauses that
5981         need to be applied.
5982
5983         Assembly Attributes were escaping the normal registration
5984         mechanism. 
5985
5986         (EmitCode): Apply attributes within an EmitContext that represents
5987         the container they were declared on.
5988         
5989         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
5990
5991 2002-05-06  Ravi Pratap  <ravi@ximian.com>
5992
5993         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
5994         Revamp completely - make much cleaner as we now operate only
5995         on a set of Types.
5996
5997         (FindMostSpecificSource, FindMostSpecificTarget): New methods
5998         to implement the logic detailed in the spec more correctly.
5999
6000         (UserDefinedConversion): Update accordingly.
6001
6002 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6003
6004         * statement.cs: Return flow analysis information up.
6005
6006         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
6007         and the default.
6008
6009         (token): Do not consume an extra character before calling
6010         decimal_digits.
6011
6012 2002-05-06  Piers Haken <piersh@friskit.com>
6013
6014         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
6015
6016 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6017
6018         * class.cs (Constructor.Emit): Set the IsStatic flag in the
6019         EmitContext during the instance constructor initializer
6020         resolution, to stop access to instance variables.
6021
6022         This is mandated by the spec, last paragraph of the `constructor
6023         initializers' section. 
6024
6025 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
6026
6027         * cs-parser.jay, class.cs (Accessor): new class used to represent
6028         an accessor (get or set).  In the past we used `null' to represent
6029         a missing accessor.  But this is ambiguous because there was no
6030         way to tell in abstract indexers/properties if one of them was
6031         specified.
6032
6033         Now there is a way of addressing that.
6034
6035         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
6036         instead of FindMembers.
6037
6038         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
6039         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
6040
6041         * attribute.cs: Treat indexers and properties as the same in terms
6042         of applying attributes
6043
6044         * ecore.cs (FindMostEncompassedType): Use statically initialized
6045         EmptyExpressions()s like we do elsewhere to avoid creating useless
6046         objects (and we take this out of the tight loop).
6047
6048         (GetConversionOperators): Move the code to extract the actual
6049         operators to a separate routine to clean things up.
6050
6051 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
6052
6053         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
6054         events are always registered FieldBuilders.
6055         
6056         * class.cs (FieldBase): New class shared by Fields 
6057
6058         * delegate.cs: If we are a toplevel delegate, use our full name.
6059         If we are a nested delegate, then only use our tail name.
6060
6061 2002-05-02  Ravi Pratap  <ravi@ximian.com>
6062
6063         * expression.cs (IsApplicable): Ensure that we add the "&" to
6064         ref/out types before comparing it with the type of the argument.
6065
6066         (IsParamsMethodApplicable): Ditto.
6067
6068         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
6069         silly me ;-)
6070
6071         * delegate.cs : Handle the case when we have more than one applicable
6072         method. Flag an error only when we finish checking all.
6073
6074 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
6075
6076         * expression.cs: Add support for boolean static initializers.
6077
6078 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
6079
6080         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
6081
6082         * parameter.cs (ComputeParameterTypes,
6083         ComputeAndDefineParameterTypes): Better error handling: now we
6084         clear the `types' cache if we fail during any of the type lookups.
6085         We also return the status code correctly to our caller
6086
6087         * delegate.cs: If we fail to define a delegate, abort the extra
6088         steps. 
6089
6090         * expression.cs (Binary.ResolveOperator): for
6091         operator==(object,object) and operator !=(object, object) we also
6092         have to verify that there is an implicit conversion from one to
6093         the other.
6094
6095         (ArrayAccess.DoResolve): Array Access can operate on
6096         non-variables. 
6097
6098 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
6099
6100         * assign.cs (CompoundAssign): A new class used as a "flag" that
6101         the assignment actually is happening as part of a compound
6102         assignment operator.
6103
6104         During compound assignment, a few new rules exist to enable things
6105         like:
6106
6107         byte b |= 1 + 2
6108
6109         From the spec:
6110         
6111         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
6112         to the type of x) if y is implicitly convertible to the type of x,
6113         and the operator is a builtin operator and the return type of the
6114         operator is explicitly convertible to the type of x. 
6115
6116         * rootcontext.cs: Reset warning level to 2.  4 catches various
6117         "interesting" features in mcs, we must clean this up at some
6118         point, but currently am trying to kill other bugs ;-)
6119
6120         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
6121         in container classes as well.  
6122
6123         * expression.cs (Binary.ResolveOperator): Handle string case
6124         before anything else (as operator overloading does emit an error
6125         before doing anything else).
6126
6127         This code could go away when we move to a table driven model, but
6128         i could not come up with a good plan last night.
6129         
6130 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
6131
6132         * typemanager.cs (CSharpName): reimplementation using regex.
6133         * class.cs: added null check for fields in Emit
6134         * rootcontext.cs: set warninglevel to 4
6135
6136 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
6137
6138         * typemanager.cs (CSharpName): reimplemented with Lupus
6139         suggestion.
6140
6141 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
6142
6143         * statement.cs (If): correclty implement Resolve, because we were
6144         not catching sem errors in there.  The same process is needed
6145         everywhere else. 
6146         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
6147         
6148
6149         (Statement.Warning_DeadCodeFound): Factorize code.
6150         (While): Report dead code here too.
6151
6152         (Statement): Added Resolve virtual method to allow
6153         for resolution split from the emit code.
6154
6155 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
6156
6157         * statement.cs (EmitBoolExpression): No longer try to resolve the
6158         expression here.    
6159         (MakeBoolean): New utility function that resolve, implicitly
6160         converts to boolean and tags the expression. 
6161         
6162
6163         (If, Do): Implement dead code elimination.
6164         (While): Implement loop inversion
6165
6166         (Do, While, For, If): Resolve the expression prior to calling our
6167         code generation.
6168
6169 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
6170
6171         * class.cs:
6172           - added method Report28 (warning: program has more than one entry point)
6173           - added method IsEntryPoint, implements paragraph 10.1 of the spec
6174           - modified method Method.Define, the part at the end of the method
6175
6176         * rootcontext.cs: added static public Location EntryPointLocation;
6177           
6178         * ../errors/cs0028.cs : Add test case for the above warning.              
6179
6180         * typemanager.cs:
6181           - modified method CSharpName to allow arrays of primitive type to
6182             be printed nicely (e.g. instead of System.Int32[][] it now prints
6183             int[][])
6184           - added method CSharpSignature: returns the signature of a method
6185             in string format to be used in reporting errors, warnings, etc.
6186
6187         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
6188         with String.Empty.
6189         
6190 2002-04-26  Ravi Pratap  <ravi@ximian.com>
6191
6192         * delegate.cs (Define): Fix extremely silly bug where I was
6193         setting the type of the 'object' parameter of the BeginInvoke
6194         method to System.IAsyncResult instead of System.Object ;-)
6195
6196 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
6197
6198         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
6199         here. 
6200
6201         (Constructor.Emit): return if we fail to initialize the
6202         constructor.  Another door closed!  
6203
6204         * expression.cs (New.DoResolve): Improve error message (from -6 to
6205         1501).  Use DeclaredOnly lookup to find the exact constructor.
6206
6207         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
6208         loop.  This is useful.
6209
6210         * cs-parser.jay: Adjust the default parameters so that destructors
6211         have the proper signature.
6212
6213 2002-04-26  Martin Baulig  <martin@gnome.org>
6214
6215         * driver.cs (LoadAssembly): If `assembly' contains any characters
6216         which are only valid in path names and not in assembly names
6217         (currently slash, backslash and point), use Assembly.LoadFrom ()
6218         instead of Assembly.Load () on the `assembly' (before iteration
6219         over the link_paths).
6220
6221 2002-04-26  Martin Baulig  <martin@gnome.org>
6222
6223         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
6224
6225 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
6226
6227         * class.cs (Property): use the new typemanager.MemberLookup
6228
6229         (TypeContainer.MemberLookup): Implement using the
6230         TypeManager.MemberLookup now. 
6231         
6232         * typemanager.cs: Make MemberLookup a function of the TypeManager,
6233         and return MemberInfos, so that these can be used without an
6234         EmitContext (what we had before).
6235
6236 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
6237
6238         * expression.cs: Fix the case where the argument to params if the
6239         type of the params.  I omitted handling this before.   Fixed
6240
6241 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
6242
6243         * driver.cs: Call BootCorlib_PopulateCoreType
6244
6245         * class.cs (Property.CheckBase): Check for properties only, not
6246         for all members. 
6247
6248         * interface.cs: Temporary hack: try/catch around the
6249         CustomAttributeBuilder, because I am getting an exception that I
6250         do not understand.
6251
6252         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
6253         types whose definitions are required to be there (attributes are
6254         defined before standard types).
6255
6256         Compute definitions as we boot the various types, as they are used
6257         immediately (value_type class will need object_type, but if we do
6258         not initialize object_type, we will pass a null, which will let
6259         the runtime pick the System.Object from the existing corlib, which
6260         is not what we want).
6261
6262 2002-04-22  Patrik Torstensson <totte@labs2.com>
6263
6264         * cs-tokenizer.cs: fixed a number of trim() issues.
6265
6266 2002-04-22  Ravi Pratap  <ravi@ximian.com>
6267
6268         * expression.cs (Argument.Type): Ensure that we return the correct
6269         type when we have out or ref parameters [in which case we 
6270         append a "&"].
6271         
6272 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
6273
6274         * class.cs (Property, Indexer): Allow extern modifier in there. 
6275
6276         * typemanager.cs (InitBaseTypes): Initializes object_type and
6277         value_type, since those will be used early on during the bootstrap
6278         process to compile corlib.
6279
6280         (InitCoreTypes): Move code from here to InitBaseTypes.
6281
6282 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
6283
6284         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
6285         single-dimension arrays as using the ldlen opcode.  
6286
6287         Daniel Lewis discovered this optimization.  
6288
6289         * typemanager.cs: Add signature for System.Array::get_Length
6290
6291 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6292
6293         * statement.cs: report the error when the foreach does not apply to an
6294         array nor a collection.
6295
6296 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
6297
6298         * expression.cs: Add implicit conversions to the operator ~.
6299
6300         * constant.cs (DecimalConstant.Emit): Emit decimal value.
6301
6302         * typemanager.cs: Locate the decimal constructor.
6303
6304 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6305
6306         * attribute.cs: use the new property of TypeOf.
6307         * expression.cs: added 'get' property around typearg.
6308
6309         These changes fix a build breaker reported by NickD. Is this the
6310         correct way to fix?  If not, please, revert my changes and make it
6311         work :-).
6312
6313 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
6314
6315         * attribute.cs: Add support for typeof in attribute invocations.
6316         I am not sure that this is right though.
6317
6318 2002-04-14  Duncan Mak  <duncan@ximian.com>
6319
6320         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
6321         Binary.Operator.Division case.
6322
6323 2002-04-13  Ravi Pratap  <ravi@ximian.com>
6324
6325         * class.cs (DefineType): Ensure that we do a proper check on
6326         attribute types and also register it with the TypeManager.
6327
6328         (TypeContainer.Targets): The default for attribute types is
6329         AttributeTargets.All.
6330         
6331         * attribute.cs (ApplyAttributes): Registering the attribute type
6332         is done elsewhere, not when we discover we have a Usage attribute.
6333
6334 2002-04-12  Ravi Pratap  <ravi@ximian.com>
6335
6336         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
6337         and get rid of is_delegate parameter.
6338
6339         * everywhere : update.
6340         
6341 2002-04-12  Ravi Pratap  <ravi@ximian.com>
6342
6343         * cs-parser.jay (compilation_unit): Revamp completely to use
6344         some new ideas that I got from Rhys' grammar to solve the problems
6345         with assembly level attributes.
6346
6347         (outer_declaration): New grammar production.
6348
6349         (attribute_sections): Add.
6350
6351         (opt_attributes): Base on attribute_sections
6352
6353         (namespace_declaration): Allow opt_attributes to tackle the case
6354         when we have assembly level attributes - we are clever in this
6355         regard now ;-)
6356
6357         * attribute.cs (ApplyAttributes): Do not worry about assembly 
6358         attributes in the non-global context.
6359
6360         * rootcontext.cs (AddGlobalAttributes): Go back to using this
6361         instead of SetGlobalAttributes.
6362
6363         * class.cs, rootcontext.cs : Ensure we define and generate 
6364         attribute types before anything else.
6365
6366         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
6367         and flag the new error -20 for the case when the attribute type
6368         does not have valid targets specified. csc does not catch this.
6369
6370         * ../errors/errors.txt : update for error # -20
6371
6372 2002-04-11  Ravi Pratap  <ravi@ximian.com>
6373
6374         * support.cs (InternalParameters.ParameterModifier): Do some null
6375         checking and return sane values.
6376
6377         * class.cs (Method.Define): If we are a PInvoke method, ensure
6378         that we are static and extern. Report error # 601
6379
6380         * ../errors/cs0601.cs : Add test case for the above error.
6381
6382 2002-04-07  Ravi Pratap  <ravi@ximian.com>
6383
6384         * rootcontext.cs (attribute_types): We need to keep type of
6385         all attribute types separately and emit code for them first.
6386
6387         (RegisterAttribute) : Implement.
6388
6389         * class.cs (DefineType): Check if the current Type is a custom
6390         attribute type and register it accordingly.
6391
6392         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
6393         adding the first attribute twice and rename to
6394
6395         (SetGlobalAttributes): this.
6396
6397         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
6398         lookups.
6399
6400         * attribute.cs (ApplyAttributes): Take an additional argument telling us
6401         if we are processing global arguments. Hmm, I am unsure of this.
6402
6403 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6404
6405         * expression.cs: added static array of strings to avoid calling
6406         Enum.ToString () for Operator in Binary. Significant recover of
6407         performance.
6408
6409 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
6410
6411         * class.cs (FindMembers): Allow the Builders of the various
6412         members to be null.  If they are skip them.  This only happens
6413         during the PInvoke declaration.
6414
6415 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
6416
6417         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
6418         failure, so we do not keep going afterwards.
6419
6420         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
6421         wanted to pass `false' as the `is_delegate' argument.  If this is
6422         the case, why not use delegate_type == null to mean `is_delegate =
6423         false' and anything else as is_delegate = true.
6424
6425 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
6426
6427         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
6428         code for the section, not the beginning of the tests.
6429
6430 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
6431
6432         * cfold.cs: Handle operator + (Enum x, Underlying x) 
6433
6434         * expression.cs (Binary): same.  Warn about errors where we have
6435         Enum/Enum in operator + as well.
6436
6437 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
6438
6439         * statement.cs:
6440                 - added support for switch(bool)
6441                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
6442                 - add TableSwitchEmit() to handle table-based switch statements
6443
6444 2002-04-05  Ravi Pratap  <ravi@ximian.com>
6445
6446         * expression.cs (Invocation.OverloadResolve): Factor out code which
6447         does parameter compatibility checking with arguments so that we can 
6448         re-use the code even from Delegate.VerifyApplicability
6449
6450         (VerifyArgumentsCompat): Move above code here.
6451
6452         * delegate.cs (VerifyApplicability): Get rid of duplicate code
6453         and instead make a call to the above method.
6454
6455 2002-03-31  Ravi Pratap  <ravi@ximian.com>
6456
6457         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
6458         We use it to keep track of classes which are attribute types.
6459
6460 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
6461
6462         * delegate.cs (Delegate.Define): Correctly define the types in the
6463         presence of fixed and array parameters.
6464
6465         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
6466         doing FindMembers.
6467
6468         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
6469         include NonPublic after the first iteration.
6470
6471         * class.cs (Indexer.CheckBase): Only check if both parents are
6472         non-null. 
6473         
6474         * cs-parser.jay (accessor_body): If empty, set to null.
6475
6476         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
6477         same code path here to resolve constants names that we did have in
6478         MemberAccess.DoResolve.  There is too much code duplicated here.
6479
6480 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
6481
6482         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
6483
6484         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
6485         to MakeUnionSet.
6486
6487         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
6488         tokens, numbers and strings.
6489
6490         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
6491         parenthesis.
6492
6493         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
6494         asyncronous parameters and the regular parameters.  
6495
6496         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
6497         specify the target directory.
6498
6499         * expression.cs: (This.DoResolve): Simplify
6500         (As.Emit): Optimize, do not generate IsInst if the expression is
6501         always of the given type.
6502
6503         (Is.DoResolve): Bug fix, we were reporting both always/never for
6504         the is expression.
6505
6506         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
6507         creating too many unnecessary arrays.
6508
6509 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
6510
6511         * class.cs (EmitFieldInitializer): Use Assign expression to assign
6512         fields instead of rolling our own initializer.   Takes care of all
6513         implicit conversions, and drops unnecessary static checks/argument.
6514
6515 2002-03-31  Dick Porter  <dick@ximian.com>
6516
6517         * driver.cs: use the GetDirectories() return values properly, and
6518         use "/" as path separator.
6519
6520 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
6521
6522         * expression.cs (Unary): Optimize - - expr into expr.
6523         (Binary): Optimize a + (-b) into a -b.
6524
6525         * codegen.cs (CodeGen): Made all methods static.
6526
6527 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
6528
6529         * rootcontext.cs: 
6530
6531         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
6532         TypeBuilder property.
6533
6534         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
6535         instead. 
6536
6537         * tree.cs: Removed the various RecordXXXX, and replaced with a
6538         single RecordDecl.  Removed all the accessor methods, and just
6539         left a single access point Type 
6540
6541         * enum.cs: Rename DefineEnum to DefineType.
6542
6543         * decl.cs: New abstract method `DefineType' used to unify the
6544         Defines for Enumerations, Interfaces, TypeContainers and
6545         Delegates.
6546
6547         (FindType): Moved LookupInterfaceOrClass here.  Moved the
6548         LookupBaseClasses method that used to live in class.cs and
6549         interface.cs here, and renamed to FindType.
6550         
6551         * delegate.cs: Implement DefineType.  Take advantage of the
6552         refactored pattern for locating the parent builder without taking
6553         the parent_builder argument (which we know does not work if we are
6554         nested, and triggering a toplevel definition).
6555
6556 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6557
6558         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
6559         accessibility of a member has changed during override and report
6560         an error if so.
6561
6562         * class.cs (Method.Define, Property.Define): Only complain on
6563         overrides if the method is private, any other accessibility is
6564         fine (and since we just checked the permission is the same, we are
6565         good to go).
6566
6567         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
6568         and elif are processed always.  The other pre-processing
6569         directives are only processed if we are "taking" the path
6570
6571 2002-03-29  Martin Baulig  <martin@gnome.org>
6572
6573         * class.cs (Method.Emit): Only emit symbolic debugging info if the
6574         current location is not Null.
6575
6576         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
6577         a separate method so we can profile it.
6578
6579         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
6580         `span.Seconds' are just seconds, but no minutes or hours.
6581         (MainDriver): Profile the CodeGen.SaveSymbols calls.
6582
6583 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6584
6585         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
6586         Remove the gratuitous set of Final:
6587
6588                                 // If an interface implementation, then we can set Final.
6589                                 if (((flags & MethodAttributes.Abstract) == 0) &&
6590                                     implementing.DeclaringType.IsInterface)
6591                                         flags |= MethodAttributes.Final;
6592
6593         I do not know what I was smoking when I used that.
6594         
6595
6596         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
6597         step into fixing the name resolution issues for delegates and
6598         unifying the toplevel name resolution.
6599
6600 2002-03-28  Martin Baulig  <martin@gnome.org>
6601
6602         * class.cs (Method.Emit): If we have a symbol writer, call its
6603         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
6604         tell it about the current method.
6605
6606         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
6607         writer that we're going to emit the first byte of IL code for a new
6608         statement (a new source line).
6609         (EmitContext.EmitTopBlock): If we have a symbol writer, call
6610         EmitContext.Mark() before emitting any code.
6611
6612         * location.cs (SymbolDocument): Return null when we're Null.
6613
6614         * statement.cs (Statement): Moved the `Location loc' variable here.
6615         (Statement.EmitBoolExpression): If we have a symbol writer, call
6616         ec.Mark() before emitting any code to tell it that we're at the
6617         beginning of a new statement.
6618         (StatementExpression): Added `Location' argument to the constructor.
6619         (Block): Added public readonly variable `StartLocation' and public
6620         variable `EndLocation'.  The latter is to be set using SetEndLocation().
6621         (Block): Added constructor which takes a start and end location.
6622         (Block.SetEndLocation): New method. This sets the end location.
6623         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
6624         local variables we create.
6625         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
6626         each statement and do also mark the begin and end of the block.
6627
6628         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
6629         tell it the current lexer.Location, use Location.Null for the end of the
6630         block.
6631         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
6632         current block, set its end location using SetEndLocation().
6633         (statement_expression): StatementExpression constructor now takes the
6634         lexer.Location as additional argument.
6635         (for_statement, declare_local_variables): Likewise.
6636         (declare_local_variables): When creating a new implicit block, use the
6637         new Block constructor and pass it the lexer.Location.
6638
6639 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6640
6641         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
6642         members also on the parent interfaces recursively.
6643
6644 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
6645
6646         * report.cs: Use new formats, since Gonzalo finished the missing
6647         bits. 
6648
6649         * expression.cs (Binary.ResolveOperator): added missing operator|
6650         operator& and operator^ for bool/bool.
6651
6652         * cs-parser.jay: CheckDef now takes a Location argument that is
6653         used to report errors more precisly (instead of reporting the end
6654         of a definition, we try to track something which is a lot closer
6655         to the source of the problem).
6656
6657         * cs-tokenizer.cs: Track global token use, so we can properly flag
6658         the use of #define/#undef after the first token has been seen.
6659
6660         Also, rename the reportXXXX to Error_DescriptiveName
6661
6662         * decl.cs (DeclSpace.IsTopLevel): Move property here from
6663         TypeContainer, so that Enum and Interface can use this too.
6664
6665         * class.cs (TypeContainer.LookupInterfaceOrClass,
6666         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
6667         `builder' argument.  Typically this was used to pass the parent
6668         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
6669         the definition).  
6670
6671         The problem is that a nested class could trigger the definition of
6672         a toplevel class, and the builder would be obviously wrong in that
6673         case. 
6674
6675         So we drop this argument, and we compute dynamically the
6676         TypeBuilder/ModuleBuilder (the correct information was available
6677         to us anyways from DeclSpace.Parent)
6678
6679         * interface.cs (Interface.DefineInterface): Drop builder
6680         parameter cleanup like class.cs
6681
6682         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
6683         like class.cs
6684
6685         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
6686         values. 
6687
6688         (Try.Emit): Propagate the returns value from the statement.
6689
6690         (Return.Emit): Even if we are leavning 
6691
6692         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
6693
6694         * modifiers.cs: Fix the computation of MethodAttributes flags.
6695
6696 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
6697
6698         * driver.cs: allow compilation of files that start with '/'.
6699         Add a default case when checking the argument of --target.
6700
6701 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
6702
6703         * interface.cs: Implement the same search algorithm for types in
6704         the interface code.
6705
6706         * delegate.cs: Do not allow multiple definition.
6707
6708         * Recovered ChangeLog that got accidentally amputated
6709
6710         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
6711
6712         * rootcontext.cs: Load manually enum to allow core classes to
6713         contain enumerations.
6714
6715         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
6716         Update to new static methods in TypeManager.
6717
6718         * typemanager.cs (GetMethod, GetConstructor): Use our
6719         implementation of FindMembers to find the members, since during
6720         corlib compilation, the types are TypeBuilders and GetMethod and
6721         GetConstructor do not work.
6722
6723         Make all methods in TypeManager static.
6724
6725         (InitCodeHelpers): Split the functionality from
6726         the InitCodeTypes function.
6727
6728         * driver.cs: Call InitCodeHelpers after we have populated the
6729         types. 
6730
6731         * cs-parser.jay (delegate_declaration): we did not used to compute
6732         the delegate name correctly for void delegates.
6733
6734 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
6735
6736         * rootcontext.cs (RootContext): Init the interface_resolve_order
6737         and type_container_resolve_order always.
6738
6739         (ResolveCore, BootstrapCorlib_ResolveClass,
6740         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
6741         compiler when compiling with --nostdlib
6742
6743         * class.cs (TypeContainer.DefineType): Check that our parent is
6744         not null.  This test is most important when we are bootstraping
6745         the core types.
6746
6747         * codegen.cs: Split out the symbol writing code.
6748
6749 2002-03-25  Martin Baulig  <martin@gnome.org>
6750
6751         * driver.cs (-g): Made -g an alias for --debug.
6752
6753 2002-03-24  Martin Baulig  <martin@gnome.org>
6754
6755         * codegen.cs (SymbolWriter): New public variable. Returns the
6756         current symbol writer.
6757         (CodeGen): Added `bool want_debugging_support' argument to the
6758          constructor. If true, tell the ModuleBuild that we want debugging
6759         support and ask it for the ISymbolWriter.
6760         (Save): If we have a symbol writer, call it's Close() method after
6761         saving the assembly.
6762
6763         * driver.c (--debug): New command line argument to create a
6764         debugger information file.
6765
6766         * location.cs (SymbolDocument): New public property. Returns an
6767         ISymbolDocumentWriter object for the current source file or null
6768         if we don't have a symbol writer.
6769
6770 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
6771
6772         * driver.cs (LoadAssembly): Correctly return when all the paths
6773         have been tried and not before.
6774
6775         * statement.cs (Switch.Emit): return the actual coverage for this
6776         statement (returns/not-returns)
6777
6778         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
6779         switch of the statement if we are the last switch section.  That
6780         kills two problems: try/catch problems (we used to emit an empty
6781         nop at the end) and switch statements where all branches would
6782         return. 
6783
6784 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
6785
6786         * driver.cs: Add default assemblies (the equivalent to the
6787         Microsoft CSC.RSP file)
6788
6789         * cs-tokenizer.cs: When updating `cols and setting it to zero,
6790         also update tokens_seen and set it to false.
6791
6792         * driver.cs: Implement --recurse for Mike.
6793
6794         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
6795         correctly splitting out the paths.
6796
6797 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
6798
6799         * interface.cs (Interface.PopulateProperty): Instead of using
6800         `parent' as the declaration space for the set parameters, use
6801         `this' 
6802
6803         * support.cs (InternalParameters): InternalParameters constructor
6804         takes a DeclSpace instead of a TypeContainer.
6805
6806         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
6807         types are being initialized, load the address of it before calling
6808         the function.  
6809
6810         (New): Provide a mechanism to disable the generation of local
6811         value type temporaries when the caller will be providing us with
6812         an address to store it.
6813
6814         (ArrayCreation.EmitDynamicInitializers): Use it.
6815
6816 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
6817
6818         * expression.cs (Invocation.EmitArguments): Only probe for array
6819         property if there is more than one argument.  Sorry about that.
6820
6821         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
6822         empty param arrays.
6823         
6824         * class.cs (Method.LabelParameters): Fix incorrect code path that
6825         prevented the `ParamArrayAttribute' from being applied to the
6826         params attribute.
6827
6828 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
6829
6830         * support.cs (ReflectionParameters): Correctly compute whether the
6831         last argument is a params array.  Fixes the problem with
6832         string.Split ('a')
6833
6834         * typemanager.cs: Make the assemblies array always be non-null
6835         (empty, but non-null)
6836
6837         * tree.cs (RecordDecl): New function that abstracts the recording
6838         of names.  This reports error 101, and provides a pointer to the
6839         previous declaration.  Fixes a crash in the compiler.
6840
6841         * cs-parser.jay (constructor_declaration): Update to new grammar,
6842         and provide a constructor_body that can be empty.
6843
6844 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
6845
6846         * driver.cs: Add support for --resources.
6847
6848         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
6849         Make all types for the various array helper methods be integer.
6850
6851         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
6852         CheckState to ConvCast.
6853
6854         (ConvCast): Now it takes a `checked' state argument, to avoid
6855         depending on the emit context for the conversion, and just using
6856         the resolve time setting.
6857
6858         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
6859         instead of Invocation.EmitArguments.  We do not emit the original
6860         arguments, instead we emit those which have been converted to
6861         unsigned int expressions.
6862
6863         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
6864
6865         * codegen.cs: ditto.
6866
6867         * expression.cs (LocalVariableReference): Drop the use of the
6868         Store function that depended on the variable index.
6869
6870         * statement.cs (VariableInfo): Drop the `Idx' property from this
6871         class, as this is not taking into account the indexes for
6872         temporaries tat we generate during the execution, getting the
6873         indexes wrong.
6874
6875         * class.cs: First emit class initializers, then call the parent
6876         constructor. 
6877
6878         * expression.cs (Binary): Fix opcode emision.
6879         (UnaryMutator.EmitCode): Support checked code generation
6880
6881         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
6882         matches for events for both the Static and Instance scans,
6883         pointing to the same element.   Fix that.
6884
6885 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
6886
6887         * rootcontext.cs (ResolveTree): Always set the
6888         interface_resolve_order, because nested interfaces will be calling
6889         into us.
6890
6891         * class.cs (GetInterfaceOrClass): Track the same resolution
6892         process used by TypeManager.LookupType.  This fixes the nested
6893         type lookups in class declarations (separate path from
6894         LookupType). 
6895
6896         (TypeContainer.DefineType): Also define nested interfaces.
6897         (TypeContainer.RegisterOrder): New public function used to
6898         register the order in which child interfaces need to be closed.
6899
6900         Nested interfaces need to be closed after their parents have been
6901         created. 
6902         
6903         * interface.cs (InterfaceAttr): Put all the logic for computing
6904         the interface attribute here. 
6905
6906         (DefineInterface): Register our interface order with the
6907         RootContext or with the TypeContainer depending on the case.
6908
6909 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
6910
6911         * cs-parser.jay: rework foreach statement to work with the new
6912         changes to the policy on SimpleNames.
6913         
6914         * report.cs: support Stacktrace on warnings as well.
6915
6916         * makefile: drop --unsafe and /unsafe from the compile.
6917
6918 2002-03-13  Ravi Pratap  <ravi@ximian.com>
6919
6920         * ecore.cs (StandardConversionExists): Modify to take an Expression
6921         as the first parameter. Ensure we do null -> reference type conversion
6922         checking.
6923
6924         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
6925         temporary Expression objects.
6926
6927 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
6928
6929         * interface.cs: workaround bug in method overloading resolution
6930         (there is already a bugzilla bug for it).
6931
6932 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
6933
6934         We could also solve this problem by having a separate path for
6935         performing type lookups, instead of DoResolve, we could have a
6936         ResolveType entry point, and only participating pieces of the
6937         production (simplename, deref, array) would implement this. 
6938         
6939         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
6940         signal SimpleName to only resolve type names and not attempt to
6941         resolve anything else.
6942
6943         * expression.cs (Cast): Set the flag.
6944
6945         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
6946
6947         * class.cs: Only report 108 if there is no `new' modifier.
6948
6949         * cs-parser.jay: rework foreach statement to work with the new
6950         changes to the policy on SimpleNames.
6951         
6952         * report.cs: support Stacktrace on warnings as well.
6953
6954         * makefile: drop --unsafe and /unsafe from the compile.
6955
6956 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
6957
6958         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
6959         lookups here, instead of doing that at parse time.  This means
6960         that our grammar will not introduce `LocalVariableReferences' as
6961         expressions at this point.  That solves the problem of code like
6962         this:
6963
6964         class X {
6965            static void Main ()
6966            { int X = 1;
6967             { X x = null }}}
6968
6969         This is only half the fix.  The full fix requires parameters to
6970         also be handled in this way.
6971
6972         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
6973         makes the use more obvious of the DeclSpace.  The
6974         ec.TypeContainer.TypeBuilder is now only used to pull the
6975         TypeBuilder for it.
6976
6977         My theory is that I can get rid of the TypeBuilder completely from
6978         the EmitContext, and have typecasts where it is used (from
6979         DeclSpace to where it matters).  
6980
6981         The only pending problem is that the code that implements Aliases
6982         is on TypeContainer, and probably should go in DeclSpace.
6983
6984         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
6985         lookups here, instead of doing that at parse time.  This means
6986         that our grammar will not introduce `LocalVariableReferences' as
6987         expressions at this point.  That solves the problem of code like
6988         this:
6989
6990         class X {
6991            static void Main ()
6992            { int X = 1;
6993             { X x = null }}}
6994
6995         This is only half the fix.  The full fix requires parameters to
6996         also be handled in this way.
6997
6998         * class.cs (Property.DefineMethod): When implementing an interface
6999         method, set newslot, when implementing an abstract method, do not
7000         set the flag (before we tried never setting it, or always setting
7001         it, which is the difference).
7002         (Indexer.DefineMethod): same.
7003         (Method.DefineMethod): same.
7004
7005         * ecore.cs: Only set the status used flag if we get back a Field.
7006
7007         * attribute.cs: Temporary hack, so Paolo can keep working.
7008
7009 2002-03-08  Ravi Pratap  <ravi@ximian.com>
7010
7011         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
7012         the unmanaged type in the case we have a MarshalAs attribute.
7013
7014         (Resolve): Handle the case when we are parsing the special MarshalAs
7015         attribute [we need to store the unmanaged type to use later]
7016         
7017         * typemanager.cs (marshal_as_attr_type): Built in type for the 
7018         MarshalAs Attribute.
7019
7020         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
7021         on parameters and accordingly set the marshalling info.
7022         
7023 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
7024
7025         * class.cs: Optimizing slightly by removing redundant code after
7026         we switched to the `NoTypes' return value.
7027         (Property.DefineMethod): use NoTypes here too.
7028
7029         This fixes the bug I introduced in my last batch of changes.
7030
7031 2002-03-05  Ravi Pratap  <ravi@ximian.com>
7032
7033         * tree.cs (RecordEnum): Add. We now keep track of enums too.
7034
7035         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
7036         Enums since those are types too. 
7037
7038         * cs-parser.jay (enum_declaration): Record enums as we parse them.
7039         
7040         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
7041         thanks to a call during the lookup process.
7042
7043 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
7044
7045         * statement.cs (Foreach): Lots of work to accomodate a particular
7046         kind of foreach statement that I had not kept in mind.  It is
7047         possible to have foreachs on classes that provide a GetEnumerator
7048         method that return objects that implement the "pattern" for using
7049         a foreach, there is no need to support GetEnumerator
7050         specifically. 
7051
7052         This is needed to compile nant.
7053
7054         * decl.cs: Only report 114 if the member is not `Finalize' and if
7055         the warning level is at least 2.
7056
7057         * class.cs: Moved the compare function from Method to
7058         MethodSignature. 
7059
7060         (MethodSignature.InheritableMemberSignatureCompare): Add new
7061         filter function that is used to extract inheritable methods from a
7062         class. 
7063
7064         (Method.Define): Use the new `inheritable_method_signature_filter'
7065         delegate
7066
7067         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
7068         command. 
7069
7070 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
7071
7072         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
7073
7074         * cs-parser.jay: Add opt_semicolon to the interface declaration.
7075
7076         * expression.cs: Pass location information to
7077         ConvertImplicitStandard. 
7078
7079         * class.cs: Added debugging code to track return values from
7080         interfaces. 
7081
7082 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
7083
7084         * expression.cs (Is.DoResolve): If either side of the `is' is an
7085         interface, do not flag the warning.
7086
7087         * ecore.cs (ImplicitReferenceConversion): We need a separate test
7088         for interfaces
7089
7090         * report.cs: Allow for --fatal to be used with --probe.
7091         
7092         * typemanager.cs (NoTypes): Move the definition for the empty Type
7093         array here. 
7094
7095         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
7096         properties. 
7097         (TypeContainer.DefineProxy): New function used to proxy to parent
7098         implementations when implementing interfaces.
7099         (TypeContainer.ParentImplements): used to lookup if our parent
7100         implements a public function that is required by an interface.
7101         (TypeContainer.VerifyPendingMethods): Hook this up.
7102
7103         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
7104         `modules' and `assemblies' arraylists into arrays.  We only grow
7105         these are the very early start up of the program, so this improves
7106         the speedof LookupType (nicely measured).
7107
7108         * expression.cs (MakeByteBlob): Replaced unsafe code with
7109         BitConverter, as suggested by Paolo.
7110
7111         * cfold.cs (ConstantFold.Binary): Special case: perform constant
7112         folding of string concatenation, but if either side is a string,
7113         and the other is not, then return null, and let the runtime use
7114         the concatenation on the string plus the object (using
7115         `Object.ToString'). 
7116
7117 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
7118
7119         Constant Folding has been implemented now.
7120         
7121         * expression.cs (Unary.Reduce): Do not throw an exception, catch
7122         the error instead on types that are not supported in one's
7123         complement. 
7124
7125         * constant.cs (Constant and all children): New set of functions to
7126         perform implict and explicit conversions.
7127         
7128         * ecore.cs (EnumConstant): Implement the new functions to perform
7129         conversion by proxying to the child expression.
7130
7131         * codegen.cs: (ConstantCheckState): Constant evaluation has its
7132         own separate setting that can not be turned off from the command
7133         line using --unchecked or --checked and is only controlled using
7134         the checked/unchecked statements and expressions.  This setting is
7135         used by the constant folder to flag errors.
7136
7137         * expression.cs (CheckedExpr, UncheckedExpr): Set the
7138         ConstantCheckState as well.   
7139
7140         During Resolve, they also have to flag the state, because the
7141         constant folder runs completely in the Resolve phase.
7142
7143         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
7144         well.
7145
7146 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
7147
7148         * cfold.cs: New file, this file contains the constant folder.
7149         
7150         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
7151         argument to track whether we are using the resulting address to
7152         load or store a value and provide better error messages. 
7153
7154         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
7155         new AddressOf arguments.
7156
7157         * statement.cs (Foreach.EmitCollectionForeach): Update
7158
7159         * expression.cs (Argument.Emit): Call AddressOf with proper
7160         arguments to track usage.
7161
7162         (New.DoEmit): Call AddressOf with new arguments.
7163
7164         (Unary.Emit): Adjust AddressOf call.
7165
7166 2002-03-01  Ravi Pratap  <ravi@ximian.com>
7167
7168         * cs-parser.jay (member_access): Change the case for pre-defined types
7169         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
7170         this suggestion.
7171
7172         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
7173         a method body.
7174
7175         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
7176         essentially like methods and apply attributes like MethodImplOptions to them too.
7177
7178         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
7179         not being null.
7180
7181         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
7182         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
7183         is the DeclSpace.
7184
7185         * Update code everywhere accordingly.
7186
7187         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
7188
7189         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
7190
7191 2002-02-28  Ravi Pratap  <ravi@ximian.com>
7192
7193         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
7194         try performing lookups against those instead of jumping straight into using
7195         the 'using' clauses.
7196
7197         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
7198
7199         (LookupType): Perform lookups in implicit parents too.
7200
7201         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
7202         sequence as RootContext.LookupType. 
7203
7204         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
7205         the various cases of namespace lookups into this method.
7206
7207 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
7208
7209         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
7210         in positional arguments)
7211
7212         * class.cs (Operator): Update the AllowedModifiers to contain
7213         extern. 
7214
7215         * cs-parser.jay: Update operator declaration to allow for the
7216         operator body to be empty.
7217
7218         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
7219         values. 
7220
7221 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
7222
7223         * class.cs (Method.Emit): Label parameters.
7224
7225         * driver.cs: Return 1 or 0 as the program exit code.
7226
7227 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
7228
7229         * expression.cs: Special case the `null' object when trying to
7230         auto-compute the type, as anything can be explicitly converted to
7231         that. 
7232
7233         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
7234         spotting this Paolo.
7235
7236         (Expression.ImplicitNumericConversion): Perform comparissions of
7237         the type using the underlying type in the case of an enumeration
7238         rather than using the enumeration type for the compare.
7239
7240         Cope with the underlying == type case, which is not possible to
7241         catch before. 
7242
7243         (Expression.ConvertNumericExplicit): Perform comparissions of
7244         the type using the underlying type in the case of an enumeration
7245         rather than using the enumeration type for the compare.
7246
7247         * driver.cs: If the user does not supply an extension, assume .exe
7248
7249         * cs-parser.jay (if_statement): Rewrote so that we can track the
7250         location for the if statement.
7251
7252         * expression.cs (Binary.ConstantFold): Only concat strings when
7253         the operation is "+", not everything ;-)
7254
7255         * statement.cs (Statement.EmitBoolExpression): Take a location
7256         argument. 
7257         (If, While, Do): Track location.
7258
7259         * expression.cs (Binary.ResolveOperator): In the object + string
7260         case, I was missing a call to ConvertImplicit
7261
7262 2002-02-25  Ravi Pratap  <ravi@ximian.com>
7263
7264         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
7265         Location arguments. Ensure we use RootContext.LookupType to do our work
7266         and not try to do a direct Type.GetType and ModuleBuilder.GetType
7267
7268         * interface.cs (PopulateMethod): Handle the type of the parameter being
7269         null gracefully.
7270
7271         * expression.cs (Invocation.BetterFunction): Handle the case when we 
7272         have a params method with no fixed arguments and a call is made with no
7273         arguments.
7274
7275 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
7276
7277         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
7278         the verbatim-string-literal
7279
7280         * support.cs (InternalParameters.ParameterModifier): handle null
7281         fixed parameters.
7282         (InternalParameters.ParameterType): ditto.
7283
7284         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
7285         duplicating the name of the variable parameter.
7286         (GetParameterByName): Fix bug where we were not looking up array
7287         paramters if they were the only present (thanks Paolo!).
7288         (GetParameterInfo): We only have an empty set of types if both
7289         fixed and array are set to null.
7290         (GetParameterInfo-idx): Handle FixedParameter == null
7291
7292         * cs-parser.jay: Handle the case where there is no catch
7293         statements (missing null test).
7294
7295 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
7296
7297         * driver.cs (MainDriver): Be conservative on our command line
7298         handling.
7299
7300         Catch DirectoryNotFoundException when calling GetFiles.
7301         
7302         (SplitPathAndPattern): Used to split the input specification into
7303         a path and a pattern that we can feed to Directory.GetFiles.
7304
7305 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
7306
7307         * statement.cs (Fixed): Implement the last case of the Fixed
7308         statement (string handling).
7309
7310         * expression.cs (StringPtr): New class used to return a char * to
7311         a string;  Used by the Fixed statement.
7312
7313         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
7314
7315         * expression.cs (Binary.ResolveOperator): Remove redundant
7316         MemberLookup pn parent type.
7317         Optimize union call, we do not need a union if the types are the same.
7318         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
7319         type.
7320
7321         Specialize the use of MemberLookup everywhere, instead of using
7322         the default settings. 
7323
7324         (StackAlloc): Implement stackalloc keyword.
7325
7326         * cs-parser.jay: Add rule to parse stackalloc.
7327         
7328         * driver.cs: Handle /h, /help, /?
7329
7330         * expression.cs (MakeByteBlob): Removed the hacks we had in place
7331         before we supported unsafe code.
7332         
7333         * makefile: add --unsafe to the self compilation of mcs.
7334
7335 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
7336
7337         * expression.cs (PointerArithmetic): New class that is used to
7338         perform pointer arithmetic.
7339         (Binary.Resolve): Handle pointer arithmetic
7340         Handle pointer comparission.
7341         (ArrayPtr): Utility expression class that is used to take the
7342         address of an array.
7343
7344         (ElementAccess): Implement array access for pointers
7345         
7346         * statement.cs (Fixed): Implement fixed statement for arrays, we
7347         are missing one more case before we are done.
7348
7349         * expression.cs (Indirection): Implement EmitAssign and set the
7350         ExprClass to Variable.  This allows pointer dereferences to be
7351         treated as variables, and to have values assigned to them.
7352         
7353         * ecore.cs (Expression.StoreFromPtr): New utility function to
7354         store values dereferencing.
7355
7356 2002-02-20  Ravi Pratap  <ravi@ximian.com>
7357
7358         * expression.cs (Binary.ResolveOperator): Ensure that we are
7359         not trying to operate on a void type - this fixes the reported
7360         bug.
7361
7362         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
7363         the parent implementation is sealed.
7364
7365         * ../errors/cs0239.cs : Add.
7366
7367         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
7368
7369         * typemanager.cs (unverifiable_code_type): Corresponds to 
7370         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
7371         which have unsafe code in them.
7372
7373         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
7374         unsafe context.
7375
7376 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
7377
7378         * cs-tokenizer.cs: Add support for @"litreal strings"
7379
7380         Make tokenizer accept pre-processor directives
7381         on any column (remove the old C-like limitation). 
7382
7383         * rootcontext.cs (EmitCode): Emit any global attributes.
7384         (AddGlobalAttributes): Used to keep track of assembly attributes. 
7385
7386         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
7387
7388         * cs-parser.jay: Add support for global attributes.  
7389
7390 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
7391
7392         * expression.cs (Indirection): New helper class.  Unary will
7393         create Indirection classes to be able to implement the
7394         IMemoryLocation interface on it.
7395
7396 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
7397
7398         * cs-parser.jay (fixed_statement): reference the right statement.
7399
7400         * statement.cs (Fixed.Emit): Finish implementing the fixed
7401         statement for the &x case.
7402
7403 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
7404
7405         * class.cs (Property.Define, Method.Define): Remove newslot when
7406         `implementing'.  
7407
7408         * modifiers.cs: My use of NewSlot when `Abstract' was set was
7409         wrong.  NewSlot should only be used if the `new' keyword is present.
7410
7411         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
7412         locating our system dir.  Sorry about this.
7413
7414 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
7415
7416         * driver.cs (GetSystemDir): Compute correctly the location of our
7417         system assemblies.  I was using the compiler directory instead of
7418         the library directory.
7419
7420 2002-02-13  Ravi Pratap  <ravi@ximian.com>
7421
7422         * expression.cs (BetterFunction): Put back in what Miguel commented out
7423         since it is the correct fix. The problem is elsewhere ;-)
7424
7425         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
7426         parameters of the parms method are themselves compatible or not !
7427
7428         (StandardConversionExists): Fix very dangerous bug where we were forgetting
7429         to check that a class implements an interface before saying that an implicit
7430         conversion was allowed. Use ImplementsInterface to do the checking.
7431
7432 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
7433
7434         * class.cs (Method.Define): Track whether we are an explicit
7435         implementation or not.  And only call DefineMethodOverride if we
7436         are an explicit implementation.
7437
7438         (Property.DefineMethod): Ditto.
7439
7440 2002-02-11  Ravi Pratap  <ravi@ximian.com>
7441
7442         * expression.cs (BetterFunction): Catch hideous bug which was
7443          preventing us from detecting ambiguous calls due to implicit casts i.e
7444         cs0121.
7445
7446 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
7447
7448         * support.cs (Pair): Remove un-needed method.  I figured why I was
7449         getting the error in cs-parser.jay, the variable in a foreach loop
7450         is readonly, and the compiler does not really treat this as a variable.
7451
7452         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
7453         instead of EQUALS in grammar.  
7454
7455         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
7456
7457         * expression.cs (Unary.DoResolve): Check whether the argument is
7458         managed or not.
7459
7460 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
7461
7462         * support.cs: Api for Pair to set a value.  Despite the fact that
7463         the variables are public the MS C# compiler refuses to compile
7464         code that accesses the field if the variable is part of a foreach
7465         statement. 
7466
7467         * statement.cs (Fixed): Begin implementation of the fixed
7468         statement.
7469
7470         (Block.AddVariable): Return the VariableInfo on success and null
7471         on failure instead of true/false. 
7472
7473         * cs-parser.jay (foreach): Catch errors on variables already
7474         defined (we were ignoring this value before) and properly unwind
7475         the block hierarchy
7476
7477         (fixed_statement): grammar for the fixed statement.
7478
7479 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
7480
7481         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
7482         pointer types to be incretemented.
7483
7484         (SizeOf): Implement.
7485
7486         * cs-parser.jay (pointer_member_access): Implement
7487         expr->IDENTIFIER production.
7488
7489         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
7490         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
7491         on safe contexts.
7492
7493         (Unary): Implement indirection.
7494
7495         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
7496         use in non-unsafe context).
7497
7498         (SimpleName.DoResolve): Check for pointers in field access on safe
7499         contexts. 
7500
7501         (Expression.LoadFromPtr): Factor the load-indirect code in this
7502         function.  This was duplicated in UnboxCast and ParameterReference
7503
7504 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
7505
7506         * expression.cs (ComposedCast): report an error if a pointer cast
7507         is used in a safe region.
7508
7509         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
7510         pointer type casts in unsafe context.
7511
7512         * codegen.cs (EmitContext): Set up IsUnsafe.
7513
7514         * cs-parser.jay (non_expression_type): Add productions for pointer
7515         casts. 
7516
7517         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
7518         code.  We should not use force into static mode if the method is
7519         not virtual.  Fixes bug in MIS
7520
7521         * statement.cs (Do.Emit, While.Emit, For.Emit,
7522         Statement.EmitBoolExpression): Add support to Do and While to
7523         propagate infinite loop as `I do return' semantics.
7524
7525         Improve the For case to also test for boolean constants.
7526
7527         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
7528         to the list of attributes we can add.
7529
7530         Remove `EmitContext' argument.
7531
7532         * class.cs (Method.Define): Apply parameter attributes.
7533         (Constructor.Define): Apply parameter attributes.
7534         (MethodCore.LabelParameters): Move here the core of labeling
7535         parameters. 
7536
7537         * support.cs (ReflectionParameters.ParameterModifier,
7538         InternalParameters.ParameterModifier): Use IsByRef on the type and
7539         only return the OUT bit for these parameters instead of in/out/ref
7540         flags.
7541
7542         This is because I miss-understood things.  The ParameterInfo.IsIn
7543         and IsOut represent whether the parameter has the [In] and [Out]
7544         attributes set.  
7545
7546 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
7547
7548         * ecore.cs (FieldExpr.Emit): Release temporaries.
7549
7550         * assign.cs (LocalTemporary.Release): new function.
7551
7552         * codegen.cs (EmitContext.GetTemporaryStorage,
7553         EmitContext.FreeTemporaryStorage): Rework the way we deal with
7554         temporary storage.  Now we can "put back" localbuilders when we
7555         are done with them
7556
7557 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
7558
7559         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
7560         need to make a copy of the variable to generate verifiable code.
7561
7562 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
7563
7564         * driver.cs: Compute dynamically the system directory.
7565
7566         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
7567         Slower, but more generally useful.  Used by the abstract
7568         registering implementation. 
7569
7570         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
7571         the rules for the special rule on Type/instances.  First check if
7572         we have the same name, and if so, try that special static path
7573         rather than the instance path.
7574         
7575 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
7576
7577         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
7578         for, while and if.
7579
7580         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
7581         Enum, ValueType, Delegate or Array for non-corlib compiles.
7582
7583         * cs-tokenizer.cs: Catch long identifiers (645)
7584
7585         * typemanager.cs (IndexerPropetyName): Ravi never tested this
7586         piece of code.
7587
7588         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
7589         fix, we were returning too early, so we were not registering
7590         pending methods from abstract classes.
7591
7592         Do not register pending methods if the class is abstract.
7593
7594         * expression.cs (Conditional.DoResolve): Report circular implicit
7595         conversions when we neecd to compute it for conditional
7596         expressions. 
7597
7598         (Is.DoResolve): If the expression is always of the provided type,
7599         flag warning 183.  If the expression can not ever be of the
7600         provided type flag warning 184.
7601
7602         * class.cs: Catch 169 as well.
7603
7604         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
7605         read. 
7606
7607 2002-01-18  Nick Drochak  <ndrochak@gol.com>
7608
7609         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
7610
7611 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
7612
7613         * interface.cs: (PopulateMethod): Check for pointers being defined
7614         only if the unsafe context is active.
7615         (PopulateProperty): ditto.
7616         (PopulateIndexer): ditto.
7617
7618         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
7619         specified.  If pointers are present, make sure that they are
7620         present in an unsafe context.
7621         (Constructor, Constructor.Define): ditto.
7622         (Field, Field.Define): ditto.
7623         (Property, Property.Define): ditto.
7624         (Event, Event.Define): ditto.
7625
7626         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
7627         hashtable if there are classes or structs defined.
7628
7629         * expression.cs (LocalVariableReference.DoResolve): Simplify this
7630         code, as the constant resolution moved.
7631
7632         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
7633         the metadata, so we can flag error 133. 
7634
7635         * decl.cs (MemberCore.UnsafeOK): New function to test that a
7636         pointer is being declared in an unsafe context.
7637
7638 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
7639
7640         * modifiers.cs (Modifiers.Check): Require a Location argument.
7641         Report error 227 for Unsafe use.
7642
7643         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
7644
7645         * statement.cs (For.Emit): If the test is null, then report that
7646         we do `return', as we wont reach anything afterwards.
7647
7648         (Switch.SwitchGoverningType): Track the expression that matched
7649         the conversion.
7650
7651         * driver.cs: Allow negative numbers as an error code to flag.
7652
7653         * cs-parser.jay: Handle 1551.
7654
7655         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
7656
7657 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
7658
7659         * cs-parser.jay: Report 1518 (type declaration can only contain
7660         class, struct, interface, enum or delegate)
7661
7662         (switch_label): Report 1523 (keywords `case' or `default' must
7663         preced code)
7664
7665         (opt_switch_sections): Report 1522 (empty switch)
7666
7667         * driver.cs: Report 1515 (response file specified multiple times)
7668         Report 1516 (Source file specified multiple times).
7669
7670         * expression.cs (Argument.Resolve): Signal 1510
7671
7672         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
7673         access not allowed in static code)
7674
7675 2002-01-11  Ravi Pratap  <ravi@ximian.com>
7676
7677         * typemanager.cs (IsPointerType): Utility method which we are going
7678         to need a lot.
7679
7680         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
7681         the object type, so we take care of that.
7682
7683         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
7684         
7685         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
7686         added to non-params parameters :-)
7687
7688         * typemanager.cs (CSharpName): Include 'void' type too. 
7689
7690         (void_ptr_type): Include in the set of core types.
7691
7692         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
7693         duplicating code.
7694
7695         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
7696         an unsafe context.
7697
7698         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
7699         completely forgotten about it.
7700
7701 2002-01-10  Ravi Pratap  <ravi@ximian.com>
7702
7703         * cs-parser.jay (pointer_type): Add. This begins our implementation
7704         of parsing rules for unsafe code.
7705
7706         (unsafe_statement): Implement.
7707
7708         (embedded_statement): Modify to include the above.
7709
7710         * statement.cs (Unsafe): Implement new class for unsafe blocks.
7711
7712         * codegen.cs (EmitContext.InUnsafe): Add. This determines
7713         if the current context is an unsafe one.
7714
7715         * cs-parser.jay (local_variable_pointer_type): Since local variable types
7716         are handled differently, we need separate rules for them.
7717
7718         (local_variable_declaration): Update to use local_variable_pointer_type
7719         to allow variable declarations of unmanaged pointer types.
7720
7721         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
7722         in unsafe contexts.
7723
7724         * ../errors/cs0214.cs : Add.
7725
7726 2002-01-16  Nick Drochak  <ndrochak@gol.com>
7727
7728         * makefile: remove 'response' file when cleaning.
7729
7730 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
7731
7732         * cs-parser.jay: Report 1524.
7733
7734 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
7735
7736         * typemanager.cs (RegisterMethod): drop checking if we have
7737         registered this from here
7738
7739 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
7740
7741         * class.cs (Method.EmitDestructor): Implement calling our base
7742         destructor. 
7743
7744         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
7745         value of InFinally.
7746
7747         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
7748         this routine and will wrap the call in a try/catch block.  Deal
7749         with the case.
7750
7751 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
7752
7753         * ecore.cs (Expression.MemberLookup): instead of taking a
7754         parameter `same_type' that was used to tell whether we could
7755         access private members we compute our containing type from the
7756         EmitContext.
7757
7758         (FieldExpr): Added partial support for volatile fields.  This does
7759         not work for volatile fields exposed from assemblies, as I can not
7760         figure out how to extract the modreq from it.
7761
7762         Updated all the source files to use this.
7763
7764         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
7765         because it is referenced by MemberLookup very often. 
7766
7767 2002-01-09  Ravi Pratap  <ravi@ximian.com>
7768
7769         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
7770         TypeBuilder.GetCustomAttributes to retrieve what we need.
7771
7772         Get rid of redundant default_member_attr_type as this is the same as
7773         default_member_type which already exists.
7774
7775         * interface.cs, attribute.cs : Update accordingly.
7776         
7777 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
7778
7779         * typemanager.cs: Enable IndexerPropertyName again.  It does not
7780         work for TYpeBuilders though.  Ravi, can you please fix this?
7781
7782         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
7783
7784         * expression.cs (Argument.Emit): Handle the case of ref objects
7785         being passed to ref functions;  
7786
7787         (ParameterReference.EmitLoad): Loads the content of the pointer
7788         without dereferencing.
7789
7790 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
7791
7792         * cs-tokenizer.cs: Implemented the pre-processing expressions.
7793
7794 2002-01-08  Ravi Pratap  <ravi@ximian.com>
7795
7796         * class.cs (Indexer.DefineMethod): Incorporate the interface
7797         type in the name of the method if we are doing explicit interface
7798         implementation.
7799
7800         * expression.cs (ConversionExists): Remove as it is completely obsolete.
7801
7802         (BetterConversion): Fix extremely trivial bug where we were referring to
7803         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
7804         again !
7805
7806         * ../errors/bug16.cs : Add although we have fixed it.
7807
7808 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
7809
7810         * expression.cs (BaseIndexer): Begin implementation.
7811
7812         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
7813
7814         * cs-parser.jay (indexer_declarator): Use qualified_identifier
7815         production directly to remove a shift/reduce, and implement
7816         explicit interface implementation.
7817
7818         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
7819         after a floating point suffix.
7820
7821         * expression.cs (DoNumericPromotions): Improved the conversion for
7822         uint/uint.  If we have a constant, we avoid doing a typecast to a
7823         larger type.
7824
7825         * class.cs (Indexer): Implement explicit interface implementation
7826         for indexers.
7827         
7828 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
7829
7830         * class.cs: make the default instance constructor public and hidebysig.
7831
7832 2001-01-03  Ravi Pratap  <ravi@ximian.com>
7833
7834         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
7835         so we can call it from elsewhere.
7836
7837         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
7838         we emit it internally if the class has a defined indexer; otherwise the user
7839         emits it by decorating the class definition with the DefaultMemberAttribute.
7840
7841         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
7842         attribute is not used on a type which defines an indexer.
7843
7844         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
7845         character when we skip whitespace.
7846
7847         * ../errors/cs0646.cs : Add.
7848
7849 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
7850
7851         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
7852         again. 
7853
7854         * makefile: Add practical target `mcs3.exe' which builds the third
7855         generation compiler. 
7856
7857         * expression.cs (New): Fix structures constructor calling.
7858
7859         * class.cs (Property, Method, Indexer): Emit Final flag on the
7860         method if we are an interface implementation and we are not
7861         abstract. 
7862
7863         * ecore.cs (PropertyExpr): New public field `IsBase', tells
7864         whether this property is referencing a `base' method.
7865
7866         * expression.cs (Invocation.EmitCall): take an extra argument:
7867         is_base, this is used to determine whether the `call' or
7868         `callvirt' opcode should be used.
7869
7870         
7871         * delegate.cs: update EmitCall.
7872
7873         * class.cs (Method.Define): Set NewSlot for the cases where we are
7874         not implementing an interface method.
7875
7876         (Property.Define): ditto.
7877
7878 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
7879
7880         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
7881         'r'.  Allows mcs to parse itself fully.
7882
7883 2002-01-02  Ravi Pratap  <ravi@ximian.com>
7884
7885         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
7886         of the number of initializers that require the InitializeArray method.
7887
7888         (CheckIndices): Store the Expression in all cases - not the plain value. Also
7889         update the above field where necessary.
7890
7891         (MakeByteBlob): Update accordingly.
7892
7893         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
7894         greater than 2.
7895
7896         (EmitDynamicInitializers): Update in accordance with the new optimization.
7897
7898         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
7899         same OpCode applies.
7900
7901         * cs-parser.jay : Fix some glaring errors I introduced.
7902
7903 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
7904
7905         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
7906         so that we can check for name clashes there too.
7907
7908         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
7909         for interface indexers.
7910
7911         * interfaces.cs (Define): Emit the default member attribute.
7912
7913         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
7914         variable was being referred to while setting the value ;-)
7915
7916 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
7917
7918         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
7919         byte-by-byte information when we know the data is zero.
7920
7921         Make the block always a multiple of 4, because
7922         DefineInitializedData has a bug.
7923
7924         * assign.cs: Fix, we should assign from the temporary, not from
7925         the source. 
7926
7927         * expression.cs (MakeByteBlob): Fix my incorrect code.
7928
7929 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
7930
7931         * typemanager.cs (EnumToUnderlying): This function is used to get
7932         the underlying type from an enumeration, because it does not
7933         always work. 
7934
7935         * constant.cs: Use the I4_S form for values between -128 and 127.
7936
7937         * statement.cs (Block.LookupLabel): Looks up a label.
7938         (Block): Drop support for labeled blocks.
7939
7940         (LabeledStatement): New kind of statement that represents a label
7941         only.
7942
7943         (Goto): Finally implement this bad boy.
7944         
7945         * cs-parser.jay: Update to reflect new mechanism to implement
7946         labels.
7947
7948 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
7949
7950         * codegen.cs (EmitContext.This): a codegen property that keeps the
7951         a single instance of this instead of creating many different this
7952         instances. 
7953
7954         * delegate.cs (Delegate.DoResolve): Update to use the property;
7955
7956         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
7957
7958         * expression.cs (BaseAccess.DoResolve): Ditto.
7959
7960 2001-12-29  Ravi Pratap  <ravi@ximian.com>
7961
7962         * typemanager.cs (methodimpl_attr_type): Add to hold the type
7963         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
7964
7965         (InitCoreTypes): Update accordingly.
7966
7967         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
7968         so we can quickly store the state.
7969
7970         (ApplyAttributes): Set the correct implementation flags
7971         for InternalCall methods.
7972
7973 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
7974
7975         * expression.cs (EmitCall): if a method is not virtual, then do
7976         not use callvirt on it.
7977
7978         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
7979         user defined stuff) requires the use of stobj, which takes an
7980         address on the stack instead of an array and an index.  So emit
7981         the Ldelema operation for it.
7982
7983         (EmitStoreOpcode): Use stobj for valuetypes.
7984
7985         (UnaryMutator.EmitCode): Use the right 1 value depending on
7986         whether we are dealing with int64/uint64, float or doubles.
7987
7988         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
7989         constructors that I implemented last night.
7990
7991         (Constructor.IsDefault): Fix to work properly for static
7992         constructors.
7993
7994         * cs-parser.jay (CheckDef): report method signature errors.
7995         Update error number 103 to be 132.
7996
7997         * decl.cs: New AdditionResult enumeration value: MethodExists.
7998         Although we do this check for methods later on in the semantic
7999         analysis, catching repeated default constructors is so easy that
8000         we catch these here. 
8001         
8002         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
8003         promotions code.
8004
8005         (ParameterReference.EmitAssign, Emit): handle
8006         bools as bytes.
8007
8008         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
8009         (ArrayAccess.EmitStoreOpcode): ditto.
8010
8011         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
8012
8013         * expression.cs (MakeByteBlob): Complete all the missing types
8014         (uint, short, ushort, byte, sbyte)
8015
8016         * class.cs: Only init instance field initializers on instance
8017         constructors. 
8018
8019         Rename `constructors' to instance_constructors. 
8020
8021         (TypeContainer.AddConstructor): Only add constructors to the list
8022         if it is not static.
8023
8024         Make sure that we handle default_static_constructor independently
8025         everywhere where we handle instance_constructors
8026
8027 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
8028
8029         * class.cs: Do not lookup or create a base initializer for a
8030         static constructor.
8031
8032         (ConstructorInitializer.Resolve): use the proper type to lookup
8033         for constructors.
8034
8035         * cs-parser.jay: Report error 1585 (modifiers between type and name).
8036
8037         * enum.cs, interface.cs: Remove CloseType, this is taken care by
8038         in DeclSpace. 
8039
8040         * decl.cs: CloseType is now an virtual method, the default
8041         implementation just closes this type.
8042         
8043 2001-12-28  Ravi Pratap  <ravi@ximian.com>
8044
8045         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
8046         to PreserveSig by default. Also emit HideBySig on such methods.
8047
8048         Basically, set the defaults to standard values.
8049
8050         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
8051         argument, if candidate is better, it can't be worse than the best !
8052
8053         (Invocation): Re-write bits to differentiate between methods being
8054         applicable in their expanded form and their normal form - for params
8055         methods of course.
8056
8057         Get rid of use_standard everywhere as only standard conversions are allowed
8058         in overload resolution. 
8059
8060         More spec conformance.
8061         
8062 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
8063
8064         * driver.cs: Add --timestamp, to see where the compiler spends
8065         most of its time.
8066
8067         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
8068         `this' in static code.
8069
8070         (SimpleName.DoResolve): Implement in terms of a helper function
8071         that allows static-references to be passed upstream to
8072         MemberAccess.
8073
8074         (Expression.ResolveWithSimpleName): Resolve specially simple
8075         names when called by MemberAccess to implement the special
8076         semantics. 
8077
8078         (Expression.ImplicitReferenceConversion): Handle conversions from
8079         Null to reference types before others, as Null's type is
8080         System.Object. 
8081
8082         * expression.cs (Invocation.EmitCall): Handle the special case of
8083         calling methods declared on a reference type from a ValueType
8084         (Base classes System.Object and System.Enum)
8085
8086         (MemberAccess.Resolve): Only perform lookups on Enumerations if
8087         the left hand side is a TypeExpr, not on every enumeration. 
8088
8089         (Binary.Resolve): If types are reference types, then do a cast to
8090         object on operators != and == of both arguments.
8091         
8092         * typemanager.cs (FindMembers): Extract instance and static
8093         members if requested.
8094
8095         * interface.cs (PopulateProperty): Use void_type instead of null
8096         as the return type for the setter method.
8097
8098         (PopulateIndexer): ditto.
8099
8100 2001-12-27  Ravi Pratap  <ravi@ximian.com>
8101
8102         * support.cs (ReflectionParameters): Fix minor bug where we
8103         were examining the wrong parameter for the ParamArray attribute.
8104
8105         Cope with requests for the type of the parameter at position
8106         greater than the params parameter's. We now return the element
8107         type of the params array as that makes more sense.
8108
8109         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
8110         accordingly as we no longer have to extract the element type
8111         ourselves.
8112
8113         (Invocation.OverloadResolve): Update.
8114
8115 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
8116
8117         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
8118         against IEnumerator, test whether the return value is a descendant
8119         of the IEnumerator interface.
8120
8121         * class.cs (Indexer.Define): Use an auxiliary method to implement
8122         the other bits of the method definition.  Begin support for
8123         explicit interface implementation.
8124
8125         (Property.DefineMethod): Use TypeManager.void_type instead of null
8126         for an empty return value.
8127
8128 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
8129
8130         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
8131         dealing with a FieldExpr which is composed of a FieldBuilder, in
8132         the code path we did extract the constant, but we should have
8133         obtained the underlying value to be able to cast it (otherwise we
8134         end up in an infinite loop, this is what Ravi was running into).
8135
8136         (ArrayCreation.UpdateIndices): Arrays might be empty.
8137
8138         (MemberAccess.ResolveMemberAccess): Add support for section
8139         14.5.4.1 that deals with the special case of E.I when E is a type
8140         and something else, that I can be a reference to a static member.
8141
8142         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
8143         handle a particular array type to create byte blobs, it is just
8144         something we dont generate byteblobs for.
8145
8146         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
8147         arguments. 
8148
8149         * location.cs (Push): remove the key from the hashtable that we
8150         are about to add.   This happens for empty files.
8151
8152         * driver.cs: Dispose files after we have parsed them.
8153
8154         (tokenize): new function that only runs the tokenizer on its
8155         input, for speed testing.
8156
8157 2001-12-26  Ravi Pratap  <ravi@ximian.com>
8158
8159         * class.cs (Event.Define): Define the private field only if there
8160         are no accessors defined.
8161
8162         * expression.cs (ResolveMemberAccess): If there is no associated
8163         field with the event, that means we have an event defined with its
8164         own accessors and we should flag error cs0070 since transforming
8165         ourselves into a field is not valid in that case.
8166
8167         * ecore.cs (SimpleName.DoResolve): Same as above.
8168
8169         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
8170         and charset to sane values.
8171
8172 2001-12-25  Ravi Pratap  <ravi@ximian.com>
8173
8174         * assign.cs (DoResolve): Perform check on events only if they 
8175         are being accessed outside the declaring type.
8176
8177         * cs-parser.jay (event_declarations): Update rules to correctly
8178         set the type of the implicit parameter etc.
8179
8180         (add_accessor, remove_accessor): Set current local parameters.
8181
8182         * expression.cs (Binary): For delegate addition and subtraction,
8183         cast the return value from the method into the appropriate delegate
8184         type.
8185
8186 2001-12-24  Ravi Pratap  <ravi@ximian.com>
8187
8188         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
8189         of these as the workaround is unnecessary.
8190
8191         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
8192         delegate data - none of that is needed at all.
8193
8194         Re-write bits to extract the instance expression and the delegate method
8195         correctly.
8196
8197         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
8198         on delegates too.
8199
8200         * attribute.cs (ApplyAttributes): New method to take care of common tasks
8201         of attaching attributes instead of duplicating code everywhere.
8202
8203         * everywhere : Update code to do attribute emission using the above method.
8204
8205 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
8206
8207         * expression.cs (IsParamsMethodApplicable): if there are not
8208         parameters, return immediately.
8209
8210         * ecore.cs: The 0 literal can be implicity converted to an enum
8211         type. 
8212
8213         (SimpleName.DoResolve): First lookup the type, then lookup the
8214         members. 
8215
8216         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
8217         want to get its address.  If the InstanceExpression is not
8218         addressable, store the result in a temporary variable, then get
8219         the address of it.
8220
8221         * codegen.cs: Only display 219 errors on warning level or above. 
8222
8223         * expression.cs (ArrayAccess): Make it implement the
8224         IMemoryLocation interface.
8225
8226         (Binary.DoResolve): handle the operator == (object a, object b)
8227         and operator != (object a, object b) without incurring into a
8228         BoxedCast (because 5 != o should never be performed).
8229
8230         Handle binary enumerator operators.
8231
8232         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
8233         value type, otherwise use Ldelem_ref.
8234
8235         Use precomputed names;
8236
8237         (AddressOf): Implement address of
8238
8239         * cs-parser.jay (labeled_statement): Fix recursive block
8240         addition by reworking the production.
8241
8242         * expression.cs (New.DoEmit): New has a special case:
8243                 
8244                  If we are dealing with a ValueType, we have a few
8245                  situations to deal with:
8246                 
8247                     * The target of New is a ValueType variable, that is
8248                       easy, we just pass this as the variable reference
8249                 
8250                     * The target of New is being passed as an argument,
8251                       to a boxing operation or a function that takes a
8252                       ValueType.
8253                 
8254                       In this case, we need to create a temporary variable
8255                       that is the argument of New.
8256
8257
8258 2001-12-23  Ravi Pratap  <ravi@ximian.com>
8259
8260         * rootcontext.cs (LookupType): Check that current_type is not null before
8261         going about looking at nested types.
8262
8263         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
8264         not implement the IAssignMethod interface any more.
8265
8266         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
8267         where we tranform them into FieldExprs if they are being resolved from within
8268         the declaring type.
8269
8270         * ecore.cs (SimpleName.DoResolve): Do the same here.
8271
8272         * assign.cs (DoResolve, Emit): Clean up code considerably. 
8273
8274         * ../errors/bug10.cs : Add.
8275
8276         * ../errors/cs0070.cs : Add.
8277
8278         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
8279
8280         * assign.cs : Get rid of EventIsLocal everywhere.
8281         
8282 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
8283
8284         * ecore.cs (ConvertIntLiteral): finished the implementation.
8285
8286         * statement.cs (SwitchLabel): Convert the value we are using as a
8287         key before looking up the table.
8288
8289 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
8290
8291         * codegen.cs (EmitTopBlock): Require a Location argument now.
8292
8293         * cs-parser.jay (constructor_declarator): We need to setup
8294         current_local_parameters before we parse the
8295         opt_constructor_initializer, to allow the variables to be bound
8296         to the constructor arguments.
8297
8298         * rootcontext.cs (LookupType): First lookup nested classes in our
8299         class and our parents before we go looking outside our class.
8300
8301         * expression.cs (ConstantFold): Extract/debox the values at the
8302         beginnning. 
8303
8304         * rootcontext.cs (EmitCode): Resolve the constants first before we
8305         resolve the types.  This is not really needed, but it helps debugging.
8306
8307         * statement.cs: report location.
8308         
8309         * cs-parser.jay: pass location to throw statement.
8310
8311         * driver.cs: Small bug fix.
8312
8313         * report.cs: Updated format to be 4-zero filled digits.
8314
8315 2001-12-22  Ravi Pratap  <ravi@ximian.com>
8316
8317         * expression.cs (CheckIndices): Fix minor bug where the wrong
8318         variable was being referred to ;-)
8319
8320         (DoEmit): Do not call EmitStaticInitializers when the 
8321         underlying type is System.Object.
8322
8323 2001-12-21  Ravi Pratap  <ravi@ximian.com>
8324
8325         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
8326         and do the usual workaround for SRE.
8327
8328         * class.cs (MyEventBuilder.EventType): New member to get at the type
8329         of the event, quickly.
8330
8331         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
8332
8333         * assign.cs (Assign.DoResolve): Handle the case when the target
8334         is an EventExpr and perform the necessary checks.
8335
8336         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
8337         interface.
8338
8339         (SimpleName.MemberStaticCheck): Include check for EventExpr.
8340
8341         (EventExpr): Set the type in the constructor itself since we 
8342         are meant to be born fully resolved.
8343
8344         (EventExpr.Define): Revert code I wrote earlier.
8345                 
8346         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
8347         instance expression is null. The instance expression is a This in that case
8348         or a null, depending on whether it is a static method or not.
8349
8350         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
8351         refers to more than one method.
8352
8353         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
8354         and accordingly flag errors.
8355
8356 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
8357
8358         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
8359
8360 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
8361
8362         * location.cs (ToString): Provide useful rutine.
8363
8364 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
8365
8366         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
8367         objects, return the actual integral boxed.
8368
8369         * statement.cs (SwitchLabel): define an ILLabel for each
8370         SwitchLabel. 
8371         
8372         (Switch.CheckSwitch): If the value is a Literal, extract
8373         the underlying literal.
8374         
8375         Also in the unused hashtable we had, add the SwitchLabel so we can
8376         quickly look this value up.
8377
8378         * constant.cs: Implement a bunch of new constants.  Rewrite
8379         Literal based on this.  Made changes everywhere to adapt to this.
8380         
8381         * expression.cs (Expression.MakeByteBlob): Optimize routine by
8382         dereferencing array only once, and also copes with enumrations.
8383
8384         bytes are two bytes wide, not one.
8385
8386         (Cast): Perform constant conversions.
8387         
8388         * ecore.cs (TryImplicitIntConversion): Return literals instead of
8389         wrappers to the literals here.
8390
8391         * expression.cs (DoNumericPromotions): long literals can converted
8392         to ulong implicity (this is taken care of elsewhere, but I was
8393         missing this spot).
8394
8395         * ecore.cs (Expression.Literalize): Make the return type Literal,
8396         to improve type checking.
8397
8398         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
8399
8400 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
8401
8402         * literal.cs: Revert code from ravi that checked the bounds.  The
8403         bounds are sane by the definition of the type itself. 
8404
8405         * typemanager.cs: Fix implementation of ImplementsInterface.  We
8406         need to actually look up in our parent hierarchy for interfaces
8407         implemented. 
8408
8409         * const.cs: Use the underlying type for enumerations
8410
8411         * delegate.cs: Compute the basename for the delegate creation,
8412         that should fix the delegate test case, and restore the correct
8413         Type Lookup semantics in rootcontext
8414
8415         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
8416         referencing a nested type with the Reflection API is using the "+"
8417         sign. 
8418
8419         * cs-parser.jay: Do not require EOF token at the end.
8420
8421 2001-12-20  Ravi Pratap  <ravi@ximian.com>
8422
8423         * rootcontext.cs (LookupType): Concatenate type names with
8424         a '.' instead of a '+' The test suite passes again.
8425
8426         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
8427         field of the enumeration.
8428
8429         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
8430         the case when the member is an EventExpr.
8431
8432         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
8433         static has an associated instance expression.
8434
8435         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
8436
8437         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
8438
8439         * class.cs (Event.Define): Register event and perform appropriate checks
8440         for error #111.
8441
8442         We define the Add and Remove methods even if the use provides none because
8443         in that case, we provide default implementations ourselves.
8444
8445         Define a private field of the type of the event. This is done by the CSC compiler
8446         and we should be doing it too ;-)
8447
8448         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
8449         More methods we use in code we generate.
8450
8451         (multicast_delegate_type, delegate_type): Two separate types since the distinction
8452         is important.
8453
8454         (InitCoreTypes): Update accordingly for the above.
8455
8456         * class.cs (Event.Emit): Generate code for default accessors that we provide
8457
8458         (EmitDefaultMethod): Do the job in the above.
8459
8460         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
8461         appropriate place.
8462
8463 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
8464
8465         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
8466         builders even if we were missing one.
8467
8468         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
8469         pass the Basename as our class name instead of the Name.  The
8470         basename will be correctly composed for us.
8471
8472         * parameter.cs (Paramters): Now takes a Location argument.
8473
8474         * decl.cs (DeclSpace.LookupType): Removed convenience function and
8475         make all the code call directly LookupType in RootContext and take
8476         this chance to pass the Location information everywhere.
8477
8478         * Everywhere: pass Location information.
8479
8480 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
8481
8482         * class.cs (Constructor.Define): Updated way of detecting the
8483         length of the parameters.
8484
8485         (TypeContainer.DefineType): Use basename as the type name for
8486         nested types.
8487
8488         (TypeContainer.Define): Do not recursively define types here, as
8489         definition is taken care in order by the RootContext.
8490
8491         * tree.cs: Keep track of namespaces in a per-file basis.
8492
8493         * parameter.cs (Parameter.ComputeSignature): Update to use
8494         DeclSpace. 
8495
8496         (Parameters.GetSignature): ditto.
8497
8498         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
8499         instead of a TypeContainer.
8500
8501         (Interface.SemanticAnalysis): Use `this' instead of our parent to
8502         resolve names.  Because we need to be resolve in our context, not
8503         our parents.
8504         
8505         * driver.cs: Implement response files.
8506
8507         * class.cs (TypeContainer.DefineType): If we are defined, do not
8508         redefine ourselves.
8509         
8510         (Event.Emit): Emit the code for add/remove handlers.
8511         (Event.Define): Save the MethodBuilders for add/remove.
8512
8513         * typemanager.cs: Use pair here too.
8514
8515         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
8516         DictionaryEntry requires the first argument to be non-null.  
8517         
8518         (enum_declaration): Compute full name for registering the
8519         enumeration.
8520         
8521         (delegate_declaration): Instead of using
8522         formal_parameter_list, use opt_formal_parameter_list as the list
8523         can be empty.
8524
8525         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
8526         (EventParsing): New property that controls whether `add' and
8527         `remove' are returned as tokens or identifiers (for events);
8528
8529 2001-12-19  Ravi Pratap  <ravi@ximian.com>
8530
8531         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
8532         use MyEventBuilder only and let it wrap the real builder for us.
8533
8534         (MyEventBuilder): Revamp constructor etc.
8535
8536         Implement all operations that we perform on EventBuilder in precisely the same
8537         way here too.
8538
8539         (FindMembers): Update to use the EventBuilder member.
8540
8541         (Event.Emit): Update accordingly.
8542
8543 2001-12-18  Ravi Pratap  <ravi@ximian.com>
8544
8545         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
8546         by calling the appropriate methods.
8547
8548         (GetCustomAttributes): Make stubs as they cannot possibly do anything
8549         useful.
8550
8551         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
8552
8553 2001-12-17  Ravi Pratap  <ravi@ximian.com>
8554
8555         * delegate.cs (Delegate.Populate): Check that the return type
8556         and various parameters types are indeed accessible.
8557
8558         * class.cs (Constructor.Define): Same here.
8559
8560         (Field.Define): Ditto.
8561
8562         (Event.Define): Ditto.
8563
8564         (Operator.Define): Check that the underlying Method defined itself
8565         correctly - so it's MethodBuilder should not be null.
8566
8567         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
8568         expression happens to be null.
8569
8570         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
8571         members but as of now we don't seem to be able to do anything really useful with it.
8572
8573         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
8574         not the EventBuilder.
8575
8576 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
8577
8578         * cs-tokenizer.cs: Add support for defines.
8579         Add support for #if, #elif, #else, #endif
8580         
8581         (eval_var): evaluates a variable.
8582         (eval): stubbed for evaluating functions.
8583
8584         * cs-parser.jay: Pass the defines information
8585
8586         * driver.cs: Add --define command line option.
8587
8588         * decl.cs: Move MemberCore here.
8589
8590         Make it the base class for DeclSpace.  This allows us to catch and
8591         report 108 and 109 for everything now.
8592
8593         * class.cs (TypeContainer.Define): Extract all the members
8594         before populating and emit the warning 108 (new keyword required
8595         to override) instead of having each member implement this.
8596
8597         (MemberCore.Define): New abstract method, we will be using this in
8598         the warning reporting engine in Populate.
8599         
8600         (Operator.Define): Adjust to new MemberCore protocol. 
8601
8602         * const.cs (Const): This does not derive from Expression, it is a
8603         temporary object we use to create fields, it is a MemberCore. 
8604
8605         * class.cs (Method.Define): Allow the entry point to be in a
8606         specific class.
8607
8608         * driver.cs: Rewrite the argument handler to clean it up a bit.
8609
8610         * rootcontext.cs: Made it just an auxiliary namespace feature by
8611         making everything static.
8612
8613         * driver.cs: Adapt code to use RootContext type name instead of
8614         instance variable.
8615
8616         * delegate.cs: Remove RootContext argument.
8617
8618         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
8619         argument. 
8620
8621         * class.cs (Event.Define): The lookup can fail.
8622         
8623         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
8624
8625         * expression.cs: Resolve the this instance before invoking the code.
8626
8627 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
8628
8629         * cs-parser.jay: Add a production in element_access that allows
8630         the thing to become a "type" reference.  This way we can parse
8631         things like "(string [])" as a type.
8632
8633         Note that this still does not handle the more complex rules of
8634         casts. 
8635         
8636
8637         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
8638
8639         * ecore.cs: (CopyNewMethods): new utility function used to
8640         assemble the list of methods from running FindMembers.
8641
8642         (MemberLookup): Rework FindMembers so that 
8643
8644 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
8645
8646         * class.cs (TypeContainer): Remove Delegates who fail to be
8647         defined.
8648
8649         * delegate.cs (Populate): Verify that we dont get null return
8650         values.   TODO: Check for AsAccessible.
8651
8652         * cs-parser.jay: Use basename to emit error 574 (destructor should
8653         have the same name as container class), not the full name.
8654
8655         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
8656         possible representation.  
8657
8658         Also implements integer type suffixes U and L.
8659
8660 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
8661
8662         * expression.cs (ArrayCreation.DoResolve): We need to do the
8663         argument resolution *always*.
8664
8665         * decl.cs: Make this hold the namespace.  Hold the root context as
8666         well.
8667         (LookupType): Move here.
8668
8669         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
8670
8671         * location.cs (Row, Name): Fixed the code, it was always returning
8672         references to the first file.
8673
8674         * interface.cs: Register properties defined through interfaces.
8675
8676         * driver.cs: Add support for globbing on the command line
8677
8678         * class.cs (Field): Make it derive from MemberCore as well.
8679         (Event): ditto.
8680
8681 2001-12-15  Ravi Pratap  <ravi@ximian.com>
8682
8683         * class.cs (Event::Define): Check that the type of the event is a delegate
8684         type else flag error #66.
8685
8686         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
8687         same.
8688
8689         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
8690         values of EntryPoint, CharSet etc etc.
8691
8692         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
8693
8694         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
8695         be null and we should ignore this. I am not sure if this is really clean. Apparently,
8696         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
8697         which needs this to do its work.
8698
8699         * ../errors/cs0066.cs : Add.
8700
8701 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
8702
8703         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
8704         helper functions.
8705
8706         * class.cs: (MethodSignature.MethodSignature): Removed hack that
8707         clears out the parameters field.
8708         (MemberSignatureCompare): Cleanup
8709
8710         (MemberCore): New base class used to share code between MethodCore
8711         and Property.
8712
8713         (RegisterRequiredImplementations) BindingFlags.Public requires
8714         either BindingFlags.Instace or Static.  Use instance here.
8715
8716         (Property): Refactored code to cope better with the full spec.
8717
8718         * parameter.cs (GetParameterInfo): Return an empty array instead
8719         of null on error.
8720
8721         * class.cs (Property): Abstract or extern properties have no bodies.
8722
8723         * parameter.cs (GetParameterInfo): return a zero-sized array.
8724
8725         * class.cs (TypeContainer.MethodModifiersValid): Move all the
8726         method modifier validation to the typecontainer so we can reuse
8727         this on properties.
8728
8729         (MethodCore.ParameterTypes): return an empty sized array of types.
8730
8731         (Property.Define): Test property modifier validity.
8732
8733         Add tests for sealed/override too.
8734
8735         (Method.Emit): abstract or extern methods have no bodies.
8736
8737 2001-12-14  Ravi Pratap  <ravi@ximian.com>
8738
8739         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
8740         thing.
8741
8742         (Method::Define, ::Emit): Modify accordingly.
8743
8744         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
8745
8746         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
8747
8748         * makefile: Pass in /unsafe.
8749
8750 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
8751
8752         * class.cs (MakeKey): Kill routine.
8753         
8754         * class.cs (TypeContainer.Define): Correctly define explicit
8755         method implementations (they require the full interface name plus
8756         the method name).
8757
8758         * typemanager.cs: Deply the PtrHashtable here and stop using the
8759         lame keys.  Things work so much better.
8760
8761         This of course broke everyone who depended on `RegisterMethod' to
8762         do the `test for existance' test.  This has to be done elsewhere.
8763
8764         * support.cs (PtrHashtable): A hashtable that avoid comparing with
8765         the object stupid Equals method (because, that like fails all over
8766         the place).  We still do not use it.
8767
8768         * class.cs (TypeContainer.SetRequiredInterface,
8769         TypeContainer.RequireMethods): Killed these two routines and moved
8770         all the functionality to RegisterRequiredImplementations.
8771
8772         (TypeContainer.RegisterRequiredImplementations): This routine now
8773         registers all the implementations required in an array for the
8774         interfaces and abstract methods.  We use an array of structures
8775         which can be computed ahead of time to reduce memory usage and we
8776         also assume that lookups are cheap as most classes will not
8777         implement too many interfaces.
8778
8779         We also avoid creating too many MethodSignatures.
8780
8781         (TypeContainer.IsInterfaceMethod): Update and optionally does not
8782         clear the "pending" bit if we find that there are problems with
8783         the declaration.
8784
8785         (TypeContainer.VerifyPendingMethods): Update to report errors of
8786         methods that look like implementations but are not.
8787
8788         (TypeContainer.Define): Add support for explicit interface method
8789         implementation. 
8790         
8791 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
8792
8793         * typemanager.cs: Keep track of the parameters here instead of
8794         being a feature of the TypeContainer.
8795
8796         * class.cs: Drop the registration of parameters here, as
8797         InterfaceMethods are also interface declarations.
8798
8799         * delegate.cs: Register methods with the TypeManager not only with
8800         the TypeContainer.  This code was buggy.
8801
8802         * interface.cs: Full registation here.
8803
8804 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
8805
8806         * expression.cs: Remove reducer for binary expressions, it can not
8807         be done this way.
8808
8809         * const.cs: Put here the code that used to go into constant.cs
8810
8811         * constant.cs: Put here the code for constants, this is a new base
8812         class for Literals.
8813
8814         * literal.cs: Make Literal derive from Constant.
8815
8816 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
8817
8818         * statement.cs (Return.Emit): Report error 157 if the user
8819         attempts to return from a finally block.
8820
8821         (Return.Emit): Instead of emitting a return, jump to the end of
8822         the function.
8823
8824         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
8825         LocalBuilder to store the result of the function.  ReturnLabel is
8826         the target where we jump.
8827         
8828
8829 2001-12-09  Radek Doulik  <rodo@ximian.com>
8830
8831         * cs-parser.jay: remember alias in current namespace
8832
8833         * ecore.cs (SimpleName::DoResolve): use aliases for types or
8834         namespaces
8835
8836         * class.cs (LookupAlias): lookup alias in my_namespace
8837
8838         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
8839         aliases hashtable
8840         (LookupAlias): lookup alias in this and if needed in parent
8841         namespaces
8842
8843 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
8844
8845         * support.cs: 
8846
8847         * rootcontext.cs: (ModuleBuilder) Made static, first step into
8848         making things static.  I need this to avoid passing the
8849         TypeContainer when calling ParameterType.
8850
8851         * support.cs (InternalParameters.ParameterType): Remove ugly hack
8852         that did string manipulation to compute the type and then call
8853         GetType.  Use Parameter.ParameterType instead.
8854
8855         * cs-tokenizer.cs: Consume the suffix for floating values.
8856
8857         * expression.cs (ParameterReference): figure out whether this is a
8858         reference parameter or not.  Kill an extra variable by computing
8859         the arg_idx during emission.
8860
8861         * parameter.cs (Parameters.GetParameterInfo): New overloaded
8862         function that returns whether a parameter is an out/ref value or not.
8863
8864         (Parameter.ParameterType): The type of the parameter (base,
8865         without ref/out applied).
8866         
8867         (Parameter.Resolve): Perform resolution here.
8868         (Parameter.ExternalType): The full type (with ref/out applied).
8869
8870         * statement.cs (Using.Emit, Using.EmitExpression): Implement
8871         support for expressions on the using statement.
8872
8873 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
8874
8875         * statement.cs (Using.EmitLocalVariableDecls): Split the
8876         localvariable handling of the using statement.
8877
8878         (Block.EmitMeta): Keep track of variable count across blocks.  We
8879         were reusing slots on separate branches of blocks.
8880
8881         (Try.Emit): Emit the general code block, we were not emitting it. 
8882
8883         Check the type of the declaration to be an IDisposable or
8884         something that can be implicity converted to it. 
8885
8886         Emit conversions if required.
8887
8888         * ecore.cs (EmptyExpression): New utility class.
8889         (Expression.ImplicitConversionExists): New utility function.
8890
8891 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
8892
8893         * statement.cs (Using): Implement.
8894
8895         * expression.cs (LocalVariableReference): Support read only variables.
8896
8897         * statement.cs: Remove the explicit emit for the Leave opcode.
8898         (VariableInfo): Add a readonly field.
8899
8900 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
8901
8902         * ecore.cs (ConvCast): new class used to encapsulate the various
8903         explicit integer conversions that works in both checked and
8904         unchecked contexts.
8905
8906         (Expression.ConvertNumericExplicit): Use new ConvCast class to
8907         properly generate the overflow opcodes.
8908
8909 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
8910
8911         * statement.cs: The correct type for the EmptyExpression is the
8912         element_type, not the variable type.  Ravi pointed this out.
8913
8914 2001-12-04  Ravi Pratap  <ravi@ximian.com>
8915
8916         * class.cs (Method::Define): Handle PInvoke methods specially
8917         by using DefinePInvokeMethod instead of the usual one.
8918
8919         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
8920         above to do the task of extracting information and defining the method.
8921         
8922 2001-12-04  Ravi Pratap  <ravi@ximian.com>
8923
8924         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
8925         of the condition for string type.
8926
8927         (Emit): Move that here. 
8928
8929         (ArrayCreation::CheckIndices): Keep string literals in their expression
8930         form.
8931
8932         (EmitDynamicInitializers): Handle strings appropriately.
8933
8934 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
8935
8936         * codegen.cs (EmitContext): Replace multiple variables with a
8937         single pointer to the current Switch statement.
8938
8939         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
8940         EmitContext.
8941
8942 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
8943
8944         * statement.cs 
8945
8946         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
8947         default'.
8948         
8949         (Foreach.Emit): Foreach on arrays was not setting
8950         up the loop variables (for break/continue).
8951
8952         (GotoCase): Semi-implented.
8953         
8954 2001-12-03  Ravi Pratap  <ravi@ximian.com>
8955
8956         * attribute.cs (CheckAttribute): Handle system attributes by using
8957         Attribute.GetAttributes to examine information we need.
8958
8959         (GetValidPlaces): Same here.
8960
8961         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
8962
8963         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
8964
8965         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
8966
8967         (Method::Define): Set appropriate flags if we have a DllImport attribute.
8968
8969         (Method::Emit): Handle the case when we are a PInvoke method.
8970
8971 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
8972
8973         * expression.cs: Use ResolveWithSimpleName on compound names.
8974
8975 2001-12-02  Ravi Pratap  <ravi@ximian.com>
8976
8977         * constant.cs (EmitConstant): Make sure we resolve the associated expression
8978         before trying to reduce it.
8979
8980         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
8981
8982         * constant.cs (LookupConstantValue): Implement.
8983
8984         (EmitConstant): Use the above in emitting the constant.
8985
8986         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
8987         that are user-defined by doing a LookupConstantValue on them.
8988
8989         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
8990         too, like above.
8991
8992 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
8993
8994         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
8995
8996         (BaseAccess.DoResolve): Implement.
8997
8998         (MemberAccess.DoResolve): Split this routine into a
8999         ResolveMemberAccess routine that can be used independently
9000
9001 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
9002
9003         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
9004         As that share bits of the implementation.  Is returns a boolean,
9005         while As returns the Type that is being probed.
9006
9007 2001-12-01  Ravi Pratap  <ravi@ximian.com>
9008
9009         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
9010         instead of a Literal - much easier.
9011
9012         (EnumInTransit): Remove - utterly useless :-)
9013
9014         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
9015
9016         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
9017
9018         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
9019         chain when we have no associated expression.
9020
9021 2001-11-30  Ravi Pratap  <ravi@ximian.com>
9022
9023         * constant.cs (Define): Use Location while reporting the errror.
9024
9025         Also emit a warning when 'new' is used and there is no inherited
9026         member to hide.
9027
9028         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
9029         populated.
9030
9031         (LookupEnumValue): Implement to lookup an enum member's value and define it
9032         if necessary.
9033
9034         (Populate): Re-write accordingly to use the above routine.
9035
9036 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
9037
9038         * expression.cs (This): Fix prototype for DoResolveLValue to
9039         override the base class DoResolveLValue.
9040
9041         * cs-parser.cs: Report errors cs574 and cs575 (destructor
9042         declarations) 
9043
9044         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
9045         (we need to load the address of the field here).  This fixes
9046         test-22. 
9047         
9048         (FieldExpr.DoResolveLValue): Call the DoResolve
9049         function to initialize the Instance expression.
9050         
9051         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
9052         correctly the GetEnumerator operation on a value type.
9053
9054         * cs-parser.jay: Add more simple parsing error catches.
9055
9056         * statement.cs (Switch): Add support for string switches.
9057         Handle null specially.
9058
9059         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
9060
9061 2001-11-28  Ravi Pratap  <ravi@ximian.com>
9062
9063         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
9064
9065         (declare_local_constant): New helper function.
9066
9067         * statement.cs (AddConstant): Keep a separate record of constants
9068
9069         (IsConstant): Implement to determine if a variable is a constant.
9070
9071         (GetConstantExpression): Implement.
9072
9073         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
9074
9075         * statement.cs (IsVariableDefined): Re-write.
9076
9077 2001-11-27  Ravi Pratap  <ravi@ximian.com>
9078
9079         * class.cs (TypeContainer::FindMembers): Look for constants
9080         in the case when we are looking for MemberTypes.Field
9081
9082         * expression.cs (MemberAccess::DoResolve): Check that in the
9083         case we are a FieldExpr and a Literal, we are not being accessed
9084         by an instance reference.
9085
9086         * cs-parser.jay (local_constant_declaration): Implement.
9087
9088         (declaration_statement): Implement for constant declarations.
9089
9090 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
9091
9092         * statement.cs (Switch): Catch double defaults.
9093
9094         (Switch): More work on the switch() statement
9095         implementation.  It works for integral values now, need to finish
9096         string support.
9097
9098
9099 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
9100
9101         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
9102         integer literals into other integer literals.  To be used by
9103         switch. 
9104
9105 2001-11-24  Ravi Pratap  <ravi@ximian.com>
9106
9107         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
9108         some memory.
9109
9110         (EmitDynamicInitializers): Cope with the above since we extract data
9111         directly from ArrayData now.
9112
9113         (ExpectInitializers): Keep track of whether initializers are mandatory
9114         or not.
9115
9116         (Bounds): Make it a hashtable to prevent the same dimension being 
9117         recorded for every element in that dimension.
9118
9119         (EmitDynamicInitializers): Fix bug which prevented the Set array method
9120         from being found.
9121
9122         Also fix bug which was causing the indices to be emitted in the reverse
9123         order.
9124
9125 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
9126
9127         * expression.cs (ArrayCreation): Implement the bits that Ravi left
9128         unfinished.  They do not work, because the underlying code is
9129         sloppy.
9130
9131 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9132
9133         * cs-parser.jay: Remove bogus fixme.
9134
9135         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
9136         on Switch statement.
9137         
9138 2001-11-23  Ravi Pratap  <ravi@ximian.com>
9139
9140         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
9141         the same. 
9142         
9143         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
9144         parameter. Apparently, any expression is allowed. 
9145
9146         (ValidateInitializers): Update accordingly.
9147
9148         (CheckIndices): Fix some tricky bugs thanks to recursion.
9149
9150         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
9151         I was being completely brain-dead.
9152
9153         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
9154         and re-write acordingly.
9155
9156         (DelegateInvocation): Re-write accordingly.
9157
9158         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
9159
9160         (MakeByteBlob): Handle types more correctly.
9161
9162         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
9163         initialization from expressions but it is incomplete because I am a complete
9164         Dodo :-|
9165
9166 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9167
9168         * statement.cs (If.Emit): Fix a bug that generated incorrect code
9169         on If.  Basically, we have to return `true' (ie, we do return to
9170         our caller) only if both branches of the if return.
9171
9172         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
9173         short-circuit operators, handle them as short circuit operators. 
9174
9175         (Cast.DoResolve): Resolve type.
9176         (Cast.Cast): Take an expression as the target type.
9177
9178         * cs-parser.jay (cast_expression): Remove old hack that only
9179         allowed a limited set of types to be handled.  Now we take a
9180         unary_expression and we resolve to a type during semantic
9181         analysis.
9182
9183         Use the grammar productions from Rhys to handle casts (this is
9184         not complete like Rhys syntax yet, we fail to handle that corner
9185         case that C# has regarding (-x), but we will get there.
9186         
9187 2001-11-22  Ravi Pratap  <ravi@ximian.com>
9188
9189         * class.cs (EmitFieldInitializer): Take care of the case when we have a
9190         field which is an array type.
9191
9192         * cs-parser.jay (declare_local_variables): Support array initialization too.
9193
9194         * typemanager.cs (MakeKey): Implement.
9195
9196         (everywhere): Use the above appropriately.
9197
9198         * cs-parser.jay (for_statement): Update for array initialization while
9199         declaring variables.
9200
9201         * ecore.cs : The error message was correct, it's the variable's names that
9202         were misleading ;-) Make the code more readable.
9203
9204         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
9205         the correct type etc.
9206
9207         (ConvertExplicit): Handle Enum types by examining the underlying type.
9208
9209 2001-11-21  Ravi Pratap  <ravi@ximian.com>
9210
9211         * parameter.cs (GetCallingConvention): Always return
9212         CallingConventions.Standard for now.
9213
9214 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9215
9216         * expression.cs (Binary.ResolveOperator): Update the values of `l'
9217         and `r' after calling DoNumericPromotions.
9218
9219         * ecore.cs: Fix error message (the types were in the wrong order).
9220
9221         * statement.cs (Foreach.ProbeCollectionType): Need to pass
9222         BindingFlags.Instance as well 
9223
9224         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
9225         implicit int literal conversion in an empty cast so that we
9226         propagate the right type upstream.
9227
9228         (UnboxCast): new class used to unbox value types.
9229         (Expression.ConvertExplicit): Add explicit type conversions done
9230         by unboxing.
9231
9232         (Expression.ImplicitNumericConversion): Oops, forgot to test for
9233         the target type before applying the implicit LongLiterals to ULong
9234         literal cast.
9235
9236 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
9237
9238         * cs-parser.jay (for_statement): Reworked the way For works: now
9239         we declare manually any variables that are introduced in
9240         for_initializer to solve the problem of having out-of-band code
9241         emition (that is what got for broken).
9242
9243         (declaration_statement): Perform the actual variable declaration
9244         that used to be done in local_variable_declaration here.
9245
9246         (local_variable_declaration): Do not declare anything, just pass
9247         the information on a DictionaryEntry
9248
9249 2001-11-20  Ravi Pratap  <ravi@ximian.com>
9250
9251         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
9252         re-write of the logic to now make it recursive.
9253
9254         (UpdateIndices): Re-write accordingly.
9255
9256         Store element data in a separate ArrayData list in the above methods.
9257
9258         (MakeByteBlob): Implement to dump the array data into a byte array.
9259
9260 2001-11-19  Ravi Pratap  <ravi@ximian.com>
9261
9262         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
9263         into CheckIndices.
9264
9265         * constant.cs (Define): Implement.
9266
9267         (EmitConstant): Re-write fully.
9268
9269         Pass in location info.
9270
9271         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
9272         respectively.
9273
9274         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
9275         DictionaryEntry since we need location info too.
9276
9277         (constant_declaration): Update accordingly.
9278
9279         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
9280         code into another method : UpdateIndices.
9281
9282 2001-11-18  Ravi Pratap  <ravi@ximian.com>
9283
9284         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
9285         some type checking etc.
9286
9287 2001-11-17  Ravi Pratap  <ravi@ximian.com>
9288
9289         * expression.cs (ArrayCreation::ValidateInitializers): Implement
9290         bits to provide dimension info if the user skips doing that.
9291
9292         Update second constructor to store the rank correctly.
9293
9294 2001-11-16  Ravi Pratap  <ravi@ximian.com>
9295
9296         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
9297         and try to implement.
9298
9299         * ../errors/cs0150.cs : Add.
9300
9301         * ../errors/cs0178.cs : Add.
9302
9303 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
9304
9305         * statement.cs: Implement foreach on multi-dimensional arrays. 
9306
9307         * parameter.cs (Parameters.GetParameterByName): Also lookup the
9308         name of the params argument.
9309
9310         * expression.cs: Use EmitStoreOpcode to get the right opcode while
9311         initializing the array.
9312
9313         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
9314         we can use this elsewhere.
9315
9316         * statement.cs: Finish implementation of foreach for single
9317         dimension arrays.
9318
9319         * cs-parser.jay: Use an out-of-band stack to pass information
9320         around, I wonder why I need this.
9321
9322         foreach_block: Make the new foreach_block the current_block.
9323
9324         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
9325         function used to return a static Parameters structure.  Used for
9326         empty parameters, as those are created very frequently.
9327
9328         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
9329
9330 2001-11-15  Ravi Pratap  <ravi@ximian.com>
9331
9332         * interface.cs : Default modifier is private, not public. The
9333         make verify test passes again.
9334
9335 2001-11-15  Ravi Pratap  <ravi@ximian.com>
9336
9337         * support.cs (ReflectionParameters): Fix logic to determine
9338         whether the last parameter is a params one. Test 9 passes again.
9339
9340         * delegate.cs (Populate): Register the builders we define with
9341         RegisterParameterForBuilder. Test 19 passes again.
9342
9343         * cs-parser.jay (property_declaration): Reference $6 instead
9344         of $$ to get at the location.
9345
9346         (indexer_declaration): Similar stuff.
9347
9348         (attribute): Ditto.
9349
9350         * class.cs (Property): Register parameters for the Get and Set methods
9351         if they exist. Test 23 passes again.
9352
9353         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
9354         call to EmitArguments as we are sure there aren't any params arguments. 
9355         Test 32 passes again.
9356
9357         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
9358         IndexOutOfRangeException. 
9359
9360         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
9361         Test 33 now passes again.
9362         
9363 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
9364
9365         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
9366         broke a bunch of things.  Will have to come up with a better way
9367         of tracking locations.
9368
9369         * statement.cs: Implemented foreach for single dimension arrays.
9370
9371 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
9372
9373         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
9374         an error.  This removes the lookup from the critical path.
9375
9376         * cs-parser.jay: Removed use of temporary_loc, which is completely
9377         broken. 
9378
9379 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
9380
9381         * support.cs (ReflectionParameters.ParameterModifier): Report
9382         whether the argument is a PARAMS argument or not.
9383
9384         * class.cs: Set the attribute `ParamArrayAttribute' on the
9385         parameter argument.
9386
9387         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
9388         and cons_param_array_attribute (ConstructorInfo for
9389         ParamArrayAttribute)., 
9390
9391         * codegen.cs: Emit the return using the `Return' statement, that
9392         way we can report the error correctly for missing return values. 
9393
9394         * class.cs (Method.Emit): Clean up.
9395
9396         * expression.cs (Argument.Resolve): Take another argument: the
9397         location where this argument is used.  Notice that this is not
9398         part of the "Argument" class as to reduce the size of the
9399         structure (we know the approximate location anyways).
9400
9401         Test if the argument is a variable-reference, if not, then
9402         complain with a 206.
9403
9404         (Argument.Emit): Emit addresses of variables.
9405
9406         (Argument.FullDesc): Simplify.
9407
9408         (Invocation.DoResolve): Update for Argument.Resolve.
9409
9410         (ElementAccess.DoResolve): ditto.
9411
9412         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
9413         method should be virtual, as this method is always virtual.
9414
9415         (NewDelegate.DoResolve): Update for Argument.Resolve.
9416
9417         * class.cs (ConstructorInitializer.DoResolve): ditto.
9418         
9419         * attribute.cs (Attribute.Resolve): ditto.
9420
9421 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
9422
9423         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
9424
9425         * expression.cs (ParameterReference): Drop IStackStorage and implement
9426         IAssignMethod instead. 
9427
9428         (LocalVariableReference): ditto.
9429         
9430         * ecore.cs (FieldExpr): Drop IStackStorage and implement
9431         IAssignMethod instead. 
9432
9433 2001-11-13  Miguel de Icaza <miguel@ximian.com>
9434
9435         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
9436         enumerations that are used in heavily used structures derive from
9437         byte in a laughable and pathetic attempt to reduce memory usage.
9438         This is the kind of pre-optimzations that you should not do at
9439         home without adult supervision.
9440
9441         * expression.cs (UnaryMutator): New class, used to handle ++ and
9442         -- separatedly from the other unary operators.  Cleans up the
9443         code, and kills the ExpressionStatement dependency in Unary.
9444
9445         (Unary): Removed `method' and `Arguments' from this class, making
9446         it smaller, and moving it all to SimpleCall, so I can reuse this
9447         code in other locations and avoid creating a lot of transient data
9448         strucutres when not required.
9449
9450         * cs-parser.jay: Adjust for new changes.
9451
9452 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
9453
9454         * enum.cs (Enum.Populate): If there is a failure during
9455         definition, return
9456
9457         * cs-parser.jay (opt_enum_base): we used to catch type errors
9458         here, but this is really incorrect.  The type error should be
9459         catched during semantic analysis.
9460
9461 2001-12-11  Ravi Pratap  <ravi@ximian.com>
9462
9463         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
9464         current_local_parameters as expected since I, in my stupidity, had forgotten
9465         to do this :-)
9466
9467         * attribute.cs (GetValidPlaces): Fix stupid bug.
9468
9469         * class.cs (Method::Emit): Perform check on applicability of attributes.
9470
9471         (Constructor::Emit): Ditto.
9472
9473         (Field::Emit): Ditto.
9474
9475         (Field.Location): Store location information.
9476
9477         (Property, Event, Indexer, Operator): Ditto.
9478
9479         * cs-parser.jay (field_declaration): Pass in location for each field.
9480
9481         * ../errors/cs0592.cs : Add.
9482
9483 2001-11-12  Ravi Pratap  <ravi@ximian.com>
9484
9485         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
9486
9487         (InitCoreTypes): Update accordingly.
9488
9489         (RegisterAttrType, LookupAttr): Implement.
9490
9491         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
9492         info about the same.
9493
9494         (Resolve): Update to populate the above as necessary.
9495
9496         (Error592): Helper.
9497
9498         (GetValidPlaces): Helper to the above.
9499
9500         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
9501
9502         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
9503
9504 2001-11-12  Ravi Pratap  <ravi@ximian.com>
9505
9506         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
9507
9508         * ../errors/cs0617.cs : Add.
9509
9510 2001-11-11  Ravi Pratap  <ravi@ximian.com>
9511
9512         * enum.cs (Emit): Rename to Populate to be more consistent with what
9513         we expect it to do and when exactly it is called.
9514
9515         * class.cs, rootcontext.cs : Update accordingly.
9516
9517         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
9518         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
9519
9520         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
9521
9522         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
9523         of a fieldinfo using the above, when dealing with a FieldBuilder.
9524
9525 2001-11-10  Ravi Pratap  <ravi@ximian.com>
9526
9527         * ../errors/cs0031.cs : Add.
9528
9529         * ../errors/cs1008.cs : Add.
9530
9531         * ../errrors/cs0543.cs : Add.
9532
9533         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
9534         enum type.
9535
9536         (FindMembers): Implement.
9537
9538         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
9539         enums and delegates too.
9540
9541         (enum_types): Rename to builder_to_enum.
9542
9543         (delegate_types): Rename to builder_to_delegate.
9544
9545         * delegate.cs (FindMembers): Implement.
9546
9547 2001-11-09  Ravi Pratap  <ravi@ximian.com>
9548
9549         * typemanager.cs (IsEnumType): Implement.
9550
9551         * enum.cs (Emit): Re-write parts to account for the underlying type
9552         better and perform checking etc.
9553
9554         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
9555         of the underlying type.
9556
9557         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
9558         value
9559
9560         * enum.cs (error31): Helper to report error #31.
9561
9562         * cs-parser.jay (enum_declaration): Store location of each member too.
9563
9564         * enum.cs (member_to_location): New hashtable. 
9565
9566         (AddEnumMember): Update location hashtable.
9567
9568         (Emit): Use the location of each member while reporting errors.
9569
9570 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
9571
9572         * cs-parser.jay: A for_initializer if is a
9573         local_variable_declaration really ammount to have an implicit
9574         block with the variable declaration and no initializer for for.
9575
9576         * statement.cs (For.Emit): Cope with null initializers.
9577
9578         This fixes the infinite loop on for initializers.
9579
9580 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
9581
9582         * enum.cs: More cleanup.
9583
9584         * ecore.cs: Remove dead code.
9585
9586         * class.cs (Property.Emit): More simplification.
9587         (Event.Emit): ditto.
9588
9589         Reworked to have less levels of indentation.
9590         
9591 2001-11-08  Ravi Pratap  <ravi@ximian.com>
9592
9593         * class.cs (Property): Emit attributes.
9594
9595         (Field): Ditto.
9596         
9597         (Event): Ditto.
9598
9599         (Indexer): Ditto.
9600
9601         (Operator): Ditto.
9602
9603         * enum.cs (Emit): Ditto.
9604
9605         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
9606         Enums too.
9607
9608         * class.cs (Field, Event, etc.): Move attribute generation into the
9609         Emit method everywhere.
9610
9611         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
9612         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
9613         as we had no way of defining nested enums !
9614
9615         * rootcontext.cs : Adjust code accordingly.
9616
9617         * typemanager.cs (AddEnumType): To keep track of enum types separately.
9618
9619 2001-11-07  Ravi Pratap  <ravi@ximian.com>
9620
9621         * expression.cs (EvalConstantExpression): Move into ecore.cs
9622         
9623         * enum.cs (Enum): Rename some members and make them public and readonly
9624         according to our convention.
9625
9626         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
9627         nothing else.
9628
9629         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
9630
9631         (Enum::Emit): Write a simple version for now which doesn't try to compute
9632         expressions. I shall modify this to be more robust in just a while.
9633
9634         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
9635
9636         (TypeContainer::CloseType): Create the Enum types too.
9637
9638         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
9639
9640         * expression.cs (EvalConstantExpression): Get rid of completely.
9641
9642         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
9643         user-defined values and other cases.
9644
9645         (IsValidEnumLiteral): Helper function.
9646
9647         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
9648         out there in the case we had a literal FieldExpr.
9649
9650         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
9651
9652         (Literalize): Revamp a bit to take two arguments.
9653         
9654         (EnumLiteral): New class which derives from Literal to wrap enum literals.
9655         
9656 2001-11-06  Ravi Pratap  <ravi@ximian.com>
9657
9658         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
9659
9660         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
9661
9662         (Resolve): Use the above to ensure we have proper initializers.
9663
9664 2001-11-05  Ravi Pratap  <ravi@ximian.com>
9665
9666         * expression.cs (Expression::EvalConstantExpression): New method to 
9667         evaluate constant expressions.
9668
9669         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
9670
9671 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
9672
9673         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
9674         in an array.
9675
9676         (Binary.ResolveOperator): Handle operator != (object a, object b)
9677         and operator == (object a, object b);
9678
9679         (Binary.DoNumericPromotions): Indicate whether the numeric
9680         promotion was possible.
9681
9682         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
9683         Implement.  
9684
9685         Made the ArrayAccess implement interface IAssignMethod instead of
9686         IStackStore as the order in which arguments are passed reflects
9687         this.
9688
9689         * assign.cs: Instead of using expr.ExprClass to select the way of
9690         assinging, probe for the IStackStore/IAssignMethod interfaces.
9691
9692         * typemanager.cs: Load InitializeArray definition.
9693
9694         * rootcontext.cs (RootContext.MakeStaticData): Used to define
9695         static data that can be used to initialize arrays. 
9696
9697 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
9698
9699         * expression.cs: Handle operator== and operator!= for booleans.
9700
9701         (Conditioal.Reduce): Implement reducer for the ?: operator.
9702
9703         (Conditional.Resolve): Implement dead code elimination.
9704
9705         (Binary.Resolve): Catch string literals and return a new
9706         concatenated string.
9707
9708         (Unary.Reduce): Implement reduction of unary expressions.
9709
9710         * ecore.cs: Split out the expression core handling here.
9711
9712         (Expression.Reduce): New method used to perform constant folding
9713         and CSE.  This is needed to support constant-expressions. 
9714         
9715         * statement.cs (Statement.EmitBoolExpression): Pass true and false
9716         targets, and optimize for !x.
9717
9718 2001-11-04  Ravi Pratap  <ravi@ximian.com>
9719
9720         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
9721         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
9722         set custom atttributes.
9723
9724         * literal.cs (Literal::GetValue): New abstract method to return the actual
9725         value of the literal, cast as an object.
9726
9727         (*Literal): Implement GetValue method.
9728
9729         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
9730         expressions to the arraylist but objects of type Argument.
9731
9732         * class.cs (TypeContainer::Emit): Emit our attributes too.
9733
9734         (Method::Emit, Constructor::Emit): Ditto.
9735
9736         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
9737         to be ignoring earlier.
9738
9739 2001-11-03  Ravi Pratap  <ravi@ximian.com>
9740
9741         * attribute.cs (AttributeSection::Define): Implement to do the business
9742         of constructing a CustomAttributeBuilder.
9743
9744         (Attribute): New trivial class. Increases readability of code.  
9745
9746         * cs-parser.jay : Update accordingly.
9747
9748         (positional_argument_list, named_argument_list, named_argument): New rules
9749
9750         (attribute_arguments): Use the above so that we are more correct.
9751         
9752 2001-11-02  Ravi Pratap  <ravi@ximian.com>
9753         
9754         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
9755         to perform all checks for a method with a params parameter.
9756
9757         (Invocation::OverloadResolve): Update to use the above method and therefore
9758         cope correctly with params method invocations.
9759
9760         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
9761         params too.
9762
9763         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
9764         constructors in our parent too because we can't afford to miss out on 
9765         protected ones ;-)
9766
9767         * attribute.cs (AttributeSection): New name for the class Attribute
9768
9769         Other trivial changes to improve readability.
9770
9771         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
9772         use the new class names.
9773         
9774 2001-11-01  Ravi Pratap  <ravi@ximian.com>
9775
9776         * class.cs (Method::Define): Complete definition for params types too
9777
9778         (Indexer::Define): Ditto.
9779
9780         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
9781         Cope everywhere with a request for info about the array parameter.
9782
9783 2001-11-01  Ravi Pratap  <ravi@ximian.com>
9784
9785         * tree.cs (RecordNamespace): Fix up to check for the correct key.
9786
9787         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
9788         local_variable_type to extract the string corresponding to the type.
9789
9790         (local_variable_type): Fixup the action to use the new helper method.
9791
9792         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
9793         go.
9794
9795         * expression.cs : Clean out code which uses the above.
9796
9797 2001-10-31  Ravi Pratap  <ravi@ximian.com>
9798         
9799         * typemanager.cs (RegisterMethod): Check if we already have an existing key
9800         and bale out if necessary by returning a false.
9801
9802         (RegisterProperty): Ditto.
9803
9804         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
9805         and print out appropriate error messages.
9806
9807         * interface.cs (everywhere): Ditto.
9808
9809         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
9810         location to constructor.
9811
9812         * class.cs (Property, Event, Indexer): Update accordingly.
9813
9814         * ../errors/cs111.cs : Added.
9815
9816         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
9817         of a method, as laid down by the spec.
9818
9819         (Invocation::OverloadResolve): Use the above method.
9820
9821 2001-10-31  Ravi Pratap  <ravi@ximian.com>
9822
9823         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
9824         now take a TypeContainer and a Parameters object.
9825
9826         (ParameterData): Modify return type of ParameterModifier method to be 
9827         Parameter.Modifier and not a string.
9828
9829         (ReflectionParameters, InternalParameters): Update accordingly.
9830
9831         * expression.cs (Argument::GetParameterModifier): Same here.
9832
9833         * support.cs (InternalParameters::ParameterType): Find a better way of determining
9834         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
9835         symbol in it at all so maybe this is only for now.
9836
9837 2001-10-30  Ravi Pratap  <ravi@ximian.com>
9838
9839         * support.cs (InternalParameters): Constructor now takes an extra argument 
9840         which is the actual Parameters class.
9841
9842         (ParameterDesc): Update to provide info on ref/out modifiers.
9843
9844         * class.cs (everywhere): Update call to InternalParameters to pass in
9845         the second argument too.
9846
9847         * support.cs (ParameterData): Add ParameterModifier, which is a method 
9848         to return the modifier info [ref/out etc]
9849
9850         (InternalParameters, ReflectionParameters): Implement the above.
9851
9852         * expression.cs (Argument::ParameterModifier): Similar function to return
9853         info about the argument's modifiers.
9854
9855         (Invocation::OverloadResolve): Update to take into account matching modifiers 
9856         too.
9857
9858         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
9859         a new SetFormalParameters object which we pass to InternalParameters.
9860
9861 2001-10-30  Ravi Pratap  <ravi@ximian.com>
9862
9863         * expression.cs (NewArray): Merge into the ArrayCreation class.
9864
9865 2001-10-29  Ravi Pratap  <ravi@ximian.com>
9866
9867         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
9868         NewUserdefinedArray into one as there wasn't much of a use in having
9869         two separate ones.
9870
9871         * expression.cs (Argument): Change field's name to ArgType from Type.
9872
9873         (Type): New readonly property which returns the proper type, taking into 
9874         account ref/out modifiers.
9875
9876         (everywhere): Adjust code accordingly for the above.
9877
9878         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
9879         whether we are emitting for a ref or out parameter.
9880
9881         * expression.cs (Argument::Emit): Use the above field to set the state.
9882
9883         (LocalVariableReference::Emit): Update to honour the flag and emit the
9884         right stuff.
9885
9886         * parameter.cs (Attributes): Set the correct flags for ref parameters.
9887
9888         * expression.cs (Argument::FullDesc): New function to provide a full desc.
9889
9890         * support.cs (ParameterData): Add method ParameterDesc to the interface.
9891
9892         (ReflectionParameters, InternalParameters): Implement the above method.
9893
9894         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
9895         reporting errors.
9896
9897         (Invocation::FullMethodDesc): Ditto. 
9898
9899 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
9900
9901         * cs-parser.jay: Add extra production for the second form of array
9902         creation. 
9903
9904         * expression.cs (ArrayCreation): Update to reflect the above
9905         change. 
9906
9907         * Small changes to prepare for Array initialization.
9908
9909 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
9910
9911         * typemanager.cs (ImplementsInterface): interface might be null;
9912         Deal with this problem;
9913
9914         Also, we do store negative hits on the cache (null values), so use
9915         this instead of calling t.GetInterfaces on the type everytime.
9916
9917 2001-10-28  Ravi Pratap  <ravi@ximian.com>
9918
9919         * typemanager.cs (IsBuiltinType): New method to help determine the same.
9920
9921         * expression.cs (New::DoResolve): Get rid of array creation code and instead
9922         split functionality out into different classes.
9923
9924         (New::FormArrayType): Move into NewBuiltinArray.
9925
9926         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
9927         quite useless.
9928
9929         (NewBuiltinArray): New class to handle creation of built-in arrays.
9930
9931         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
9932         account creation of one-dimensional arrays.
9933
9934         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
9935
9936         (NewUserdefinedArray::DoResolve): Implement.
9937
9938         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
9939
9940         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
9941         we maintain inside the TypeManager. This is necessary to perform lookups on the
9942         module builder.
9943
9944         (LookupType): Update to perform GetType on the module builders too.     
9945
9946         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
9947
9948         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
9949
9950 2001-10-23  Ravi Pratap  <ravi@ximian.com>
9951
9952         * expression.cs (New::DoResolve): Implement guts of array creation.
9953
9954         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
9955         
9956 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
9957
9958         * expression.cs: Fix bug I introduced lsat night that broke
9959         Delegates. 
9960
9961         (Expression.Resolve): Report a 246 error (can not resolve name)
9962         if we find a SimpleName in the stream.
9963         
9964         (Expression.ResolveLValue): Ditto.
9965         
9966         (Expression.ResolveWithSimpleName): This function is a variant of
9967         ResolveName, this one allows SimpleNames to be returned without a
9968         warning.  The only consumer of SimpleNames is MemberAccess
9969
9970 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
9971
9972         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
9973         might arrive here.  I have my doubts that this is correct.
9974
9975         * statement.cs (Lock): Implement lock statement.
9976
9977         * cs-parser.jay: Small fixes to support `lock' and `using'
9978
9979         * cs-tokenizer.cs: Remove extra space
9980
9981         * driver.cs: New flag --checked, allows to turn on integer math
9982         checking. 
9983
9984         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
9985         Threading.Monitor.Exit 
9986         
9987 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
9988
9989         * expression.cs (IndexerAccess::DoResolveLValue): Set the
9990         Expression Class to be IndexerAccess.
9991
9992         Notice that Indexer::DoResolve sets the eclass to Value.
9993
9994 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
9995
9996         * class.cs (TypeContainer::Emit): Emit code for indexers.
9997
9998         * assign.cs (IAssignMethod): New interface implemented by Indexers
9999         and Properties for handling assignment.
10000
10001         (Assign::Emit): Simplify and reuse code. 
10002         
10003         * expression.cs (IndexerAccess, PropertyExpr): Implement
10004         IAssignMethod, clean up old code. 
10005
10006 2001-10-22  Ravi Pratap  <ravi@ximian.com>
10007
10008         * typemanager.cs (ImplementsInterface): New method to determine if a type
10009         implements a given interface. Provides a nice cache too.
10010
10011         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
10012         method.
10013
10014         (ConvertReferenceExplicit): Ditto.
10015
10016         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
10017         various methods, with correct names etc.
10018
10019         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
10020         Operator.UnaryNegation.
10021
10022         * cs-parser.jay (operator_declarator): Be a little clever in the case where
10023         we have a unary plus or minus operator.
10024
10025         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
10026         UnaryMinus.
10027
10028         * everywhere : update accordingly.
10029
10030         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
10031         respectively.
10032
10033         * class.cs (Method::Define): For the case where we are implementing a method
10034         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
10035         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
10036         
10037 2001-10-21  Ravi Pratap  <ravi@ximian.com>
10038
10039         * interface.cs (FindMembers): Implement to work around S.R.E
10040         lameness.
10041
10042         * typemanager.cs (IsInterfaceType): Implement.
10043
10044         (FindMembers): Update to handle interface types too.
10045
10046         * expression.cs (ImplicitReferenceConversion): Re-write bits which
10047         use IsAssignableFrom as that is not correct - it doesn't work.
10048
10049         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
10050         and accordingly override EmitStatement.
10051
10052         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
10053         using the correct logic :-)
10054
10055 2001-10-19  Ravi Pratap  <ravi@ximian.com>
10056
10057         * ../errors/cs-11.cs : Add to demonstrate error -11 
10058
10059 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
10060
10061         * assign.cs (Assign::Resolve): Resolve right hand side first, and
10062         then pass this as a hint to ResolveLValue.
10063         
10064         * expression.cs (FieldExpr): Add Location information
10065
10066         (FieldExpr::LValueResolve): Report assignment to readonly
10067         variable. 
10068         
10069         (Expression::ExprClassFromMemberInfo): Pass location information.
10070
10071         (Expression::ResolveLValue): Add new method that resolves an
10072         LValue. 
10073
10074         (Expression::DoResolveLValue): Default invocation calls
10075         DoResolve. 
10076
10077         (Indexers): New class used to keep track of indexers in a given
10078         Type. 
10079
10080         (IStackStore): Renamed from LValue, as it did not really describe
10081         what this did.  Also ResolveLValue is gone from this interface and
10082         now is part of Expression.
10083
10084         (ElementAccess): Depending on the element access type
10085         
10086         * typemanager.cs: Add `indexer_name_type' as a Core type
10087         (System.Runtime.CompilerServices.IndexerNameAttribute)
10088
10089         * statement.cs (Goto): Take a location.
10090         
10091 2001-10-18  Ravi Pratap  <ravi@ximian.com>
10092
10093         * delegate.cs (Delegate::VerifyDelegate): New method to verify
10094         if two delegates are compatible.
10095
10096         (NewDelegate::DoResolve): Update to take care of the case when
10097         we instantiate a delegate from another delegate.
10098
10099         * typemanager.cs (FindMembers): Don't even try to look up members
10100         of Delegate types for now.
10101
10102 2001-10-18  Ravi Pratap  <ravi@ximian.com>
10103
10104         * delegate.cs (NewDelegate): New class to take care of delegate
10105         instantiation.
10106
10107         * expression.cs (New): Split the delegate related code out into 
10108         the NewDelegate class.
10109
10110         * delegate.cs (DelegateInvocation): New class to handle delegate 
10111         invocation.
10112
10113         * expression.cs (Invocation): Split out delegate related code into
10114         the DelegateInvocation class.
10115
10116 2001-10-17  Ravi Pratap  <ravi@ximian.com>
10117
10118         * expression.cs (New::DoResolve): Implement delegate creation fully
10119         and according to the spec.
10120
10121         (New::DoEmit): Update to handle delegates differently.
10122
10123         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
10124         because of which we were printing out arguments in reverse order !
10125
10126         * delegate.cs (VerifyMethod): Implement to check if the given method
10127         matches the delegate.
10128
10129         (FullDelegateDesc): Implement.
10130
10131         (VerifyApplicability): Implement.
10132
10133         * expression.cs (Invocation::DoResolve): Update to accordingly handle
10134         delegate invocations too.
10135
10136         (Invocation::Emit): Ditto.
10137
10138         * ../errors/cs1593.cs : Added.
10139
10140         * ../errors/cs1594.cs : Added.
10141
10142         * delegate.cs (InstanceExpression, TargetMethod): New properties.
10143
10144 2001-10-16  Ravi Pratap  <ravi@ximian.com>
10145
10146         * typemanager.cs (intptr_type): Core type for System.IntPtr
10147
10148         (InitCoreTypes): Update for the same.
10149
10150         (iasyncresult_type, asynccallback_type): Ditto.
10151
10152         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
10153         correct.
10154
10155         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
10156         too.
10157
10158         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
10159         the builders for the 4 members of a delegate type :-)
10160
10161         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
10162         type.
10163
10164         * expression.cs (New::DoResolve): Implement guts for delegate creation.
10165
10166         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
10167
10168 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
10169
10170         * statement.cs (Break::Emit): Implement.   
10171         (Continue::Emit): Implement.
10172
10173         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10174         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10175         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10176         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
10177         end loop
10178         
10179         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
10180         properties that track the label for the current loop (begin of the
10181         loop and end of the loop).
10182
10183 2001-10-15  Ravi Pratap  <ravi@ximian.com>
10184
10185         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
10186         use of emitting anything at all.
10187
10188         * class.cs, rootcontext.cs : Get rid of calls to the same.
10189
10190         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
10191
10192         (Populate): Define the constructor correctly and set the implementation
10193         attributes.
10194
10195         * typemanager.cs (delegate_types): New hashtable to hold delegates that
10196         have been defined.
10197
10198         (AddDelegateType): Implement.
10199
10200         (IsDelegateType): Implement helper method.
10201
10202         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
10203
10204         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
10205         and accordingly handle it.
10206
10207         * delegate.cs (Populate): Take TypeContainer argument.
10208         Implement bits to define the Invoke method. However, I still haven't figured out
10209         how to take care of the native int bit :-(
10210
10211         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
10212         Qualify the name of the delegate, not its return type !
10213
10214         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
10215         conversion.
10216
10217         (StandardConversionExists): Checking for array types turns out to be recursive.
10218
10219         (ConvertReferenceExplicit): Implement array conversion.
10220
10221         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
10222         
10223 2001-10-12  Ravi Pratap  <ravi@ximian.com>
10224
10225         * cs-parser.jay (delegate_declaration): Store the fully qualified
10226         name as it is a type declaration.
10227
10228         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
10229         readonly.
10230
10231         (DefineDelegate): Renamed from Define. Does the same thing essentially,
10232         as TypeContainer::DefineType.
10233
10234         (Populate): Method in which all the definition of the various methods (Invoke)
10235         etc is done.
10236
10237         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
10238         see.
10239         
10240         (CloseDelegate): Finally creates the delegate.
10241
10242         * class.cs (TypeContainer::DefineType): Update to define delegates.
10243         (Populate, Emit and CloseType): Do the same thing here too.
10244
10245         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
10246         delegates in all these operations.
10247
10248 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
10249
10250         * expression.cs: LocalTemporary: a new expression used to
10251         reference a temporary that has been created.
10252
10253         * assign.cs: Handle PropertyAccess back here, so that we can
10254         provide the proper semantic access to properties.
10255
10256         * expression.cs (Expression::ConvertReferenceExplicit): Implement
10257         a few more explicit conversions. 
10258
10259         * modifiers.cs: `NEW' modifier maps to HideBySig.
10260
10261         * expression.cs (PropertyExpr): Make this into an
10262         ExpressionStatement, and support the EmitStatement code path. 
10263
10264         Perform get/set error checking, clean up the interface.
10265
10266         * assign.cs: recognize PropertyExprs as targets, and if so, turn
10267         them into toplevel access objects.
10268
10269 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
10270
10271         * expression.cs: PropertyExpr::PropertyExpr: use work around the
10272         SRE.
10273
10274         * typemanager.cs: Keep track here of our PropertyBuilders again to
10275         work around lameness in SRE.
10276
10277 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
10278
10279         * expression.cs (LValue::LValueResolve): New method in the
10280         interface, used to perform a second resolution pass for LValues. 
10281         
10282         (This::DoResolve): Catch the use of this in static methods.
10283
10284         (This::LValueResolve): Implement.
10285
10286         (This::Store): Remove warning, assigning to `this' in structures
10287         is 
10288
10289         (Invocation::Emit): Deal with invocation of
10290         methods on value types.  We need to pass the address to structure
10291         methods rather than the object itself.  (The equivalent code to
10292         emit "this" for structures leaves the entire structure on the
10293         stack instead of a pointer to it). 
10294
10295         (ParameterReference::DoResolve): Compute the real index for the
10296         argument based on whether the method takes or not a `this' pointer
10297         (ie, the method is static).
10298
10299         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
10300         value types returned from functions when we need to invoke a
10301         method on the sturcture.
10302         
10303
10304 2001-10-11  Ravi Pratap  <ravi@ximian.com>
10305
10306         * class.cs (TypeContainer::DefineType): Method to actually do the business of
10307         defining the type in the Modulebuilder or Typebuilder. This is to take
10308         care of nested types which need to be defined on the TypeBuilder using
10309         DefineNestedMethod.
10310
10311         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
10312         methods in RootContext, only ported to be part of TypeContainer.
10313
10314         (TypeContainer::GetInterfaceOrClass): Ditto.
10315
10316         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
10317
10318         * interface.cs (Interface::DefineInterface): New method. Does exactly
10319         what RootContext.CreateInterface did earlier, only it takes care of nested types 
10320         too.
10321
10322         (Interface::GetInterfaces): Move from RootContext here and port.
10323
10324         (Interface::GetInterfaceByName): Same here.
10325
10326         * rootcontext.cs (ResolveTree): Re-write.
10327
10328         (PopulateTypes): Re-write.
10329
10330         * class.cs (TypeContainer::Populate): Populate nested types too.
10331         (TypeContainer::Emit): Emit nested members too.
10332
10333         * typemanager.cs (AddUserType): Do not make use of the FullName property,
10334         instead just use the name argument passed in as it is already fully
10335         qualified.
10336
10337         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
10338         to TypeContainer mapping to see if a type is user-defined.
10339
10340         * class.cs (TypeContainer::CloseType): Implement. 
10341
10342         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
10343         the default constructor.
10344         
10345         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
10346         twice.
10347
10348         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
10349
10350         * interface.cs (CloseType): Create the type here.
10351         
10352         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
10353         the hierarchy.
10354
10355         Remove all the methods which are now in TypeContainer.
10356
10357 2001-10-10  Ravi Pratap  <ravi@ximian.com>
10358
10359         * delegate.cs (Define): Re-write bits to define the delegate
10360         correctly.
10361
10362 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
10363
10364         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
10365
10366         * expression.cs (ImplicitReferenceConversion): handle null as well
10367         as a source to convert to any reference type.
10368
10369         * statement.cs (Return): Perform any implicit conversions to
10370         expected return type.  
10371
10372         Validate use of return statement.  
10373
10374         * codegen.cs (EmitContext): Pass the expected return type here.
10375
10376         * class.cs (Method, Constructor, Property): Pass expected return
10377         type to EmitContext.
10378
10379 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
10380
10381         * expression.cs: Make DoResolve take an EmitContext instead of a
10382         TypeContainer.
10383
10384         Replaced `l' and `location' for `loc', for consistency.
10385         
10386         (Error, Warning): Remove unneeded Tc argument.
10387
10388         * assign.cs, literal.cs, constant.cs: Update to new calling
10389         convention. 
10390         
10391         * codegen.cs: EmitContext now contains a flag indicating whether
10392         code is being generated in a static method or not.
10393
10394         * cs-parser.jay: DecomposeQI, new function that replaces the old
10395         QualifiedIdentifier.  Now we always decompose the assembled
10396         strings from qualified_identifier productions into a group of
10397         memberaccesses.
10398
10399 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
10400
10401         * rootcontext.cs: Deal with field-less struct types correctly now
10402         by passing the size option to Define Type.
10403
10404         * class.cs: Removed hack that created one static field. 
10405
10406 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
10407
10408         * statement.cs: Moved most of the code generation here. 
10409
10410 2001-10-09  Ravi Pratap  <ravi@ximian.com>
10411
10412         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
10413         seem very right.
10414
10415         (ElementAccess): Remove useless bits for now - keep checks as the spec
10416         says.
10417
10418 2001-10-08  Ravi Pratap  <ravi@ximian.com>
10419
10420         * expression.cs (ElementAccess::DoResolve): Remove my crap code
10421         and start performing checks according to the spec.
10422
10423 2001-10-07  Ravi Pratap  <ravi@ximian.com>
10424
10425         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
10426         rank_specifiers instead.
10427
10428         (rank_specifiers): Change the order in which the rank specifiers are stored
10429
10430         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
10431
10432         * expression.cs (ElementAccess): Implement the LValue interface too.
10433         
10434 2001-10-06  Ravi Pratap  <ravi@ximian.com>
10435         
10436         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
10437         except that user defined conversions are not included.
10438
10439         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
10440         perform the conversion of the return type, if necessary.
10441
10442         (New::DoResolve): Check whether we are creating an array or an object
10443         and accordingly do the needful.
10444
10445         (New::Emit): Same here.
10446
10447         (New::DoResolve): Implement guts of array creation.
10448
10449         (New::FormLookupType): Helper function.
10450
10451 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
10452
10453         * codegen.cs: Removed most of the code generation here, and move the
10454         corresponding code generation bits to the statement classes. 
10455
10456         Added support for try/catch/finalize and throw.
10457         
10458         * cs-parser.jay: Added support for try/catch/finalize.
10459
10460         * class.cs: Catch static methods having the flags override,
10461         virtual or abstract.
10462
10463         * expression.cs (UserCast): This user cast was not really doing
10464         what it was supposed to do.  Which is to be born in fully resolved
10465         state.  Parts of the resolution were being performed at Emit time! 
10466
10467         Fixed this code.
10468
10469 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
10470
10471         * expression.cs: Implicity convert the result from UserCast.
10472
10473 2001-10-05  Ravi Pratap  <ravi@ximian.com>
10474
10475         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
10476         prevented it from working correctly. 
10477
10478         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
10479         merely ConvertImplicit.
10480
10481 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
10482
10483         * typemanager.cs: Make the LookupTypeContainer function static,
10484         and not per-instance.  
10485
10486         * class.cs: Make static FindMembers (the one that takes a Type
10487         argument). 
10488
10489         * codegen.cs: Add EmitForeach here.
10490
10491         * cs-parser.jay: Make foreach a toplevel object instead of the
10492         inline expansion, as we need to perform semantic analysis on it. 
10493
10494 2001-10-05  Ravi Pratap  <ravi@ximian.com>
10495
10496         * expression.cs (Expression::ImplicitUserConversion): Rename to
10497         UserDefinedConversion.
10498
10499         (Expression::UserDefinedConversion): Take an extra argument specifying 
10500         whether we look for explicit user conversions too.
10501
10502         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
10503
10504         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
10505
10506         (ExplicitUserConversion): Make it a call to UserDefinedConversion
10507         with the appropriate arguments.
10508
10509         * cs-parser.jay (cast_expression): Record location too.
10510
10511         * expression.cs (Cast): Record location info.
10512
10513         (Expression::ConvertExplicit): Take location argument.
10514
10515         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
10516         to determine if we are doing explicit conversions.
10517
10518         (UserCast::Emit): Update accordingly.
10519
10520         (Expression::ConvertExplicit): Report an error if everything fails.
10521
10522         * ../errors/cs0030.cs : Add.
10523
10524 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
10525
10526         * modifiers.cs: If the ABSTRACT keyword is present, also set the
10527         virtual and newslot bits. 
10528
10529         * class.cs (TypeContainer::RegisterRequiredImplementations):
10530         Record methods we need.
10531
10532         (TypeContainer::MakeKey): Helper function to make keys for
10533         MethodBases, since the Methodbase key is useless.
10534
10535         (TypeContainer::Populate): Call RegisterRequiredImplementations
10536         before defining the methods.   
10537
10538         Create a mapping for method_builders_to_methods ahead of time
10539         instead of inside a tight loop.
10540
10541         (::RequireMethods):  Accept an object as the data to set into the
10542         hashtable so we can report interface vs abstract method mismatch.
10543
10544 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
10545
10546         * report.cs: Make all of it static.
10547
10548         * rootcontext.cs: Drop object_type and value_type computations, as
10549         we have those in the TypeManager anyways.
10550
10551         Drop report instance variable too, now it is a global.
10552
10553         * driver.cs: Use try/catch on command line handling.
10554
10555         Add --probe option to debug the error reporting system with a test
10556         suite. 
10557
10558         * report.cs: Add support for exiting program when a probe
10559         condition is reached.
10560
10561 2001-10-03  Ravi Pratap  <ravi@ximian.com>
10562
10563         * expression.cs (Binary::DoNumericPromotions): Fix the case when
10564         we do a forcible conversion regardless of type, to check if 
10565         ForceConversion returns a null.
10566
10567         (Binary::error19): Use location to report error.
10568
10569         (Unary::error23): Use location here too.
10570
10571         * ../errors/cs0019.cs : Check in.
10572
10573         * ../errors/cs0023.cs : Check in.
10574
10575         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
10576         case of a non-null MethodInfo object with a length of 0 !
10577
10578         (Binary::ResolveOperator): Flag error if overload resolution fails to find
10579         an applicable member - according to the spec :-)
10580         Also fix logic to find members in base types.
10581
10582         (Unary::ResolveOperator): Same here.
10583
10584         (Unary::report23): Change name to error23 and make first argument a TypeContainer
10585         as I was getting thoroughly confused between this and error19 :-)
10586         
10587         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
10588         (::FindMostEncompassedType): Implement.
10589         (::FindMostEncompassingType): Implement.
10590         (::StandardConversionExists): Implement.
10591
10592         (UserImplicitCast): Re-vamp. We now need info about most specific
10593         source and target types so that we can do the necessary conversions.
10594
10595         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
10596         mathematical union with no duplicates.
10597
10598 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
10599
10600         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
10601         in order from base classes to child classes, so that we can in
10602         child classes look up in our parent for method names and
10603         attributes (required for handling abstract, virtual, new, override
10604         constructs: we need to instrospect our base class, and if we dont
10605         populate the classes in order, the introspection might be
10606         incorrect.  For example, a method could query its parent before
10607         the parent has any methods and would determine that the parent has
10608         no abstract methods (while it could have had them)).
10609
10610         (RootContext::CreateType): Record the order in which we define the
10611         classes.
10612
10613 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
10614
10615         * class.cs (TypeContainer::Populate): Also method definitions can
10616         fail now, keep track of this.
10617
10618         (TypeContainer::FindMembers): Implement support for
10619         DeclaredOnly/noDeclaredOnly flag.
10620
10621         (Constructor::Emit) Return the ConstructorBuilder.
10622
10623         (Method::Emit) Return the MethodBuilder. 
10624         Check for abstract or virtual methods to be public.
10625
10626         * rootcontext.cs (RootContext::CreateType): Register all the
10627         abstract methods required for the class to be complete and the
10628         interface methods that must be implemented. 
10629
10630         * cs-parser.jay: Report error 501 (method requires body if it is
10631         not marked abstract or extern).
10632
10633         * expression.cs (TypeOf::Emit): Implement.
10634
10635         * typemanager.cs: runtime_handle_type, new global type.
10636
10637         * class.cs (Property::Emit): Generate code for properties.
10638
10639 2001-10-02  Ravi Pratap  <ravi@ximian.com>
10640
10641         * expression.cs (Unary::ResolveOperator): Find operators on base type
10642         too - we now conform exactly to the spec.
10643
10644         (Binary::ResolveOperator): Same here.
10645
10646         * class.cs (Operator::Define): Fix minor quirk in the tests.
10647
10648         * ../errors/cs0215.cs : Added.
10649
10650         * ../errors/cs0556.cs : Added.
10651
10652         * ../errors/cs0555.cs : Added.
10653
10654 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
10655
10656         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
10657         single integer which is really efficient
10658
10659 2001-10-01  Ravi Pratap  <ravi@ximian.com>
10660
10661         *  expression.cs (Expression::ImplicitUserConversion): Use location
10662         even in the case when we are examining True operators.
10663  
10664         * class.cs (Operator::Define): Perform extensive checks to conform
10665         with the rules for operator overloading in the spec.
10666
10667         * expression.cs (Expression::ImplicitReferenceConversion): Implement
10668         some of the other conversions mentioned in the spec.
10669
10670         * typemanager.cs (array_type): New static member for the System.Array built-in
10671         type.
10672
10673         (cloneable_interface): For System.ICloneable interface.
10674
10675         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
10676         we start resolving the tree and populating types.
10677
10678         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
10679  
10680 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
10681
10682         * expression.cs (Expression::ExprClassFromMemberInfo,
10683         Expression::Literalize): Create literal expressions from
10684         FieldInfos which are literals.
10685
10686         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
10687         type casts, because they were wrong.  The test suite in tests
10688         caught these ones.
10689
10690         (ImplicitNumericConversion): ushort to ulong requires a widening
10691         cast. 
10692
10693         Int32 constant to long requires widening cast as well.
10694
10695         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
10696         for integers because the type on the stack is not i4.
10697
10698 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
10699
10700         * expression.cs (report118): require location argument. 
10701
10702         * parameter.cs: Do not dereference potential null value.
10703
10704         * class.cs: Catch methods that lack the `new' keyword when
10705         overriding a name.  Report warnings when `new' is used without
10706         anything being there to override.
10707
10708         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
10709
10710         * class.cs: Only add constructor to hashtable if it is non-null
10711         (as now constructors can fail on define).
10712
10713         (TypeManager, Class, Struct): Take location arguments.
10714
10715         Catch field instance initialization in structs as errors.
10716
10717         accepting_filter: a new filter for FindMembers that is static so
10718         that we dont create an instance per invocation.
10719
10720         (Constructor::Define): Catch errors where a struct constructor is
10721         parameterless 
10722
10723         * cs-parser.jay: Pass location information for various new
10724         constructs. 
10725         
10726         * delegate.cs (Delegate): take a location argument.
10727
10728         * driver.cs: Do not call EmitCode if there were problesm in the
10729         Definition of the types, as many Builders wont be there. 
10730
10731         * decl.cs (Decl::Decl): Require a location argument.
10732
10733         * cs-tokenizer.cs: Handle properly hex constants that can not fit
10734         into integers, and find the most appropiate integer for it.
10735
10736         * literal.cs: Implement ULongLiteral.
10737
10738         * rootcontext.cs: Provide better information about the location of
10739         failure when CreateType fails.
10740         
10741 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
10742
10743         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
10744         as well.
10745
10746         * expression.cs (Binary::CheckShiftArguments): Add missing type
10747         computation.
10748         (Binary::ResolveOperator): Add type to the logical and and logical
10749         or, Bitwise And/Or and Exclusive Or code paths, it was missing
10750         before.
10751
10752         (Binary::DoNumericPromotions): In the case where either argument
10753         is ulong (and most signed types combined with ulong cause an
10754         error) perform implicit integer constant conversions as well.
10755
10756 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
10757
10758         * expression.cs (UserImplicitCast): Method should always be
10759         non-null. 
10760         (Invocation::BetterConversion): Simplified test for IntLiteral.
10761
10762         (Expression::ImplicitNumericConversion): Split this routine out.
10763         Put the code that performs implicit constant integer conversions
10764         here. 
10765
10766         (Expression::Resolve): Become a wrapper around DoResolve so we can
10767         check eclass and type being set after resolve.
10768
10769         (Invocation::Badness): Remove this dead function
10770
10771         (Binary::ResolveOperator): Do not compute the expensive argumnets
10772         unless we have a union for it.
10773
10774         (Probe::Emit): Is needs to do an isinst and then
10775         compare against null.
10776
10777         (::CanConvert): Added Location argument.  If the Location argument
10778         is null (Location.Null), then we do not report errors.  This is
10779         used by the `probe' mechanism of the Explicit conversion.  We do
10780         not want to generate an error for something that the user
10781         explicitly requested to be casted.  But the pipeline for an
10782         explicit cast first tests for potential implicit casts.
10783
10784         So for now, if the Location is null, it means `Probe only' to
10785         avoid adding another argument.   Might have to revise this
10786         strategy later.
10787
10788         (ClassCast): New class used to type cast objects into arbitrary
10789         classes (used in Explicit Reference Conversions).
10790
10791         Implement `as' as well.
10792
10793         Reverted all the patches from Ravi below: they were broken:
10794
10795                 * The use of `level' as a mechanism to stop recursive
10796                   invocations is wrong.  That was there just to catch the
10797                   bug with a strack trace but not as a way of addressing
10798                   the problem.
10799
10800                   To fix the problem we have to *understand* what is going
10801                   on and the interactions and come up with a plan, not
10802                   just get things going.
10803
10804                 * The use of the type conversion cache that I proposed
10805                   last night had an open topic: How does this work across
10806                   protection domains.  A user defined conversion might not
10807                   be public in the location where we are applying the
10808                   conversion, a different conversion might be selected
10809                   (ie, private A->B (better) but public B->A (worse),
10810                   inside A, A->B applies, but outside it, B->A will
10811                   apply).
10812
10813                 * On top of that (ie, even if the above is solved),
10814                   conversions in a cache need to be abstract.  Ie, `To
10815                   convert from an Int to a Short use an OpcodeCast', not
10816                   `To convert from an Int to a Short use the OpcodeCast on
10817                   the variable 5' (which is what this patch was doing).
10818         
10819 2001-09-28  Ravi Pratap  <ravi@ximian.com>
10820
10821         * expression.cs (Invocation::ConversionExists): Re-write to use
10822         the conversion cache
10823         
10824         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
10825         cache all conversions done, not just user-defined ones.
10826
10827         (Invocation::BetterConversion): The real culprit. Use ConversionExists
10828         to determine if a conversion exists instead of acutually trying to 
10829         perform the conversion. It's faster too.
10830
10831         (Expression::ConvertExplicit): Modify to use ConversionExists to check
10832         and only then attempt the implicit conversion.
10833
10834 2001-09-28  Ravi Pratap  <ravi@ximian.com>
10835
10836         * expression.cs (ConvertImplicit): Use a cache for conversions
10837         already found. Check level of recursion and bail out if necessary.
10838         
10839 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
10840
10841         * typemanager.cs (string_concat_string_string, string_concat_object_object):
10842         Export standard methods that we expect for string operations.
10843         
10844         * statement.cs (Block::UsageWarning): Track usage of variables and
10845         report the errors for not used variables.
10846
10847         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
10848         operator. 
10849
10850 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
10851
10852         * codegen.cs: remove unnneded code 
10853
10854         * expression.cs: Removed BuiltinTypeAccess class
10855
10856         Fix the order in which implicit conversions are
10857         done.  
10858
10859         The previous fixed dropped support for boxed conversions (adding a
10860         test to the test suite now)
10861
10862         (UserImplicitCast::CanConvert): Remove test for source being null,
10863         that code is broken.  We should not feed a null to begin with, if
10864         we do, then we should track the bug where the problem originates
10865         and not try to cover it up here.
10866
10867         Return a resolved expression of type UserImplicitCast on success
10868         rather than true/false.  Ravi: this is what I was talking about,
10869         the pattern is to use a static method as a "constructor" for
10870         objects. 
10871
10872         Also, do not create arguments until the very last minute,
10873         otherwise we always create the arguments even for lookups that
10874         will never be performed. 
10875
10876         (UserImplicitCast::Resolve): Eliminate, objects of type
10877         UserImplicitCast are born in a fully resolved state. 
10878         
10879         * typemanager.cs (InitCoreTypes): Init also value_type
10880         (System.ValueType). 
10881
10882         * expression.cs (Cast::Resolve): First resolve the child expression.
10883
10884         (LValue): Add new method AddressOf to be used by
10885         the `&' operator.  
10886
10887         Change the argument of Store to take an EmitContext instead of an
10888         ILGenerator, because things like FieldExpr need to be able to call
10889         their children expression to generate the instance code. 
10890
10891         (Expression::Error, Expression::Warning): Sugar functions for
10892         reporting errors.
10893
10894         (Expression::MemberLookup): Accept a TypeContainer instead of a
10895         Report as the first argument.
10896
10897         (Expression::ResolvePrimary): Killed.  I still want to improve
10898         this as currently the code is just not right.
10899
10900         (Expression::ResolveMemberAccess): Simplify, but it is still
10901         wrong. 
10902
10903         (Unary::Resolve): Catch errors in AddressOf operators.
10904
10905         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
10906         index to a byte for the short-version, or the compiler will choose
10907         the wrong Emit call, which generates the wrong data.
10908
10909         (ParameterReference::Emit, ::Store): same.
10910
10911         (FieldExpr::AddressOf): Implement.
10912         
10913         * typemanager.cs: TypeManager: made public variable instead of
10914         property.
10915         
10916         * driver.cs: document --fatal.
10917
10918         * report.cs (ErrorMessage, WarningMessage): new names for the old
10919         Error and Warning classes.
10920
10921         * cs-parser.jay (member_access): Turn built-in access to types
10922         into a normal simplename
10923
10924 2001-09-27  Ravi Pratap  <ravi@ximian.com>
10925
10926         * expression.cs (Invocation::BetterConversion): Fix to cope
10927         with q being null, since this was introducing a bug.
10928
10929         * expression.cs (ConvertImplicit): Do built-in conversions first.
10930
10931 2001-09-27  Ravi Pratap  <ravi@ximian.com>
10932
10933         * expression.cs (UserImplicitCast::Resolve): Fix bug.
10934
10935 2001-09-27  Ravi Pratap  <ravi@ximian.com>
10936
10937         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
10938         I had introduced long ago (what's new ?).
10939
10940         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
10941         the work of all the checking. 
10942         (ConvertImplicit): Call CanConvert and only then create object if necessary.
10943         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
10944
10945         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
10946         that is the right way. 
10947
10948         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
10949         overloading resolution. Use everywhere instead of cutting and pasting code.
10950
10951         (Binary::ResolveOperator): Use MakeUnionSet.
10952
10953         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
10954         we have to convert to bool types. Not complete yet.
10955         
10956 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
10957
10958         * typemanager.cs (TypeManager::CSharpName): support ushort.
10959
10960         * expression.cs (Expression::TryImplicitIntConversion): Attempts
10961         to provide an expression that performsn an implicit constant int
10962         conversion (section 6.1.6).
10963         (Expression::ConvertImplicitRequired): Reworked to include
10964         implicit constant expression conversions.
10965
10966         (Expression::ConvertNumericExplicit): Finished.
10967
10968         (Invocation::Emit): If InstanceExpression is null, then it means
10969         that we perform a call on this.
10970         
10971 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
10972
10973         * expression.cs (Unary::Emit): Remove some dead code.
10974         (Probe): Implement Resolve and Emit for `is'.
10975         (Expression::ConvertImplicitRequired): Attempt to do constant
10976         expression conversions here.  Maybe should be moved to
10977         ConvertImplicit, but I am not sure.
10978         (Expression::ImplicitLongConstantConversionPossible,
10979         Expression::ImplicitIntConstantConversionPossible): New functions
10980         that tell whether is it possible to apply an implicit constant
10981         expression conversion.
10982
10983         (ConvertNumericExplicit): Started work on explicit numeric
10984         conversions.
10985
10986         * cs-parser.jay: Update operator constants.
10987
10988         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
10989         (Parameters::GetSignature): Hook up VerifyArgs here.
10990         (Parameters::VerifyArgs): Verifies that no two arguments have the
10991         same name. 
10992
10993         * class.cs (Operator): Update the operator names to reflect the
10994         ones that the spec expects (as we are just stringizing the
10995         operator names).
10996         
10997         * expression.cs (Unary::ResolveOperator): Fix bug: Use
10998         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
10999         previous usage did only work for our methods.
11000         (Expression::ConvertImplicit): Handle decimal implicit numeric
11001         conversions as well.
11002         (Expression::InternalTypeConstructor): Used to invoke constructors
11003         on internal types for default promotions.
11004
11005         (Unary::Emit): Implement special handling for the pre/post
11006         increment/decrement for overloaded operators, as they need to have
11007         the same semantics as the other operators.
11008
11009         (Binary::ResolveOperator): ditto.
11010         (Invocation::ConversionExists): ditto.
11011         (UserImplicitCast::Resolve): ditto.
11012         
11013 2001-09-26  Ravi Pratap  <ravi@ximian.com>
11014
11015         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
11016         operator, return after emitting body. Regression tests pass again !
11017
11018         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
11019         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
11020         (Invocation::OverloadResolve): Ditto.
11021         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
11022
11023         * everywhere : update calls to the above methods accordingly.
11024
11025 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
11026
11027         * assign.cs (Assign): Make it inherit from ExpressionStatement.
11028
11029         * expression.cs (ExpressionStatement): New base class used for
11030         expressions that can appear in statements, so that we can provide
11031         an alternate path to generate expression that do not leave a value
11032         on the stack.
11033
11034         (Expression::Emit, and all the derivatives): We no longer return
11035         whether a value is left on the stack or not.  Every expression
11036         after being emitted leaves a single value on the stack.
11037
11038         * codegen.cs (EmitContext::EmitStatementExpression): Use the
11039         facilties of ExpressionStatement if possible.
11040
11041         * cs-parser.jay: Update statement_expression.
11042
11043 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
11044
11045         * driver.cs: Change the wording of message
11046
11047 2001-09-25  Ravi Pratap  <ravi@ximian.com>
11048
11049         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
11050         the type of the expression to the return type of the method if
11051         we have an overloaded operator match ! The regression tests pass again !
11052         (Unary::ResolveOperator): Ditto.
11053
11054         * expression.cs (Invocation::ConversionExists): Correct the member lookup
11055         to find "op_Implicit", not "implicit" ;-)
11056         (UserImplicitCast): New class to take care of user-defined implicit conversions.
11057         (ConvertImplicit, ForceConversion): Take TypeContainer argument
11058
11059         * everywhere : Correct calls to the above accordingly.
11060
11061         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
11062         (ConvertImplicit): Do user-defined conversion if it exists.
11063
11064 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
11065
11066         * assign.cs: track location.
11067         (Resolve): Use implicit conversions on assignment.
11068
11069         * literal.cs: Oops.  Not good, Emit of short access values should
11070         pass (Bytes) or the wrong argument will be selected.
11071
11072         * expression.cs (Unary::Emit): Emit code for -expr.
11073         
11074         (Unary::ResolveOperator): Handle `Substract' for non-constants
11075         (substract from zero from the non-constants).
11076         Deal with Doubles as well. 
11077         
11078         (Expression::ConvertImplicitRequired): New routine that reports an
11079         error if no implicit conversion exists. 
11080
11081         (Invocation::OverloadResolve): Store the converted implicit
11082         expressions if we make them
11083         
11084 2001-09-24  Ravi Pratap  <ravi@ximian.com>
11085
11086         * class.cs (ConstructorInitializer): Take a Location argument.
11087         (ConstructorBaseInitializer): Same here.
11088         (ConstructorThisInitializer): Same here.
11089
11090         * cs-parser.jay : Update all calls accordingly.
11091
11092         * expression.cs (Unary, Binary, New): Take location argument.
11093         Update accordingly everywhere.
11094
11095         * cs-parser.jay : Update all calls to the above to take a location
11096         argument.
11097
11098         * class.cs : Ditto.
11099
11100 2001-09-24  Ravi Pratap  <ravi@ximian.com>
11101
11102         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
11103         (Invocation::BetterConversion): Same here
11104         (Invocation::ConversionExists): Ditto.
11105
11106         (Invocation::ConversionExists): Implement.
11107
11108 2001-09-22  Ravi Pratap  <ravi@ximian.com>
11109
11110         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
11111         Also take an additional TypeContainer argument.
11112
11113         * All over : Pass in TypeContainer as argument to OverloadResolve.
11114
11115         * typemanager.cs (CSharpName): Update to check for the string type and return
11116         that too.
11117
11118         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
11119         a given method.
11120         
11121 2001-09-21  Ravi Pratap  <ravi@ximian.com>
11122
11123         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
11124         (Invocation::BetterFunction): Implement.
11125         (Invocation::BetterConversion): Implement.
11126         (Invocation::ConversionExists): Skeleton, no implementation yet.
11127
11128         Okay, things work fine !
11129
11130 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
11131
11132         * typemanager.cs: declare and load enum_type, delegate_type and
11133         void_type. 
11134
11135         * expression.cs (Expression::Emit): Now emit returns a value that
11136         tells whether a value is left on the stack or not.  This strategy
11137         might be reveted tomorrow with a mechanism that would address
11138         multiple assignments.
11139         (Expression::report118): Utility routine to report mismatches on
11140         the ExprClass.
11141
11142         (Unary::Report23): Report impossible type/operator combination
11143         utility function.
11144
11145         (Unary::IsIncrementableNumber): Whether the type can be
11146         incremented or decremented with add.
11147         (Unary::ResolveOperator): Also allow enumerations to be bitwise
11148         complemented. 
11149         (Unary::ResolveOperator): Implement ++, !, ~,
11150
11151         (Invocation::Emit): Deal with new Emit convetion.
11152         
11153         * All Expression derivatives: Updated their Emit method to return
11154         whether they leave values on the stack or not.
11155         
11156         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
11157         stack for expressions that are statements. 
11158
11159 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
11160
11161         * expression.cs (LValue): New interface.  Must be implemented by
11162         LValue objects.
11163         (LocalVariableReference, ParameterReference, FieldExpr): Implement
11164         LValue interface.
11165         
11166         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
11167         interface for generating code, simplifies the code.
11168
11169 2001-09-20  Ravi Pratap  <ravi@ximian.com>
11170
11171         * expression.cs (everywhere): Comment out return statements in ::Resolve
11172         methods to avoid the warnings.
11173
11174 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
11175
11176         * driver.cs (parse): Report error 2001 if we can not open the
11177         source file.
11178
11179         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
11180         not resolve it.
11181
11182         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
11183         object. 
11184
11185         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
11186         otherwise nested blocks end up with the same index.
11187
11188         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
11189
11190         * expression.cs:  Instead of having FIXMEs in the Resolve
11191         functions, throw exceptions so it is obvious that we are facing a
11192         bug. 
11193
11194         * cs-parser.jay (invocation_expression): Pass Location information.
11195
11196         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
11197         Use a basename for those routines because .NET does not like paths
11198         on them. 
11199
11200         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
11201         already defined.
11202
11203 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
11204
11205         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
11206         are loading the correct data types (throws an exception if not).
11207         (TypeManager::InitCoreTypes): Use CoreLookupType
11208
11209         * expression.cs (Unary::ResolveOperator): return the child
11210         expression for expressions which are just +expr.
11211         (Unary::ResolveOperator): Return negative literals for -LITERAL
11212         expressions (otherwise they are Unary {Literal}).
11213         (Invocation::Badness): Take into account `Implicit constant
11214         expression conversions'.
11215
11216         * literal.cs (LongLiteral): Implement long literal class.
11217         (IntLiteral): export the `Value' of the intliteral. 
11218
11219 2001-09-19  Ravi Pratap  <ravi@ximian.com>
11220
11221         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
11222
11223         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
11224         instead of 'Operator'
11225
11226         * expression.cs (Binary::ResolveOperator): Update accordingly.
11227         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
11228         and 'Minus'
11229
11230         * cs-parser.jay (unary_expression): Update to use the new names.
11231
11232         * gen-treedump.cs (GetUnary): Same here.
11233
11234         * expression.cs (Unary::Resolve): Implement.
11235         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
11236         operators are found instead of making noise ;-)
11237         (Unary::ResolveOperator): New method to do precisely the same thing which
11238         Binary::ResolveOperator does for Binary expressions.
11239         (Unary.method, .Arguments): Add.
11240         (Unary::OperName): Implement.   
11241         (Unary::ForceConversion): Copy and Paste !
11242
11243         * class.cs (Operator::Define): Fix a small bug for the case when we have 
11244         a unary operator.
11245
11246         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
11247         for the inbuilt operators. Only overloading works for now ;-)
11248
11249 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
11250
11251         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
11252         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
11253
11254         * expression.cs (This::Emit): Implement. 
11255         (This::Resolve): Implement.
11256         (TypeOf:Resolve): Implement.
11257         (Expression::ResolveSimpleName): Add an implicit this to instance
11258         field references. 
11259         (MemberAccess::Resolve): Deal with Parameters and Fields. 
11260         Bind instance variable to Field expressions.
11261         (FieldExpr::Instance): New field used to track the expression that
11262         represents the object instance.
11263         (FieldExpr::Resolve): Track potential errors from MemberLookup not
11264         binding 
11265         (FieldExpr::Emit): Implement.
11266
11267         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
11268         the last instruction contains a return opcode to avoid generating
11269         the last `ret' instruction (this generates correct code, and it is
11270         nice to pass the peverify output).
11271
11272         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
11273         initializer for static and instance variables.
11274         (Constructor::Emit): Allow initializer to be null in the case of
11275         static constructors.  Only emit initializer for instance
11276         constructors. 
11277
11278         (TypeContainer::FindMembers): Return a null array if there are no
11279         matches.
11280
11281         Also fix the code for the MemberTypes.Method branch, as it was not
11282         scanning that for operators (or tried to access null variables before).
11283
11284         * assign.cs (Assign::Emit): Handle instance and static fields. 
11285
11286         * TODO: Updated.
11287
11288         * driver.cs: Stop compilation if there are parse errors.
11289
11290         * cs-parser.jay (constructor_declaration): Provide default base
11291         initializer for non-static constructors.
11292         (constructor_declarator): Do not provide a default base
11293         initializers if none was specified.
11294         Catch the fact that constructors should not have parameters.
11295
11296         * class.cs: Do not emit parent class initializers for static
11297         constructors, that should be flagged as an error.
11298
11299 2001-09-18  Ravi Pratap  <ravi@ximian.com>
11300
11301         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
11302         Move back code into TypeContainer::Populate.
11303
11304 2001-09-18  Ravi Pratap  <ravi@ximian.com>
11305
11306         * class.cs (TypeContainer::AddConstructor): Fix the check to
11307         compare against Name, not Basename. 
11308         (Operator::OpType): Change Plus and Minus to Add and Subtract.
11309
11310         * cs-parser.jay : Update accordingly.
11311
11312         * class.cs (TypeContainer::FindMembers): For the case where we are searching
11313         for methods, don't forget to look into the operators too.
11314         (RegisterMethodBuilder): Helper method to take care of this for
11315         methods, constructors and operators.
11316         (Operator::Define): Completely revamp.
11317         (Operator.OperatorMethod, MethodName): New fields.
11318         (TypeContainer::Populate): Move the registering of builders into
11319         RegisterMethodBuilder.
11320         (Operator::Emit): Re-write.
11321
11322         * expression.cs (Binary::Emit): Comment out code path to emit method
11323         invocation stuff for the case when we have a user defined operator. I am
11324         just not able to get it right !
11325         
11326 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
11327
11328         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
11329         argument. 
11330
11331         (Expression::MemberLookup): Provide a version that allows to
11332         specify the MemberTypes and BindingFlags. 
11333
11334         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
11335         so it was not fetching variable information from outer blocks.
11336
11337         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
11338         Beforefieldinit as it was buggy.
11339
11340         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
11341         that Ravi put here.  
11342
11343         * class.cs (Constructor::Emit): Only emit if block is not null.
11344         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
11345         deal with this by semantically definining it as if the user had
11346         done it.
11347
11348         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
11349         constructors as we now "emit" them at a higher level.
11350
11351         (TypeContainer::DefineDefaultConstructor): Used to define the
11352         default constructors if none was provided.
11353
11354         (ConstructorInitializer): Add methods Resolve and Emit. 
11355         
11356         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
11357
11358 2001-09-17  Ravi Pratap  <ravi@ximian.com>
11359
11360         * class.cs (TypeContainer::EmitDefaultConstructor): Register
11361         the default constructor builder with our hashtable for methodbuilders
11362         to methodcores.
11363
11364         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
11365         and argument_count is 0 in which case we have a match.
11366         (Binary::ResolveOperator): More null checking and miscellaneous coding
11367         style cleanup.
11368
11369 2001-09-17  Ravi Pratap  <ravi@ximian.com>
11370
11371         * rootcontext.cs (IsNameSpace): Compare against null.
11372
11373         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
11374
11375         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
11376         and Unary::Operator.
11377
11378         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
11379         accordingly.
11380
11381         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
11382         we have overloaded operators.
11383         (Binary::ResolveOperator): Implement the part which does the operator overload
11384         resolution.
11385
11386         * class.cs (Operator::Emit): Implement.
11387         (TypeContainer::Emit): Emit the operators we have too.
11388
11389         * expression.cs (Binary::Emit): Update to emit the appropriate code for
11390         the case when we have a user-defined operator.
11391         
11392 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
11393
11394         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
11395
11396 2001-09-16  Ravi Pratap  <ravi@ximian.com>
11397
11398         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
11399         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
11400         (Constructor::Emit): Implement.
11401         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
11402         if we have no work to do. 
11403         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
11404         Emit method.
11405
11406         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
11407         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
11408
11409         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
11410         of parent.parent.
11411
11412 2001-09-15  Ravi Pratap  <ravi@ximian.com>
11413
11414         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
11415         in the source.
11416         (Tree::RecordNamespace): Method to do what the name says ;-)
11417         (Tree::Namespaces): Property to get at the namespaces hashtable.
11418
11419         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
11420         keep track.
11421
11422         * rootcontext.cs (IsNamespace): Fixed it :-)
11423
11424 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
11425
11426         * class.cs (TypeContainer::FindMembers): Add support for
11427         constructors. 
11428         (MethodCore): New class that encapsulates both the shared aspects
11429         of a Constructor and a Method.  
11430         (Method, Constructor): Factored pieces into MethodCore.
11431
11432         * driver.cs: Added --fatal which makes errors throw exceptions.
11433         Load System assembly as well as part of the standard library.
11434
11435         * report.cs: Allow throwing exceptions on errors for debugging.
11436
11437         * modifiers.cs: Do not use `parent', instead use the real type
11438         container to evaluate permission settings.
11439
11440         * class.cs: Put Ravi's patch back in.  He is right, and we will
11441         have to cope with the
11442
11443 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11444
11445         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
11446         FamORAssem, not FamANDAssem.
11447         
11448 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
11449
11450         * driver.cs: Added --parse option that only parses its input files
11451         and terminates.
11452
11453         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
11454         incorrect.  IsTopLevel is not used to tell whether an object is
11455         root_types or not (that can be achieved by testing this ==
11456         root_types).  But to see if this is a top-level *class* (not
11457         necessarly our "toplevel" container). 
11458
11459 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11460
11461         * enum.cs (Enum::Define): Modify to call the Lookup method on the
11462         parent instead of a direct call to GetType.
11463
11464 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11465
11466         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
11467         Modifiers.TypeAttr. This should just be a call to that method.
11468
11469         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
11470         object so that we can determine if we are top-level or not.
11471
11472         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
11473         TypeContainer too.
11474
11475         * enum.cs (Enum::Define): Ditto.
11476
11477         * modifiers.cs (FieldAttr): Re-write.
11478
11479         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
11480         (TypeContainer::HaveStaticConstructor): New property to provide access
11481         to precisely that info.
11482
11483         * modifiers.cs (MethodAttr): Re-write.
11484         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
11485
11486         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
11487         of top-level types as claimed.
11488         
11489 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
11490
11491         * expression.cs (MemberLookup): Fruitless attempt to lookup
11492         constructors.  Maybe I need to emit default constructors?  That
11493         might be it (currently .NET emits this for me automatically).
11494         (Invocation::OverloadResolve): Cope with Arguments == null.
11495         (Invocation::EmitArguments): new function, shared by the new
11496         constructor and us.
11497         (Invocation::Emit): Handle static and instance methods.  Emit
11498         proper call instruction for virtual or non-virtual invocations.
11499         (New::Emit): Implement.
11500         (New::Resolve): Implement.
11501         (MemberAccess:Resolve): Implement.
11502         (MethodGroupExpr::InstanceExpression): used conforming to the spec
11503         to track instances.
11504         (FieldExpr::Resolve): Set type.
11505
11506         * support.cs: Handle empty arguments.
11507                 
11508         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
11509         SimpleLookup): Auxiliary routines to help parse a qualifier
11510         identifier.  
11511
11512         Update qualifier_identifier rule.
11513
11514         * codegen.cs: Removed debugging messages.
11515
11516         * class.cs: Make this a global thing, this acts just as a "key" to
11517         objects that we might have around.
11518
11519         (Populate): Only initialize method_builders_to_methods once.
11520
11521         * expression.cs (PropertyExpr): Initialize type from the
11522         PropertyType. 
11523
11524         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
11525         Resolve pattern.  Attempt to implicitly convert value to boolean.
11526         Emit code.
11527
11528         * expression.cs: Set the type for the int32/int32 argument case.
11529         (Binary::ResolveOperator): Set the return type to boolean for
11530         comparission operators
11531
11532         * typemanager.cs: Remove debugging print code.
11533
11534         (Invocation::Resolve): resolve type.
11535
11536         * class.cs: Allocate a MemberInfo of the correct size, as the code
11537         elsewhere depends on the test to reflect the correct contents.
11538
11539         (Method::) Keep track of parameters, due to System.Reflection holes
11540
11541         (TypeContainer::Populate): Keep track of MethodBuilders to Method
11542         mapping here.
11543
11544         (TypeContainer::FindMembers): Use ArrayList and then copy an array
11545         of the exact size and return that.
11546
11547         (Class::LookupMethodByBuilder): New function that maps
11548         MethodBuilders to its methods.  Required to locate the information
11549         on methods because System.Reflection bit us again.
11550
11551         * support.cs: New file, contains an interface ParameterData and
11552         two implementations: ReflectionParameters and InternalParameters
11553         used to access Parameter information.  We will need to grow this
11554         as required.
11555
11556         * expression.cs (Invocation::GetParameterData): implement a cache
11557         and a wrapper around the ParameterData creation for methods. 
11558         (Invocation::OverloadResolve): Use new code.
11559
11560 2001-09-13  Ravi Pratap  <ravi@ximian.com>
11561
11562         * class.cs (TypeContainer::EmitField): Remove and move into 
11563         (Field::Define): here and modify accordingly.
11564         (Field.FieldBuilder): New member.
11565         (TypeContainer::Populate): Update accordingly.
11566         (TypeContainer::FindMembers): Implement.
11567
11568 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
11569
11570         * statement.cs: (VariableInfo::VariableType): New field to be
11571         initialized with the full type once it is resolved. 
11572
11573 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
11574
11575         * parameter.cs (GetParameterInfo): Use a type cache to compute
11576         things only once, and to reuse this information
11577
11578         * expression.cs (LocalVariableReference::Emit): Implement.
11579         (OpcodeCast::Emit): fix.
11580
11581         (ParameterReference::Resolve): Implement.
11582         (ParameterReference::Emit): Implement.
11583
11584         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
11585         that are expressions need to stay as Expressions.
11586
11587         * typemanager.cs (CSharpName): Returns the C# name of a type if
11588         possible. 
11589
11590         * expression.cs (Expression::ConvertImplicit): New function that
11591         implements implicit type conversions.
11592
11593         (Expression::ImplicitReferenceConversion): Implements implicit
11594         reference conversions.
11595
11596         (EmptyCast): New type for transparent casts.
11597
11598         (OpcodeCast): New type for casts of types that are performed with
11599         a sequence of bytecodes.
11600         
11601         (BoxedCast): New type used for casting value types into reference
11602         types.  Emits a box opcode.
11603
11604         (Binary::DoNumericPromotions): Implements numeric promotions of
11605         and computation of the Binary::Type.
11606
11607         (Binary::EmitBranchable): Optimization.
11608
11609         (Binary::Emit): Implement code emission for expressions.
11610         
11611         * typemanager.cs (TypeManager): Added two new core types: sbyte
11612         and byte.
11613
11614 2001-09-12  Ravi Pratap  <ravi@ximian.com>
11615
11616         * class.cs (TypeContainer::FindMembers): Method which does exactly
11617         what Type.FindMembers does, only we don't have to use reflection. No
11618         implementation yet.
11619
11620         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
11621         typecontainer objects as we need to get at them.
11622         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
11623
11624         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
11625         typecontainer object.
11626
11627         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
11628         of just a Report object.
11629
11630 2001-09-11  Ravi Pratap  <ravi@ximian.com>
11631
11632         * class.cs (Event::Define): Go back to using the prefixes "add_" and
11633         "remove_"
11634         (TypeContainer::Populate): Now define the delegates of the type too.
11635         (TypeContainer.Delegates): Property to access the list of delegates defined
11636         in the type.
11637
11638         * delegates.cs (Delegate::Define): Implement partially.
11639
11640         * modifiers.cs (TypeAttr): Handle more flags.
11641
11642 2001-09-11  Ravi Pratap  <ravi@ximian.com>
11643
11644         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
11645         and not <=
11646         (Operator::Define): Re-write logic to get types by using the LookupType method
11647         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
11648         (Indexer::Define): Ditto.
11649         (Event::Define): Ditto.
11650         (Property::Define): Ditto.
11651         
11652 2001-09-10  Ravi Pratap  <ravi@ximian.com>
11653
11654         * class.cs (TypeContainer::Populate): Now define operators too. 
11655         (TypeContainer.Operators): New property to access the list of operators
11656         in a type.
11657         (Operator.OperatorMethodBuilder): New member to hold the method builder
11658         for the operator we are defining.
11659         (Operator::Define): Implement.
11660
11661 2001-09-10  Ravi Pratap  <ravi@ximian.com>
11662
11663         * class.cs (Event::Define): Make the prefixes of the accessor methods
11664         addOn_ and removeOn_ 
11665
11666         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
11667         of the location being passed in too. Ideally, this should go later since all
11668         error reporting should be done through the Report object.
11669
11670         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
11671         (Populate): Iterate thru the indexers we have and define them too.
11672         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
11673         for the get and set accessors.
11674         (Indexer::Define): Implement.
11675         
11676 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
11677
11678         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
11679         my previous implementation, did not work.
11680
11681         * typemanager.cs: Add a couple of missing types (the longs).
11682
11683         * literal.cs: Use TypeManager.bool_type instead of getting it.
11684
11685         * expression.cs (EventExpr): New kind of expressions.
11686         (Expressio::ExprClassFromMemberInfo): finish
11687
11688 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
11689
11690         * assign.cs: Emit stores to static fields differently.
11691
11692 2001-09-08  Ravi Pratap  <ravi@ximian.com>
11693
11694         * Merge in changes and adjust code to tackle conflicts. Backed out my
11695         code in Assign::Resolve ;-) 
11696
11697 2001-09-08  Ravi Pratap  <ravi@ximian.com>
11698
11699         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
11700         instead Report.Error and also pass in the location.
11701         (CSharpParser::Lexer): New readonly property to return the reference
11702         to the Tokenizer object.
11703         (declare_local_variables): Use Report.Error with location instead of plain 
11704         old error.
11705         (CheckDef): Ditto.
11706
11707         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
11708         (Operator.CheckBinaryOperator): Ditto.
11709
11710         * cs-parser.jay (operator_declarator): Update accordingly.
11711
11712         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
11713         (CheckBinaryOperator): Same here.
11714
11715         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
11716         on the name without any prefixes of namespace names etc. This is because we
11717         already might have something already fully qualified like 
11718         'System.Console.WriteLine'
11719
11720         * assign.cs (Resolve): Begin implementation. Stuck ;-)
11721
11722 2001-09-07  Ravi Pratap  <ravi@ximian.com>
11723
11724         * cs-tokenizer.cs (location): Return a string which also contains
11725         the file name.
11726
11727         * expression.cs (ElementAccess): New class for expressions of the
11728         type 'element access.'
11729         (BaseAccess): New class for expressions of the type 'base access.'
11730         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
11731         respectively.
11732         
11733         * cs-parser.jay (element_access): Implement action.
11734         (base_access): Implement actions.
11735         (checked_expression, unchecked_expression): Implement.
11736
11737         * cs-parser.jay (local_variable_type): Correct and implement.
11738         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
11739
11740         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
11741
11742         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
11743         name and the specifiers.
11744
11745         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
11746         
11747         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
11748         making them all public ;-)
11749
11750         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
11751         class anyways.
11752         
11753 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
11754
11755         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
11756         PropertyExprs.
11757         (FieldExpr, PropertyExprs): New resolved expressions.
11758         (SimpleName::MemberStaticCheck): Perform static checks for access
11759         to non-static fields on static methods. Maybe this should be
11760         generalized for MemberAccesses. 
11761         (SimpleName::ResolveSimpleName): More work on simple name
11762         resolution. 
11763
11764         * cs-parser.jay (primary_expression/qualified_identifier): track
11765         the parameter index.
11766
11767         * codegen.cs (CodeGen::Save): Catch save exception, report error.
11768         (EmitContext::EmitBoolExpression): Chain to expression generation
11769         instead of temporary hack.
11770         (::EmitStatementExpression): Put generic expression code generation.
11771
11772         * assign.cs (Assign::Emit): Implement variable assignments to
11773         local variables, parameters and fields.
11774
11775 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
11776
11777         * statement.cs (Block::GetVariableInfo): New method, returns the
11778         VariableInfo for a variable name in a block.
11779         (Block::GetVariableType): Implement in terms of GetVariableInfo
11780
11781         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
11782         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
11783
11784 2001-09-06  Ravi Pratap  <ravi@ximian.com>
11785
11786         * cs-parser.jay (operator_declaration): Continue on my quest : update
11787         to take attributes argument.
11788         (event_declaration): Ditto.
11789         (enum_declaration): Ditto.
11790         (indexer_declaration): Ditto.
11791         
11792         * class.cs (Operator::Operator): Update constructor accordingly.
11793         (Event::Event): Ditto.
11794
11795         * delegate.cs (Delegate::Delegate): Same here.
11796
11797         * enum.cs (Enum::Enum): Same here.
11798         
11799 2001-09-05  Ravi Pratap  <ravi@ximian.com>
11800
11801         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
11802
11803         * ../tests/cs0658.cs : New file to demonstrate error 0658.
11804
11805         * attribute.cs (Attributes): New class to encapsulate all attributes which were
11806         being passed around as an arraylist.
11807         (Attributes::AddAttribute): Method to add attribute sections.
11808
11809         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
11810         (struct_declaration): Update accordingly.
11811         (constant_declaration): Update.
11812         (field_declaration): Update.
11813         (method_header): Update.
11814         (fixed_parameter): Update.
11815         (parameter_array): Ditto.
11816         (property_declaration): Ditto.
11817         (destructor_declaration): Ditto.
11818         
11819         * class.cs (Struct::Struct): Update constructors accordingly.
11820         (Class::Class): Ditto.
11821         (Field::Field): Ditto.
11822         (Method::Method): Ditto.
11823         (Property::Property): Ditto.
11824         (TypeContainer::OptAttribute): update property's return type.
11825         
11826         * interface.cs (Interface.opt_attributes): New member.
11827         (Interface::Interface): Update to take the extra Attributes argument.
11828
11829         * parameter.cs (Parameter::Parameter): Ditto.
11830
11831         * constant.cs (Constant::Constant): Ditto.
11832
11833         * interface.cs (InterfaceMemberBase): New OptAttributes field.
11834         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
11835         the attributes as a parameter.
11836         (InterfaceProperty): Update constructor call.
11837         (InterfaceEvent): Ditto.
11838         (InterfaceMethod): Ditto.
11839         (InterfaceIndexer): Ditto.
11840
11841         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
11842         pass the attributes too.
11843         (interface_event_declaration): Ditto.
11844         (interface_property_declaration): Ditto.
11845         (interface_method_declaration): Ditto.
11846         (interface_declaration): Ditto.
11847
11848 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
11849
11850         * class.cs (Method::Define): Track the "static Main" definition to
11851         create an entry point. 
11852
11853         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
11854         EntryPoint if we find it. 
11855
11856         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
11857         (EmitContext::ig): Make this variable public.
11858
11859         * driver.cs: Make the default output file be the first file name
11860         with the .exe extension.  
11861
11862         Detect empty compilations
11863
11864         Handle various kinds of output targets.  Handle --target and
11865         rename -t to --dumper.
11866
11867         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
11868         methods inherited from Expression return now an Expression.  This
11869         will is used during the tree rewriting as we resolve them during
11870         semantic analysis.
11871
11872         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
11873         the spec.  Missing entirely is the information about
11874         accessability of elements of it.
11875
11876         (Expression::ExprClassFromMemberInfo): New constructor for
11877         Expressions that creates a fully initialized Expression based on
11878         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
11879         a Type.
11880
11881         (Invocation::Resolve): Begin implementing resolution of invocations.
11882         
11883         * literal.cs (StringLiteral):  Implement Emit.
11884
11885 2001-09-05  Ravi Pratap  <ravi@ximian.com>
11886
11887         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
11888         member.
11889         
11890 2001-09-04  Ravi Pratap  <ravi@ximian.com>
11891
11892         * cs-parser.jay (attribute_arguments): Implement actions.
11893         (attribute): Fix bug in production. Implement action.
11894         (attribute_list): Implement.
11895         (attribute_target): Implement.
11896         (attribute_target_specifier, opt_target_specifier): Implement
11897         (CheckAttributeTarget): New method to check if the attribute target
11898         is valid.
11899         (attribute_section): Implement.
11900         (opt_attributes): Implement.
11901
11902         * attribute.cs : New file to handle attributes.
11903         (Attribute): Class to hold attribute info.
11904
11905         * cs-parser.jay (opt_attribute_target_specifier): Remove production
11906         (attribute_section): Modify production to use 2 different rules to 
11907         achieve the same thing. 1 s/r conflict down !
11908         Clean out commented, useless, non-reducing dimension_separator rules.
11909         
11910         * class.cs (TypeContainer.attributes): New member to hold list
11911         of attributes for a type.
11912         (Struct::Struct): Modify to take one more argument, the attribute list.
11913         (Class::Class): Ditto.
11914         (Field::Field): Ditto.
11915         (Method::Method): Ditto.
11916         (Property::Property): Ditto.
11917         
11918         * cs-parser.jay (struct_declaration): Update constructor call to
11919         pass in the attributes too.
11920         (class_declaration): Ditto.
11921         (constant_declaration): Ditto.
11922         (field_declaration): Ditto.
11923         (method_header): Ditto.
11924         (fixed_parameter): Ditto.
11925         (parameter_array): Ditto.
11926         (property_declaration): Ditto.
11927
11928         * constant.cs (Constant::Constant): Update constructor similarly.
11929         Use System.Collections.
11930
11931         * parameter.cs (Parameter::Parameter): Update as above.
11932
11933 2001-09-02  Ravi Pratap  <ravi@ximian.com>
11934
11935         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
11936         (TypeContainer.delegates): New member to hold list of delegates.
11937
11938         * cs-parser.jay (delegate_declaration): Implement the action correctly 
11939         this time as I seem to be on crack ;-)
11940
11941 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
11942
11943         * rootcontext.cs (RootContext::IsNamespace): new function, used to
11944         tell whether an identifier represents a namespace.
11945
11946         * expression.cs (NamespaceExpr): A namespace expression, used only
11947         temporarly during expression resolution.
11948         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
11949         utility functions to resolve names on expressions.
11950
11951 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
11952
11953         * codegen.cs: Add hook for StatementExpressions. 
11954
11955         * class.cs: Fix inverted test for static flag in methods.
11956
11957 2001-09-02  Ravi Pratap  <ravi@ximian.com>
11958
11959         * class.cs (Operator::CheckUnaryOperator): Correct error number used
11960         to make it coincide with MS' number.
11961         (Operator::CheckBinaryOperator): Ditto.
11962
11963         * ../errors/errors.txt : Remove error numbers added earlier.
11964
11965         * ../errors/cs1019.cs : Test case for error # 1019
11966
11967         * ../errros/cs1020.cs : Test case for error # 1020
11968
11969         * cs-parser.jay : Clean out commented cruft.
11970         (dimension_separators, dimension_separator): Comment out. Ostensibly not
11971         used anywhere - non-reducing rule.
11972         (namespace_declarations): Non-reducing rule - comment out.
11973
11974         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
11975         with TypeContainer::AddEnum.
11976
11977         * delegate.cs : New file for delegate handling classes.
11978         (Delegate): Class for declaring delegates.
11979
11980         * makefile : Update.
11981
11982         * cs-parser.jay (delegate_declaration): Implement.
11983
11984 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
11985
11986         * class.cs (Event::Define): Implement.
11987         (Event.EventBuilder): New member.
11988
11989         * class.cs (TypeContainer::Populate): Update to define all enums and events
11990         we have.
11991         (Events): New property for the events arraylist we hold. Shouldn't we move to using
11992         readonly fields for all these cases ?
11993
11994 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
11995
11996         * class.cs (Property): Revamp to use the convention of making fields readonly.
11997         Accordingly modify code elsewhere.
11998
11999         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
12000         the Define method of the Property class.
12001
12002         * class.cs : Clean up applied patch and update references to variables etc. Fix 
12003         trivial bug.
12004         (TypeContainer::Populate): Update to define all the properties we have. Also
12005         define all enumerations.
12006
12007         * enum.cs (Define): Implement.
12008         
12009 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
12010
12011         * cs-parser.jay (overloadable_operator): The semantic value is an
12012         enum of the Operator class.
12013         (operator_declarator): Implement actions.
12014         (operator_declaration): Implement.
12015
12016         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
12017         validity of definitions.
12018         (Operator::CheckBinaryOperator): Static method to check for binary operators
12019         (TypeContainer::AddOperator): New method to add an operator to a type.
12020
12021         * cs-parser.jay (indexer_declaration): Added line to actually call the
12022         AddIndexer method so it gets added ;-)
12023
12024         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
12025         already taken care of by the MS compiler ?  
12026
12027 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
12028
12029         * class.cs (Operator): New class for operator declarations.
12030         (Operator::OpType): Enum for the various operators.
12031
12032 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
12033
12034         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
12035         ostensibly handle this in semantic analysis.
12036
12037         * cs-parser.jay (general_catch_clause): Comment out
12038         (specific_catch_clauses, specific_catch_clause): Ditto.
12039         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
12040         (catch_args, opt_catch_args): New productions.
12041         (catch_clause): Rewrite to use the new productions above
12042         (catch_clauses): Modify accordingly.
12043         (opt_catch_clauses): New production to use in try_statement
12044         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
12045         and re-write the code in the actions to extract the specific and
12046         general catch clauses by being a little smart ;-)
12047
12048         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
12049         Hooray, try and catch statements parse fine !
12050         
12051 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12052
12053         * statement.cs (Block::GetVariableType): Fix logic to extract the type
12054         string from the hashtable of variables.
12055
12056         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
12057         I end up making that mistake ;-)
12058         (catch_clauses): Fixed gross error which made Key and Value of the 
12059         DictionaryEntry the same : $1 !!
12060
12061 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12062
12063         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
12064
12065         * cs-parser.jay (event_declaration): Correct to remove the semicolon
12066         when the add and remove accessors are specified. 
12067
12068 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12069
12070         * cs-parser.jay (IndexerDeclaration): New helper class to hold
12071         information about indexer_declarator.
12072         (indexer_declarator): Implement actions.
12073         (parsing_indexer): New local boolean used to keep track of whether
12074         we are parsing indexers or properties. This is necessary because 
12075         implicit_parameters come into picture even for the get accessor in the 
12076         case of an indexer.
12077         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
12078
12079         * class.cs (Indexer): New class for indexer declarations.
12080         (TypeContainer::AddIndexer): New method to add an indexer to a type.
12081         (TypeContainer::indexers): New member to hold list of indexers for the
12082         type.
12083
12084 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
12085
12086         * cs-parser.jay (add_accessor_declaration): Implement action.
12087         (remove_accessor_declaration): Implement action.
12088         (event_accessors_declaration): Implement
12089         (variable_declarators): swap statements for first rule - trivial.
12090
12091         * class.cs (Event): New class to hold information about event
12092         declarations.
12093         (TypeContainer::AddEvent): New method to add an event to a type
12094         (TypeContainer::events): New member to hold list of events.
12095
12096         * cs-parser.jay (event_declaration): Implement actions.
12097
12098 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
12099
12100         * cs-parser.jay (dim_separators): Implement. Make it a string
12101         concatenating all the commas together, just as they appear.
12102         (opt_dim_separators): Modify accordingly
12103         (rank_specifiers): Update accordingly. Basically do the same
12104         thing - instead, collect the brackets here.
12105         (opt_rank_sepcifiers): Modify accordingly.
12106         (array_type): Modify to actually return the complete type string
12107         instead of ignoring the rank_specifiers.
12108         (expression_list): Implement to collect the expressions
12109         (variable_initializer): Implement. We make it a list of expressions
12110         essentially so that we can handle the array_initializer case neatly too.
12111         (variable_initializer_list): Implement.
12112         (array_initializer): Make it a list of variable_initializers
12113         (opt_array_initializer): Modify accordingly.
12114
12115         * expression.cs (New::NType): Add enumeration to help us
12116         keep track of whether we have an object/delegate creation
12117         or an array creation.
12118         (New:NewType, New::Rank, New::Indices, New::Initializers): New
12119         members to hold data about array creation.
12120         (New:New): Modify to update NewType
12121         (New:New): New Overloaded contructor for the array creation
12122         case.
12123
12124         * cs-parser.jay (array_creation_expression): Implement to call
12125         the overloaded New constructor.
12126         
12127 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
12128
12129         * class.cs (TypeContainer::Constructors): Return member
12130         constructors instead of returning null.
12131
12132 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
12133
12134         * typemanager.cs (InitCoreTypes): Initialize the various core
12135         types after we have populated the type manager with the user
12136         defined types (this distinction will be important later while
12137         compiling corlib.dll)
12138
12139         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
12140         on Expression Classification.  Now all expressions have a method
12141         `Resolve' and a method `Emit'.
12142
12143         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
12144         generation from working.     Also add some temporary debugging
12145         code. 
12146         
12147 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
12148
12149         * codegen.cs: Lots of code generation pieces.  This is only the
12150         beginning, will continue tomorrow with more touches of polish.  We
12151         handle the fundamentals of if, while, do, for, return.  Others are
12152         trickier and I need to start working on invocations soon.
12153         
12154         * gen-treedump.cs: Bug fix, use s.Increment here instead of
12155         s.InitStatement. 
12156
12157         * codegen.cs (EmitContext): New struct, used during code
12158         emission to keep a context.   Most of the code generation will be
12159         here. 
12160
12161         * cs-parser.jay: Add embedded blocks to the list of statements of
12162         this block.  So code generation proceeds in a top down fashion.
12163
12164 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
12165
12166         * statement.cs: Add support for multiple child blocks.
12167
12168 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
12169
12170         * codegen.cs (EmitCode): New function, will emit the code for a
12171         Block of code given a TypeContainer and its ILGenerator. 
12172
12173         * statement.cs (Block): Standard public readonly optimization.
12174         (Block::Block constructors): Link children. 
12175         (Block::Child): Child Linker.
12176         (Block::EmitVariables): Emits IL variable declarations.
12177
12178         * class.cs: Drop support for MethodGroups here, delay until
12179         Semantic Analysis.
12180         (Method::): Applied the same simplification that I did before, and
12181         move from Properties to public readonly fields.
12182         (Method::ParameterTypes): Returns the parameter types for the
12183         function, and implements a cache that will be useful later when I
12184         do error checking and the semantic analysis on the methods is
12185         performed.
12186         (Constructor::GetCallingConvention): Renamed from CallingConvetion
12187         and made a method, optional argument tells whether this is a class
12188         or a structure to apply the `has-this' bit.
12189         (Method::GetCallingConvention): Implement, returns the calling
12190         convention. 
12191         (Method::Define): Defines the type, a second pass is performed
12192         later to populate the methods.
12193
12194         (Constructor::ParameterTypes): implement a cache similar to the
12195         one on Method::ParameterTypes, useful later when we do semantic
12196         analysis. 
12197
12198         (TypeContainer::EmitMethod):  New method.  Emits methods.
12199
12200         * expression.cs: Removed MethodGroup class from here.
12201         
12202         * parameter.cs (Parameters::GetCallingConvention): new method.
12203
12204 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
12205
12206         * class.cs (TypeContainer::Populate): Drop RootContext from the
12207         argument. 
12208
12209         (Constructor::CallingConvention): Returns the calling convention.
12210         (Constructor::ParameterTypes): Returns the constructor parameter
12211         types. 
12212         
12213         (TypeContainer::AddConstructor): Keep track of default constructor
12214         and the default static constructor.
12215
12216         (Constructor::) Another class that starts using `public readonly'
12217         instead of properties. 
12218
12219         (Constructor::IsDefault): Whether this is a default constructor. 
12220
12221         (Field::) use readonly public fields instead of properties also.
12222
12223         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
12224         track of static constructors;  If none is used, turn on
12225         BeforeFieldInit in the TypeAttributes. 
12226
12227         * cs-parser.jay (opt_argument_list): now the return can be null
12228         for the cases where there are no arguments. 
12229
12230         (constructor_declarator): If there is no implicit `base' or
12231         `this', then invoke the default parent constructor. 
12232         
12233         * modifiers.cs (MethodAttr): New static function maps a set of
12234         modifiers flags into a MethodAttributes enum
12235         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
12236         MethodAttr, TypeAttr to represent the various mappings where the
12237         modifiers are used.
12238         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
12239
12240 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
12241
12242         * parameter.cs (GetParameterInfo): Fix bug where there would be no
12243         method arguments.
12244
12245         * interface.cs (PopulateIndexer): Implemented the code generator
12246         for interface indexers.
12247
12248 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
12249
12250         * interface.cs (InterfaceMemberBase): Now we track the new status
12251         here.  
12252
12253         (PopulateProperty): Implement property population.  Woohoo!  Got
12254         Methods and Properties going today. 
12255
12256         Removed all the properties for interfaces, and replaced them with
12257         `public readonly' fields. 
12258
12259 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
12260
12261         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
12262         initialize their hashtables/arraylists only when they are needed
12263         instead of doing this always.
12264
12265         * parameter.cs: Handle refs and out parameters.
12266
12267         * cs-parser.jay: Use an ArrayList to construct the arguments
12268         instead of the ParameterCollection, and then cast that to a
12269         Parameter[] array.
12270
12271         * parameter.cs: Drop the use of ParameterCollection and use
12272         instead arrays of Parameters.
12273
12274         (GetParameterInfo): Use the Type, not the Name when resolving
12275         types. 
12276
12277 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
12278
12279         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
12280         and instead use public readonly fields.
12281
12282         * class.cs: Put back walking code for type containers.
12283
12284 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
12285
12286         * class.cs (MakeConstant): Code to define constants.
12287
12288         * rootcontext.cs (LookupType): New function.  Used to locate types 
12289
12290         
12291 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
12292
12293         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
12294         this System.Reflection code is.  Kudos to Microsoft
12295         
12296         * typemanager.cs: Implement a type cache and avoid loading all
12297         types at boot time.  Wrap in LookupType the internals.  This made
12298         the compiler so much faster.  Wow.  I rule!
12299         
12300         * driver.cs: Make sure we always load mscorlib first (for
12301         debugging purposes, nothing really important).
12302
12303         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
12304         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
12305
12306         * rootcontext.cs: Lookup types on their namespace;  Lookup types
12307         on namespaces that have been imported using the `using' keyword.
12308
12309         * class.cs (TypeContainer::TypeAttr): Virtualize.
12310         (Class::TypeAttr): Return attributes suitable for this bad boy.
12311         (Struct::TypeAttr): ditto.
12312         Handle nested classes.
12313         (TypeContainer::) Remove all the type visiting code, it is now
12314         replaced with the rootcontext.cs code
12315
12316         * rootcontext.cs (GetClassBases): Added support for structs. 
12317
12318 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
12319
12320         * interface.cs, statement.cs, class.cs, parameter.cs,
12321         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
12322         Drop use of TypeRefs, and use strings instead.
12323
12324 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
12325
12326         * rootcontext.cs: 
12327
12328         * class.cs (Struct::Struct): set the SEALED flags after
12329         checking the modifiers.
12330         (TypeContainer::TypeAttr): new property, returns the
12331         TypeAttributes for a class.  
12332
12333         * cs-parser.jay (type_list): Oops, list production was creating a
12334         new list of base types.
12335
12336         * rootcontext.cs (StdLib): New property.
12337         (GetInterfaceTypeByName): returns an interface by type name, and
12338         encapsulates error handling here.
12339         (GetInterfaces): simplified.
12340         (ResolveTree): Encapsulated all the tree resolution here.
12341         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
12342         types. 
12343         
12344         * driver.cs: Add support for --nostdlib, to avoid loading the
12345         default assemblies.
12346         (Main): Do not put tree resolution here. 
12347
12348         * rootcontext.cs: Beginning of the class resolution.
12349
12350 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
12351
12352         * rootcontext.cs: Provide better error reporting. 
12353
12354         * cs-parser.jay (interface_base): set our $$ to be interfaces.
12355
12356         * rootcontext.cs (CreateInterface): Handle the case where there
12357         are no parent interfaces.
12358         
12359         (CloseTypes): Routine to flush types at the end.
12360         (CreateInterface): Track types.
12361         (GetInterfaces): Returns an array of Types from the list of
12362         defined interfaces.
12363
12364         * typemanager.c (AddUserType): Mechanism to track user types (puts
12365         the type on the global type hash, and allows us to close it at the
12366         end). 
12367         
12368 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
12369
12370         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
12371         RecordInterface instead.
12372
12373         * cs-parser.jay: Updated to reflect changes above.
12374
12375         * decl.cs (Definition): Keep track of the TypeBuilder type that
12376         represents this type here.  Not sure we will use it in the long
12377         run, but wont hurt for now.
12378
12379         * driver.cs: Smaller changes to accomodate the new code.
12380
12381         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
12382         when done. 
12383
12384         * rootcontext.cs (CreateInterface):  New method, used to create
12385         the System.TypeBuilder type for interfaces.
12386         (ResolveInterfaces): new entry point to resolve the interface
12387         hierarchy. 
12388         (CodeGen): Property, used to keep track of the code generator.
12389
12390 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
12391
12392         * cs-parser.jay: Add a second production for delegate_declaration
12393         with `VOID'.
12394
12395         (enum_body): Put an opt_comma here instead of putting it on
12396         enum_body or enum_member_declarations so we can handle trailing
12397         commas on enumeration members.  Gets rid of a shift/reduce.
12398         
12399         (type_list): Need a COMMA in the middle.
12400
12401         (indexer_declaration): Tell tokenizer to recognize get/set
12402
12403         * Remove old targets.
12404
12405         * Re-add the parser target.
12406
12407 2001-07-13  Simon Cozens <simon@simon-cozens.org>
12408
12409         * cs-parser.jay: Add precendence rules for a number of operators
12410         ot reduce the number of shift/reduce conflicts in the grammar.
12411         
12412 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
12413
12414         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
12415         and put it here.
12416
12417         Get rid of old crufty code.
12418
12419         * rootcontext.cs: Use this to keep track of the parsed
12420         representation and the defined types available to the program. 
12421
12422         * gen-treedump.cs: adjust for new convention.
12423
12424         * type.cs: Split out the type manager, and the assembly builder
12425         from here. 
12426
12427         * typemanager.cs: the type manager will live here now.
12428
12429         * cil-codegen.cs: And the code generator here. 
12430
12431 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
12432
12433         * makefile: Fixed up for easy making.
12434
12435 2001-07-13  Simon Cozens <simon@simon-cozens.org>
12436
12437         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
12438         the 
12439
12440         (unary_expression): Expand pre_increment_expression and
12441         post_decrement_expression to reduce a shift/reduce.
12442
12443 2001-07-11  Simon Cozens
12444
12445         * cs-tokenizer.cs: Hex numbers should begin with a 0.
12446
12447         Improve allow_keyword_as_indent name.
12448
12449 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
12450
12451         * Adjustments for Beta2. 
12452
12453 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
12454
12455         * decl.cs: Added `Define' abstract method.
12456         (InTransit): new property, used to catch recursive definitions. 
12457
12458         * interface.cs: Implement `Define'. 
12459
12460         * modifiers.cs: Map Modifiers.constants to
12461         System.Reflection.TypeAttribute flags.
12462
12463         * class.cs: Keep track of types and user-defined types.
12464         (BuilderInit): New method for creating an assembly
12465         (ResolveType): New function to launch the resolution process, only
12466         used by interfaces for now.
12467
12468         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
12469         that are inserted into the name space. 
12470
12471 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
12472
12473         * ARGH.  I have screwed up my tree so many times due to the use of
12474         rsync rather than using CVS.  Going to fix this at once. 
12475
12476         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
12477         load types.
12478
12479 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
12480
12481         * Experiment successful: Use System.Type rather that our own
12482         version of Type.  
12483
12484 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
12485
12486         * cs-parser.jay: Removed nsAliases from here.
12487
12488         Use new namespaces, handle `using XXX;' 
12489
12490         * namespace.cs: Reimplemented namespace handling, use a recursive
12491         definition of the class.  Now we can keep track of using clauses
12492         and catch invalid using clauses.
12493
12494 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
12495
12496         * gen-treedump.cs: Adapted for all the renaming.
12497
12498         * expression.cs (Expression): this class now has a Type property
12499         which returns an expression Type.
12500
12501         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
12502         `Type', as this has a different meaning now in the base
12503
12504 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
12505
12506         * interface.cs, class.cs: Removed from all the sources the
12507         references to signature computation, as we can not do method
12508         signature computation during the parsing time, as we are not
12509         trying to solve at that point distinguishing:
12510
12511         class X {
12512                 void a (Blah x) {}
12513                 void a (NS.Blah x) {}
12514         }
12515
12516         Which depending on the context might be valid or not, as we do not
12517         know if Blah is the same thing as NS.Blah at that point.
12518
12519         * Redid everything so the code uses TypeRefs now instead of
12520         Types.  TypeRefs are just temporary type placeholders, that need
12521         to be resolved.  They initially have a pointer to a string and the
12522         current scope in which they are used.  This is used later by the
12523         compiler to resolve the reference to an actual Type. 
12524
12525         * DeclSpace is no longer a CIR.Type, and neither are
12526         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
12527         are all DeclSpaces, but no Types. 
12528
12529         * type.cs (TypeRefManager): This implements the TypeRef manager,
12530         which keeps track of all the types that need to be resolved after
12531         the parsing has finished. 
12532
12533 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
12534
12535         * ARGH.  We are going to have to store `foreach' as a class rather
12536         than resolving it, as we need to verify error 1579 after name
12537         resolution.   *OR* we could keep a flag that says `This request to
12538         IEnumerator comes from a foreach statement' which we can then use
12539         to generate the error.
12540
12541 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
12542
12543         * class.cs (TypeContainer.AddMethod): we now add methods to the
12544         MethodGroup instead of the method hashtable.  
12545
12546         * expression.cs: Add MethodGroup abstraction, which gets us one
12547         step closer to the specification in the way we handle method
12548         declarations.  
12549
12550         * cs-parser.jay (primary_expression): qualified_identifier now
12551         tried to match up an identifier to a local variable reference or
12552         to a parameter reference.
12553
12554         current_local_parameters is now a parser global variable that
12555         points to the current parameters for the block, used during name
12556         lookup.
12557
12558         (property_declaration): Now creates an implicit `value' argument to
12559         the set accessor.
12560
12561 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
12562
12563         * parameter.cs: Do not use `param' arguments as part of the
12564         signature, per the spec.
12565
12566 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
12567
12568         * decl.cs: Base class for classes, structs and interfaces.  This
12569         is the "Declaration Space" 
12570
12571         * cs-parser.jay: Use CheckDef for checking declaration errors
12572         instead of having one on each function.
12573
12574         * class.cs: Factor out some code for handling error handling in
12575         accordance to the "Declarations" section in the "Basic Concepts"
12576         chapter in the ECMA C# spec.
12577
12578         * interface.cs: Make all interface member classes derive from
12579         InterfaceMemberBase.
12580
12581 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
12582
12583         * Many things: all interfaces are parsed and generated in
12584         gen-treedump.  Support for member variables, constructors,
12585         destructors, properties, constants is there.
12586
12587         Beginning of the IL backend, but very little done, just there for
12588         testing purposes. 
12589
12590 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
12591
12592         * cs-parser.jay: Fix labeled statement.
12593
12594         * cs-tokenizer.cs (escape): Escape " and ' always.
12595         ref_line, ref_name: keep track of the line/filename as instructed
12596         by #line by the compiler.
12597         Parse #line.
12598
12599 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
12600
12601         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
12602         to match the values in System.CodeDOM.
12603
12604         Divid renamed to Divide.
12605
12606         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
12607         statements. 
12608         (Statements.set): remove.
12609
12610         * System.CodeDOM/CodeCatchClause.cs: always have a valid
12611         statements. 
12612
12613         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
12614         falseStatements always have valid values. 
12615
12616         * cs-parser.jay: Use System.CodeDOM now.
12617