2005-07-18 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / ChangeLog
1 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2
3         Fix #57707
4         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
5         AssemblyCultureAttribute is not used on executable.
6
7         * rootcontext.cs,
8         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
9
10 2005-07-16  Raja R Harinath  <rharinath@novell.com>
11
12         Fix #60638.
13         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
14         New.  Reports CS0252/CS0253.
15         Mostly taken from preliminary patch by Duncak Mak.
16         (Binary.DoResolveOperator): Store results of operator lookup.
17         Use them to detect if we need to warn about unintended reference
18         comparisons.
19
20 2005-07-15  Raja R Harinath  <rharinath@novell.com>
21
22         Fix #72969.
23         * namespace.cs (Namespace.Lookup): Add back location parameter.
24         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
25         * delegate.cs, ecore.cs, expression.cs: Update to changes.
26
27         * codegen.cs (EmitContext.DeclSpace): Make readonly.
28         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
29         (Namespace.LookupType): ... this.
30         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
31         of namespaces.
32         * typemanager.cs (LookupTypeReflection): Remove buggy code that
33         purported to handle pointers.
34         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
35         CoreLookupType.
36
37 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
38
39         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
40         type as namespace.
41
42 2005-07-15  Raja R Harinath  <rharinath@novell.com>
43
44         * namespace.cs (Namespace.Lookup): Drop location parameter.
45         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
46         (NamespaceEntry.Lookup): ... this.
47         (NamespaceEntry.Error_AmbiguousTypeReference):
48         Move here from DeclSpace.
49         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
50         names ...
51         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
52         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
53         Move to NamespaceEntry.
54         * delegate.cs, expression.cs: Update to changes.
55
56 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
57
58         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
59         CheckAttributeType and refactored.
60         (Attribute.ResolvePossibleAttributeType): Changed to reuse
61         ResolveAsTypeTerminal error handling.
62         (ResolveAsTypeTerminal): Introduced because of global attributes extra
63         handling.
64         (GetSignatureForError): Print errors in same way.
65
66         * class.cs,
67         * codegen.cs: Reflect attribute GetSignatureForError change.
68
69         * ecore.cs,
70         * expression.cs: Add silent parameter to ResolveAsTypeStep.
71
72         * namespace.cs (UsingEntry): Refactored to make fields private.
73
74         * assign.cs,
75         statement.cs: Error_UnexpectedKind has extra parameter.
76
77 2005-07-14  Raja R Harinath  <rharinath@novell.com>
78
79         * ecore.cs (IAlias): Remove.
80         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
81         that implement the interface.
82         * namespace.cs (Namespace): Likewise.
83         (Namespace.declspaces): Renamed from 'defined_names'.
84         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
85         DeclSpace instead of an IAlias.
86         * tree.cs (Tree.AddDecl): Update.
87
88 2005-07-12  Raja R Harinath  <rharinath@novell.com>
89
90         * statement.cs (Block.Flags); Remove HasVarargs.
91         (Block.HasVarargs): Move to ToplevelBlock.
92         (Block.ThisVariable, Block.AddThisVariable): Likewise.
93         (Block.Variables): Make protected.  Initialize variable hashtable
94         if necessary.
95         (Block.AddVariable): Update.
96         (Block.Resolve): Update to changes.
97         (ToplevelBlock.HasVarargs): New boolean.
98         (ToplevelBlock.ThisVariable): Move here from Block.
99         (ToplevelBlock.AddThisVariable): Likewise.
100         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
101         * expression.cs (This.ResolveBase): Update to changes.
102         (ArglistAccess.DoResolve): Likewise.
103
104 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
105
106         Fix #75321
107         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
108
109         * class.cs (TypeContainer.VerifyMembers): Distinguish between
110         not used and not used & assigned.
111         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
112
113 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
114
115         Fix #75053
116         * expression.cs (Is.DoResolve): null is never provided type.
117
118 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
119
120         Fix #52496
121         * cs-parser.jay: Less strict event error rule to catch more errors.
122
123 2005-07-08  Martin Baulig  <martin@ximian.com>
124
125         Fix test-iter-10.cs - distinguish whether we `yield' in a property
126         gettter (allowed) or setter (not allowed).
127
128         * class.cs (Accessor): Implement IIteratorContainer.
129         (Accessor.Yields): New public field.
130         (PropertyBase.PropertyMethod.Define): Handle iterators on a
131         per-accessor basis.
132
133         * cs-parser.jay
134         (get_accessor_declaration, set_accessor_declaration): Set the
135         `yields' flag on the accessor, not the property.
136         (property_declaration): Do the iterators check on a per-accessor
137         basis and not for the whole property.
138
139 2005-07-08  Martin Baulig  <martin@ximian.com>
140
141         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
142         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
143
144 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
145
146         Fix #74975
147         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
148         (ExtractSecurityPermissionSet): Cope with self referencing security
149         attributes properly.
150
151         * driver.cs (SetOutputFile): Made public property OutputFile.
152
153 2005-07-07  Raja R Harinath  <rharinath@novell.com>
154
155         Fix #75486.
156         * class.cs (TypeContainer.first_nonstatic_field): Rename from
157         has_nonstatic_fields.  Make into a FieldBase pointer.
158         (TypeContainer.AddField): Add CS0282 check.
159         (TypeContainer.EmitType): Update.
160
161 2005-07-06  Miguel de Icaza  <miguel@novell.com>
162
163         * cs-tokenizer.cs (consume_identifier): Do not create strings to
164         compare if they start with __.
165
166 2005-07-06  Raja R Harinath  <rharinath@novell.com>
167
168         * statement.cs (Switch.SwitchGoverningType): Only look at
169         UserCasts that don't need implicit standard conversions to one of
170         the allowed switch types (Fixes test-322.cs).
171         (LocalInfo.Resolve): Re-enable sanity-test.
172
173 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
174
175         * cs-tokenizer.cs (consume_identifier): Detect double undescores
176         
177         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
178         
179         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
180
181 2005-07-06  Raja R Harinath  <rharinath@novell.com>
182
183         Fix #75472.
184         * ecore.cs (SimpleName.GetSignatureForError): Add.
185         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
186         (MemberAccess.GetSignatureForError): Add.
187
188 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
189  
190         The big error and warning messages review.
191         
192         * anonymous.cs,
193         * assign.cs,
194         * attribute.cs,
195         * class.cs,
196         * codegen.cs,
197         * convert.cs,
198         * cs-parser.jay,
199         * cs-tokenizer.cs,
200         * decl.cs,
201         * delegate.cs,
202         * doc.cs,
203         * driver.cs,
204         * ecore.cs,
205         * enum.cs,
206         * expression.cs,
207         * flowanalysis.cs,
208         * iterators.cs,
209         * literal.cs,
210         * location.cs,
211         * modifiers.cs,
212         * namespace.cs,
213         * parameter.cs,
214         * pending.cs,
215         * report.cs,
216         * rootcontext.cs,
217         * statement.cs,
218         * support.cs,
219         * tree.cs,
220         * typemanager.cs: Updated.
221         
222         * class.cs: (MethodCore.SetYields): Moved here to share.
223         (PropertyMethod.Define): Moved iterator setup here.
224         
225         * iterators.cs: Add orig_method to have full access to parent
226         container.
227
228 2005-07-05  Raja R Harinath  <rharinath@novell.com>
229
230         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
231         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
232         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
233         variable of struct type.
234         * expression.cs (Unary.ResolveOperator): Update to change.
235         (Indirection.VerifyFixed): Likewise.
236         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
237         (ParameterReference.VerifyFixed): Value parameters are fixed.
238         (This.VerifyFixed): Treat 'this' as a value parameter.
239         * statement.cs (LocalInfo.IsFixed): Remove.
240
241 2005-07-01  Martin Baulig  <martin@ximian.com>
242
243         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
244         `ec.EmitThis ()' to get the correct scope.
245
246 2005-07-01  Martin Baulig  <martin@ximian.com>
247
248         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
249         instance is a ParameterReference; fixes #75299.
250
251 2005-07-01  Martin Baulig  <martin@ximian.com>
252
253         Reverted Marek's latest patch (r46725):
254         - it contains structural changes which are neither mentioned in
255           the ChangeLog nor explained anywhere; for example the additional
256           argument of EmitContext's and Iterator's .ctor's and the
257           TypeContainer.DefineMembers() change.
258         - structural changes like this should go in in seperate patches
259           and not be hidden in a huge patch which just seems to affect
260           warnings and errors.
261           a big and hard to understand patch.
262         - it breaks iterators and causes regressions, for instance in
263           test-iter-03.cs.      
264
265 2005-06-30  Raja R Harinath  <rharinath@novell.com>
266
267         Fix #75412.
268         * expression.cs (Indexers.map): Remove.
269         (Indexers.Append): Filter out inaccessible setters and getters.
270         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
271
272         Fix #75283.
273         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
274         Refactored from ...
275         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
276         (FieldExpr.Emit, PropertyExpr.Emit): Update.
277         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
278         * expression.cs (Invocation.EmitCall): Add CS0120 check.
279
280 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
281
282         Fix #75322
283         * class.cs (FieldBase.GetInitializerExpression): One more field
284         for backup.
285
286 2005-06-28  Miguel de Icaza  <miguel@novell.com>
287
288         * pending.cs: Do not define a proxy if the base method is virtual,
289         it will be picked up by the runtime (bug 75270).
290
291 2005-06-08  Martin Baulig  <martin@ximian.com>
292
293         The big Iterators rewrite :-)
294
295         * iterators.cs: Rewrite this to use the anonymous methods framework.
296
297         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
298         before the TypeContainers; see 2test-21.cs.
299
300         * class.cs
301         (TypeContainer.DefineType): Don't create a new EmitContext if we
302         already have one (this only happens if we're an Iterator).
303         (TypeContainer.Define): Also call Define() on all our iterators.
304         (Method.CreateEmitContext): Added support for iterators.
305
306         * anonymous.cs
307         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
308         (AnonymousContainer.CreateMethodHost): Moved here from
309         AnonymousMethod and made abstract.
310         (AnonymousContainer.CreateScopeType): New abstract method.
311         (AnonymousContainer.IsIterator): New public property.
312         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
313         get the ScopeTypeBuilder rather than manually defining it here. 
314         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
315         iterators here.
316
317         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
318         before RootContext.DefineTypes().
319
320         * codegen.cs (EmitContext.RemapToProxy): Removed.
321         (EmitContext.CurrentAnonymousMethod): Changed type from
322         AnonymousMethod -> AnonymousContainer.
323         (EmitContext.ResolveTopBlock): Protect from being called twice.
324         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
325         (EmitContext.EmitThis): Removed the iterators hacks; use the
326         anonymous methods framework for that.
327
328         * statement.cs
329         (ToplevelBlock.Container): Make this a property, not a field.
330         (ToplevelBlock.ReParent): New public method; move the
331         ToplevelBlock into a new container.
332         (Foreach.TemporaryVariable): Simplify.
333
334 2005-06-05  Martin Baulig  <martin@ximian.com>
335
336         * statement.cs (LocalInfo.CompilerGenerated): New flag.
337         (Block.AddTemporaryVariable): New public method; creates a new
338         `LocalInfo' for a temporary variable.
339         (Block.EmitMeta): Create the LocalBuilders for all the temporary
340         variables here.
341         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
342         non-iterator variables.
343
344 2005-06-05  Martin Baulig  <martin@ximian.com>
345
346         * statement.cs (Foreach.TemporaryVariable): Create the
347         LocalBuilder in the Emit phase and not in Resolve since in some
348         situations, we don't have an ILGenerator during Resolve; see
349         2test-19.cs for an example.
350
351 2005-06-04  Martin Baulig  <martin@ximian.com>
352
353         **** Merged r45395 from GCS ****
354
355         The big Foreach rewrite - Part II.
356
357         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
358         with `PropertyInfo ienumerator_getcurrent'.
359
360         * codegen.cs (VariableStorage): Removed.
361
362         * statement.cs
363         (Foreach): Derive from Statement, not ExceptionStatement.
364         (Foreach.CollectionForeach): New nested class.  Moved all the code
365         dealing with collection foreach here.
366         (Foreach.ForeachHelperMethods): Removed.
367         (Foreach.TemporaryVariable): Implement IMemoryLocation.
368
369 2005-05-23  Martin Baulig  <martin@ximian.com>
370
371         * statement.cs (Try.DoResolve): Don't create a `finally' if we
372         don't need to.  Fix #75014.
373
374 2005-05-20  Martin Baulig  <martin@ximian.com>
375
376         Merged r44808 from GMCS.
377
378         * class.cs (TypeContainer.CircularDepException): Removed.
379         (TypeContainer.DefineType): Removed the `InTransit' stuff.
380         (TypeContainer.CheckRecursiveDefinition): Check for circular class
381         (CS0146) and interface (CS0529) dependencies here.
382
383 2005-06-21  Raja R Harinath  <rharinath@novell.com>
384
385         * expression.cs (Invocation.EmitCall): Fix initialization
386         'this_call' to reflect current behaviour.  Fix indentation.
387
388         * convert.cs (FindMostEncompassedType): Add two trivial special
389         cases (number_of_types == 0 || number_of_types == 1).
390         (FindMostEncompasingType): Likewise.
391
392 2005-06-17  Raja R Harinath  <rharinath@novell.com>
393
394         Some cleanups preparing for the fix of #75283.
395         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
396         error testing.
397         (EventExpr.InstanceResolve): Likewise.
398         (EventExpr.DoResolve): Remove redundant checks.
399
400 2005-06-10  Duncan Mak  <duncan@novell.com>
401
402         * cs-tokenizer.cs (process_directives): New flag for controlling
403         the processing of preprocessor directives.
404         (x_token): After seeing a '#', return Token.NONE instead of going
405         to handle_preprocessing_directive() when not processing
406         directives. This avoids unnecessary processing during the token peek in
407         is_punct().
408
409         This fixes #74939.
410
411         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
412         the existing error reporting methods instead of Report.Error.
413
414         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
415         after Raja's rewrite.
416
417 2005-06-08  Miguel de Icaza  <miguel@novell.com>
418
419         * class.cs: Small fix.
420
421 2005-06-08  Raja R Harinath  <rharinath@novell.com>
422
423         Fix #75160.
424         * class.cs (GetPartialBases): Fix return value check of
425         part.GetClassBases.
426
427 2005-06-07  Raja R Harinath  <rharinath@novell.com>
428
429         Ensure that partial classes are registered in their enclosing
430         namespace.  Initial part of fix of #75160.
431         * tree.cs (Tree.RecordDecl): Add new namespace argument.
432         Register declspace with namespace here, not in
433         DeclSpace.RecordDecl.
434         * cs-parser.jay: Pass namespace to RecordDecl.
435         * class.cs (PartialContainer.Create): Likewise.
436         (ClassPart.DefineType): New sanity-check.  Throws an exception if
437         called.
438         * decl.cs (Declspace.RecordDecl): Remove.
439         * namespace.cs (NamespaceEntry.DefineName): Remove.
440
441 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
442
443         * rootcontext.cs: Reset TargetExt as well.
444
445 2005-06-03  Raja R Harinath  <rharinath@novell.com>
446
447         * ecore.cs (Expression.Resolve): Emit CS0654 error when
448         -langversion:ISO-1.
449
450 2005-06-02  Raja R Harinath  <rharinath@novell.com>
451
452         Fix #75080, cs0119.cs.
453         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
454         of ...
455         (Expression.Resolve): ... this.  Use it.  Remove bogus code
456         allowing ExprClass.Type and ExprClass.Namespace for
457         ResolveFlags.VariableOrValue.
458         (Expression.Resolve) [1-argument variant]: Change default resolve
459         flags based on language version.
460         (Expression.Error_UnexpectedKind): Use a simple string array
461         rather than an ArrayList.
462         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
463         not ExprClass.Type.
464         (TypeOfVoid.DoResolve): Likewise.
465         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
466         flags argument -- it always has the same value.
467
468 2005-05-31  Raja R Harinath  <rharinath@novell.com>
469
470         Fix #75081.
471         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
472         Use it in the error message.
473         * assign.cs, expression.cs, statement.cs: Update.
474
475 2005-05-30  Raja R Harinath  <rharinath@novell.com>
476
477         Fix #75088.
478         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
479         the "almostMatchedMember" case too.
480         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
481         that failed the accessibility checks to 'almost_match'.
482
483 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
484
485         * attribute.cs: Use internal MethodBuilder methods to set
486         ExactSpelling and SetLastError on PInvoke methods, instead
487         of passing them via charset.  Fixes #75060.
488
489 2005-05-27  Raja R Harinath  <rharinath@novell.com>
490
491         * parameter.cs (Parameter): Remove TODO comment.
492         (Parameter.DefineParameter): Remove Location parameter.
493         (Parameters.LabelParameters): Likewise.
494         * class.cs (Constructor.Emit): Update to change.
495         (MethodData.Emit): Likewise.
496         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
497         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
498
499 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
500
501         * parameter.cs,
502           Removed Parameters.Location and added Parameter.Location instead.
503           Removed Location parameter from Emit() and GetSignature().
504         * anonymous.cs,
505           class.cs,
506           cs-parser.jay,
507           delegate.cs,
508           iterators.cs,
509           statement.cs :
510           Modified all related calls.
511
512 2005-05-26  Raja R Harinath  <rharinath@novell.com>
513
514         Improve user-defined conversion handling.
515         * convert.cs (GetConversionOperators): Rewrite.  Return only the
516         applicable operators.
517         (AddConversionOperators): New.  Helper for GetConversionOperators.
518         (FindMostEncompassedType, FindMostEncompassingType): Verify that
519         there is only one most encompassed/encompassing type.
520         (FindMostSpecificSource, FindMostSpecificTarget): Remove
521         "applicable operator" handling.
522         (UserConversion): Move cache here from GetConversionOperators.
523         Directly cache the chosen operator, rather than the whole
524         MethodGroup.
525         (ExplicitNumericConversion): Fix buggy implementation of Decimal
526         case.  Allow conversion of decimal to sbyte and byte too.
527         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
528         New static methods.  Used to avoid allocating EmptyExpressions in
529         convert.cs.
530
531 2005-05-24  Duncan Mak  <duncan@novell.com>
532
533         * ecore.cs (CastFromDecimal): New class for casting a decimal to
534         another class, used in Convert.ExplicitNumericConversion.
535         (CastToDecimal): New class, similar to above, but casts to
536         System.Decimal, used in Convert.ImplicitNumericConversion and also
537         in explicit convesion from double/float to decimal.
538
539         * convert.cs (ImplicitNumericConversion): Handle implicit
540         conversions to System.Decimal.
541         (ExplicitNumericConversion): handle explicit conversions to
542         System.Decimal.
543
544         This fixes #68711.
545         
546 2005-05-20  Miguel de Icaza  <miguel@novell.com>
547
548         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
549         know the type at this stage, just break through.   Fixes #75008 
550
551 2005-05-19  Martin Baulig  <martin@ximian.com>
552
553         * delegate.cs
554         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
555         to disable error reporting.
556
557         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
558         here since we don't want to report an error; see the new test-336.cs.
559
560 2005-05-19  Raja R Harinath  <rharinath@novell.com>
561
562         * statement.cs (ToplevelBlock.GetParameterReference)
563         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
564         Move here from class Block.
565         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
566         * expression.cs (ParameterReference.DoResolveBase): Likewise.
567
568 2005-05-18  Martin Baulig  <martin@ximian.com>
569
570         Fix #74978.
571
572         * flowanalysis.cs
573         (FlowBranching.Reachability): Add non-static public And() and Or()
574         methods.
575         (FlowBranchingSwitch): New class; do the `break_origins' thing
576         like in FlowBranchingLoop.
577         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
578         reachability, not just locals and parameters.
579         (FlowBranching.MergeChild): Remove some of the hacks for loop and
580         switch; MergeBreakOrigins() now takes care of that.
581
582 2005-05-18  Martin Baulig  <martin@ximian.com>
583
584         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
585         a loop and may leave it, reset the barrier; fixes #74974.
586
587 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
588         
589         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
590         is back.
591         
592         * cs-parser.jay: Catch more lexical errors.
593         
594         * report.cs: Add one more Error method.
595         
596         * rootcontext.cs,
597         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
598
599 2005-05-17  Martin Baulig  <martin@ximian.com>
600
601         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
602         #70970. 
603
604 2005-05-16  Raja R Harinath  <rharinath@novell.com>
605
606         Fix test-382.cs.  Emit values of decimal constants.
607         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
608         Carved out of ...
609         (TypeContainer.AddField): ... this.
610         (TypeContainer.EmitFieldInitializers): Allow the list of fields
611         with initializers to include 'Const's.
612         (ClassPart.RegisterFieldForInitialization): Forward to
613         PartialContainer.
614         * const.cs (Const.Const): Pass initializer to base class.
615         (Const.Define): In case of decimal constants, register them for
616         initialization in a static constructor.
617
618 2005-05-14  Martin Baulig  <martin@ximian.com>
619
620         * statement.cs (Block.Resolve): Correctly handle unreachable code;
621         do not call ResolveUnreachable() on unreachable statements in
622         here, see the comment in the source code.
623
624 2005-05-13  Raja R Harinath  <rharinath@novell.com>
625
626         Fix #74934.
627         * expression.cs (BinaryResolveOperator): If one of the operands of
628         an equality comparison is 'null' and the other is a pointer type,
629         convert the null to a NullPointer.
630         * convert.cs (ImplicitReferenceConversion): If the expression is a
631         NullLiteral and the target type is a pointer type, return a
632         NullPointer instead.
633         (ImplicitConversionStandard): Likewise.
634
635 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
636         
637         * cs-parser.jay: Set readonly context based on special constructs.
638         
639         * expression.cs (LocalVariableReference.DoResolveBase): Improved
640         readonly variable error handling.
641         
642         * rootcontext.cs (EmitCode): Don't verify members when error
643         occurred.
644         
645         * statement.cs (LocalInfo): Add reaodnly context information.
646         (SetReadOnlyContext, GetReadOnlyContext): New methods.
647
648 2005-05-13  Raja R Harinath  <rharinath@novell.com>
649
650         * statement.cs (Block.Resolve): Revert change below.  Modify fix
651         for #74041 to initialize 'resolved' to false only for explicit
652         blocks.  Fixes #74873.
653
654 2005-05-12  Raja R Harinath  <harinath@gmail.com>
655
656         Fix #74920.
657         * typemanager.cs (unmanaged_enclosing_types): New.
658         (IsUnmanagedType): Avoid infloops by using
659         'unmanaged_enclosing_types' to talk with recursive invocations.
660
661 2005-05-13  Martin Baulig  <martin@ximian.com>
662
663         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
664         instance variable, not a local.  Fix #74873.
665         (Block.ResolveUnreachable): Set it to true here.
666
667 2005-05-11  Duncan Mak  <duncan@novell.com>
668
669         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
670         continuing to process for 'arg'.
671         (handle_preprocessing_directive): Check the argument of the #endif
672         directive and report error CS1025 if there are any trailing
673         characters.
674
675         According to the C# spec, having even whitespace after the #endif
676         directive is illegal; however, because we call arg.TrimEnd ()
677         beforehand, we have the same behavior as csc, allowing whitespace
678         after the directive.
679
680         Fixes #74892.
681
682 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
683
684         Fix #74863.
685         
686         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
687         (Constructor.GetObsoleteAttribute): Implemented correctly.
688
689 2005-05-10  Martin Baulig  <martin@ximian.com>
690
691         * support.cs (ReflectionParameters.ParameterModifier): Use
692         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
693         and `ParameterAttributes.In'.  Fixes #74884.
694
695 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
696
697         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
698         
699         * expression.cs (Argument.GetParameterModifier): Turned to property.
700         (Invocation.Error_InvalidArguments): Add more descriptive errors.
701         
702         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
703         its C# equivalent.
704         
705 2005-05-09  Raja R Harinath  <rharinath@novell.com>
706
707         Fix #74852.
708         * decl.cs (MemberCache.AddMethods): Register override methods,
709         rather than non-override methods.
710         * typemanager.cs (RegisterOverride): New.
711         (IsOverride): Update.
712
713 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
714
715         Fix #73105.
716         
717         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
718         recursive declaration.
719         
720         * statement.cs (Block.ResolveMeta): Report any error in resolving.
721         
722 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
723
724         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
725         
726         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
727
728 2005-05-05  Raja R Harinath  <rharinath@novell.com>
729
730         Fix #74797.
731         * decl.cs (DeclSpace.FamilyAccessible): 
732         Use TypeManager.IsNestedFamilyAccessible.
733
734         Fix reopened #64812.
735         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
736         internal'.
737
738 2005-05-04  Raja R Harinath  <rharinath@novell.com>
739             Abin Thomas  <projectmonokochi@rediffmail.com>
740             Anoob V E  <projectmonokochi@rediffmail.com>
741             Harilal P R  <projectmonokochi@rediffmail.com>
742
743         Fix #64812.
744         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
745         allow access to all static members.
746
747 2005-05-04  Martin Baulig  <martin@ximian.com>
748
749         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
750
751 2005-05-04  Martin Baulig  <martin@ximian.com>
752
753         Fix #74655.
754
755         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
756         section at the end; make things work if `default' is not the last
757         section.        
758
759 2005-05-04  Martin Baulig  <martin@ximian.com>
760
761         Fix #70400.
762
763         * statement.cs (Switch): Replaced the `got_default' field with a
764         `default_section' one.
765         (Switch.CheckSwitch): Set `default_section' here.
766         (Switch.Resolve): If we're a constant switch and the constant is
767         not found, use the default section.
768
769 2005-05-03  Martin Baulig  <martin@ximian.com>
770
771         * expression.cs (ArrayAccess.EmitGetLength): New public method.
772
773         * statement.cs (Foreach.ArrayForeach): New nested class.
774         (Foreach.TemporaryVariable): New nested class.
775         (Foreach.EmitArrayForeach): Removed; this is now in the new
776         ArrayForeach class.
777
778 2005-05-03  Raja R Harinath  <rharinath@novell.com>
779
780         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
781         more conservative.
782         (VerifyPendingMethods): Revert change below.
783
784         * typemanager.cs (IsOverride, RegisterNonOverride): New.
785         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
786         that used to trigger warning -28.  Remove warning -28.
787         * expression.cs (Invocation.OverloadResolve): Use
788         TypeManager.IsOverride to distinguish override methods.
789
790         Fix #74773.
791         * pending.cs (VerifyPendingMethods): If a base type implements the
792         requested interface, don't bother checking individual methods of
793         the base type.  As a side-effect, this prevents the creation of
794         unnecessary proxies.
795
796 2005-05-02  Martin Baulig  <martin@ximian.com>
797
798         Fix #70182.
799
800         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
801         Also `And' the locals if the old vector is null.
802         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
803         null; in this case we basically reset all the variables.        
804
805 2005-05-02  Martin Baulig  <martin@ximian.com>
806
807         Fix #74529.
808
809         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
810         Added `FlowBranching branching' argument; always `and' the
811         variables instead of `or'ing them unless we're an infinite loop.
812
813         * statement.cs (While.Resolve): Create a new sibling unless we're
814         infinite.       
815
816 2005-05-02  Martin Baulig  <martin@ximian.com>
817
818         Fix #70140.
819
820         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
821         arguments; use it instead of creating a new TopLevelBlock.
822         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
823         our ConstructorInitializer.
824
825         * statement.cs
826         (TopLevelBlock.TopLevelBranching): New public property.
827         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
828         and create our `TopLevelBranching'.
829
830         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
831         anonymous method host, use `block.TopLevelBranching' rather than
832         creating a new branching.
833
834 2005-04-20  Miguel de Icaza  <miguel@novell.com>
835
836         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
837         a ScopeInfo, if any of the current children is a child of the new
838         entry, move those children there.
839
840 2005-04-30  Martin Baulig  <martin@ximian.com>
841
842         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
843         at the beginning of a SwitchSection.  Fix #73335.
844
845 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
846
847         Fix #74378
848         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
849         
850         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
851         (FieldExpr.DoResolve): Obsolete members are ignored for field
852         initializers.
853         
854 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
855
856         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
857         of arrays detection.
858
859         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
860         verification.
861         (Field.VerifyClsCompliance): Volatile fields are not compliant.
862
863         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
864         arrays report.
865
866 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
867
868         * cs-parser.jay: Use the prefered version of -unsafe in error
869         message.
870
871 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
872
873         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
874         circumstances.
875
876 2005-04-20  John Luke  <john.luke@gmail.com>
877
878         * driver.cs: fix typo in error message, --outout to --output
879
880 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
881
882         * codegen.cs (InRefOutArgumentResolving): New field.
883         
884         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
885         fields outside contructor.
886         
887         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
888         
889 2005-04-19  Miguel de Icaza  <miguel@novell.com>
890
891         * anonymous.cs (CaptureContext.EmitParameterInstance): The
892         parameter code was not completed ever, so it was not as up-to-date
893         as local variables.  Must finish it.
894
895         The bug fix was to compare the Toplevel of the block, not the
896         current block.  Thanks for Ben for pointing this out. 
897
898 2005-04-19  Raja R Harinath  <rharinath@novell.com>
899
900         * decl.cs (AddMethods): Use the declaring type of the problem
901         method to determine if we want to squash a warning.
902
903 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
904
905         * attribute.cs: Removed debug output.
906
907         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
908         
909         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
910         Report.Stderr.
911         
912 2005-04-18  Raja R Harinath  <rharinath@novell.com>
913
914         Fix #74481.
915         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
916         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
917         all null comparisons against reference types.
918
919 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
920
921         Fix# 74565
922         * class.cs (TypeContainer.CircularDepException) New nested
923         exception class.
924         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
925         (TypeContainer.DefineType): Removed error, reset InTransit before
926         exit.
927         (Class.DefineType): Throw exception when is in Transit.
928         Catch exception and report error.
929         (Struct.DefineType): Throw exception when is in Transit.
930         Catch exception and report error.
931         (Interface.DefineType): Throw exception when is in Transit.
932         Catch exception and report error.
933
934         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
935         handle nested exception handlers.
936
937         * flowanalysis.cs (InTryWithCatch): New method, search for try with
938         a catch.
939
940         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
941         InFinally and InCatch storage.
942
943         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
944         (Catch.Resolve): Set and Restore ec.InCatch.
945         (Try.Resolve): Set and Restore ec.InFinally.
946         (Try.HasCatch): True when try has catch.
947
948 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
949
950         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
951           for the same event member, so exclude such cases from warning 419.
952           Fixed bug #74633.
953
954 2005-04-16  Miguel de Icaza  <miguel@novell.com>
955
956         * expression.cs (Binary.ResolveOperator): Apply patch from John
957         Luke to fix bug 59864: operators &, | and ^ on enumerations
958         require that the same enum type on both sides.
959
960         * driver.cs: Add warnings to old flag usage, this is to assist
961         people who produce Makefiles and hope that the Makefiles will be
962         used on Windows.
963
964         * class.cs (TypeContainer.EmitType): Moved the definition of the
965         special $PRIVATE$ field from the resolve phase to the Emit phase.
966         During resolve we do not know if we are a struct with
967         HasExplicitLayout, we know this only after the attributes for the
968         type are emitted.
969
970         Set the FieldOffset to zero on the dummy field that we create for
971         the class.   Fixes 74590.
972
973 2005-04-16  Raja R Harinath  <rharinath@novell.com>
974
975         Fix #73834.
976         * ecore.cs (PropertyExpr.resolved): New.
977         (DoResolve): Use it to handle a case of double resolution here.
978         Handle a case of identical-name-and-type-name.
979         * expression.cs (ArrayCreation.CheckIndices): Avoid double
980         resolution by storing the results of expression resolution back
981         into the "probes" array.
982
983 2005-04-15  Raja R Harinath  <rharinath@novell.com>
984
985         Fix cs0208-7.cs and cs0208-8.cs.
986         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
987         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
988         error reporting to point out the reason a struct is not unmanaged.
989
990 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
991
992         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
993           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
994
995 2005-04-13  Raja R Harinath  <rharinath@novell.com>
996
997         Fix #74528.
998         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
999         IdenticalNameAndTypeName here.
1000         (EventExpr.InstanceResolve): Likewise.
1001
1002 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1003
1004         C# 2.0 DefaultCharSetAttribute implementation
1005         
1006         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1007         which allows us to set GlobalNamespace for every resolve.
1008         (Attribute.ResolveArguments): Cut from Resolve.
1009         (Attribute.GetCharSetValue): Returns CharSet named argument.
1010         (Attribute.DefinePInvokeMethod): Gets default charset from
1011         module settings.
1012         (GlobalAttribute.ResolveAsTypeStep): Override.
1013         (GlobalAttribute.ResolveArguments): Override.
1014         
1015         * class.cs (TypeAttr): Is protected.
1016         
1017         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1018         (ModuleClass.DefaultCharSetType): New memeber.
1019         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1020         
1021         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1022         charset from module.
1023         
1024         * delegate.cs (TypeAttr): Override.
1025         (Delegate.DefineType): Use this TypeAttr.
1026         
1027         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1028         at very early stage (before types are defined) to resolve model
1029         module attributes. It will probably not work with corlib but it
1030         should be ok.
1031         
1032         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1033         charset from module.
1034         
1035         * typemanager.cs (default_charset_type): New type.
1036
1037 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1038
1039         * decl.cs (MemberCache.AddMethods): Don't warn if
1040         System.Object.Finalize has buggy MethodAttributes.
1041
1042         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1043         removed below.
1044
1045 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1046
1047         * doc.cs : detect ambiguous reference to overloaded members.
1048           Fixed bug #71603. MS 1.1 csc does not detect it.
1049
1050 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1051
1052         * doc.cs : delegates must not be referenced with parameters.
1053           Fixed bug #71605.
1054
1055 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1056
1057         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1058
1059 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1060
1061         * driver.cs (MainDriver): Stop processing if the CLS stage found
1062         errors. 
1063
1064         (CompilerCallableEntryPoint.InvokeCompiler): Always
1065         reset after execution;   Take a TextWriter argument for the
1066         output.
1067
1068         * report.cs: Use the error stream instead of hardcoding stderr. 
1069
1070 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1071
1072         * class.cs: Reduce code paths to test, too small of an
1073         optimization to make it worth the extra testing.  Always perform
1074         it. 
1075
1076 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1077
1078         Fix #74510.
1079         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1080         operators that had errors reported on them.
1081
1082 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1083
1084         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1085         argument types.
1086         (Attribute.Resolve): Add named argument type checking.
1087         
1088         * class.cs (FixedField.Define): Use IsPrimitiveType
1089         
1090         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1091         
1092         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1093         unsafe parameter types.
1094         
1095         * statement.cs (Using.ResolveExpression): Add better error description.
1096         
1097         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1098         
1099 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1100
1101         Fix #74484.
1102         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1103         AttributeUsageAttribute in the emitcontext of the attribute class,
1104         not in the emitcontext of the attributable entity it was attached to.
1105         * cs-parser.jay: Use 'current_class', not 'current_container',
1106         when creating a GlobalAttribute.
1107
1108 2005-04-08  Alp Toker  <alp@atoker.com>
1109
1110         * pending.cs: The fix to #58413 failed to compile methods implementing
1111         interfaces with/without params modifiers and vice versa, even though
1112         params modifiers aren't part of the signature. Make the modifier check
1113         less strict as in csc.
1114
1115 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1116             Anoob V E  <projectmonokochi@rediffmail.com>
1117             Harilal P R  <projectmonokochi@rediffmail.com>
1118
1119         Fix #58413.
1120         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1121         modifiers of pending methods.
1122         (PendingImplementation.PendingImplementation): Initialize it.
1123         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1124         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1125         with ParameterData.  Add check for modifiers.
1126         * class.cs (MethodData.Define): Update to changes.
1127
1128 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1129
1130         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1131
1132 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1133
1134         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1135         property.
1136         
1137         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1138         
1139         * rootcontext.cs,
1140         * typemanager.cs: Registered RequiredAttributeAttribute.
1141         
1142 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1143
1144         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1145         Warning CS0169 is back at level 3.
1146         (IMethodData.SetMemberIsUsed): New method.
1147         
1148         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1149         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1150         
1151         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1152
1153         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1154         contants.
1155         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1156         is used.
1157         
1158         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1159         is used.
1160         
1161         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1162         to avoid the problems with nested types.
1163
1164 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1165             Anoob V.E  <projectmonokochi@rediffmail.com>
1166             Harilal P.R  <projectmonokochi@rediffmail.com>
1167             Raja R Harinath  <rharinath@novell.com>
1168
1169         Fix #73820.
1170         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1171         attribute.
1172         * typemanager (GetConstructor): Make public.
1173
1174 2005-04-05  John Luke  <john.luke@gmail.com>
1175             Raja R Harinath  <rharinath@novell.com>
1176
1177         Fix #62232.
1178         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1179         struct too.  Return false quicker in a few cases.
1180         (VerifyUnManaged): Use it.
1181
1182 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1183
1184         Fix #74041.
1185         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1186         not 'unreachable_seen'.
1187
1188 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1189
1190         * attribute.cs (Attribute.GetValue): Removed unused.
1191         
1192         * codegen.cs (CodeGen.TrimExt): Removed unused.
1193         
1194         * cs-parser.jay (output): Removed unused.
1195         
1196         * cs-tokenizer.cs (hex_digits): Removed unused.
1197         
1198         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1199         
1200         * expression.cs (Indirection.LoadExprValue): Removed unused.
1201         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1202         
1203         * iterators.cs (Iterator.param_types): Removed unused.
1204         
1205         * statement.cs (Goto.block): Removed unused.
1206         (ToplevelBlock.did): Removed unused.
1207         (Switch.ResolveConstantSwitch): Removed unused.
1208
1209 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1210
1211         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1212         resetting thingy.
1213
1214 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1215
1216         Fix #74232 and cs0208-3.cs.
1217         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1218         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1219         unmanaged type.  Don't use FieldBuilders when 't' is a
1220         TypeBuilder.  Use ModFlags and MemberType fields.
1221         * class.cs (MemberBase.member_type): Rename from MemberType.
1222         (MemberBase.MemberType): New property.  Determines member_type on
1223         demand.
1224         (MemberBase.DoDefine): Don't initialize MemberType here.
1225         (FieldMember.Define): Likewise.
1226
1227 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1228
1229         Fix #74241
1230         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1231         Attributes are emitted there.
1232         
1233 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1234
1235         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1236         keyword in 'partial enum' too.
1237         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1238         is not allowed).
1239         Report from Kamil Skalski <nazgul@omega.pl>.
1240
1241         Fix #74309.
1242         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1243         have partial containers too.
1244
1245         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1246         in block' checks to Block.CheckInvariantMeaningInBlock.
1247         * statement.cs (Block.GetKnownVariableInfo): Make private.
1248         (Block.IsVariableUsedInChildBlock): Remove.
1249         (Block.IsVariableUsedInBlock): Likewise.
1250         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1251         conflicting declaration.
1252         (Block.AddVariable): Make error messages less long-winded and more
1253         specific.  Show location of conflicting declaration.
1254         * parameter.cs (Parameters.Location): New readonly property.
1255
1256 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1257
1258         Clean up semantics of invoking ResolveMemberAccess.
1259         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1260         can have an instance, ensure that we pass in a non-TypeExpression
1261         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1262         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1263         argument.  Update to changes and simplify.
1264         (FieldExpr.Emitinstance): Remove CS0120 check.
1265         (PropertyExpr.EmitInstance): Likewise.
1266         * expression.cs (Argument.Resolve): Likewise.
1267         (Invocation.DoResolve): Update to changes in semantics of
1268         InstanceExpression.
1269
1270 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1271
1272         Fix #74241
1273         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1274         customization.
1275         
1276         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1277
1278 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1279
1280         Fix difference in behaviour with commandline invocation.
1281         * driver.cs (Driver.Reset): New.
1282         (CompilerCallableEntryPoint): Call it.
1283
1284         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1285         variable" warnings if the boolean expression failed to resolve.
1286
1287 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1288
1289         * attribute.cs: Fix the union of several permissions when some of them
1290         are unrestricted (so the result isn't an unrestricted permission set).
1291         Fix #74036.
1292
1293 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1294
1295         * ecore.cs (MemberExpr): New class.  Convert from interface
1296         IMemberExpr.
1297         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1298         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1299         error checks.
1300         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1301         (MethodGroupExpr.IsExplicitImpl): Remove.
1302         (Expression.GetFieldFromEvent): Remove.
1303         (SimpleName.MemberStaticCheck): Remove.
1304         (SimpleName.DoSimpleNameResolve): Update to changes.
1305         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1306         (MemberAccess.IdenticalNameAndTypeName): Remove.
1307         (MemberAccess.error176): Move to MemberExpr.
1308         (MemberAccess.DoResolve): Update to changes.
1309         (BaseAccess.DoResolve): Likewise.
1310
1311 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1312
1313         C# 2.0 Conditional attribute class implementation
1314         
1315         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1316         Analyzes class whether it has attribute which has ConditionalAttribute
1317         and its condition is not defined.
1318         
1319         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1320         (Class.IsExcluded): New method. Search for at least one defined
1321         condition in ConditionalAttribute of attribute class.
1322
1323 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1324
1325         * ecore.cs (PropertyExpr): Derive from Expression, not
1326         ExpressionStatement.
1327         (PropertyExpr.EmitStatement): Remove.
1328
1329 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1330
1331         Fix #74060.
1332         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1333         internal field "value__" of an enum be private.  The examples for
1334         "value__" that I found on MSDN all used FieldAttributes.Private.
1335
1336         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1337         Don't mention IL method attribute names.
1338
1339         Fix #47991.  Remove a TODO.
1340         * statement.cs (Block.Toplevel): Make into a field.
1341         (Block.Parameters): Move into ToplevelBlock.
1342         (Block.known_variables): Rename from child_variable_names.
1343         (Block.Block): Remove variants that take Parameters.  Initialize
1344         'Toplevel' with the immediately surrounding toplevel block.
1345         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1346         LocalInfo parameter.
1347         (Block.GetKnownVariableInfo): New.
1348         (Block.IsVariableNameUsedInChildBlock): Update.
1349         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1350         the block, even though it may not be in scope.
1351         (Block.AddVariable): Remove Parameters parameter.  Use
1352         Toplevel.Parameters instead.
1353         (Block.AddConstant): Remove Parameters parameter.
1354         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1355         (Block.IsParamaterReference): Likewise.
1356         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1357         (ToplevelBlock.Parameters): New.  Moved from Block.
1358         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1359         initialize Parameters to a non-null value.
1360         * cs-parser.jay: Update to changes.
1361         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1362         simple names that mean different things in the same block.  Use
1363         Block.IsVariableNameUsedInBlock.
1364
1365 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1366
1367         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1368         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1369         GetTypeHandle.  It is possible for a reflected type to derive from
1370         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1371         System.Array during mscorlib compilation).
1372         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1373         contain a method_hash, don't create one either.  Don't create a
1374         deep copy of the base cache's method_hash.
1375         (MemberCache.SetupCache): Rename back from DeepCopy.
1376         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1377         already initialized.  If we see an override function, add its
1378         underlying base virtual function to the member_hash too.
1379
1380         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1381
1382 2005-03-26  Raja R Harinath  <harinath@acm.org>
1383
1384         Fix #73038.
1385         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1386         fails to resolve, ensure that the LHS is still resolved as an
1387         lvalue.
1388
1389 2005-03-25  Raja R Harinath  <harinath@acm.org>
1390
1391         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1392         ec.ContainerType.
1393         (Enum.current_ec): Remove.
1394         (Enum.LookupEnumValue): Remove EmitContext argument.
1395         Just uses the one created during DefineType.
1396         (Enum.FindMembers): Update.
1397         * expression.cs (MemberAccess.DoResolve): Update.
1398
1399 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1400
1401         * assign.cs (Assign.DoResolve): Check for CS1717 when
1402         source and target are same (uses Equals).
1403
1404         * expression.cs (LocalVariableReference, ParameterReference,
1405         This): Implemented Equals, GetHashCode.
1406
1407         * statement.cs (Block.GetParameterReference): Removed useless
1408         local variable.
1409
1410 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1411
1412         Fix cs0128.cs
1413         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1414         blocks before deciding whether the error is cs0136 or cs0128.
1415
1416         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1417         (using_alias_directive, using_namespace_directive): Pass
1418         MemberName, not an expression to Namespace.UsingAlias and
1419         Namespace.Using.
1420         (MakeName): Use the MemberName of the namespace.
1421         * namespace.cs (Namespace.MemberName): New.
1422         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1423         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1424         Likewise.
1425         * decl.cs (MemberName.Name): Make readonly.
1426         (MemberName.FromDotted): New "constructor".
1427         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1428         (MemberCore.Name): Compute from MemberName on demand.
1429         (MemberCore.SetMemberName): Provide a way to change the
1430         MemberName.
1431         (MemberCore.AddToContainer): Don't take a fullname parameter.
1432         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1433         fully qualified name of the container to the member name.
1434         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1435         only if the type is a member of the root container.
1436         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1437         MemberName.Left rather than searching for an embedded ".".
1438         (PartialContainer.CreatePart): Update to changes in RootContext.
1439         (MemberBase.ShortName): Turn into a property.  Use
1440         MemberCore.SetMemberName.
1441         (MemberBase.ExplicitInterfaceName): Remove.
1442         (MemberBase.UpdateMemberName): Remove.
1443         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1444         (PropertyBase.SetMemberName): New override.
1445         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1446         (Tree.GetDecl): New.
1447         (Tree.AllDecls): Rename from Decls.
1448         * attribute.cs, enum.cs, report.cs: Update to changes.
1449         * driver.cs (MainDriver): Use MemberName.FromDotted on
1450         RootContext.MainClass.
1451
1452 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1453
1454         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1455         checks.
1456
1457         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1458
1459 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1460
1461         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1462         property accessor modifiers.
1463
1464         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1465         fixed buffer attribute (CS1716).
1466         (PropertyMethod.HasCustomAccessModifier): When property accessor
1467         has custom modifier.
1468
1469         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1470         modifiers.
1471         (PropertyExpr.DoResolveLValue): Add CS0272.
1472
1473 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1474
1475         * convert.cs: When converting to a pointer, use the proper Conv.U
1476         or Conv.I depending on the source data type.
1477
1478         * cs-tokenizer.cs: Make the size for large decimal constants,
1479         fixes #72957.
1480
1481 2005-03-17  Martin Baulig  <martin@ximian.com>
1482
1483         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1484         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1485
1486 2005-03-17  Martin Baulig  <martin@ximian.com>
1487
1488         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1489         to bool so we can return an error condition.
1490         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1491         returned an error.
1492
1493 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1494
1495         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1496         attributes.
1497
1498 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1499
1500         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1501         Refactor to avoid traversing the list of assemblies, and to avoid
1502         string concatenation.
1503         * typemanager.cs (guid_attr_type): Remove.
1504         (negative_hits, pointers, references): Remove hashes.
1505         (type_hash): New.
1506         (GetConstructedType): New.  Uses type_hash to handle constructed
1507         types (arrays, references, pointers).
1508         (GetReferenceType, GetPointerType): Use it.
1509         (GetNestedType): New.  Uses type_hash to handle nested types of
1510         reflected types.
1511         (LookupType, LookupTypeDirect): Remove.
1512         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1513         'types' hash and LookupTypeReflection directly.
1514         (params_string, params_object): Use GetConstructedType.
1515         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1516         top-level types.
1517         (Namespace.Lookup): Use cached_types.
1518         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1519         provided by old TypeManager.LookupType.
1520         * rootcontext.cs (MakeFQN): Remove.
1521         * decl.cs (DeclSpace.MakeFQN): Likewise.
1522         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1523         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1524         TypeManager.GetConstructedType.
1525         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1526
1527 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1528
1529         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
1530         indexers.
1531
1532         * cs-parser.jay: Reports CS1527 for any namespace element.
1533
1534         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1535         Added CS0407.
1536
1537         * expression.cs (ParameterReference.IsAssigned): Changed error to
1538         CS0269.
1539         (Error_WrongNumArguments): Moved CS0245 detection here.
1540
1541         * statement.cs (Return.Resolve): Add CS1622 report.
1542
1543 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1544
1545         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1546
1547 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1548
1549         * attribute.cs expression.cs: Get rid of some allocations.
1550
1551 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1552
1553         * doc.cs : just eliminate the latest change.
1554
1555 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1556
1557         * doc.cs : commented out the latest change. It breaks xml-030.cs
1558
1559 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1560
1561         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1562           fail. So invoke CreateType() in FindDocumentedType().
1563
1564 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1565
1566         * cs-tokenizer.cs : added IsKeyword().
1567         * doc.cs : Detect keyword incorrectly used as identifier.
1568           Allow identifiers prefixed by @.
1569
1570 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1571
1572         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1573         It caused exception in namespace resolving (again!).
1574         
1575         * class.cs (Class.ctor): Removed exit.
1576         (PropertyMethod.ctor): ditto.
1577         
1578         * codegen.cs (Codegen.Reset): Reset static data.
1579         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1580         
1581         * cs-tokenizer.cs (Cleanup): Removed.
1582         
1583         * driver.cs (GetSystemDir): Rewrote to one line command.
1584         It caused problem with unloaded dynamic modules.
1585         (UnixParseOption): Removed Exit.
1586         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1587         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1588         Now can be mcs used as library.
1589         
1590         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1591         empty location.
1592         
1593         * location.cs (Reset): Reset static data.
1594         
1595         * namespace.cs (Reset): Reset static data.
1596         
1597         * report.cs (Report.Reset): Reset static data.
1598         
1599         * rootcontext.cs (RootContext.Reset): Reset static data.
1600         
1601         * tree.cs (RootTypes.ctor): Use Location.Null
1602         
1603         * typemanager.cs (TypeManager.Reset): Reset static data.
1604         (CoreLookupType): Removed Exit.
1605         (TypeHandle.Reset): Reset static data.
1606         
1607 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1608
1609         Fix #73516.
1610         * typemanager.cs (ComputeNamespaces): Import namespaces from
1611         referenced modules too.
1612
1613 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1614
1615         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1616         than '.'.
1617
1618 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1619
1620         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1621         enclosing DeclSpace.  This ensures that a name-lookup populates
1622         more caches and there are fewer 'TypeExpression's.  Carve out
1623         nested type lookup into ...
1624         (LookupNestedTypeInHierarchy): ... this.
1625
1626 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1627
1628         Clean up a few partial-class semantics.  
1629         Fixes test-357.cs and cs1618-2.cs.
1630         * cs-parser.jay (struct_declaration): Use 'current_class' as
1631         parent of newly-created struct.  Remove call to Register ().
1632         Use 'pop_current_class' to complete handing the current struct.
1633         (interface_declaration): Likewise.
1634         (class_declaration): Likewise.
1635         (enum_declaration): Use 'current_class' as parent of newly created
1636         enum.
1637         (delegate_declaration): Likewise.
1638         (pop_current_class): New function.  This is used to handle closing
1639         up the 'current_class' and 'current_container', and pointing them
1640         to the enclosing class/container.
1641         (CSharpParser): Initialize 'current_class' too.
1642         * decl.cs (MemberCore): Add check for invariant: a partial
1643         container is not a parsed entity, and thus does not enclose any
1644         parsed members.
1645         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1646         (DeclSpace.BaseTypeExpr): Use it.
1647         (DeclSpace.LookupType): Add check for invariant.
1648         * class.cs (TypeContainer): Add check for invariant: a nested
1649         class should have the same NamespaceEntry as its enclosing class.
1650         (TypeContainer.EmitFieldInitializers): Make virtual.
1651         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1652         MemberCore.
1653         (TypeContainer.Register): Remove.
1654         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1655         null.  Use TypeResolveEmitContext for resolving base types and
1656         interfaces.  Move initialization of Parts.TypeBuilder here from
1657         ...
1658         (TypeContainer.DefineNestedTypes): ... here.
1659         (PartialContainer): Take a Namespace not a NamespaceEntry.
1660         (PartialContainer.Create): Don't use Register.  Call the
1661         appropriate Add... function directly.
1662         (ClassPart): Take both the PartialContainer and the enclosing
1663         class as constructor arguments.
1664         (ClassPart.EmitFieldInitializers): Override.
1665         (ClassPart.PartFindNestedTypes): Remove.
1666         (FieldBase.GetInitializerExpression): Resolve the initializer
1667         expression in the emit context of the enclosing class.
1668         * tree.cs (RootTypes): Remove Register ().
1669         
1670 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1671
1672         * cs-parser.jay: Removed CS0134.
1673         
1674         * driver.cs: Removed CS1901.
1675         
1676         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1677         for predefined types.
1678
1679 2005-03-07  Duncan Mak  <duncan@novell.com>
1680
1681         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1682         well. Fixes bug #73454.
1683
1684 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1685
1686         * cs-tokenizer.cs (xtoken): Add CS1035.
1687         
1688         * class.cs (MethodData.Define): Add CS0683.
1689         (FieldMember.ctor): Add CS0681.
1690
1691 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1692
1693         * ecore.cs (SimpleName.DoResolve): Rename from
1694         SimpleName.DoResolveAllowStatic.
1695         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1696         Pass 'intermediate' flag to MemberStaticCheck.
1697         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1698         of "intermediate" lookups via MemberAccess.
1699         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1700         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1701
1702 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1703
1704         Fix #73394.
1705         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1706         slipped in because of variable names that are identical to a
1707         builtin type's BCL equivalent ('string String;', 'int Int32;').
1708         (PropertyExpr.EmitInstance): Likewise.
1709
1710 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1711
1712         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1713         
1714         * report.cs (warning_ignore_table): Made public.
1715
1716 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1717
1718         Fix #73282.
1719         * class.cs (MethodData.Emit): Pass 'container' to
1720         container.GetObsoleteAttribute instead of 'container.Parent'.
1721
1722 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1723
1724         * cs-parser.jay: Add 1534 error test.
1725
1726         * iterators.cs (Yield.CheckContext): Add error 1629.
1727         (Iterator.ctor): Save unsafe modifier.
1728         (MoveNextMethod.DoEmit): Restore unsafe context.
1729
1730         * namespace.cs (UsingAlias): Better error message.
1731
1732 2005-03-03  Dan Winship  <danw@novell.com>
1733
1734         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1735         the warning message [#73219]
1736
1737 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1738
1739         Fix compile with MCS 1.0.0.0.
1740         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1741         w_restore to not depend on string constant folding.
1742
1743 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1744
1745         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
1746         CS0246 check to users who passed 'silent = false'.
1747         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1748         check.
1749         (SimpleName.SimpleNameResolve): Update.
1750         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
1751         (MemberAccess.IdenticalNameAndTypeName): Update.
1752         * doc.cs (FindDocumentedTypeNonArray): Update.
1753
1754 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
1755
1756         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
1757         * parameters.cs (ComputeAndDefineParameters): Remove.
1758         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
1759         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
1760         Use GetParameterInfo.
1761
1762 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
1763
1764         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
1765
1766 2005-03-02  Raja R Harinath  <rharinath@novell.com>
1767
1768         Unify DeclSpace.LookupType and DeclSpace.FindType.
1769         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
1770         is in charge of defining nested types on demand.
1771         (DeclSpace.LookupType): Use it when the current_type is a
1772         TypeBuilder.  Use LookupTypeDirect for reflected types.
1773         (DeclSpace.FindType): Remove.
1774         (DeclSpace.LookupInterfaceOrClass): Likewise.
1775         (DeclSpace.DefineTypeAndParents): Likewise.
1776         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
1777         DeclSpace.LookupType.
1778         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
1779         * typemanager.cs (LookupType): Simplify.
1780         (AddUserType): Remove type from negative_hits.
1781         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
1782         * class.cs (TypeContainer.FindMembers): Move handling of nested
1783         types ...
1784         (TypeContainer.FindMembers_NestedTypes): ... here.
1785         (TypeContainer.FindNestedType): Implement override.
1786         (ClassPart.FindNestedType): Delegate to PartialContainer.
1787         (ClassPart.PartFindNestedType): Looks up the nested types of the
1788         part alone.
1789
1790 2005-03-02  Martin Baulig  <martin@ximian.com>
1791
1792         * class.cs (TypeContainer.DoDefineMembers): We also need a default
1793         static constructor in static classes.
1794
1795 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
1796
1797         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
1798         sizeParamIndex is not specified.
1799
1800 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
1801
1802         Fix #73117
1803         * report.cs (WarningMessage.IsEnabled): Missing null check.
1804
1805 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1806
1807         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
1808         in the fields and not in the properties.
1809
1810 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
1811
1812         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
1813         fields as well.
1814
1815 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1816
1817         * attribute.cs: Small refactoring (improved robustness).
1818         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
1819         (ValidateGuid): Removed.
1820         (Resolve): Removed referenced to above mentioned.
1821         (GetAttributeUsage): Made private and changed to work without
1822         class assistance.
1823         (GetIndexerAttributeValue): Don't crash.
1824         (GetConditionalAttributeValue): Ditto.
1825         (GetClsCompliantAttributeValue): Ditto.
1826         (ExtractSecurityPermissionSet): All attributes exceptions are
1827         error 648.
1828         (GetPropertyValue): New helper.
1829         (GetMethodImplOptions): New method.
1830         (DefinePInvokeMethod): Reuse common code. Implemented handling of
1831         some missing properties.
1832         
1833         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
1834         (Method.ApplyAttributeBuilder): Updated.
1835         
1836         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
1837         exception.
1838
1839 2005-02-28  Raja R Harinath  <rharinath@novell.com>
1840
1841         Fix #73052.
1842         * report.cs (Report.SymbolRelatedToPreviousError): Handle
1843         non-simple types (array, pointer, reference).
1844
1845 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1846
1847         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
1848
1849         * class.cs (MethodCore.IsDuplicateImplementation): Special error
1850         for operators.
1851         (Method.CheckBase): Catch wrong destructor here.
1852         (MethodData.Define): Add errors 550, 668.
1853
1854         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
1855
1856         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
1857
1858         * pending.cs (VerifyPendingMethods): Add error 551.
1859
1860         * typemanager.cs (CSharpName): Next error report helper.
1861
1862 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
1863
1864         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
1865         attributes. Removed useless attribute double check.
1866         It saves almost 2MBs for corlib.
1867
1868 2005-02-25  Raja R Harinath  <rharinath@novell.com>
1869
1870         Fix #72924.
1871         * statement.cs (ExpressionStatement.Resolve): Make robust to being
1872         called twice in case of error.
1873
1874 2005-02-23  Chris Toshok  <toshok@ximian.com>
1875
1876         Fix compiler portions of #72827.
1877         * statement.cs (Block.Emit): call Begin/EndScope on the
1878         EmitContext instead of the ILGenerator.
1879
1880         * codegen.cs (EmitContext.BeginScope): new method, call
1881         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
1882         we have one.)
1883         (EmitContext.BeginScope): same, but EndScope and CloseScope
1884
1885         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
1886         offset and call the superclass's OpenScope(int) with it.
1887         (SymbolWriter.CloseScope): get the current il
1888         offset and call superclass's CloseScope(int) with it.
1889
1890 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
1891
1892         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
1893         CS1677 for out and ref as well.
1894
1895         * class.cs (Method.Define): Add error CS1599 detection.
1896         
1897         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
1898         
1899         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
1900         
1901         * delegate.cs (Delegate.Define): Add error CS1599 detection.
1902         
1903         * support.cs.cs (ModifierDesc): New helper method.
1904
1905 2005-02-23  Raja R Harinath  <rharinath@novell.com>
1906             Abin Thomas  <projectmonokochi@rediffmail.com>
1907             Anoob V E  <projectmonokochi@rediffmail.com>
1908             Harilal P R  <projectmonokochi@rediffmail.com>
1909
1910         Fix #57851, #72718.
1911         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
1912         MemberLookup (used for error reporting) actually returns a result.
1913         Fix error report number (122, not 112).
1914
1915 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
1916             Anoob V E  <projectmonokochi@rediffmail.com>
1917             Harilal P R  <projectmonokochi@rediffmail.com>
1918
1919         Fix #71134.
1920         * pending.cs (PendingImplementation.GetAbstractMethods):
1921         Find NonPublic members too.
1922
1923 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
1924
1925         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
1926         Fixed error 217.
1927         
1928         * class.cs (MethodCore.CheckMethodAgainstBase):
1929         Add error 239 report.
1930
1931 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1932
1933         Fix #68955.
1934         * expression.cs (Invocation.IsApplicable): Make public.
1935         (Invocation.IsParamsMethodApplicable): Likewise.
1936         * delegate.cs (Delegate.VerifyApplicability): Don't use
1937         Invocation.VerifyArgumentCompat for parameter applicability
1938         testing.  Use Invocation.IsApplicable and
1939         Invocation.IsParamsMethodApplicable.
1940
1941 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1942
1943         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
1944         
1945         * class.cs (Operator.Define): Add error 217 report.
1946         
1947 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1948
1949         * namespace.cs (UsingEntry.Resolve): Undo change below.
1950
1951 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1952
1953         Fix #72756.
1954         * ecore.cs (Expression.MemberLookupFailed): Add argument to
1955         disable the error message when the extended MemberLookup also
1956         fails.
1957         (Expression.MemberLookupFinal): Update.
1958         (SimpleName.DoSimpleNameResolve): Update.
1959         * expression.cs (MemberAccess.ResolveNamespaceOrType):
1960         Don't use MemberLookupFinal.
1961         (New.DoResolve): Update.
1962         (BaseAccess.CommonResolve): Update.
1963
1964 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1965
1966         Fix #72732.
1967         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
1968         occured previously, don't resolve again.
1969
1970 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1971
1972         Fix #69949
1973         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
1974         argument. Call ResolveAttributeUsage for unresolved.
1975         when types doesn't match ctor arguments.
1976         
1977         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
1978         for nested attribute classes.
1979         (Class.attribute_usage): Removed.
1980         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
1981         for attribute class.
1982         
1983         * ecore.cs (IsAttribute): Removed.
1984         
1985         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
1986         
1987         * rootcontext.cs (RegisterAttribute): Removed, attributes are
1988         now normal types.
1989         (attribute_types): Removed.
1990         (EmitCode): Global attributes are emited as the latest.
1991
1992 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
1993
1994         * class.cs (EmitFieldInitializers): Don't emit field initializer
1995         for default values when optimilization is on.
1996         
1997         * constant.cs (Constant.IsDefaultValue): New property.
1998         
1999         * driver.cs: Add /optimize handling.
2000         
2001         * constant.cs,
2002         * ecore.cs,
2003         * literal.cs: Implement new IsDefaultValue property.
2004         
2005         * rootcontext.cs (Optimize): New field, holds /optimize option.
2006
2007 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2008
2009         Fix crasher in re-opened #72347.
2010         * namespace.cs (Namespace.Lookup): Return null if
2011         DeclSpace.DefineType returns null.
2012
2013         Fix #72678.
2014         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2015
2016 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2017
2018         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2019         now returns null if it cannot resolve to an lvalue.
2020         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2021         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2022         returned null.  Remove check for SimpleName.
2023         (EventExpr.DoResolveLValue): New.
2024         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2025         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2026         error from ...
2027         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2028         avoid CS0131 error.
2029         (Unary.ResolveOperator): Move CS0211 check ...
2030         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2031         CS0131 error.
2032         (Unary.DoResolveLValue): Simplify.
2033         (AddressOf.DoResolveLValue): New.
2034         (ArrayAccess.DoResolveLValue): New.
2035
2036 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2037
2038         * attribute.cs (Attribute.Resolve): Add arguments casting for
2039         when types doesn't match ctor arguments.
2040
2041 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2042
2043         Fix parts of #63202.
2044         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2045         lookup of operator in base type.  Ensure that all checks happen
2046         when the operator resolves to an "op_..." method.
2047
2048 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2049
2050         Fix #71992.
2051         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2052         'ignore_cs0104' parameter.  Pass it to ...
2053         (NamespaceEntry.Lookup): ... this.
2054         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2055         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2056         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2057         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2058         Update.  Request that cs0104 errors be ignored.
2059         (ComposedCast.ResolveAsTypeStep): Update.
2060
2061 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2062
2063         Fix #59209.
2064         * expression.cs (Invocation.BetterFunction): Remove support for
2065         comparing virtual functions and their overrides.
2066         (Invocation.IsOverride): New.
2067         (Invocation.OverloadResolve): Don't consider 'override' functions
2068         during candidate selection.  Store them in a lookaside list.
2069         If the selected method is a 'virtual' function, use the list to
2070         find any overrides that are closer to the LHS type.
2071
2072 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2073
2074         * expression.cs (New.DoResolve): Add complex core type reduction.
2075         (New.Constantify): Converts complex core type syntax like 'new int ()'
2076         to simple constant.
2077         
2078 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2079
2080         * decl.cs (EntryType.EntryType): New constructor to create an
2081         updated copy of a cache entry.
2082         (MemberCache.AddMethods): Use it.
2083         (MemberCache.ClearDeclaredOnly): Remove.
2084         (MemberCache.MemberCache): Update.
2085
2086 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2087
2088         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2089         variable.  This one is represents the actual low-level declaration
2090         of the method, as opposed to the semantic level `IsStatic'.   
2091
2092         An anonymous method which is hosted into a static method might be
2093         actually an instance method.  IsStatic would reflect the
2094         container, while MethodIsStatic represents the actual code
2095         generated.
2096
2097         * expression.cs (ParameterReference): Use the new MethodIsStatic
2098         instead of IsStatic.
2099
2100         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2101         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2102         set on the current EmitContext. 
2103
2104         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2105         resolve our casted expression as an LValue.  This triggers the
2106         proper LValue processing that is later required by Assign.
2107
2108         This fixes 72347.
2109
2110         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2111
2112 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2113
2114         C# 2.0 Fixed buffer implementation
2115
2116         * anonymous.cs: Update after RegisterHelperClass renaming.
2117
2118         * attribute.cs (AttributeTester.fixed_buffer_cache):
2119         Cache of external fixed buffers.
2120         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2121         implementation if field is fixed buffer else null.
2122
2123         * class.cs
2124         (TypeContainer.AddField): Accept FieldMember instead of Field.
2125         (FieldBase.IsFieldClsCompliant): Extracted code from
2126         VerifyClsCompliance descendant customization.
2127         (FixedField): New class handles fixed buffer fields.
2128         (FixedFieldExternal): Keeps information about imported fixed
2129         buffer.
2130         (IFixedField): Make access to internal or external fixed buffer
2131         same.
2132
2133         * cs-parser.jay: Add fixed buffer parsing.
2134
2135         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2136         buffer.
2137
2138         * expression.cs (Indirection): Extended implementation to accept
2139         fixed buffer field.
2140         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2141         (ElementAccess.MakePointerAccess): Get type as parameter.
2142         (DoResolve): Add fixed buffer field expression conversion.
2143         (DoResolveLValue): Ditto.
2144         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2145         (ArrayPtr): Derives from FixedBufferPtr.
2146         (ArrayPtr.Emit): Add extra emit for array elements.
2147
2148         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2149
2150         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2151         for compiler generated types.
2152         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2153
2154         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2155         and consume less memory.
2156         (Fixed.Resolve): Add fixed buffer case.
2157
2158         * typemanager.cs (compiler_generated_attr_ctor,
2159         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2160         (HasElementType): Add our own implementation to work on every
2161         runtime.
2162
2163 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2164
2165         * anonymous.cs (CaptureContext): Track whether `this' has been
2166         referenced.   
2167
2168         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2169         only captured `this' if it was implicitly done (instance
2170         methods/variables were used). 
2171
2172         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2173         `this' must be captured.
2174
2175 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2176  
2177         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2178         is null it means that there has been no need to capture anything,
2179         so we just create a sibling.
2180
2181         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2182
2183         Just a partial fix.  The other half is fairly elusive.
2184         
2185 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2186
2187         Fix #52586, cs0121-4.cs.
2188         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2189         and return a hashtable.
2190         (MemberCache.ClearDeclaredOnly): New.
2191         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2192         the method_hash of a base type too.
2193         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2194         type methods.  Overwrite entries with the same MethodHandle so
2195         that the ReflectedType is correct.  The process leaves in base
2196         virtual functions and their overrides as distinct entries.
2197         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2198         matters since it was boxed in a ArrayList before.
2199         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2200         modifier.
2201         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2202         case of a virtual function and its override (choose the overload
2203         as better).
2204         (Invocation.OverloadResolve): Avoid 'override' members during
2205         'applicable_type' calculation.
2206
2207 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2208
2209         Combine two near-redundant caches.
2210         * typemanager.cs (method_params): Rename from method_internal_params.
2211         (TypeManager.GetParameterData): New.  Replace
2212         Invocation.GetParameterData.
2213         (TypeManager.LookupParametersByBuilder): Remove.
2214         * expression.cs (Invocation.method_parameter_cache): Remove.
2215         (Invocation.GetParameterData): Remove.
2216         Update to changes.
2217         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2218         Update to changes.
2219
2220 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2221
2222         Fix #72015.
2223         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2224         TypeManager.multicast_delegate_type is null, resolve it by looking
2225         up "System.MulticastDelegate".
2226         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2227
2228 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2229             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2230             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2231
2232         Fix cs0164.cs.
2233         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2234         (LabeledStatement.AddReference): New.  Set 'referenced'.
2235         (Goto.Resolve): Use it.
2236
2237 2005-02-05  John Luke  <john.luke@gmail.com>
2238
2239         * driver.cs: remove duplicate -doc line in Usage ()
2240
2241 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2242
2243         * location.cs (Location.AddFile): Fix CS2002 error report.
2244
2245 2005-02-02  Martin Baulig  <martin@ximian.com>
2246
2247         * delegate.cs (Delegate.DefineType): Report an internal error if
2248         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2249         details.        
2250
2251 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2252
2253         Fix a crasher in a variant of #31984.
2254         * const.cs (Constant.CheckBase): New override that defers the
2255         new-or-override check in case the base type hasn't been populated
2256         yet.
2257         (Constant.Define): Ensure the new-or-override check is performed.
2258
2259 2005-02-01  Duncan Mak  <duncan@ximian.com>
2260
2261         * const.cs (LookupConstantValue): Check that `ce' is not null
2262         before calling GetValue ().
2263
2264 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2265
2266         Fix test-334.cs (#69519).
2267         * cs-parser.jay (using_alias_directive): Pass in an expression to
2268         NamespaceEntry.UsingAlias.
2269         (using_namespace_directive): Pass in an expression to
2270         NamespaceEntry.Using.
2271         (namespace_name): Don't flatten to a string.
2272         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2273         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2274         ResolveAsTypeStep.
2275         (NamespaceEntry.UsingEntry): Likewise.
2276         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2277         changes.
2278         (NamespaceEntry.LookupForUsing): Remove.
2279         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2280         names.
2281         (NamespaceEntry.Lookup): Remove support for dotted names.
2282
2283 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2284
2285         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2286         split into two.
2287         (NamespaceEntry.ImplicitParent): Compute on demand.
2288         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2289         parallels the current.
2290         (NamespaceEntry.LookupForUsing): Use it.
2291         (NamespaceEntry.Lookup): If the current namespace-entry is
2292         implicit, don't search aliases and using tables.
2293
2294 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2295
2296         Fix #31984.
2297         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2298         BaseCache here.
2299         (TypeContainer.BaseCache): Compute on demand.
2300         (TypeContainer.FindMembers): Define constants and types if they're
2301         not already created.
2302         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2303         check.
2304         * const.cs (Constant.Define): Make idempotent.
2305
2306 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2307
2308         * pending.cs: Produce better code (no nops produced by using Ldarg
2309         + value).
2310         
2311         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2312         i - 1' it should be arg + 1.
2313
2314         Fixes bug #71819.
2315
2316 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2317
2318         * attribute.cs (Attribute.CheckAttributeType): Make private
2319         non-virtual.
2320         (Attribute.ResolveType): Make virtual.
2321         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2322         handling of RootContext.Tree.Types.
2323
2324 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2325
2326         Update attribute-handling to use the SimpleName/MemberAccess
2327         mechanisms.
2328         * cs-parser.jay (attribute): Pass in an expression to the
2329         constructors of Attribute and GlobalAttribute.
2330         * attribute.cs (Attribute): Take an expression for the name.
2331         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2332         passed in attribute name expression.
2333         (Attribute.CheckAttributeType): Use it.
2334         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2335         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2336         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2337         argument to prevent error messages if the lookup fails.
2338
2339 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2340
2341         * expression.cs (Indirection): Implemented IVariable interface
2342         to support indirection in AddressOf operator.
2343         (PointerArithmetic.Emit): Add optimalization for case where
2344         result can be precomputed.
2345
2346 2005-01-26  Martin Baulig  <martin@ximian.com>
2347
2348         * class.cs (TypeContainer.AttributeTargets): Return the correct
2349         AttributeTargets depending on our `Kind' instead of throwing an
2350         exception; fixes #71632.
2351
2352 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2353
2354         Fix #71257
2355         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2356         constant members.
2357
2358 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2359
2360         Fix #71602.
2361         * expression.cs (MemberAccess.DoResolve): Don't complain with
2362         cs0572 when the LHS of a member access has identical name and type
2363         name.
2364
2365 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2366
2367         Fix #71651, #71675
2368         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2369         CreatePermission.
2370         Create custom PermissionSet only for PermissionSetAttribute.
2371
2372 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2373
2374         Fix #71649
2375         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2376         delegates in static class.
2377
2378 2005-01-24  Martin Baulig  <martin@ximian.com>
2379
2380         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2381         merging an implicit block, just use its reachability.
2382
2383         * statement.cs (Block.Resolve): Make the unreachable code check
2384         work wrt. implicit blocks; see test-337 from #63842.
2385
2386 2005-01-21  Alp Toker  <alp@atoker.com>
2387  
2388         * cs-parser.jay: destructor_declaration's container is PartialContainer
2389         not Class when partial types are used, so use Kind prop instead of
2390         'is'.
2391         
2392 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2393
2394         * cs-parser.jay: Improve error reporting when an interface
2395         declares new types.
2396
2397 2005-01-20  Dick Porter  <dick@ximian.com>
2398
2399         * support.cs: SeekableStreamReader fix from Sandor Dobos
2400         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2401         chars are read.  Fixes bug 70369.
2402
2403 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2404
2405         * cs-parser.jay (catch_clause): Simplify current_block handling
2406         somewhat.
2407
2408 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2409
2410         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2411         code with ImplicitStandardConversion to handle the implicit
2412         conversion of method groups into valid delegate invocations. 
2413
2414         The problem is that in parameter handling we were using this code
2415         path.  Fixes bug #64698
2416
2417 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2418
2419         * cs-parser.jay: Fix several infelicities.
2420         - Avoid assigning to the parser value stack.  Code like 
2421           '$3 = null' is unclean.  Synthesize a value for the code block
2422           instead. 
2423         - Avoid using oob_stack for storing location information.  Use ...
2424         (_mark_): ... this.  New (empty) rule.  Saves the current location
2425         in $$.
2426         (foreach_statement): Avoid using oob_stack for current_block
2427         handling.  Use technique used in for_statement and
2428         using_statement.  Synthesize a value for the code block to store
2429         additional intermediate information.
2430
2431 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2432
2433         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2434         of a different type is only allowed to private fields of a
2435         containing type, not on fields of a base class.
2436
2437         See test-174.cs and error cs0122-9.cs
2438
2439 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2440
2441         Fix test-335.cs (bug #58126).
2442         * cs-parser.jay (argument): Split out non-expression parts of the
2443         rule into 'non_simple_argument'.
2444         (invocation_expression): Support parenthesized invocations with
2445         multiple arguments, and with single non-simple arguments.
2446
2447 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2448
2449         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2450         places.
2451
2452 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2453
2454         Fix cs0038-1.cs, cs1640-6.cs.
2455         * ecore.cs (Expression.Resolve): Remove special-case for
2456         SimpleName in error-handling.
2457         (Expression.almostMatchedMembers): Relax access permission to
2458         protected.
2459         (Expression.MemberLookupFailed): Handle duplicates in
2460         almostMatchedMembers list.
2461         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2462         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2463         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2464         overload if the passed in MemberInfo is a MethodBase.
2465
2466 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2467
2468         Fix #70749
2469         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2470         for non-CAS & merge permission sets properly.
2471
2472 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2473
2474         Improve standard-compliance of simple name and member access 
2475         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2476         * ecore.cs (FullNamedExpression): New abstract base class 
2477         for Namespaces and TypeExpressions.
2478         (ResolveFlags.SimpleName): Remove.
2479         (SimpleName): Remove support for dotted names.
2480         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2481         DeclSpace.FindType and DeclSpace.LookupType.
2482         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2483         (Expression.ExprClassName): Make member function.
2484         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2485         a namespace.  Remove creation of dotted "SimpleName"s.
2486         (MemberAccess.DoResolve): Likewise.
2487         * decl.cs (DeclSpace.Cache): Make private.
2488         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2489         (DeclSpace.FindType): Update.
2490         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2491         FullNamedExpression.
2492         * namespace.cs (Namespace): Derive from FullNamedExpression
2493         so that it can be part of expression resolution.
2494         (Namespace.Lookup): Return an FullNamedExpression.
2495         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2496         namespace.
2497         * rootcontext.cs (NamespaceLookup): Remove.
2498         (LookupType): Move to DeclSpace.
2499         * attribute.cs (CheckAttributeType): Update.
2500         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2501         (FindDocumentedTypeNonArray): Likewise.
2502
2503 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2504
2505         Fix cs0509.cs, cs1632.cs.
2506         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2507         is the same as IsInterface.
2508         (TypeContainer.GetClassBases): Likewise.
2509         * statement.cs (LabeledStatement.ig): New field.
2510         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2511         label.
2512         (LabeledStatement.DoEmit): Check that the label was created with
2513         the same ILGenerator.
2514
2515 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2516
2517         Fix #71058
2518         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2519         accessors to its properties.
2520
2521         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2522         from accessors to property.
2523         
2524 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2525
2526         Fix #70722
2527         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2528         only for overrides.
2529         
2530 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2531
2532         * attribute.cs: Check for null and empty strings.  
2533
2534         I have lost another battle to Paolo.
2535
2536 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
2537
2538         Fix #70942
2539         * class.cs (PropertyMethod): Set Parent field in ctors.
2540         (SetMethod.InternalParameters): Add unsafe switch hack.
2541         Override MarkForDuplicationCheck where it is appropriate.
2542
2543         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
2544         It says whether container allows members with the same name.
2545         Base default is no.
2546         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
2547         Removed is_method parameter.
2548
2549 2005-01-06  Duncan Mak  <duncan@ximian.com>
2550
2551         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
2552         because the previous change led to incorrect reporting of CS1032
2553         ("Cannot define/undefine preprocessor symbols after first token in
2554         file"). Instead of using `tokens_seen' as the only flag that
2555         triggers CS1040, introduce `comments_seen'. This new flag is used
2556         to signify having seen comments on the current line, so it is
2557         unset after a newline.
2558
2559 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2560
2561         * doc.cs : When searching for a type, find nested type too.
2562           This fixes bug #71040.
2563
2564 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2565
2566         * doc.cs :
2567           - Warn missing member comment on those classes which also does not
2568             have doc comments. Fixed bug #71041.
2569           - Don't warn missing doc comment on default constructor.
2570             Fixed bug #71042.
2571
2572 2005-01-06  Duncan Mak  <duncan@ximian.com>
2573
2574         * cs-tokenizer.cs (xtoken): After handling traditional C-style
2575         comments, set `tokens_seen' to true. This allows us to detect
2576         misplaced preprocessor directives (i.e. not at the beginning of
2577         the a line, nor after whitespaces). In that case, report error
2578         CS1040. This fixes bug #56460.
2579
2580         * cs-parser.jay (interface_member_declaration): Add checks for
2581         IsExplicitImpl, and report CS0541 error if an interface member is
2582         defined as an explicit interface declaration.
2583
2584 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
2585
2586         Fix #70817
2587         * class.cs (PropertyMethod): Set Parent field in ctors.
2588         (SetMethod.InternalParameters): Add unsafe switch hack.
2589         
2590         * decl.cs (MemberCore.Parent): Cannot be readonly.
2591
2592 2005-01-06  Raja R Harinath  <rharinath@novell.com>
2593
2594         * decl.cs (DeclSpace.ResolveType): Remove.
2595         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
2596         Merge in code from ...
2597         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
2598         * class.cs, enum.cs: Update to changes.
2599
2600 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
2601
2602         * anonymous.cs: Ensure that we init the scope of our parent if it
2603         has not been initialized yet.
2604
2605 2004-12-30  Duncan Mak  <duncan@ximian.com>
2606
2607         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
2608         if field.FieldBuilder is null. Fixes #70758.
2609
2610         * convert.cs: Fixed some typos and updated some of the comments.
2611         (ImplicitStandardConversionExists):
2612         (TryImplicitIntConversion): If `target_type' is an interface and
2613         the type of `ic' implements this interface, return true or a new
2614         BoxedCast instead of null. This fixes #70468.
2615
2616 2004-12-29  Duncan Mak  <duncan@ximian.com>
2617
2618         * expression.cs (Argument.Emit): Check that Expr is
2619         IMemoryLocation before casting to it, and report CS1510 otherwise.
2620
2621         This fixes #70402.
2622
2623 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
2624
2625         * statement.cs (Block.ThisVariable): remove the recursion here, to
2626         make the --profile more sane.
2627
2628 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
2629
2630         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
2631         assembly, by JB Evain.
2632
2633 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2634
2635         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
2636           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
2637         "parent" refers to enclosing type/class.  "base" refers to superclass.
2638
2639 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2640
2641         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2642         Ensure that we only have GlobalAttributes.
2643         * attribute.cs (Attribute.Emit): Make non-virtual.
2644         (GlobalAttribute.Emit): Remove.
2645         (Attribute.Resolve): Make virtual.
2646         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
2647         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
2648         the argument. Don't create one.
2649         (Attribute.GetObsoleteAttribute): Likewise.
2650         (Attribute.GetClsCompliantAttributeValue): Likewise.
2651         * class.cs, decl.cs: Update to changes.
2652
2653 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
2654
2655         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
2656         
2657         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
2658         
2659         * statement.cs (Foreach.Resolve): Add error 186 report.
2660
2661 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
2662
2663         * expression.cs (Conditional.DoResolve): Add warning 429.
2664         
2665         * statement.cs (If.Resolve): Add warning 665.
2666
2667 2004-12-16  Raja R Harinath  <rharinath@novell.com>
2668
2669         New invariant: RootContext.Tree.Types.NamespaceEntry == null
2670         except when in the parser, and in GlobalAttribute.
2671         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
2672         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
2673         RootContext.Tree.Types.NamespaceEntry once work is done.
2674         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
2675         and resets RootContext.Tree.Types.NamespaceEntry.
2676
2677 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
2678
2679         * cs-parser.jay: Don't create a block for every variable.
2680
2681 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
2682
2683         * location.cs: Provide extra information.
2684
2685         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
2686         variables from the captured environment, it is the ldarg_0.
2687
2688 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2689
2690         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
2691         find a conclusion.
2692         
2693         * class.cs: Changed warning level for 169 to avoid developer
2694         displeasure from warning flooding. It will be changed back when they
2695         fix most of current BCL warnings.
2696         
2697         * RootContext.cs: Pushed default WarningLevel to 3.
2698         
2699         * statement.cs: Removed unused variable.
2700
2701 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2702
2703         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
2704         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
2705         Add error 502 report.
2706         (StaticClass.DefineType): Add error 441 report.
2707         (Class.AllowedModifiersProp): New virtual property as temporary
2708         extension to AllowedModifiers.
2709         (Class.DefineType): Add error 418 report. Moved ModFlags check here
2710         to share implementation with StaticClass and don't call virtual
2711         methods from ctor.
2712         
2713         * driver.cs (MainDriver): Add error 1558 test.
2714
2715         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
2716         report. Moved error 36 test here.
2717
2718         * statement.cs (Throw.Resolve): Add error 724 report.
2719
2720         * typemanager.cs: Add out_attribute_type core type.
2721         
2722 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
2723
2724         * class.cs (TypeContainer.VerifyClsCompliance): Add error
2725         3018 report.
2726         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
2727
2728         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
2729         3017 report.
2730         
2731         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
2732
2733         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
2734         Add error 3023 report.
2735         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
2736
2737         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
2738         implementation.
2739
2740 2004-12-12  John Luke  <john.luke@gmail.com>
2741
2742         * driver.cs (AddArgs): take -- into account when
2743         adding arguments, fixes bug 65710 
2744
2745 2004-12-12  Martin Baulig  <martin@ximian.com>
2746
2747         * expression.cs (Unary.TryReduceNegative): Added support for
2748         SByteConstant and ByteConstant.
2749         (Unary.Reduce): Check error values from TryReduceNegative().
2750
2751 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
2752
2753         * attributes.cs (Attribute.Resolve): Avoid multiple error report
2754         and report exception as error 182.
2755
2756 2004-12-10  Raja R Harinath  <rharinath@novell.com>
2757
2758         * driver.cs (Main): Fix message when there are warnings.
2759
2760 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
2761
2762         * delegate.cs: Fixed my fix from yesterday, sorry about that.
2763
2764 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
2765
2766         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
2767         Reduced number of warnings.
2768         
2769         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
2770
2771 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
2772
2773         * driver.cs: Removed message.
2774
2775         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
2776
2777 2004-12-08    <vargaz@freemail.hu>
2778
2779         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
2780
2781 2004-12-08  Martin Baulig  <martin@ximian.com>
2782
2783         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
2784         instead of a CS3002 for properties and indexer.
2785
2786 2004-12-08  Martin Baulig  <martin@ximian.com>
2787
2788         * decl.cs (MemberName.ToString): Make this work again.
2789
2790 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
2791
2792         * attribute.cs (Resolve): Add error 591 detection.
2793
2794         * class.cs (FieldMember.Define): Add error 1547 detection.
2795         (Indexer.Define): Add error 620 detection.
2796         (Operator.Define): Add error 590 detection.
2797
2798         * ecore.cs: Missing argument for error 79.
2799
2800         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
2801         detection.
2802
2803 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
2804
2805         Fix #70106
2806         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
2807         only.
2808
2809 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
2810
2811         * cs-parser.jay : handle doc comments on implicit/explicit operators.
2812           Some operator comments were suppressed.
2813         * doc.cs : Implicit/explicit operator name in doc comments are like
2814           "op_Explicit(type)~returnType", so added suffix handling.
2815
2816 2004-12-07  Martin Baulig  <martin@ximian.com>
2817
2818         * decl.cs
2819         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2820         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2821         (DeclSpace.ec): New protected field; store the EmitContext here.
2822         (DeclSpace.EmitContext): New public property; moved here from
2823         `TypeContainer'.
2824         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2825         EmitContext.
2826
2827         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2828         (Enum.Emit): Don't create a new EmitContext.
2829
2830         * delegate.cs (Delegate.DefineType): Always create the
2831         EmitContext.
2832
2833         * iterators.cs (Iterators.DefineIterator): Create a new
2834         EmitContext and store it in `ec'.
2835
2836 2004-08-24  Martin Baulig  <martin@ximian.com>
2837
2838         * typemanager.cs
2839         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
2840         this for accessibility checks.
2841         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
2842         IsNestedFamilyAccessible.
2843         (TypeManager.IsSubclassOf): New method, do what the name actually
2844         says.   
2845
2846 2004-12-06  Raja R Harinath  <rharinath@novell.com>
2847
2848         Fix crash on cs0657-17.cs.
2849         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2850         Use RootContext.Tree.Types, not 'new RootTypes ()'.
2851         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
2852         the case where the NamespaceEntry gets overwritten.
2853
2854 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
2855
2856         Fixed #69195, #56821
2857         * ecore.cs (ResolveBoolean): Tiny refactoring.
2858
2859         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
2860         of right expression resolving when left is false constant and
2861         operator is LogicalAnd OR true constant and operator is LogicalOr.
2862
2863         * statement.cs (ResolveUnreachable): Always reports warning.
2864
2865 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
2866
2867         * class.cs: Distinguish between 1721 and 1722 (just a little help
2868         for the programmer).
2869
2870 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
2871
2872         * delegate.cs: Only allow this on new versions of the language. 
2873
2874 2004-12-02  Duncan Mak  <duncan@ximian.com>
2875
2876         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
2877         Expression class.
2878         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
2879         here as a static method. Take an additional bool out parameter
2880         `must_do_cs1540_check' for signaling to InstanceResolve.
2881         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
2882         member field from PropertyExpr class and made it an argument of
2883         the method instead.
2884         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
2885         check for MarshalByRefObject, and report CS0122 instead of CS1540.
2886         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
2887         and `remove_accessor' as well as InstanceResolve: report CS0122
2888         where applicable.
2889
2890         Fixes #70129.
2891
2892 2004-12-03  Raja R Harinath  <rharinath@novell.com>
2893
2894         Fix test-327.cs, test-328.cs, and put in early infrastructure
2895         for eventually fixing #52697.
2896         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
2897         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
2898         from other methods.
2899         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
2900         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
2901         (VerifyUsing, error246): Update.
2902         * rootcontext.cs (RootContext.NamespaceLookup): Just use
2903         'NamespaceEntry.LookupNamespaceOrType'.
2904
2905 2004-12-03  Martin Baulig  <martin@ximian.com>
2906
2907         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
2908         method as our child, call AnonymousMethod.Compatible() on it.
2909
2910 2004-12-03  Raja R Harinath  <rharinath@novell.com>
2911
2912         Disable XML documentation support in 'basic' profile.
2913         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
2914         Redirect XmlElement to System.Object.
2915         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
2916         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
2917         * mcs.exe.sources: Add doc-bootstrap.cs.
2918         * doc-bootstrap.cs: New file.  Contains empty stub implementation
2919         of doc.cs.
2920
2921 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
2922
2923         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
2924           comments are allowed.
2925
2926 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2927
2928         * delegate.cs: Add checks for subtypes in paramaters and return values
2929         in VerifyMethod () to add support for Covariance/Contravariance
2930         in delegates.
2931         
2932 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
2933
2934         * report.cs: Remove extra closing parenthesis.
2935
2936         * convert.cs (Error_CannotImplicitConversion): If the name of the
2937         types are the same, provide some extra information.
2938
2939         * class.cs (FieldBase): Use an unused bit field from the field to
2940         encode the `has_offset' property from the FieldMember.  This saves
2941         a couple of Ks on bootstrap compilation.
2942
2943         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
2944         method as our child, return the AnonymousMethod resolved
2945         expression.
2946
2947         * expression.cs (New.DoResolve): Allow return values from
2948         NewDelegate to also include AnonymousMethods.
2949
2950         Fixes #70150.
2951
2952 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
2953
2954         Fix bug #70102
2955         * attribute.cs (Resolve): Improved implementation of params
2956         attribute arguments.
2957
2958         * support.cs (ParameterData): Add HasParams to be faster.
2959
2960 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
2961
2962         all things are for /doc support:
2963
2964         * doc.cs: new file that supports XML documentation generation.
2965         * mcs.exe.sources: added doc.cs.
2966         * driver.cs:
2967           Handle /doc command line option.
2968           Report error 2006 instead of 5 for missing file name for /doc.
2969           Generate XML documentation when required, after type resolution.
2970         * cs-tokenizer.cs:
2971           Added support for picking up documentation (/// and /** ... */),
2972           including a new XmlCommentState enumeration.
2973         * cs-parser.jay:
2974           Added lines to fill Documentation element for field, constant,
2975           property, indexer, method, constructor, destructor, operator, event
2976           and class, struct, interface, delegate, enum.
2977           Added lines to warn incorrect comment.
2978         * rootcontext.cs :
2979           Added Documentation field (passed only when /doc was specified).
2980         * decl.cs:
2981           Added DocComment, DocCommentHeader, GenerateDocComment() and
2982           OnGenerateDocComment() and some supporting private members for
2983           /doc feature to MemberCore.
2984         * class.cs:
2985           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
2986         * delegate.cs:
2987           Added overriden DocCommentHeader.
2988         * enum.cs:
2989           Added overriden DocCommentHeader and GenerateDocComment().
2990
2991 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
2992
2993         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
2994         unwrapping the enumeration values, chain to
2995         DoConstantNumericPromotions again, so we can promote things to the
2996         fundamental types (takes care of enums that are bytes, sbytes).
2997
2998         Fixes bug #62054.
2999
3000 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3001
3002         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3003         Fix long-standing bug in type-lookup.  Use FindType instead of
3004         LookupType when ec.ResolvingTypeTree.
3005         (Attribute.ResolveType, Attribute.Resolve)
3006         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3007         Update to changes.
3008         (Attributes.Search): Remove internal version.  Update.
3009         (Attributes.SearchMulti): Update.
3010         (Attributes.GetClsCompliantAttribute): Remove.
3011         (Attributes.GetIndexerNameAttribute): Remove.
3012         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3013         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3014         * class.cs (Indexer.Define): Likewise.
3015
3016 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3017
3018         Fix bug #68790
3019         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3020         MarshallByReference members access.
3021
3022         * expression.cs: Use CheckMarshallByRefAccess;
3023         Better error CS0197 message.
3024
3025         * report.cs: Print whole related error message.
3026
3027 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3028
3029         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3030         the current directory to help debugging.
3031
3032 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3033
3034         * class (GetClassBases): Better error 60 report.
3035         (EventProperty): Disabled warning 67 detection.
3036
3037 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3038
3039         Fix bug #60324
3040         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3041
3042         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3043         precise values.
3044
3045 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3046
3047         Fix bug #49488
3048         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3049
3050         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3051
3052 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3053
3054         * attribute.cs (Attribute.Resolve): Refine error reporting and
3055         report a cs0117 if the identifier does not exist, to distinguish
3056         from 0617 which is a miss-use of the actual identifier.
3057
3058         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3059         between cs0070 and cs0079.
3060
3061         * class.cs (MemberBase.DoDefine): When reporting a wrong
3062         accessibility level, we use MethodCore to compare instead of
3063         Method (this was a regression in some refactoring effort).
3064
3065         So now we correctly report cs0056 again.
3066
3067         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3068         testing the target_type (which was known to be object_type) and
3069         not the source type (which is anonymous_method).
3070
3071         Fixed reporting of error cs1660.
3072
3073         * expression.cs (UserCast.Source): Expose the underlying cast.
3074
3075         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3076         allowed types to find a match to int32 first (most common).
3077
3078         In addition, it ignores any ImplicitUserConversions that did an
3079         internal implicit conversion (as the switch statement allows only
3080         one integral conversion to exist).
3081
3082         * class.cs (PartialContainer.Create): rename `name' to
3083         `member_name' for clarity.  Then replace the string calls with a
3084         call to MemberName.GetPartialName, as now using
3085         MemberName.ToString is an error (this is due to the side effects
3086         it had, that were fixed in the past).
3087
3088         This will restore the error reporting on a number of partial class
3089         errors that were missusing this (and getting an exception as a
3090         results, which is now just a plain textual warning, because
3091         yyparse debug output would crash otherwise).
3092
3093 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3094
3095         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3096
3097 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3098
3099         * rootcontext.cs (LookupType): Make sure to cache lookups that
3100         don't give us a negative result. This saves about 5% of corlib
3101         compilation time.
3102
3103 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3104
3105         * report.cs (AbstractMessage.Print): messages are sent to stderr
3106
3107         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3108         non-interface in the list of interfaces (at this point, either
3109         parent was properly set, or a base class is being listed in the
3110         interfaces section).
3111
3112         This flags error 1722, and resolves the crash from bug 69259.
3113
3114 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3115
3116         * statement.cs (Using.EmitExpressionFinally): make this work right
3117         for valuetypes. Fixes 69926.
3118
3119 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3120
3121         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3122         converted to an enum" here, before we try to change the underlying
3123         type.  This code exists, but it is a different code path than the
3124         one used while encoding constants.
3125
3126         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3127         old bug: when converting from the null literal to a pointer,
3128         return an EmptyCast, not the NullLiteral.
3129
3130         This fixes #69921, the recent null_type changes probably made this
3131         bug more prominent.
3132
3133         (ImplicitReferenceConversionExists): In addition, resynchronized
3134         the code here, so it matches the same code in
3135         ImplicitReferenceConversionExists for the `from any class-type S
3136         to any interface-type T'.
3137         
3138
3139 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3140
3141         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3142
3143 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3144
3145         * cs-parser.jay: Use verbosity accordingly. 
3146
3147 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3148
3149         * expression.cs (Unary.ResolveOperator): Do not report warning;
3150         AddressOf reads from variable.
3151         
3152         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3153
3154 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3155
3156         Fix bug #69462
3157
3158         * attribute.cs (Attributable): Removed CheckTargets.
3159         (Attributes.Emit): Explicit attribute targets are tested here.
3160
3161         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3162         not enabled for interfaces.
3163
3164         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3165         (GetAssemblyName): Ouch next bug there.
3166
3167 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3168
3169         * expression.cs: Error 275 added.
3170         
3171 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3172
3173         Fix bug #69177 (Implemented decimal constant support)
3174
3175         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3176         (BinaryFold): Add DecimalConstant.
3177
3178         * const.cs (Define): Decimal constant 
3179         (is not constant.
3180         (ChangeType): Add decimal type handling.
3181         (LookupConstantValue): Don't set value for decimal type but
3182         emit DecimalConstantAttribute. Needed for constant optimization.
3183
3184         * constant.cs (ToDecimal): New method.
3185         (ConvertToDecimal): New method.
3186         (IntConstant): Implemented ConvertToDecimal.
3187         (DecimalConstant.Emit): Emit optimized version for decimals in
3188         int range.
3189
3190         * expression.cs (ResolveOperator): Changed order of constant
3191         reduction to work correctly with native types which have
3192         overloaded operators.
3193         (ResolveMemberAccess): Extract constant value from attribute
3194         for decimal type.
3195
3196         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3197
3198         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3199         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3200         (ChangeType): Decimal is special.
3201         (TypeToCoreType): Add decimal type.
3202
3203 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3204
3205         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3206         decimal types.
3207
3208 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3209
3210         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3211         test cs1667-5.cs.
3212
3213 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3214
3215         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3216
3217         * pending.cs (PendingImplementation): Grab only interfaces.
3218
3219 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3220
3221         * statement.cs (ForeachHelperMethods): Add location member and
3222         error 202 detection.
3223
3224 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3225
3226         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3227         automatically handled by executable.make.
3228         (PROGRAM): Make profile-specific.
3229
3230 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3231
3232         * expression.cs (DoResolveBase): Fixed wrong warning for out
3233         variables.
3234
3235 2004-11-18  Martin Baulig  <martin@ximian.com>
3236
3237         Merged latest changes into gmcs.  Please keep this comment in
3238         here, it makes it easier for me to see what changed in MCS since
3239         the last time I merged.
3240
3241 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3242
3243         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3244         (TypeHandle.GetMemberCache): New.
3245         (TypeHandle.TypeHandle): Update.
3246         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3247         (TypeManager.LookupParentInterfacesCache):
3248         Rename from LookupInterfaceCache.  Optimize slightly.
3249         (TypeManager.MemberLookup_FindMembers): Update.
3250         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3251         multi-type variant.
3252         (AddCacheContents): Rename from AddHashtable.
3253         * class.cs (TypeContainer.parent_container): Remove.
3254         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3255         (TypeContainer.DoDefineMembers): Don't initialize it.
3256         Update to name changes.
3257         
3258 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3259
3260         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3261         that factors the code to check access modifiers on override.  
3262
3263         (PropertyBase): Use the code here.
3264
3265         Patch from Lluis S'anchez, fixes bug #69361.
3266
3267 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3268
3269         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3270         routine that is used to report the use of a captured variable
3271         whose address has been taken.
3272
3273         There are two checks: one when variables are being captured and
3274         the other check is when the address of a variable is taken. 
3275         
3276         (because an anonymous methods might be resolved before *or* after
3277         the address has been taken) and 
3278
3279         * expression.cs (Conditional.DoResolve): Remove the special
3280         casing that Martin added to trueExpr and falseExpr being both
3281         NullLiteral.  We get the right behavior now just by introducing
3282         the null_type into the compiler. 
3283
3284         * convert.cs (ExplicitConversion): Change the code to use
3285         null_type instead of testing `expr is NullLiteral'.
3286         (ImplicitConversionStandard): use null_type too.
3287         (ImplicitReferenceConversionExists): use null_type too.
3288         (ImplicitReferenceConversion): use null_type too.
3289
3290         * literal.cs: The type of `NullLiteral' is now null_type instead
3291         of object_type. 
3292         (Resolve): Set the type here.
3293
3294         * typemanager.cs: Introduce null_type.
3295
3296 2004-11-17  Martin Baulig  <martin@ximian.com>
3297
3298         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3299         direction, like FindMembers() does.  Fixes #69546, testcase is in
3300         test-315.cs.    
3301
3302 2004-11-16  Martin Baulig  <martin@ximian.com>
3303
3304         This is based on a patch from Marek Safar, see bug #69082.
3305         Fixes bugs #63705 and #67130.
3306
3307         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3308         method; create a MemberCache for an interface type and cache the
3309         result.
3310
3311         * decl.cs (IMemberContainer.ParentContainer): Removed.
3312         (IMemberContainer.ParentCache): New property.
3313         (MemberCache.SetupCacheForInterface): Removed.
3314         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3315         to create a cache for an interface's "parent".
3316
3317         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3318         interfaces too.
3319
3320 2004-11-16  Martin Baulig  <martin@ximian.com>
3321
3322         Merged back from gmcs; these changes already went into gmcs a
3323         couple of weeks ago.
3324
3325         * typemanager.cs
3326         (TypeManager.AddUserType): Removed the `ifaces' argument.
3327         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
3328         `TypeExpr []'.
3329         (TypeManager.AddUserInterface): Removed.
3330         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
3331         `TypeExpr []'.
3332         (TypeManager.GetInterfaces): Likewise.
3333         (TypeManager.GetExplicitInterfaces): Likewise.
3334
3335         * ecore.cs (TypeExpr.GetInterfaces): Removed.
3336
3337         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
3338         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
3339
3340 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3341
3342         * statement.cs: Avoid adding bools to a hashtable.
3343
3344 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3345
3346         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3347         calling an unsafe method from a safe location.
3348
3349 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3350
3351         Fix #69167
3352         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3353
3354 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3355
3356         * namespace.cs (VerifyUsing): use GetPartialName instead of
3357         ToString. 
3358
3359 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3360
3361         * statement.cs (Return.Resolve): Fix regression in typo: if
3362         `in_exc', we have to request a NeedReturnLabel, this was a typo
3363         introduced in the anonymous method check-in.  Fixes #69131.
3364
3365         * Indexers were using the ShortName when defining themselves,
3366         causing a regression in the compiler bootstrap when applying the
3367         patch from 2004-11-02 (first part), now they use their full name
3368         and the bug is gone.
3369
3370 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3371
3372         * driver.cs: Strip the path from the names of embedded resources. Fixes
3373         #68519.
3374
3375 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3376
3377         Fix error message regression: cs0104-2.cs.
3378         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3379         (AliasEntry.Resolve): Update.
3380         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3381         'silent' flag.
3382         (RootContext.LookupType): Update.
3383
3384 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3385
3386         * cs-parser.jay: Add support for handling accessor modifiers
3387         * class: Add support port accessor modifiers and error checking,
3388         define PropertyMethod.Define as virtual (not abstract anymore)
3389         * ecore.cs: Add checking for proeprties access with access modifiers
3390         * iterators.cs: Modify Accessor constructor call based in the modified
3391         constructor
3392 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3393
3394         * expression.cs (StringConcat): Handle being called twice,
3395         as when we have a concat in a field init with more than two
3396         ctors in the class
3397
3398 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3399
3400         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3401         special case explicit implementations, we should always produce
3402         the .property or .event declaration.
3403         
3404         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3405         since it will not return correct data if people use this
3406         unresolved in the presence of using statements (see test-313).
3407
3408         * class.cs (MethodData.Define): If we are an explicit interface
3409         implementation, set the method name to the full name of the
3410         interface plus the name of the method.  
3411
3412         Notice that using the method.MethodName.GetFullName() does not
3413         work, as it will only contain the name as declared on the source
3414         file (it can be a shorthand in the presence of using statements)
3415         and not the fully qualifed type name, for example:
3416
3417         using System;
3418
3419         class D : ICloneable {
3420                 object ICloneable.Clone ()  {
3421                 }
3422         }
3423
3424         Would produce a method called `ICloneable.Clone' instead of
3425         `System.ICloneable.Clone'.
3426
3427         * namespace.cs (Alias.Resolve): Use GetPartialName.
3428         
3429 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3430
3431         * cs-parser.jay: Add error 1055 report.
3432
3433 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3434
3435         * assign.cs (Assign.DoResolve): Only do the transform of
3436         assignment into a New if the types are compatible, if not, fall
3437         through and let the implicit code deal with the errors and with
3438         the necessary conversions. 
3439
3440 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3441
3442         * cs-parser.jay: Add error 1031 report.
3443
3444         * cs-tokenizer.cs: Add location for error 1038.
3445
3446 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3447
3448         * cs-parser.jay: Add error 1016 report.
3449
3450 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3451
3452         * cs-parser.jay: Add errors 1575,1611 report.
3453
3454 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3455
3456         * cs-parser.jay: Add error 1001 report.
3457
3458 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3459
3460         Fix #68850
3461         * attribute.cs (GetMarshal): Add method argument for
3462         caller identification.
3463
3464         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
3465         agument for GetMarshal and RuntimeMissingSupport.
3466
3467 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3468
3469         * attribute.cs (ExtractSecurityPermissionSet): Removed
3470         TypeManager.code_access_permission_type.
3471
3472         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3473
3474 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3475
3476         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3477         for obsolete use of a variable here.   Fixes regression on errors
3478         cs0619-25 and cs0619-26.
3479
3480 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3481
3482         Fix #62358, implemented security attribute encoding.
3483
3484         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3485         Tests permitted SecurityAction for assembly or other types.
3486         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3487         data from SecurityPermissionAttribute to PermisionSet class.
3488
3489         * class.cs (ApplyAttributeBuilder): Added special handling
3490         for System.Security.Permissions.SecurityAttribute based types.
3491
3492         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
3493         special handling for System.Security.Permissions.SecurityAttribute
3494         based types.
3495
3496         * enum.cs (ApplyAttributeBuilder): Added special handling
3497         for System.Security.Permissions.SecurityAttribute based types.
3498
3499         * parameter.cs (ApplyAttributeBuilder): Added special handling
3500         for System.Security.Permissions.SecurityAttribute based types.
3501
3502         * rootcontext.cs: Next 2 core types.
3503
3504         * typemanager.cs (TypeManager.security_permission_attr_type):
3505         Built in type for the SecurityPermission Attribute.
3506         (code_access_permission_type): Build in type.
3507
3508 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
3509
3510         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
3511         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
3512         all of this information into
3513         EmitContext.EmitCapturedVariableInstance.
3514         
3515         * codegen.cs (EmitCapturedVariableInstance): move here the
3516         funcionality of emitting an ldarg.0 in the presence of a
3517         remapping.   This centralizes the instance emit code.
3518
3519         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
3520         then emit a load of this: it means that we have reached the
3521         topmost ScopeInfo: the one that contains the pointer to the
3522         instance of the class hosting the anonymous method.
3523
3524         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
3525         captures to the topmost CaptureContext.
3526
3527 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
3528
3529         * expression.cs (LocalVariableReference): Move the knowledge about
3530         the iterators into codegen's EmitCapturedVariableInstance.
3531
3532 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
3533
3534         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
3535         all code paths return a value from an anonymous method (it is the
3536         same as the 161 error, but for anonymous methods).
3537
3538 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
3539
3540         The introduction of anonymous methods in the compiler changed
3541         various ways of doing things in the compiler.  The most
3542         significant one is the hard split between the resolution phase
3543         and the emission phases of the compiler.
3544
3545         For instance, routines that referenced local variables no
3546         longer can safely create temporary variables during the
3547         resolution phase: they must do so from the emission phase,
3548         since the variable might have been "captured", hence access to
3549         it can not be done with the local-variable operations from the runtime.
3550         
3551         * statement.cs 
3552
3553         (Block.Flags): New flag `IsTopLevel' to indicate that this block
3554         is a toplevel block.
3555
3556         (ToplevelBlock): A new kind of Block, these are the blocks that
3557         are created by the parser for all toplevel method bodies.  These
3558         include methods, accessors and anonymous methods.
3559
3560         These contain some extra information not found in regular blocks:
3561         A pointer to an optional CaptureContext (for tracking captured
3562         local variables and parameters).  A pointer to the parent
3563         ToplevelBlock.
3564         
3565         (Return.Resolve): Catch missmatches when returning a value from an
3566         anonymous method (error 1662).
3567         Invoke NeedReturnLabel from the Resolve phase instead of the emit
3568         phase.
3569
3570         (Break.Resolve): ditto.
3571
3572         (SwitchLabel): instead of defining the labels during the
3573         resolution phase, we now turned the public ILLabel and ILLabelCode
3574         labels into methods called GetILLabelCode() and GetILLabel() that
3575         only define the label during the Emit phase.
3576
3577         (GotoCase): Track the SwitchLabel instead of the computed label
3578         (its contained therein).  Emit the code by using
3579         SwitchLabel.GetILLabelCode ().
3580
3581         (LocalInfo.Flags.Captured): A new flag has been introduce to track
3582         whether the Local has been captured or not.
3583
3584         (LocalInfo.IsCaptured): New property, used to tell whether the
3585         local has been captured.
3586         
3587         * anonymous.cs: Vastly updated to contain the anonymous method
3588         support.
3589
3590         The main classes here are: CaptureContext which tracks any
3591         captured information for a toplevel block and ScopeInfo used to
3592         track the activation frames for various local variables.   
3593
3594         Each toplevel block has an optional capture context associated
3595         with it.  When a method contains an anonymous method both the
3596         toplevel method and the anonymous method will create a capture
3597         context.   When variables or parameters are captured, they are
3598         recorded on the CaptureContext that owns them, for example:
3599
3600         void Demo () {
3601              int a;
3602              MyDelegate d = delegate {
3603                  a = 1;
3604              }
3605         }
3606
3607         Here `a' will be recorded as captured on the toplevel
3608         CapturedContext, the inner captured context will not have anything
3609         (it will only have data if local variables or parameters from it
3610         are captured in a nested anonymous method.
3611
3612         The ScopeInfo is used to track the activation frames for local
3613         variables, for example:
3614
3615         for (int i = 0; i < 10; i++)
3616                 for (int j = 0; j < 10; j++){
3617                    MyDelegate d = delegate {
3618                         call (i, j);
3619                    }
3620                 }
3621
3622         At runtime this captures a single captured variable `i', but it
3623         captures 10 different versions of the variable `j'.  The variable
3624         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
3625         recorded on a child.  
3626
3627         The toplevel ScopeInfo will also track information like the `this'
3628         pointer if instance variables were referenced (this is necessary
3629         as the anonymous method lives inside a nested class in the host
3630         type of the method). 
3631
3632         (AnonymousMethod): Expanded to track the Toplevel, implement
3633         `AnonymousMethod.Compatible' to tell whether an anonymous method
3634         can be converted to a target delegate type. 
3635
3636         The routine now also produces the anonymous method content
3637
3638         (AnonymousDelegate): A helper class that derives from
3639         DelegateCreation, this is used to generate the code necessary to
3640         produce the delegate for the anonymous method that was created. 
3641
3642         * assign.cs: API adjustments for new changes in
3643         Convert.ImplicitStandardConversionExists.
3644
3645         * class.cs: Adjustments to cope with the fact that now toplevel
3646         blocks are of type `ToplevelBlock'. 
3647
3648         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
3649         insteda of standard blocks.
3650
3651         Flag errors if params arguments are passed to anonymous methods.
3652
3653         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
3654         `CurrentAnonymousMethod' which points to the current Anonymous
3655         Method.  The variable points to the AnonymousMethod class that
3656         holds the code being compiled.  It is set in the new EmitContext
3657         created for the anonymous method.
3658
3659         (EmitContext.Phase): Introduce a variable and an enumeration to
3660         assist in enforcing some rules about when and where we are allowed
3661         to invoke certain methods (EmitContext.NeedsReturnLabel is the
3662         only one that enfonces this right now).
3663
3664         (EmitContext.HaveCaptureInfo): new helper method that returns
3665         whether we have a CapturedContext initialized.
3666
3667         (EmitContext.CaptureVariable): New method used to register that a
3668         LocalInfo must be flagged for capturing. 
3669
3670         (EmitContext.CapturedParameter): New method used to register that a
3671         parameters must be flagged for capturing. 
3672         
3673         (EmitContext.CapturedField): New method used to register that a
3674         field must be flagged for capturing. 
3675
3676         (EmitContext.HaveCapturedVariables,
3677         EmitContext.HaveCapturedFields): Return whether there are captured
3678         variables or fields. 
3679
3680         (EmitContext.EmitMethodHostInstance): This is used to emit the
3681         instance for the anonymous method.  The instance might be null
3682         (static methods), this (for anonymous methods that capture nothing
3683         and happen to live side-by-side with the current method body) or a
3684         more complicated expression if the method has a CaptureContext.
3685
3686         (EmitContext.EmitTopBlock): Routine that drives the emission of
3687         code: it will first resolve the top block, then emit any metadata
3688         and then emit the code.  The split is done so that we can extract
3689         any anonymous methods and flag any captured variables/parameters.
3690         
3691         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
3692         during this phase, the ILGenerator should not be used as labels
3693         and local variables declared here might not be accessible to any
3694         code that is part of an anonymous method.  
3695
3696         Exceptions to this include the temporary variables that are
3697         created by some statements internally for holding temporary
3698         variables. 
3699         
3700         (EmitContext.EmitMeta): New routine, in charge of emitting all the
3701         metadata for a cb
3702
3703         (EmitContext.TemporaryReturn): This method is typically called
3704         from the Emit phase, and its the only place where we allow the
3705         ReturnLabel to be defined other than the EmitMeta.  The reason is
3706         that otherwise we would have to duplicate a lot of logic in the
3707         Resolve phases of various methods that today is on the Emit
3708         phase. 
3709
3710         (EmitContext.NeedReturnLabel): This no longer creates the label,
3711         as the ILGenerator is not valid during the resolve phase.
3712
3713         (EmitContext.EmitThis): Extended the knowledge in this class to
3714         work in anonymous methods in addition to iterators. 
3715
3716         (EmitContext.EmitCapturedVariableInstance): This emits whatever
3717         code is necessary on the stack to access the instance to a local
3718         variable (the variable will be accessed as a field).
3719
3720         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
3721         EmitContext.EmitAddressOfParameter): Routines to support
3722         parameters (not completed at this point). 
3723         
3724         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
3725         will also remove the parameters.
3726
3727         * convert.cs (Convert): Define a `ConstantEC' which points to a
3728         null.  This is just to prefity some code that uses
3729         ImplicitStandardConversion code and do not have an EmitContext
3730         handy.
3731
3732         The idea is to flag explicitly that at that point in time, it is
3733         known that the conversion will not trigger the delegate checking
3734         code in implicit conversions (which requires a valid
3735         EmitContext). 
3736
3737         Everywhere: pass new EmitContext parameter since
3738         ImplicitStandardConversionExists now requires it to check for
3739         anonymous method conversions. 
3740
3741         (Convert.ImplicitStandardConversionExists): If the type of an
3742         expression is the anonymous_method_type, and the type is a
3743         delegate, we invoke the AnonymousMethod.Compatible method to check
3744         whether an implicit conversion is possible. 
3745
3746         (Convert.ImplicitConversionStandard): Only do implicit method
3747         group conversions if the language level is not ISO_1.
3748
3749         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
3750         MethodInfo for the Invoke method.  used by Delegate and
3751         AnonymousDelegate.
3752
3753         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
3754         method conversions if the target type is a delegate.
3755
3756         Removed extra debugging nops.
3757
3758         (LocalVariableReference): Turn the `local_info' into a public
3759         field. 
3760
3761         Add `prepared' field, the same hack used for FieldExprs to cope
3762         with composed assignments, as Local variables do not necessarily
3763         operate purely on the stack as they used to: they can be captured
3764         fields. 
3765
3766         Add `temp' for a temporary result, like fields.
3767
3768         Refactor DoResolve and DoResolveLValue into DoResolveBase.
3769
3770         It now copes with Local variables that are captured and emits the
3771         proper instance variable to load it from a field in the captured
3772         case. 
3773
3774         (ParameterReference.DoResolveBase): During the resolve phase,
3775         capture parameters if we are in an anonymous method.
3776
3777         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
3778         anonymous method, use the EmitContext helper routines to emit the
3779         parameter reference.
3780
3781         * iterators.cs: Set RemapToProxy to true/false during the
3782         EmitDispose class.
3783
3784         * parameters.cs (GetParameterByName): New helper method. 
3785
3786         * typemanager.cs (anonymous_method_type) a new type that
3787         represents an anonyous method.  This is always an internal type,
3788         used as a fencepost to test against the anonymous-methodness of an
3789         expression. 
3790         
3791 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
3792
3793         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
3794         561 report.
3795         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
3796
3797 2004-10-18  Martin Baulig  <martin@ximian.com>
3798
3799         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
3800         `Type' directly, but call ResolveType() on it.
3801         (Catch.Resolve): Likewise.
3802         (Foreach.Resolve): Likewise.
3803
3804 2004-10-18  Martin Baulig  <martin@ximian.com>
3805
3806         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
3807         `Type' directly, but call ResolveType() on it.
3808         (Probe.DoResolve): Likewise.
3809         (ArrayCreation.LookupType): Likewise.
3810         (TypeOf.DoResolve): Likewise.
3811         (SizeOf.DoResolve): Likewise.
3812
3813 2004-10-18  Martin Baulig  <martin@ximian.com>
3814
3815         * expression.cs (Invocation.BetterFunction): Put back
3816         TypeManager.TypeToCoreType().
3817
3818 2004-10-18  Raja R Harinath  <rharinath@novell.com>
3819
3820         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
3821         the ResolveType.
3822
3823 2004-10-18  Martin Baulig  <martin@ximian.com>
3824
3825         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
3826         `Type' directly, but call ResolveType() on it.
3827
3828 2004-10-18  Martin Baulig  <martin@ximian.com>
3829
3830         * class.cs (FieldMember.Define): Don't access the TypeExpr's
3831         `Type' directly, but call ResolveType() on it.
3832         (MemberBase.DoDefine): Likewise.
3833
3834         * expression.cs (New.DoResolve): Don't access the TypeExpr's
3835         `Type' directly, but call ResolveType() on it.
3836         (ComposedCast.DoResolveAsTypeStep): Likewise.
3837
3838         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
3839         `Type' directly, but call ResolveType() on it.
3840
3841 2004-10-17  John Luke  <john.luke@gmail.com>
3842
3843         * class.cs (Operator.GetSignatureForError): use CSharpName
3844
3845         * parameter.cs (Parameter.GetSignatureForError): Returns
3846         correct name even if was not defined.
3847
3848 2004-10-13  Raja R Harinath  <rharinath@novell.com>
3849
3850         Fix #65816.
3851         * class.cs (TypeContainer.EmitContext): New property.
3852         (DefineNestedTypes): Create an emitcontext for each part.
3853         (MethodCore.DoDefineParameters): Use container's emitcontext.
3854         Pass type array to InternalParameters.
3855         (MemberBase.DoDefine): Use container's emitcontext.
3856         (FieldMember.Define): Likewise.
3857         (Event.Define): Likewise.
3858         (SetMethod.GetParameterInfo): Change argument to EmitContext.
3859         Pass type array to InternalParameters.
3860         (SetIndexerMethod.GetParameterInfo): Likewise.
3861         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
3862         * delegate.cs (Define): Pass emitcontext to
3863         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
3864         array to InternalParameters.
3865         * expression.cs (ParameterReference.DoResolveBase): Pass
3866         emitcontext to GetParameterInfo.
3867         (ComposedCast.DoResolveAsTypeStep): Remove check on
3868         ec.ResolvingTypeTree.
3869         * parameter.cs (Parameter.Resolve): Change argument to
3870         EmitContext.  Use ResolveAsTypeTerminal.
3871         (Parameter.GetSignature): Change argument to EmitContext.
3872         (Parameters.ComputeSignature): Likewise.
3873         (Parameters.ComputeParameterTypes): Likewise.
3874         (Parameters.GetParameterInfo): Likewise.
3875         (Parameters.ComputeAndDefineParameterTypes): Likewise.
3876         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
3877         * support.cs (InternalParameters..ctor): Remove variant that takes
3878         a DeclSpace.
3879         * typemanager.cs (system_intptr_expr): New.
3880         (InitExpressionTypes): Initialize it.
3881
3882 2004-10-12  Chris Toshok  <toshok@ximian.com>
3883
3884         * cs-parser.jay: fix location for try_statement and catch_clause.
3885
3886 2004-10-11  Martin Baulig  <martin@ximian.com>
3887
3888         * report.cs: Don't make --fatal abort on warnings, we have
3889         -warnaserror for that.
3890
3891 2004-10-07  Raja R Harinath  <rharinath@novell.com>
3892
3893         More DeclSpace.ResolveType avoidance.
3894         * decl.cs (MemberCore.InUnsafe): New property.
3895         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
3896         with newly created EmitContext.
3897         (FieldMember.Define): Likewise.
3898         * delegate.cs (Delegate.Define): Likewise.
3899         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
3900         only if normal name-lookup fails.
3901         (TypeExpr.DoResolve): Enable error-checking.
3902         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
3903         (SizeOf.DoResolve): Likewise.
3904         (ComposedCast.DoResolveAsTypeStep): Likewise.
3905         (StackAlloc.DoResolve): Likewise.
3906         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
3907         (Block.Unsafe): New property.
3908         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
3909         (Unsafe): Set 'unsafe' flag of contained block.
3910         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
3911         (Fixed.Resolve): Likewise.
3912         (Catch.Resolve): Likewise.
3913         (Using.ResolveLocalVariableDecls): Likewise.
3914         (Foreach.Resolve): Likewise.
3915
3916 2004-10-05  John Luke <john.luke@gmail.com>
3917
3918         * cs-parser.jay: add location to error CS0175
3919
3920 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
3921
3922         * ecore.cs (Expression.Constantity): Add support for turning null
3923         into a constant.
3924
3925         * const.cs (Const.Define): Allow constants to be reference types
3926         as long as the value is Null.
3927
3928 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
3929
3930         * namespace.cs (NamespaceEntry.Using): No matter which warning
3931         level is set, check if this namespace name has already been added.
3932
3933 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
3934
3935         * expression.cs: reftype [!=]= null should always use br[true,false].
3936         # 67410
3937
3938 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
3939
3940         Fix #67108
3941         * attribute.cs: Enum conversion moved to 
3942         GetAttributeArgumentExpression to be applied to the all
3943         expressions.
3944
3945 2004-10-01  Raja R Harinath  <rharinath@novell.com>
3946
3947         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
3948         * class.c (TypeContainer.DefineType): Flag error if
3949         base types aren't accessible due to access permissions.
3950         * decl.cs (DeclSpace.ResolveType): Move logic to
3951         Expression.ResolveAsTypeTerminal.
3952         (DeclSpace.ResolveTypeExpr): Thin layer over
3953         Expression.ResolveAsTypeTerminal.
3954         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
3955         Refactor code into NestedAccess.  Use it.
3956         (DeclSpace.NestedAccess): New.
3957         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
3958         argument to silence errors.  Check access permissions.
3959         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
3960         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
3961         (Cast.DoResolve): Likewise.
3962         (New.DoResolve): Likewise.
3963         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
3964         (TypeOf.DoResolve): Likewise.
3965
3966         * expression.cs (Invocation.BetterConversion): Return the Type of
3967         the better conversion.  Implement section 14.4.2.3 more faithfully.
3968         (Invocation.BetterFunction): Make boolean.  Make correspondence to
3969         section 14.4.2.2 explicit.
3970         (Invocation.OverloadResolve): Update.
3971         (Invocation): Remove is_base field.
3972         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
3973         (Invocation.Emit): Likewise.
3974
3975 2004-09-27  Raja R Harinath  <rharinath@novell.com>
3976
3977         * README: Update to changes.
3978
3979 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
3980
3981         * cs-parser.jay: Reverted 642 warning fix.
3982
3983 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3984
3985         Fix bug #66615
3986         * decl.cs (FindMemberWithSameName): Indexer can have more than
3987         1 argument.
3988
3989 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3990
3991         * expression.cs (LocalVariableReference.DoResolveLValue):
3992         Do not report warning 219 for out values.
3993         (EmptyExpression.Null): New member to avoid extra allocations.
3994
3995 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3996
3997         * cs-parser.jay: Fix wrong warning 642 report.
3998
3999         * cs-tokenizer.cs (CheckNextToken): New helper;
4000         Inspect next character if is same as expected.
4001
4002 2004-09-23  Martin Baulig  <martin@ximian.com>
4003
4004         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4005         (Convert.ImplicitReferenceConversionExists): Likewise.
4006
4007 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4008
4009         * class.cs (Operator.Define): Add error 448 and 559 report.
4010
4011 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4012
4013         * class.cs (MemberBase.IsTypePermitted): New protected
4014         method for checking error CS0610.
4015
4016 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4017
4018         * class.cs (TypeContainer.HasExplicitLayout): New property
4019         Returns whether container has StructLayout attribute set Explicit.
4020         (FieldMember): New abstract class for consts and fields.
4021         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4022         (Field): Reuse FieldMember.
4023
4024         * const.cs (Const): Reuse FieldMember.
4025
4026         * rootcontext.cs: EmitConstants call moved to class.
4027
4028 2004-09-22  Martin Baulig  <martin@ximian.com>
4029
4030         Thanks to Peter Sestoft for this bug report.
4031
4032         * expression.cs (Conditional): If both the `trueExpr' and the
4033         `falseExpr' is a NullLiteral, return a NullLiteral.
4034
4035 2004-09-22  Martin Baulig  <martin@ximian.com>
4036
4037         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4038         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4039         for the "get_Current" call.
4040
4041 2004-09-22  Martin Baulig  <martin@ximian.com>
4042
4043         Marek and me just fixed one of our oldest bugs: #28562 :-)
4044
4045         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4046
4047         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4048         we're an EnumConstant, just return that.
4049         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4050         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4051         to get the value which'll actually be written into the attribute.
4052         However, we have to use GetValue() to access the attribute's value
4053         in the compiler.        
4054
4055 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4056
4057         * constant.cs (Constant.IsNegative): New abstract property
4058         IsNegative.
4059
4060         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4061         (StackAlloc.DoResolve): Reused IsNegative.
4062
4063 2004-09-21  Martin Baulig  <martin@ximian.com>
4064
4065         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4066         if we're used in an iterator, we may be called from different
4067         methods.
4068
4069         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4070         we actually have an exception block.
4071
4072 2004-09-20  John Luke <jluke@cfl.rr.com>
4073
4074         * class.cs, cs-parser.jay: Improve the error report for 1520:
4075         report the actual line where the error happens, not where the
4076         class was declared.
4077
4078         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4079         Pass location information that was available elsewhere.
4080
4081 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4082
4083         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4084         runtime to delay sign assemblies.
4085
4086 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4087
4088         * cs-parser.jay: Do not report the stack trace, this is barely
4089         used nowadays.
4090
4091 2004-08-22  John Luke  <john.luke@gmail.com>
4092  
4093         * driver.cs : check that a resource id is not already used
4094         before adding it, report CS1508 if it is, bug #63637
4095
4096 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4097
4098         * ecore.cs: Removed dead code.
4099
4100 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4101
4102         * class.cs: Do not report warning CS0067 on the interfaces.
4103
4104 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4105
4106         * cs-parser.jay: Add error 504 report.
4107
4108 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4109
4110         * rootcontext.cs: WarningLevel is 4 by default now.
4111
4112         * statement.cs (Fixed.Resolve): Do not null
4113         VariableInfo.
4114
4115 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4116
4117         Fixed bug #55780
4118         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4119         deep search when property is not virtual.
4120         (PropertyExpr.ResolveAccessors): Make one call for both
4121         accessors.
4122
4123 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4124
4125         Fixed bug #65766
4126         * statement.cs: Error 152 report constains also location.
4127
4128 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4129
4130         Fixed bug #65766
4131         * const.cs: Explicitly set constant as static.
4132
4133 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4134
4135         Fixed bug #64226
4136         * cs-parser.jay: Add error 1017 report.
4137
4138 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4139
4140         Fixed bug #59980, #64224
4141         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4142
4143         * typemanager.cs (IsSpecialMethod): Simplified
4144
4145 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4146
4147         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4148         condition with better params.
4149
4150 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4151
4152         Fixed bug #65238
4153         * attribute.cs (Resolve): Property has to have both
4154         accessors.
4155
4156 2004-09-14  Martin Baulig  <martin@ximian.com>
4157
4158         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4159
4160 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4161
4162         Fixed bug #61902
4163         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4164         called and is obsolete then this member suppress message
4165         when call is inside next [Obsolete] method or type.
4166
4167         * expression.cs: Use TestObsoleteMethodUsage member.
4168
4169 2004-09-14  Martin Baulig  <martin@ximian.com>
4170
4171         * cs-parser.jay: Sync a bit with the GMCS version.
4172
4173 2004-09-14  Martin Baulig  <martin@ximian.com>
4174
4175         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4176         (CSharpParser.yacc_verbose_flag): New public field.
4177
4178         * genericparser.cs: Removed.
4179
4180 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4181
4182         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4183
4184 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4185
4186         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4187
4188 2004-09-10  Martin Baulig  <martin@ximian.com>
4189
4190         Backported my MemberName changes from GMCS into MCS.
4191
4192         - we are now using a special `MemberName' class instead of using
4193         strings; in GMCS, the `MemberName' also contains the type
4194         arguments.
4195
4196         - changed the grammar rules a bit:
4197           * the old `member_name' is now a `namespace_or_type_name':
4198             The rule is that we use `namespace_or_type_name' everywhere
4199             where we expect either a "member name" (GetEnumerator) or a
4200             "member name" with an explicit interface name
4201             (IEnumerable.GetEnumerator).
4202             In GMCS, the explicit interface name may include type arguments
4203             (IEnumerable<T>.GetEnumerator).
4204           * we use `member_name' instead of just `IDENTIFIER' for
4205             "member names":
4206             The rule is that we use `member_name' wherever a member may
4207             have type parameters in GMCS.       
4208
4209         * decl.cs (MemberName): New public class.
4210         (MemberCore.MemberName): New public readonly field.
4211         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4212         (DeclSpace): Likewise.
4213
4214         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4215         * enum.cs (Enum.ctor): Likewise.
4216
4217         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4218         MemberName.     
4219         (AliasEntry.ctor): Take a MemberName, not an Expression.
4220         (AliasEntry.UsingAlias): Likewise.
4221
4222         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4223         (IMethodData.MemberName): Changed type from string to MemberName.
4224         (MemberBase.ExplicitInterfaceName): Likewise.
4225         (AbstractPropertyEventMethod.SetupName): Make this private.
4226         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4227         argument; compute the member name here.
4228         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4229         on the `member.MemberName' and the `prefix'.
4230
4231         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4232         not `type_name'.
4233         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4234         thus, we get a `MemberName' instead of a `string'.  These
4235         declarations may have type parameters in GMCS.
4236         (interface_method_declaration, delegate_declaration): Likewise.
4237         (class_declaration, interface_declaration): Likewise.
4238         (method_header): Use `namespace_or_type_name' instead of
4239         `member_name'.  We may be an explicit interface implementation.
4240         (property_declaration, event_declaration): Likewise.
4241         (member_name): This is now just an `IDENTIFIER', not a
4242         `namespace_or_type_name'.
4243         (type_name, interface_type): Removed.
4244         (namespace_or_type_name): Return a MemberName, not an Expression.
4245         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4246         call GetTypeExpression() on the MemberName to get an expression.
4247         (IndexerDeclaration.interface_type): Changed type from string to
4248         MemberName.
4249         (MakeName): Operate on MemberName's instead of string's.
4250
4251 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4252
4253         Fix bug #55770.
4254         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4255         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4256         lookup to avoid symbols introduced by 'using'.
4257         * rootcontext.cs (NamespaceLookup): Update.
4258
4259 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4260
4261         * class.cs (TypeContainer.DoDefineMembers): Do not call
4262         DefineDefaultConstructor for static classes.
4263
4264 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4265
4266         * attribute.cs (Attribute.Resolve): Add error 653 report.
4267
4268         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4269         report.
4270         (Method.ApplyAttributeBuilder): Add error 685 report.
4271         (Operator.Define): Add error 564 report.
4272
4273         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4274
4275         * expression.cs (Invocation.DoResolve): Add error
4276         245 and 250 report.
4277
4278         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4279         error 674 report.
4280
4281 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4282
4283         * class.cs (ConstructorInitializer.Resolve):
4284         Wrong error number (515->516).
4285
4286 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4287
4288         * class.cs (Indexer.Define): Add error 631 report.
4289
4290 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4291
4292         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4293
4294 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4295
4296         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4297
4298 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4299
4300         * cs-parser.jay: Added error CS0241 report.
4301
4302 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4303
4304         * cs-parser.jay (fixed_statement): Introduce a scope for the
4305         declaration in the 'fixed' statement.
4306
4307 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4308
4309         * cs-parser.jay: Added CS0230 error report.
4310
4311 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4312
4313         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4314
4315 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4316
4317         * expression.cs (Argument.Resolve): Added error CS0192 and
4318         CS0199 report.
4319
4320 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4321
4322         C# 2.0 #pragma warning feature
4323
4324         * cs-tokenizer.cs (PreProcessPragma): New method; 
4325         Handles #pragma directive.
4326
4327         * report.cs (WarningRegions): New class; Support
4328         class for #pragma warning directive. It tests whether
4329         warning is enabled for a given line.
4330
4331 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4332
4333         * const.cs: Add more descriptive error report, tahnks to
4334         Sebastien. 
4335
4336 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4337
4338         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4339
4340 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4341
4342         * expression.cs: Apply patch from Ben: Remove dead code from
4343         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4344         as that code just threw an exception anwyays.
4345
4346         * const.cs: Remove the call to the turnintoconstant, for details
4347         see bug: #63144
4348         
4349         * literal.cs: The type of the null-literal is the null type;  So
4350         we use a placeholder type (literal.cs:System.Null, defined here)
4351         for it.
4352
4353         * expression.cs (Conditional.DoResolve): Remove some old code that
4354         is no longer needed, conversions have been fixed.
4355
4356         (ArrayCreationExpression.DoResolve): Return false if we fail to
4357         resolve the inner expression.
4358
4359 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4360
4361         Fix test-290.cs.
4362         * cs-parser.jay (delegate_declaration): Record a delegate
4363         declaration as a type declaration.
4364         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4365
4366 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4367
4368         * parameter.cs: Do not crash if the type can not be resolved. 
4369
4370         * expression.cs: Report errors with unsafe pointers, fixes #64896
4371
4372 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4373
4374         * expression.cs: Pointer arith always needs to do a conv.i
4375         if the operand is a long. fix 65320
4376
4377 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4378
4379         Fixed cs0619-37.cs, cs0619-38.cs
4380
4381         * enum.cs (GetObsoleteAttribute): Removed.
4382
4383         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4384         on Enum member is double staged. The first is tested member
4385         and then enum.
4386
4387 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4388
4389         Fixed #56986, #63631, #65231
4390
4391         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4392         adds member to name container.
4393         (TypeContainer.AddToTypeContainer): New method, adds type to
4394         name container.
4395         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4396         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4397         AddOperator): Simplified by reusing AddToMemberContainer.
4398         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4399         instead of field.
4400         (Method.CheckForDuplications): Fixed implementation to test all
4401         possibilities.
4402         (MemberBase): Detection whether member is explicit interface
4403         implementation is now in constructor.
4404         (MemberBase.UpdateMemberName): Handles IndexerName.
4405         (Accessor): Changed to keep also location information.
4406         (AbstractPropertyEventMethod): Is derived from MemberCore.
4407         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4408         will be emited or not.
4409         (PropertyBase.AreAccessorsDuplicateImplementation):
4410         Tests whether accessors are not in collision with some method.
4411         (Operator): Is derived from MethodCore to simplify common
4412         operations.
4413
4414         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4415         must be performed.
4416         (DeclSpace.AddToContainer): Adds the member to defined_names
4417         table. It tests for duplications and enclosing name conflicts.
4418
4419         * enum.cs (EnumMember): Clean up to reuse the base structures
4420
4421 2004-09-03  Martin Baulig  <martin@ximian.com>
4422
4423         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4424         into TypeContainer, to make partial classes work again.
4425
4426 2004-09-03  Martin Baulig  <martin@ximian.com>
4427
4428         * rootcontext.cs (RootContext.V2): Removed.
4429
4430 2004-03-23  Martin Baulig  <martin@ximian.com>
4431
4432         * expression.cs (Invocation.OverloadResolve): Added `bool
4433         may_fail' argument and use it instead of the Location.IsNull() hack.
4434
4435 2004-09-03  Martin Baulig  <martin@ximian.com>
4436
4437         Merged latest changes into gmcs.  Please keep this comment in
4438         here, it makes it easier for me to see what changed in MCS since
4439         the last time I merged.
4440
4441 2004-09-03  Raja R Harinath  <rharinath@novell.com>
4442
4443         Fix #61128.
4444         * expression.cs (BetterConversion): Don't allow either conversion 
4445         to be null.  Remove redundant implicit conversion test when 'q ==
4446         null' -- when this function is invoked, we already know that the
4447         implicit conversion exists.
4448         (BetterFunction): Assume that 'best' is non-null.  Remove
4449         redundant reimplementation of IsApplicable when 'best' is null.
4450         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
4451         number of arguments.
4452         (IsAncestralType): Extract from OverloadResolve.
4453         (OverloadResolve): Make robust to the MethodGroupExpr being
4454         unsorted.  Implement all the logic of Section 14.5.5.1, and
4455         support overloading of methods from multiple applicable types.
4456         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
4457
4458         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
4459         (RealError, Warning): Append type of report to related symbol.
4460
4461 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
4462
4463         * enum.cs: Fixed CLS-Compliance checks for enum members.
4464         Error tests cs3008-8.cs, cs3014-8.cs
4465
4466 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4467
4468         Fixed bug #62342, #63102
4469         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4470         like ImplementMethod.
4471
4472 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4473
4474         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4475         Fixed bug #65170.
4476
4477 2004-09-02  Martin Baulig  <martin@ximian.com>
4478
4479         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4480         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4481         on the MethodBase.
4482
4483 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4484
4485         C# 2.0 Static classes implemented
4486
4487         * class.cs (TypeContainer): instance_constructors,
4488         initialized_fields, initialized_static_fields,
4489         default_constructor, base_inteface_types are protected to be
4490         accessible from StaticClass.
4491         (TypeContainer.DefineDefaultConstructor): New virtual method
4492         for custom default constructor generating
4493         (StaticClass): New class to handle "Static classes" feature.
4494
4495         * cs-parser.jay: Handle static keyword on class like instance
4496         of StaticClass.
4497
4498         * driver.cs: Added "/langversion" command line switch with two
4499         options (iso-1, default).
4500
4501 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
4502
4503         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
4504
4505 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
4506
4507         * delegate.cs: Style.
4508
4509 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4510
4511         * delegate.cs: Add seperate instance expr field for miguel.
4512
4513 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4514
4515         * PointerArithmetic (Resolve): make sure we are not doing
4516         pointer arith on void*. Also, make sure we are resolved
4517         by not setting eclass until resolve.
4518
4519         All callers: Make sure that PointerArithmetic gets resolved.
4520
4521 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4522
4523         * ArrayCreation (LookupType): If the type does not resolve 
4524         to an array, give an error.
4525
4526 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
4527
4528         * statement.cs (Try.Resolve): Fixed bug #64222
4529
4530 2004-08-27  Martin Baulig  <martin@ximian.com>
4531
4532         * class.cs
4533         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4534         crash here.     
4535
4536 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4537
4538         * ecore.cs (Constantify): Get underlying type via
4539         System.Enum.GetUnderlyingType to avoid StackOverflow on the
4540         Windows in special cases.
4541
4542 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4543
4544         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
4545         for obtaining also private methods.
4546         (GetRemoveMethod): Used GetRemoveMethod (true)
4547         for obtaining also private methods.
4548
4549 2004-08-24  Martin Baulig  <martin@ximian.com>
4550
4551         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
4552         MethodAttributes.HideBySig for operators.
4553
4554 2004-08-23  Martin Baulig  <martin@ximian.com>
4555
4556         Back to the old error reporting system :-)
4557
4558         * report.cs (Message): Removed.
4559         (Report.MessageData, ErrorData, WarningData): Removed.
4560         (Report.Error, Warning): Back to the old system.
4561
4562 2004-08-23  Martin Baulig  <martin@ximian.com>
4563
4564         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
4565
4566         * class.cs (TypeContainer.ParentContainer): New public virtual
4567         method; replaces the explicit interface implementation.
4568         (ClassPart.ParentContainer): Override.
4569
4570 2004-08-23  Martin Baulig  <martin@ximian.com>
4571
4572         * statement.cs (Switch): Added support for constant switches; see
4573         #59428 or test-285.cs.
4574
4575 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4576
4577         Fixed bug #62740.
4578         * statement.cs (GetEnumeratorFilter): Removed useless
4579         logic because C# specs is strict. GetEnumerator must be
4580         public.
4581
4582 2004-08-22  Martin Baulig  <martin@ximian.com>
4583
4584         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4585         a switch and may break, reset the barrier.  Fixes #59867.
4586
4587 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4588
4589         CLS-Compliance speed up (~5% for corlib)
4590
4591         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
4592         New method. Tests container for CLS-Compliant names
4593
4594         * class.cs (TypeContainer.VerifyClsName): New method.
4595         Checks whether container name is CLS Compliant.
4596         (Constructor): Implements IMethodData.
4597
4598         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
4599         low-case table for CLS Compliance test.
4600         (MemberCache.VerifyClsParameterConflict): New method.
4601         Checks method parameters for CS3006 error.
4602
4603         * enum.cs (EnumMember): Is derived from MemberCore.
4604         (Enum.VerifyClsName): Optimized for better performance.
4605
4606 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4607
4608         * report.cs: Renamed Error_T to Error and changed all
4609         references.
4610
4611 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4612
4613         * class.cs (TypeContainer.IndexerArrayList): New inner class
4614         container for indexers.
4615         (TypeContainer.DefaultIndexerName): New constant for default
4616         indexer name. Replaced all "Item" with this constant.
4617         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
4618
4619         * typemanager.cs (TypeManager.default_member_ctor): Cache here
4620         DefaultMemberAttribute constructor.
4621
4622 2004-08-05  Martin Baulig  <martin@ximian.com>
4623
4624         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4625         Fix bug #59429.
4626
4627 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
4628
4629         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
4630         multi platforms problem.
4631
4632         * compiler.csproj: Included shared files.
4633
4634 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4635
4636         Fix bug 60333, 55971 in the more general way
4637         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4638         Added arg_type argument for constant conversion.
4639         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
4640
4641 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4642
4643         Fix bug #59760
4644         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
4645         OperatorArrayList, MethodCoreArrayList for typecontainer
4646         containers. Changed class member types to these new types.
4647         (MethodArrayList.DefineMembers): Added test for CS0659.
4648
4649 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
4650
4651         * cfold.cs: Synchronize the folding with the code in expression.cs
4652         Binary.DoNumericPromotions for uint operands.
4653
4654         * attribute.cs: Revert patch from Raja, it introduced a regression
4655         while building Blam-1.2.1 (hard to isolate a test case).
4656
4657 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4658
4659         Fix for #55382
4660         * class.cs:
4661         (TypeContainer.Define): Renamed to DefineContainerMembers because of
4662         name collision.
4663         (MethodCore.parent_method): New member. The method we're overriding
4664         if this is an override method.
4665         (MethodCore.CheckBase): Moved from Method class and made common.
4666         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
4667         private.
4668         (MethodCore.CheckForDuplications): New abstract method. For custom
4669         member duplication search in a container
4670         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
4671         method and its return type.
4672         (Event.conflict_symbol): New member. Symbol with same name in the
4673         parent class.
4674
4675         * decl.cs:
4676         (MemberCache.FindMemberWithSameName): New method. The method
4677         is looking for conflict with inherited symbols.
4678
4679 2004-08-04  Martin Baulig  <martin@ximian.com>
4680
4681         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
4682
4683         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
4684
4685 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4686
4687         * report.cs (Message): New enum for better error, warning reference in
4688         the code.
4689         (MessageData): New inner abstract class. It generally handles printing of
4690         error and warning messages.
4691         Removed unused Error, Warning, Message methods.
4692
4693 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4694
4695         Fix for cs0592-8.cs test
4696         * attribute.cs
4697         (Attributable.ValidAttributeTargets): Made public.
4698         (Attribute.ExplicitTarget): New member for explicit target value.
4699         (Attribute.CheckTargets): Now we translate explicit attribute
4700         target to Target here.
4701
4702 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
4703
4704         * ecore.cs (MethodGroupExpr): new IsBase property.
4705
4706         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
4707
4708         * delegate.cs (DelegateCreation): store a MethodGroupExpr
4709         rather than an instance expr.
4710
4711         (DelegateCreation.Emit): Use the method group rather than
4712         the instance expression. Also, if you have base.Foo as the
4713         method for a delegate, make sure to emit ldftn, not ldftnvirt.
4714
4715         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
4716
4717         (NewDelegate.DoResolve): Only check for the existance of Invoke
4718         if the method is going to be needed. Use MethodGroupExpr.
4719
4720         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
4721
4722         * expression.cs: For pointer arith., make sure to use
4723         the size of the type, not the size of the pointer to
4724         the type.
4725
4726 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4727
4728         Fix for #60722
4729         * class.cs (Class): Added error CS0502 test.
4730
4731 2004-08-03  John Luke  <jluke@cfl.rr.com>
4732             Raja R Harinath  <rharinath@novell.com>
4733
4734         Fix for #60997.
4735         * attribute.cs (Attribute.complained_before): New flag.
4736         (Attribute.ResolveType, Attribute.Resolve),
4737         (Attribute.DefinePInvokeMethod): Set it.
4738         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
4739         
4740 2004-08-03  Martin Baulig  <martin@ximian.com>
4741
4742         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
4743         use a user-defined operator; we still need to do numeric
4744         promotions in case one argument is a builtin type and the other
4745         one has an implicit conversion to that type.  Fixes #62322.
4746
4747 2004-08-02  Martin Baulig  <martin@ximian.com>
4748
4749         * statement.cs (LocalInfo.Flags): Added `IsThis'.
4750         (LocalInfo.IsThis): New public property.
4751         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
4752
4753 2004-08-01  Martin Baulig  <martin@ximian.com>
4754
4755         * class.cs (TypeContainer.GetClassBases): Don't set the default
4756         here since we may get called from GetPartialBases().
4757         (TypeContainer.DefineType): If GetClassBases() didn't return a
4758         parent, use the default one.
4759
4760 2004-07-30  Duncan Mak  <duncan@ximian.com>
4761
4762         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
4763
4764 2004-07-30  Martin Baulig  <martin@ximian.com>
4765
4766         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
4767
4768         * class.cs (SourceMethod): New public class, derive from the
4769         symbol writer's ISourceMethod.
4770         (Method): Use the new symbol writer API.
4771
4772         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
4773         as argument and use the new symbol writer.
4774
4775         * location.cs
4776         (SourceFile): Implement the symbol writer's ISourceFile.
4777         (Location.SymbolDocument): Removed.
4778         (Location.SourceFile): New public property.
4779
4780         * symbolwriter.cs: Use the new symbol writer API.
4781
4782 2004-07-30  Raja R Harinath  <rharinath@novell.com>
4783
4784         * Makefile (install-local): Remove.  Functionality moved to
4785         executable.make.
4786
4787 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
4788
4789         * Makefile: Install mcs.exe.config file together with mcs.exe.
4790         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
4791         correct runtime version.
4792         
4793 2004-07-25  Martin Baulig  <martin@ximian.com>
4794
4795         * class.cs
4796         (TypeContainer.RegisterOrder): Removed, this was unused.
4797         (TypeContainer, interface_order): Removed.
4798         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
4799         TypeContainer as argument since we can also be called with a
4800         `PartialContainer' for a partial class/struct/interface.
4801         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
4802         of checking whether we're an `Interface' - we could be a
4803         `PartialContainer'.
4804         (PartialContainer.Register): Override; call
4805         AddClass()/AddStruct()/AddInterface() on our parent.
4806
4807         * cs-parser.jay (interface_member_declaration): Add things to the
4808         `current_container', not the `current_class'.
4809
4810         * rootcontext.cs (RegisterOrder): The overloaded version which
4811         takes an `Interface' was unused, removed.
4812
4813         * typemanager.cs (TypeManager.LookupInterface): Return a
4814         `TypeContainer', not an `Interface'.
4815         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
4816         contain a `PartialContainer' for an interface, so check it's
4817         `Kind' to figure out what it is.
4818
4819 2004-07-25  Martin Baulig  <martin@ximian.com>
4820
4821         * class.cs (Class.DefaultTypeAttributes): New public constant.
4822         (Struct.DefaultTypeAttributes): Likewise.
4823         (Interface.DefaultTypeAttributes): Likewise.
4824         (PartialContainer.TypeAttr): Override this and add the
4825         DefaultTypeAttributes.
4826
4827 2004-07-25  Martin Baulig  <martin@ximian.com>
4828
4829         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
4830         we can just use the `Parent' field instead.
4831
4832 2004-07-25  Martin Baulig  <martin@ximian.com>
4833
4834         * class.cs (TypeContainer.Emit): Renamed to EmitType().
4835
4836 2004-07-25  Martin Baulig  <martin@ximian.com>
4837
4838         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
4839         our parts before defining any methods.
4840         (TypeContainer.VerifyImplements): Make this virtual.
4841         (ClassPart.VerifyImplements): Override and call VerifyImplements()
4842         on our PartialContainer.
4843
4844 2004-07-25  Martin Baulig  <martin@ximian.com>
4845
4846         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
4847
4848         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
4849         argument, we can just use the `Parent' field instead.
4850
4851         * class.cs
4852         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
4853         (MemberBase.DoDefine): Likewise.
4854
4855 2004-07-24  Martin Baulig  <martin@ximian.com>
4856
4857         * decl.cs (MemberCore.Parent): New public field.
4858         (DeclSpace.Parent): Moved to MemberCore.
4859
4860         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
4861         (MemberBase.ctor): Added TypeContainer argument, pass it to our
4862         parent's .ctor.
4863         (FieldBase, Field, Operator): Likewise.
4864         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
4865         (EventField, Event): Likewise.
4866
4867 2004-07-23  Martin Baulig  <martin@ximian.com>
4868
4869         * class.cs (PartialContainer): New public class.
4870         (ClassPart): New public class.
4871         (TypeContainer): Added support for partial classes.
4872         (TypeContainer.GetClassBases): Splitted some of the functionality
4873         out into GetNormalBases() and GetPartialBases().
4874
4875         * cs-tokenizer.cs (Token.PARTIAL): New token.
4876         (Tokenizer.consume_identifier): Added some hacks to recognize
4877         `partial', but only if it's immediately followed by `class',
4878         `struct' or `interface'.
4879
4880         * cs-parser.jay: Added support for partial clases.
4881
4882 2004-07-23  Martin Baulig  <martin@ximian.com>
4883
4884         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
4885         a `DeclSpace' and also made it readonly.
4886         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
4887         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
4888         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
4889
4890         * cs-parser.jay: Pass the `current_class', not the
4891         `current_container' (at the moment, this is still the same thing)
4892         to a new Method, Property, Event, Indexer or Constructor.
4893
4894 2004-07-23  Martin Baulig  <martin@ximian.com>
4895
4896         * cs-parser.jay (CSharpParser): Added a new `current_class' field
4897         and removed the `current_interface' one.
4898         (struct_declaration, class_declaration, interface_declaration):
4899         Set `current_class' to the newly created class/struct/interface;
4900         set their `Bases' and call Register() before parsing their body.
4901
4902 2004-07-23  Martin Baulig  <martin@ximian.com>
4903
4904         * class.cs (Kind): New public enum.
4905         (TypeContainer): Made this class abstract.
4906         (TypeContainer.Kind): New public readonly field.
4907         (TypeContainer.CheckDef): New public method; moved here from
4908         cs-parser.jay.
4909         (TypeContainer.Register): New public abstract method.
4910         (TypeContainer.GetPendingImplementations): New public abstract
4911         method.
4912         (TypeContainer.GetClassBases): Removed the `is_class' and
4913         `is_iface' parameters.
4914         (TypeContainer.DefineNestedTypes): Formerly known as
4915         DoDefineType().
4916         (ClassOrStruct): Made this class abstract.
4917
4918         * tree.cs (RootTypes): New public type. 
4919
4920 2004-07-20  Martin Baulig  <martin@ximian.com>
4921
4922         * tree.cs (Tree.RecordNamespace): Removed.
4923         (Tree.Namespaces): Removed.
4924
4925         * rootcontext.cs (RootContext.IsNamespace): Removed.
4926
4927         * cs-parser.jay (namespace_declaration): Just create a new
4928         NamespaceEntry here.
4929
4930 2004-07-20  Martin Baulig  <martin@ximian.com>
4931
4932         * statement.cs (ExceptionStatement): New abstract class.  This is
4933         now used as a base class for everyone who's using `finally'.
4934         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
4935         our local variables before using them.
4936
4937         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
4938         virtual method.  This is used by Yield.Resolve() to "steal" an
4939         outer block's `finally' clauses.
4940         (FlowBranchingException): The .ctor now takes an ExceptionStatement
4941         argument.
4942
4943         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
4944         version which takes an ExceptionStatement.  This version must be
4945         used to create exception branchings.
4946
4947         * iterator.cs
4948         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
4949         (Iterator.EmitMoveNext): Added exception support; protect the
4950         block with a `fault' clause, properly handle 'finally' clauses.
4951         (Iterator.EmitDispose): Run all the `finally' clauses here.
4952
4953 2004-07-20  Martin Baulig  <martin@ximian.com>
4954
4955         * iterator.cs: This is the first of a set of changes in the
4956         iterator code.  Match the spec more closely: if we're an
4957         IEnumerable, then GetEnumerator() must be called.  The first time
4958         GetEnumerator() is called, it returns the current instance; all
4959         subsequent invocations (if any) must create a copy.
4960
4961 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
4962
4963         * expression.cs: Resolve the constant expression before returning
4964         it. 
4965
4966 2004-07-19  Martin Baulig  <martin@ximian.com>
4967
4968         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
4969         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
4970         the return type of the new EmitContext.
4971
4972 2004-07-18  Martin Baulig  <martin@ximian.com>
4973
4974         * class.cs (Property.Define): Fix iterators.
4975
4976         * iterators.cs (Iterator.Define): Moved the
4977         `container.AddInterator (this)' call here from the .ctor; only do
4978         it if we resolved successfully.
4979
4980 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
4981
4982         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
4983         `true' for preprocessing directives that we parse.  The return
4984         value indicates whether we should return to regular tokenizing or
4985         not, not whether it was parsed successfully.
4986
4987         In the past if we were in: #if false ... #line #endif, we would
4988         resume parsing after `#line'.  See bug 61604.
4989
4990         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
4991         building: IsEnumType should return true only for enums, not for
4992         enums or System.Enum itself.  This fixes #61593.
4993
4994         Likely what happened is that corlib was wrong: mcs depended on
4995         this bug in some places.  The bug got fixed, we had to add the
4996         hack, which caused bug 61593.
4997
4998         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
4999         that was a workaround for the older conditions.
5000
5001 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5002
5003         * assign.cs: IAssignMethod has a new interface, as documented
5004         inline. All assignment code now uses this new api.
5005
5006         * ecore.cs, expression.cs: All classes which implement
5007         IAssignMethod now use the new interface.
5008
5009         * expression.cs (Invocation): add a hack to EmitCall so that
5010         IndexerAccess can be the target of a compound assignment without
5011         evaluating its arguments twice.
5012
5013         * statement.cs: Handle changes in Invocation api.
5014
5015 2004-07-16  Martin Baulig  <martin@ximian.com>
5016
5017         * iterators.cs: Rewrote this.  We're now using one single Proxy
5018         class for both the IEnumerable and the IEnumerator interface and
5019         `Iterator' derives from Class so we can use the high-level API.
5020
5021         * class.cs (TypeContainer.AddIterator): New method.
5022         (TypeContainer.DoDefineType): New protected virtual method, which
5023         is called from DefineType().
5024         (TypeContainer.DoDefineMembers): Call DefineType() and
5025         DefineMembers() on all our iterators.
5026         (TypeContainer.Emit): Call Emit() on all our iterators.
5027         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5028
5029         * codegen.cs (EmitContext.CurrentIterator): New public field.
5030
5031 2004-07-15  Martin Baulig  <martin@ximian.com>
5032
5033         * typemanager.cs
5034         (TypeManager.not_supported_exception_type): New type.   
5035
5036 2004-07-14  Martin Baulig  <martin@ximian.com>
5037
5038         * iterators.cs: Use real error numbers.
5039
5040 2004-07-14  Martin Baulig  <martin@ximian.com>
5041
5042         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5043         requires this to be a System.Collection.IEnumerable and not a
5044         class implementing that interface.
5045         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5046
5047 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5048
5049         * class.cs: Fixed previous fix, it broke some error tests.
5050
5051 2004-07-12  Martin Baulig  <martin@ximian.com>
5052
5053         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5054         Fixes #61293.
5055
5056 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5057
5058         * assign.cs (LocalTemporary): Add new argument: is_address,If
5059         `is_address' is true, then the value that we store is the address
5060         to the real value, and not the value itself.
5061         
5062         * ecore.cs (PropertyExpr): use the new local temporary
5063         stuff to allow us to handle X.Y += z (where X is a struct)
5064
5065 2004-07-08  Martin Baulig  <martin@ximian.com>
5066
5067         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5068         not always return, just like we're doing in Using.Resolve().
5069
5070 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5071
5072         * cs-parser.jay (fixed_statement): flag this as Pinned.
5073
5074 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5075
5076         * typemanager.cs (TypeManager): Removed MakePinned method, this
5077         mechanism is replaced with the .NET 2.x compatible mechanism of
5078         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5079
5080         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5081         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5082         `IsFixed' property which has a different meaning.
5083
5084 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5085
5086         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5087         visible from inside a nested class, not just the names of the
5088         immediately enclosing class.
5089         Fix for bug #60730.
5090
5091 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5092
5093         * expression.cs (BetterConversion): Remove buggy special-case
5094         handling of "implicit constant expression conversions".  At this
5095         point, we already know that the conversion is possible -- we're
5096         only checking to see which is better.
5097
5098 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5099
5100         * cs-parser.jay: Added error CS0210 test.
5101
5102 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5103
5104         * cs-parser.jay: Added error CS0134 test.
5105
5106 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5107
5108         Fix bug #52507
5109         * cs-parser.jay: Added error CS0145 test.
5110
5111 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5112
5113         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5114
5115 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5116         
5117         * expression.cs (StackAlloc.Resolve): The argument may not
5118         be a constant; deal with this case.
5119         
5120 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5121
5122         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5123         GetIndexerAttributeValue.
5124         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5125
5126         * class.cs (Indexer.Define): Added error tests for CS0415,
5127         CS0609.
5128
5129 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5130
5131         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5132         property code.
5133
5134 2004-06-23  Martin Baulig  <martin@ximian.com>
5135
5136         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5137         neither return nor throw, reset the barrier as well.  Fixes #60457.
5138
5139 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5140
5141         * class.cs : EventAttributes is now set to None by default.
5142           This fixes bug #60459.
5143
5144 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5145
5146         Fix bug #60219
5147         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5148         Don't throw exception but return null (it's sufficient now).
5149
5150 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5151
5152         * typemanager.cs (GetArgumentTypes): Faster implementation.
5153
5154 2004-06-18  Martin Baulig  <martin@ximian.com>
5155
5156         * attribute.cs (Attribute.Resolve): Check whether we're an
5157         EmptyCast which a Constant child.  Fixes #60333.
5158
5159 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5160
5161         * statement.cs (EmitCollectionForeach): Account for the fact that
5162         not all valuetypes are in areas which we can take the address of.
5163         For these variables, we store to a temporary variable. Also, make
5164         sure that we dont emit a `callvirt' on a valuetype method.
5165
5166 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5167
5168         * expression.cs (StackAlloc.DoReSolve): Added test for
5169         negative parameter (CS0247).
5170
5171 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5172
5173         Fix bug #59792
5174         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5175
5176 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5177
5178         Fix bug #59781
5179         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5180         ulong.
5181
5182 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5183
5184         Fix bug #58254 & cs1555.cs, cs1556.cs
5185         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5186
5187 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5188
5189         * cs-parser.jay: Added error CS1669 test for indexers.
5190
5191 2004-06-11  Martin Baulig  <martin@ximian.com>
5192
5193         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5194         call this twice: for params and varargs methods.
5195
5196 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5197
5198         * class.cs:
5199         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5200
5201 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5202
5203         * attribute.cs (Attribute.GetValidTargets): Made public.
5204
5205         * class.cs: 
5206         (AbstractPropertyEventMethod): New class for better code sharing.
5207         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5208         CS1667 report.
5209         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5210
5211 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5212
5213         Fix bug #59477.
5214         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5215         that the call to Resolve is part of a MemberAccess.
5216         (Expression.Resolve): Use it for SimpleName resolution.
5217         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5218         Add 'intermediate' boolean argument.
5219         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5220         error message when the SimpleName can be resolved ambiguously
5221         between an expression and a type.
5222         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5223         public.
5224         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5225         call on the left-side.
5226
5227 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5228
5229         * class.cs:
5230         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5231
5232 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5233
5234         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5235
5236 2004-06-11  Martin Baulig  <martin@ximian.com>
5237
5238         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5239         varargs methods if applicable.
5240
5241 2004-06-11  Martin Baulig  <martin@ximian.com>
5242
5243         * expression.cs (Invocation.EmitCall): Don't use
5244         `method.CallingConvention == CallingConventions.VarArgs' since the
5245         method could also have `CallingConventions.HasThis'.
5246
5247 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5248
5249         * class.cs (Event.GetSignatureForError): Implemented.
5250         Fixed crash in error test cs3010.cs
5251
5252 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5253
5254         * cs-tokenizer.cs: Change the way we track __arglist to be
5255         consistent with the other keywords.
5256
5257 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5258
5259         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5260         tomorrow.
5261
5262 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5263
5264         * codegen.cs: Check that all referenced assemblies have a strongname
5265         before strongnaming the compiled assembly. If not report error CS1577.
5266         Fix bug #56563. Patch by Jackson Harper.
5267         * typemanager.cs: Added a method to return all referenced assemblies.
5268         Fix bug #56563. Patch by Jackson Harper.
5269
5270 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5271
5272         * class.cs:
5273         (Method.ApplyAttributeBuilder): Moved and added conditional
5274         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5275
5276         * delegate.cs:
5277         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5278
5279 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5280
5281         Fixed #59640
5282         * class.cs: (EventField.attribute_targets): Changed default target.
5283
5284 2004-06-08  Martin Baulig  <martin@ximian.com>
5285
5286         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5287
5288 2004-06-08  Martin Baulig  <martin@ximian.com>
5289
5290         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5291
5292 2004-06-07  Martin Baulig  <martin@ximian.com>
5293
5294         Added support for varargs methods.
5295
5296         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5297         keyword.
5298
5299         * cs-parser.jay: Added support for `__arglist'.
5300
5301         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5302
5303         * expression.cs (Argument.AType): Added `ArgList'.
5304         (Invocation): Added support for varargs methods.
5305         (ArglistAccess): New public class.
5306         (Arglist): New public class.
5307
5308         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5309
5310         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5311         a method's top-level block if the method has varargs.
5312
5313         * support.cs (ReflectionParameters, InternalParameters): Added
5314         support for varargs methods.    
5315
5316 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
5317
5318         * class.cs: Provide location in indexer error report.
5319
5320         * driver.cs: Use standard names.
5321
5322         * namespace.cs: Catch the use of using after a namespace has been
5323         declared also on using aliases.
5324
5325 2004-06-03  Raja R Harinath  <rharinath@novell.com>
5326
5327         Bug #50820.
5328         * typemanager.cs (closure_private_ok, closure_invocation_type)
5329         (closure_qualifier_type, closure_invocation_assembly)
5330         (FilterWithClosure): Move to ...
5331         (Closure): New internal nested class.
5332         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
5333         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
5334         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
5335         (MemberLookup, MemberLookupFailed): Use it.
5336         * expression.cs (New.DoResolve): Treat the lookup for the
5337         constructor as being qualified by the 'new'ed type.
5338         (Indexers.GetIndexersForTypeOrInterface): Update.
5339
5340 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
5341
5342         * attribute.cs
5343         (GetConditionalAttributeValue): New method. Returns
5344         condition of ConditionalAttribute.
5345         (SearchMulti): New method.  Returns all attributes of type 't'.
5346         Use it when attribute is AllowMultiple = true.
5347         (IsConditionalMethodExcluded): New method.
5348
5349         * class.cs
5350         (Method.IsExcluded): Implemented. Returns true if method has conditional
5351         attribute and the conditions is not defined (method is excluded).
5352         (IMethodData): Extended interface for ConditionalAttribute support.
5353         (PropertyMethod.IsExcluded): Implemented.
5354
5355         * decl.cs
5356         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
5357
5358         * expression.cs
5359         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
5360         on the method.
5361
5362 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5363
5364         * expression.cs (ArrayCreationExpression): Make this just an
5365         `expression'. It can't be a statement, so the code here was
5366         dead.
5367
5368 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5369
5370         Fixed #59072
5371         * typemanager.cs (GetFullNameSignature): New method for
5372         MethodBase types.
5373
5374 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5375
5376         Fixed #56452
5377         * class.cs (MemberBase.GetSignatureForError): New virtual method.
5378         Use this method when MethodBuilder is null.
5379         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
5380         Added test for error CS0626 (MONO reports error for this situation).
5381         (IMethodData.GetSignatureForError): Extended interface.
5382
5383 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5384
5385         * attribute.cs
5386         (AttributeTester.GetObsoleteAttribute): Returns instance of
5387         ObsoleteAttribute when type is obsolete.
5388
5389         * class.cs
5390         (TypeContainer.VerifyObsoleteAttribute): Override.
5391         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5392         (MethodCode.VerifyObsoleteAttribute): Override.
5393         (MemberBase.VerifyObsoleteAttribute): Override.
5394
5395         * decl.cs
5396         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5397         and report proper error.
5398
5399         *delegate.cs
5400         Delegate.VerifyObsoleteAttribute): Override.
5401
5402         * ecore.cs
5403         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5404         and report proper error.
5405         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5406
5407         * enum.cs
5408         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5409         and enum member.
5410
5411         * expression.cs
5412         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5413         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5414         Added test for ObsoleteAttribute.
5415
5416         * statement.cs
5417         (Catch): Derived from Statement.
5418
5419 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5420  
5421         Fixed bug #59071 & cs0160.cs
5422  
5423         * statement.cs (Try.Resolve): Check here whether order of catch
5424         clauses matches their dependencies.
5425
5426 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
5427
5428         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
5429         caused a regression: #59343.  Referencing nested classes from an
5430         assembly stopped working.
5431
5432 2004-05-31  Martin Baulig  <martin@ximian.com>
5433
5434         MCS is now frozen for beta 2.
5435
5436 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5437
5438         * convert.cs: add a trivial cache for overload operator resolution.
5439
5440 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5441
5442         * decl.cs: If possible, use lookuptypedirect here. We can only do
5443         this if there is no `.' after the namespace. Avoids using
5444         LookupType, which does lots of slow processing.
5445         (FindNestedType) New method, does what it says :-).
5446         * namespace.cs: use LookupTypeDirect.
5447         * rootcontext.cs: use membercache, if possible.
5448         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5449
5450 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5451
5452         * expression.cs:
5453         According to the spec, 
5454
5455         In a member access of the form E.I, if E is a single identifier,
5456         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5457         field, property, localvariable, or parameter with the same type as
5458         the meaning of E as a type-name (§3.8), then both possible
5459         meanings of E are permitted.
5460
5461         We did not check that E as a simple-name had the same type as E as
5462         a type name.
5463
5464         This trivial check gives us 5-7% on bootstrap time.
5465
5466 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5467
5468         * expression.cs (Invocation.OverloadResolve): Avoid the
5469         use of hashtables and boxing here by allocating on demand.
5470
5471 2004-05-30  Martin Baulig  <martin@ximian.com>
5472
5473         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5474         we're doing a silent lookup.  Don't try to lookup nested types in
5475         TypeManager.object_type (thanks to Ben Maurer).
5476
5477 2004-05-30  Martin Baulig  <martin@ximian.com>
5478
5479         Committing a patch from Ben Maurer.
5480
5481         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5482
5483 2004-05-29  Martin Baulig  <martin@ximian.com>
5484
5485         * class.cs (IMethodData.ShouldIgnore): New method.
5486
5487         * typemanager.cs (TypeManager.MethodFlags): Don't take a
5488         `Location' argument, we don't need it anywhere.  Use
5489         `IMethodData.ShouldIgnore ()' instead of
5490         `MethodData.GetMethodFlags ()'.
5491         (TypeManager.AddMethod): Removed.
5492         (TypeManager.AddMethod2): Renamed to AddMethod.
5493
5494 2004-05-29  Martin Baulig  <martin@ximian.com>
5495
5496         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
5497
5498         * convert.cs (Convert.ImplicitReferenceConversion): If we're
5499         converting from a class type S to an interface type and we already
5500         have an object on the stack, don't box it again.  Fixes #52578.
5501
5502 2004-05-29  Martin Baulig  <martin@ximian.com>
5503
5504         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5505         Added support for `params' parameters.  Fixes #59267.
5506
5507 2004-05-29  Martin Baulig  <martin@ximian.com>
5508
5509         * literal.cs (NullPointer): Provide a private .ctor which sets
5510         `type' to TypeManager.object_type.  Fixes #59048.
5511
5512 2004-05-29  Martin Baulig  <martin@ximian.com>
5513
5514         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
5515         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
5516
5517         * ecore.cs (EventExpr.instance_expr): Make the field private.
5518
5519 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
5520
5521         Fixed bug #50080 & cs0214-2.cs
5522         * expression.cs (Cast.DoResolve): Check unsafe context here.
5523         
5524         * statement.cs (Resolve.DoResolve): Likewise.
5525
5526 2004-05-26  Martin Baulig  <martin@ximian.com>
5527
5528         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
5529
5530         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
5531         (RootContext.LookupType): Pass down the `silent' flag.
5532
5533 2004-05-25  Martin Baulig  <martin@ximian.com>
5534
5535         * expression.cs
5536         (MethodGroupExpr.IdenticalTypeName): New public property.
5537         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
5538         expression actually refers to a type.
5539
5540 2004-05-25  Martin Baulig  <martin@ximian.com>
5541
5542         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
5543         for #56176 and made it actually work.
5544
5545 2004-05-25  Martin Baulig  <martin@ximian.com>
5546
5547         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
5548         (FieldExpr, PropertyExpr): Override and implement
5549         CacheTemporaries.  Fixes #52279.
5550
5551 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
5552
5553         * location.cs: In the new compiler listing a file twice is a
5554         warning, not an error.
5555
5556 2004-05-24  Martin Baulig  <martin@ximian.com>
5557
5558         * enum.cs (Enum.DefineType): For the `BaseType' to be a
5559         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
5560
5561 2004-05-24  Martin Baulig  <martin@ximian.com>
5562
5563         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
5564         walking the `using' list.  Fixes #53921.
5565
5566 2004-05-24  Martin Baulig  <martin@ximian.com>
5567
5568         * const.cs (Const.LookupConstantValue): Added support for
5569         EmptyCast's; fixes #55251.
5570
5571 2004-05-24  Martin Baulig  <martin@ximian.com>
5572
5573         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
5574         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
5575         which does the CS0135 check.  The reason is that we first need to
5576         check whether the variable actually exists.
5577
5578 2004-05-24  Martin Baulig  <martin@ximian.com>
5579
5580         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
5581         than RootContext.LookupType() to find the explicit interface
5582         type.  Fixes #58584.
5583
5584 2004-05-24  Raja R Harinath  <rharinath@novell.com>
5585
5586         * Makefile: Simplify.  Use executable.make.
5587         * mcs.exe.sources: New file.  List of sources of mcs.exe.
5588
5589 2004-05-24  Anders Carlsson  <andersca@gnome.org>
5590
5591         * decl.cs:
5592         * enum.cs:
5593         Use the invariant culture when doing String.Compare for CLS case
5594         sensitivity.
5595         
5596 2004-05-23  Martin Baulig  <martin@ximian.com>
5597
5598         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
5599         don't have any dots.  Fixes #52622, added cs0246-8.cs.
5600
5601         * namespace.cs (NamespaceEntry.Lookup): Likewise.
5602         
5603 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5604
5605         * class.cs (MemberBase.Define): Reuse MemberType member for 
5606         resolved type. Other methods can use it too.
5607
5608 2004-05-23  Martin Baulig  <martin@ximian.com>
5609
5610         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
5611         the variable also exists in the current block (otherwise, we need
5612         to report a CS0103).  Fixes #58670.
5613
5614 2004-05-23  Martin Baulig  <martin@ximian.com>
5615
5616         * flowanalysis.cs (Reachability.Reachable): Compute this
5617         on-the-fly rather than storing it as a field.
5618
5619 2004-05-23  Martin Baulig  <martin@ximian.com>
5620
5621         * flowanalysis.cs (Reachability.And): Manually compute the
5622         resulting `barrier' from the reachability.      
5623        
5624 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5625
5626         Fix bug #57835
5627         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
5628         instance of ObsoleteAttribute when symbol is obsolete.
5629
5630         * class.cs
5631         (IMethodData): Extended interface for ObsoleteAttribute support.
5632
5633 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5634
5635         * attribute.cs: Fix bug #55970
5636
5637 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5638
5639         Fix bug #52705
5640         * attribute.cs
5641         (GetObsoleteAttribute): New method. Creates the instance of
5642         ObsoleteAttribute.
5643         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
5644         ObsoleteAttribute when member is obsolete.
5645         (AttributeTester.Report_ObsoleteMessage): Common method for
5646         Obsolete error/warning reporting.
5647
5648         * class.cs
5649         (TypeContainer.base_classs_type): New member for storing parent type.
5650
5651         * decl.cs
5652         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
5653         for this MemberCore.
5654
5655 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5656
5657         * attribute.cs, const.cs: Fix bug #58590
5658
5659 2004-05-21  Martin Baulig  <martin@ximian.com>
5660
5661         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
5662         out parameters if the end of the method is unreachable.  Fixes
5663         #58098. 
5664
5665 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5666
5667         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
5668         Hari was right, why extra method.
5669
5670 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5671
5672         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
5673
5674 2004-05-20  Martin Baulig  <martin@ximian.com>
5675
5676         Merged this back from gmcs to keep the differences to a minumum.
5677
5678         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
5679         instead of a Declspace.
5680         (Attribute.ResolveType): Likewise.
5681         (Attributes.Search): Likewise.
5682         (Attributes.Contains): Likewise.
5683         (Attributes.GetClsCompliantAttribute): Likewise.
5684
5685         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
5686         argument.
5687         (MethodData.ApplyAttributes): Take an EmitContext instead of a
5688         DeclSpace.
5689
5690 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
5691
5692         Fix bug #58688 (MCS does not report error when the same attribute
5693         is assigned twice)
5694
5695         * attribute.cs (Attribute.Emit): Distinction between null and default.
5696
5697 2004-05-19  Raja R Harinath  <rharinath@novell.com>
5698
5699         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
5700         of a top-level attribute without an attribute target.
5701         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
5702         Make non-static.
5703         (Attribute.Conditional_GetConditionName), 
5704         (Attribute.Obsolete_GetObsoleteMessage): Update.
5705         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
5706         part of ScanForIndexerName.
5707         (Attribute.CanIgnoreInvalidAttribute): New function.
5708         (Attribute.ScanForIndexerName): Move to ...
5709         (Attributes.ScanForIndexerName): ... here.
5710         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
5711         (Attributes.Search): New internal variant that can choose not to
5712         complain if types aren't resolved.  The original signature now
5713         complains.
5714         (Attributes.GetClsCompliantAttribute): Use internal variant, with
5715         complaints suppressed.
5716         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
5717         only if it not useful.
5718         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
5719         top-level for attributes that are shared between the assembly
5720         and a top-level class.
5721         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
5722         * class.cs: Update to reflect changes.
5723         (DefineIndexers): Fuse loops.
5724         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
5725         a couple more variants of attribute names.
5726
5727 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
5728
5729         Fix bug #52585 (Implemented explicit attribute declaration)
5730
5731         * attribute.cs:
5732         (Attributable.ValidAttributeTargets): New abstract method. It gets
5733         list of valid attribute targets for explicit target declaration.
5734         (Attribute.Target): It holds target itself.
5735         (AttributeSection): Removed.
5736         (Attribute.CheckTargets): New method. It checks whether attribute
5737         target is valid for the current element.
5738
5739         * class.cs:
5740         (EventProperty): New class. For events that are declared like
5741         property (with add and remove accessors).
5742         (EventField): New class. For events that are declared like field.
5743         class.cs
5744
5745         * cs-parser.jay: Implemented explicit attribute target declaration.
5746
5747         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
5748         Override ValidAttributeTargets.
5749
5750         * parameter.cs:
5751         (ReturnParameter): Class for applying custom attributes on 
5752         the return type.
5753         (ParameterAtribute): New class. Class for applying custom
5754         attributes on the parameter type.
5755
5756 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
5757
5758         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
5759         definitions. 
5760
5761         (Method): Allow UNSAFE here.
5762
5763         * modifiers.cs: Support unsafe reporting.
5764
5765 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
5766
5767         * decl.cs: Fix bug #58478.
5768
5769 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5770
5771         * statement.cs: When checking for unreachable code on an EmptyStatement,
5772         set the location. Fixes bug #58488.
5773
5774 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
5775
5776         * driver.cs: Add -pkg handling.
5777
5778         From Gonzalo: UseShelLExecute=false
5779
5780 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
5781
5782         * attribute.cs:
5783         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
5784         for attribute.
5785         (Attribute.IsClsCompliaceRequired): Moved to base for better
5786         accesibility.
5787         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
5788         when attribute is AttributeUsageAttribute.
5789         (Attribute.GetValidTargets): Simplified.
5790         (Attribute.GetAttributeUsage): New method returns AttributeUsage
5791         attribute for this type.
5792         (Attribute.ApplyAttributes): Method renamed to Emit and make
5793         non-static.
5794         (GlobalAttributeSection): New class for special handling of global
5795         attributes (assembly, module).
5796         (AttributeSection.Emit): New method.
5797
5798         * class.cs: Implemented Attributable abstract methods.
5799         (MethodCore.LabelParameters): Moved to Parameter class.
5800         (Accessor): Is back simple class.
5801         (PropertyMethod): Implemented Attributable abstract class.
5802         (DelegateMethod): Implemented Attributable abstract class.
5803         (Event): New constructor for disctintion between normal Event
5804         and Event with accessors.
5805
5806         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
5807
5808         * codegen.cs, const.cs, decl.cs, delegate.cs:
5809         (CommonAssemblyModulClass): Implemented Attributable abstract class
5810         and simplified.
5811
5812         * enum.cs: Implement IAttributeSupport interface.
5813         (EnumMember): New class for emum members. Implemented Attributable
5814         abstract class
5815
5816         * parameter.cs:
5817         (ParameterBase): Is abstract.
5818         (ReturnParameter): New class for easier [return:] attribute handling.
5819
5820         * typemanager.cs: Removed builder_to_attr.
5821
5822 2004-05-11  Raja R Harinath  <rharinath@novell.com>
5823
5824         Fix bug #57151.
5825         * attribute.cs (Attribute.GetPositionalValue): New function.
5826         * class.cs (TypeContainer.VerifyMembers): New function.
5827         (TypeContainer.Emit): Use it.
5828         (ClassOrStruct): New base class for Class and Struct.
5829         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
5830         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
5831         class.
5832         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
5833         then each non-static field should have a FieldOffset attribute.
5834         Otherwise, none of the fields should have a FieldOffset attribute.
5835         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
5836         and FieldOffset attributes.
5837         * typemanager.cs (TypeManager.struct_layout_attribute_type)
5838         (TypeManager.field_offset_attribute_type): New core types.
5839         (TypeManager.InitCoreTypes): Initialize them.
5840
5841 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
5842
5843         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
5844         Return correct type.
5845         From bug #58270.
5846
5847 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
5848
5849         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
5850         be implicitly converted to ulong.
5851         
5852         * expression.cs: The logic for allowing operator &, | and ^ worked
5853         was wrong, it worked before because we did not report an error in
5854         an else branch.  Fixes 57895.
5855
5856         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
5857         allow volatile fields to be reference types.
5858
5859 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
5860
5861         * driver.cs: Add support for /debug-
5862
5863 2004-05-07  Raja R Harinath  <rharinath@novell.com>
5864
5865         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
5866         Add a 'complain' parameter to silence errors.
5867         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
5868         silently overlooked type-resolutions.
5869         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
5870         to reflect changes.
5871         (Attributes.Search): New function.
5872         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
5873         (Attributes.GetAttributeFullName): Remove hack.
5874         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
5875         Update to reflect changes.
5876         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5877         Use Attributes.Search instead of nested loops.
5878
5879 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
5880
5881         * decl.cs:
5882         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
5883         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
5884         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
5885
5886         * report.cs: (Report.Warning): Renamed to Warning_T because of
5887         parameter collision.
5888
5889 2004-05-05  Raja R Harinath  <rharinath@novell.com>
5890
5891         * expression.cs (MemberAccess.ResolveMemberAccess):
5892         Exit with non-zero status after Report.Error.
5893         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
5894         Likewise.
5895         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
5896
5897 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
5898
5899         * support.cs: Don't hang when the file is empty.
5900
5901 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
5902
5903         * support.cs: In SeekableStreamReader, compute the preamble size of the
5904           underlying stream. Position changes should take into account that initial
5905           count of bytes.
5906
5907 2004-05-03  Todd Berman  <tberman@sevenl.net>
5908
5909         * driver.cs: remove unused GetSysVersion function.
5910
5911 2004-05-03  Todd Berman  <tberman@sevenl.net>
5912
5913         * driver.cs: Remove the hack from saturday, as well as the hack
5914         from jackson (LoadAssemblyFromGac), also adds the CWD to the
5915         link_paths to get that bit proper.
5916
5917 2004-05-01  Todd Berman  <tberman@sevenl.net>
5918
5919         * driver.cs: Try a LoadFrom before a Load, this checks the current
5920         path. This is currently a bug in mono that is be fixed, however, this
5921         provides a workaround for now. This will be removed when the bug
5922         is fixed.
5923
5924 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
5925
5926         * CryptoConvert.cs: Updated to latest version. Fix issue with 
5927         incomplete key pairs (#57941).
5928
5929 2004-05-01  Todd Berman  <tberman@sevenl.net>
5930
5931         * driver.cs: Remove '.' from path_chars, now System.* loads properly
5932         from the GAC
5933
5934 2004-04-30  Jackson Harper  <jackson@ximian.com>
5935
5936         * codegen.cs: Open keys readonly.
5937         
5938 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5939
5940         * typemanager.cs: don't report cyclic struct layout when a struct
5941         contains 2 or more fields of the same type. Failed for Pango.AttrShape
5942         which has 2 Pango.Rectangle fields.
5943
5944 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5945
5946         * expression.cs: Handle IntPtr comparisons with IL code
5947         rather than a method call.
5948
5949 2004-04-29  Martin Baulig  <martin@ximian.com>
5950
5951         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
5952         the list of PropertyInfo's in class hierarchy and find the
5953         accessor.  Fixes #56013.
5954
5955 2004-04-29  Martin Baulig  <martin@ximian.com>
5956
5957         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
5958
5959 2004-04-29  Martin Baulig  <martin@ximian.com>
5960
5961         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
5962
5963         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
5964
5965 2004-04-29  Martin Baulig  <martin@ximian.com>
5966
5967         * class.cs (ConstructorInitializer.Resolve): Check whether the
5968         parent .ctor is accessible.  Fixes #52146.
5969
5970 2004-04-29  Martin Baulig  <martin@ximian.com>
5971
5972         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
5973
5974         * statement.cs (Using.EmitLocalVariableDecls): Use
5975         TypeManager.idisposable_type, not typeof (IDisposable).
5976         (Foreach.EmitCollectionForeach): Added support for valuetypes.
5977
5978 2004-04-29  Martin Baulig  <martin@ximian.com>
5979
5980         * class.cs (Event.Define): Don't emit the field and don't set
5981         RTSpecialName and SpecialName for events on interfaces.  Fixes
5982         #57703. 
5983
5984 2004-04-29  Raja R Harinath  <rharinath@novell.com>
5985
5986         Refactor Attribute.ApplyAttributes.
5987         * attribute.cs (Attributable): New base class for objects that can
5988         have Attributes applied on them.
5989         (Attribute): Make AttributeUsage fields public.
5990         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
5991         (Attribute.IsInternalCall): New property.
5992         (Attribute.UsageAttr): Convert to a public read-only property.
5993         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
5994         (Attribute.ResolveType, Attribute.Resolve)
5995         (Attribute.ScanForIndexerName): Update to reflect changes.
5996         (Attribute.CheckAttributeTarget): Re-format.
5997         (Attribute.ApplyAttributes): Refactor, to various
5998         Attributable.ApplyAttributeBuilder methods.
5999         * decl.cs (MemberCore): Make Attributable.
6000         * class.cs (Accessor): Make Attributable.
6001         (MethodData.ApplyAttributes): Use proper attribute types, not
6002         attribute names.
6003         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6004         (TypeContainer.ApplyAttributeBuilder)
6005         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6006         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6007         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6008         (Operator.ApplyAttributeBuilder): New factored-out methods.
6009         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6010         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6011         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6012         * parameter.cs (ParameterBase): New Attributable base class
6013         that can also represent Return types.
6014         (Parameter): Update to the changes.
6015
6016 2004-04-29  Jackson Harper  <jackson@ximian.com>
6017
6018         * driver.cs: Prefer the corlib system version when looking for
6019         assemblies in the GAC. This is still a hack, but its a better hack
6020         now.
6021         
6022 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6023
6024         * decl.cs, enum.cs: Improved error 3005 reporting.
6025   
6026         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6027         (related_symbols): New private member for list of symbols
6028         related to reported error/warning.
6029         
6030         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6031
6032 2004-04-29  Martin Baulig  <martin@ximian.com>
6033
6034         * ecore.cs (Expression.Constantify): If we're an enum and
6035         TypeManager.TypeToCoreType() doesn't give us another type, use
6036         t.UnderlyingSystemType.  Fixes #56178.  
6037
6038 2004-04-29  Martin Baulig  <martin@ximian.com>
6039
6040         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6041         interfaces and for each interface, only add members directly
6042         declared in that interface.  Fixes #53255.
6043
6044 2004-04-28  Martin Baulig  <martin@ximian.com>
6045
6046         * expression.cs (ConditionalLogicalOperator): Use a temporary
6047         variable for `left' to avoid that we evaluate it more than once;
6048         bug #52588.
6049
6050 2004-04-28  Martin Baulig  <martin@ximian.com>
6051
6052         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6053         `void[]' (CS1547).
6054
6055 2004-04-28  Martin Baulig  <martin@ximian.com>
6056
6057         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6058         void (CS1547).
6059
6060         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6061         whether the type is not void (CS1547).
6062
6063 2004-04-28  Martin Baulig  <martin@ximian.com>
6064
6065         * expression.cs (Unary.DoResolveLValue): Override this and report
6066         CS0131 for anything but Operator.Indirection.
6067
6068 2004-04-28  Martin Baulig  <martin@ximian.com>
6069
6070         Committing a patch from Ben Maurer; see bug #50820.
6071
6072         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6073         check for classes.
6074
6075         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6076         classes.        
6077
6078 2004-04-28  Martin Baulig  <martin@ximian.com>
6079
6080         Committing a patch from Ben Maurer; see bug #50820.
6081
6082         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6083         check for classes.
6084
6085         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6086         classes.        
6087
6088 2004-04-28  Martin Baulig  <martin@ximian.com>
6089
6090         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6091         (Block.AddLabel): Call DoLookupLabel() to only search in the
6092         current block.
6093
6094 2004-04-28  Martin Baulig  <martin@ximian.com>
6095
6096         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6097         comparing StringConstants and NullLiterals in Equality and Inequality.
6098
6099 2004-04-28  Jackson Harper  <jackson@ximian.com>
6100
6101         * driver.cs: Attempt to load referenced assemblies from the
6102         GAC. This is the quick and dirty version of this method that
6103         doesnt take into account versions and just takes the first
6104         canidate found. Will be good enough for now as we will not have more
6105         then one version installed into the GAC until I update this method.
6106
6107 2004-04-28  Martin Baulig  <martin@ximian.com>
6108
6109         * typemanager.cs (TypeManager.CheckStructCycles): New public
6110         static method to check for cycles in the struct layout.
6111
6112         * rootcontext.cs (RootContext.PopulateTypes): Call
6113         TypeManager.CheckStructCycles() for each TypeContainer.
6114         [Note: We only need to visit each type once.]
6115
6116 2004-04-28  Martin Baulig  <martin@ximian.com>
6117
6118         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6119
6120         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6121         success and added `out object value'.  Use a `bool resolved' field
6122         to check whether we've already been called rather than
6123         `ConstantValue != null' since this breaks for NullLiterals.
6124
6125 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6126
6127         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6128         setting of this flag, since the 'set' method may be non-public.
6129
6130 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6131
6132         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6133         check on current_vector.Block.
6134
6135 2004-04-27  Martin Baulig  <martin@ximian.com>
6136
6137         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6138         a field initializer.  Fixes #56459.
6139
6140 2004-04-27  Martin Baulig  <martin@ximian.com>
6141
6142         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6143         we're not attempting to use an indexer.  Fixes #52154.
6144
6145 2004-04-27  Martin Baulig  <martin@ximian.com>
6146
6147         * statement.cs (Return): Don't create a return label if we don't
6148         need it; reverts my change from January 20th.  Thanks to Ben
6149         Maurer for this.
6150
6151 2004-04-27  Martin Baulig  <martin@ximian.com>
6152
6153         According to the spec, `goto' can only leave a nested scope, but
6154         never enter it.
6155
6156         * statement.cs (Block.LookupLabel): Only lookup in the current
6157         block, don't recurse into parent or child blocks.
6158         (Block.AddLabel): Check in parent and child blocks, report
6159         CS0140/CS0158 if we find a duplicate.
6160         (Block): Removed this indexer for label lookups.
6161         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6162         this already does the error reporting for us.
6163
6164         * flowanalysis.cs
6165         (FlowBranching.UsageVector.Block): New public variable; may be null.
6166         (FlowBranching.CreateSibling): Added `Block' argument.
6167         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6168         label for the target of a `goto' and check whether we're not
6169         leaving a `finally'.
6170
6171 2004-04-27  Martin Baulig  <martin@ximian.com>
6172
6173         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6174         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6175         just for returns).
6176
6177 2004-04-27  Martin Baulig  <martin@ximian.com>
6178
6179         * statement.cs (Block.AddLabel): Also check for implicit blocks
6180         and added a CS0158 check.
6181
6182 2004-04-27  Martin Baulig  <martin@ximian.com>
6183
6184         * flowanalysis.cs (FlowBranchingLoop): New class.
6185         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6186         UsageVector's instead of an ArrayList.
6187         (FlowBranching.Label): Likewise.
6188         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6189         (FlowBranching.AddBreakVector): New method.
6190
6191 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6192
6193         * attribute.cs: Small regression fix: only convert the type if we
6194         the type is different, fixes System.Drawing build.
6195
6196 2004-04-27  Martin Baulig  <martin@ximian.com>
6197
6198         * attribute.cs (Attribute.Resolve): If we have a constant value
6199         for a named field or property, implicity convert it to the correct
6200         type.
6201
6202 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6203
6204         * statement.cs (Block.Block): Implicit blocks share
6205         'child_variable_names' fields with parent blocks.
6206         (Block.AddChildVariableNames): Remove.
6207         (Block.AddVariable): Mark variable as "used by a child block" in
6208         every surrounding block.
6209         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6210         been used in a child block, complain about violation of "Invariant
6211         meaning in blocks" rule.
6212         * cs-parser.jay (declare_local_variables): Don't use
6213         AddChildVariableNames.
6214         (foreach_statement): Don't create an implicit block: 'foreach'
6215         introduces a scope.
6216
6217 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6218
6219         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6220         converting from 0L to ulong.  Fixes 57522.
6221
6222 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6223
6224         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6225         derived class hides via 'new' keyword field from base class (test-242.cs).
6226         TODO: Handle this in the more general way.
6227         
6228         * class.cs (CheckBase): Ditto.
6229
6230 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6231
6232         * decl.cs (caching_flags): New member for storing cached values
6233         as bit flags.
6234         (MemberCore.Flags): New enum where bit flags for caching_flags
6235         are defined.
6236         (MemberCore.cls_compliance): Moved to caching_flags.
6237         (DeclSpace.Created): Moved to caching_flags.
6238
6239         * class.cs: Use caching_flags instead of DeclSpace.Created
6240         
6241 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6242
6243         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6244         if we are only a derived class, not a nested class.
6245
6246         * typemanager.cs: Same as above, but do this at the MemberLookup
6247         level (used by field and methods, properties are handled in
6248         PropertyExpr).   Allow for the qualified access if we are a nested
6249         method. 
6250
6251 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6252
6253         * class.cs: Refactoring.
6254         (IMethodData): New inteface; Holds links to parent members
6255         to avoid member duplication (reduced memory allocation).
6256         (Method): Implemented IMethodData interface.
6257         (PropertyBase): New inner classes for get/set methods.
6258         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6259         (Event): New inner classes for add/remove methods.
6260         (Event.DelegateMethod): Implemented IMethodData interface.
6261
6262         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6263         EmitContext (related to class.cs refactoring).
6264
6265 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6266
6267         * delegate.cs (Delegate.VerifyApplicability): If the number of
6268         arguments are the same as the number of parameters, first try to
6269         verify applicability ignoring  any 'params' modifier on the last
6270         parameter.
6271         Fixes #56442.
6272
6273 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6274
6275         * class.cs (TypeContainer.AddIndexer): Use
6276         'ExplicitInterfaceName' to determine if interface name was
6277         explicitly specified.  'InterfaceType' is not initialized at this time.
6278         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6279         Indexers array is already in the required order.  Initialize
6280         'IndexerName' only if there are normal indexers.
6281         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6282         (TypeContainer.Emit): Emit DefaultMember attribute only if
6283         IndexerName is initialized.
6284         Fixes #56300.
6285
6286 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6287
6288         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6289         Fixes #57007
6290
6291 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6292
6293         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6294         attributes.
6295         Fix for #56456.
6296
6297         * attribute.cs (Attribute.Resolve): Check for duplicate named
6298         attributes.
6299         Fix for #56463.
6300
6301 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6302
6303         * iterators.cs (MarkYield): track whether we are in an exception,
6304         and generate code accordingly.  Use a temporary value to store the
6305         result for our state.
6306
6307         I had ignored a bit the interaction of try/catch with iterators
6308         since their behavior was not entirely obvious, but now it is
6309         possible to verify that our behavior is the same as MS .NET 2.0
6310
6311         Fixes 54814
6312
6313 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6314
6315         * iterators.cs: Avoid creating temporaries if there is no work to
6316         do. 
6317
6318         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6319         Enumerations, use TypeManager.EnumToUnderlying and call
6320         recursively. 
6321
6322         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6323         bug #57013
6324
6325         (This.Emit): Use EmitContext.EmitThis to emit our
6326         instance variable.
6327
6328         (This.EmitAssign): Ditto.
6329
6330         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6331         codepaths, we will move all the functionality into
6332         Mono.CSharp.This 
6333
6334         (FieldExpr.EmitAssign): Ditto.
6335
6336         This fixes several hidden bugs that I uncovered while doing a code
6337         review of this today.
6338
6339         * codegen.cs (EmitThis): reworked so the semantics are more clear
6340         and also support value types "this" instances.
6341
6342         * iterators.cs: Changed so that for iterators in value types, we
6343         do not pass the value type as a parameter.  
6344
6345         Initialization of the enumerator helpers is now done in the caller
6346         instead of passing the parameters to the constructors and having
6347         the constructor set the fields.
6348
6349         The fields have now `assembly' visibility instead of private.
6350
6351 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6352
6353         * expression.cs (Argument.Resolve): Check if fields passed as ref
6354         or out are contained in a MarshalByRefObject.
6355
6356         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6357         another compiler type.
6358
6359 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6360
6361         * class.cs (Indexer.Define): use the new name checking method.
6362         Also, return false on an error.
6363         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6364         (is_identifier_[start/part]_character): make static.
6365
6366 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6367
6368         * expression.cs (Binary.ResolveOperator): Do no append strings
6369         twice: since we can be invoked more than once (array evaluation)
6370         on the same concatenation, take care of this here.  Based on a fix
6371         from Ben (bug #56454)
6372
6373 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6374
6375         * codegen.cs: Fix another case where CS1548 must be reported (when 
6376         delay-sign isn't specified and no private is available #56564). Fix
6377         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6378         error when MCS is used on the MS runtime and we need to delay-sign 
6379         (which seems unsupported by AssemblyBuilder - see #56621).
6380
6381 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6382
6383         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6384         (TypeManager.ComputeNamespaces): Faster implementation for
6385         Microsoft runtime.
6386
6387         * compiler.csproj: Updated AssemblyName to mcs.
6388
6389 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6390
6391         * rootcontext.cs: Add new types to the boot resolution.
6392
6393         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
6394         MulticastDelegate is not allowed.
6395
6396         * typemanager.cs: Add new types to lookup: System.TypedReference
6397         and ArgIterator.
6398
6399         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
6400         check for TypedReference or ArgIterator, they are not allowed. 
6401
6402         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
6403         makes us properly catch 1510 in some conditions (see bug 56016 for
6404         details). 
6405
6406 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
6407
6408         * CryptoConvert.cs: update from corlib version
6409         with endian fixes.
6410
6411 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
6412
6413         * class.cs (Indexer.Define): Check indexername declaration
6414
6415 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
6416
6417         * attribute.cs (IsClsCompliant): Fixed problem with handling
6418         all three states (compliant, not-compliant, undetected).
6419
6420 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
6421
6422         * attribute.cs (Attribute): Location is now public.
6423         (Resolve): Store resolved arguments (pos_values) in attribute class.
6424         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
6425         (GetClsCompliantAttributeValue): New method that gets
6426         CLSCompliantAttribute value.
6427         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
6428         if exists else null.
6429         (AttributeTester): New class for CLS-Compliant verification routines.
6430
6431         * class.cs (Emit): Add CLS-Compliant verification.
6432         (Method.GetSignatureForError): Implemented.
6433         (Constructor.GetSignatureForError): Implemented
6434         (Constructor.HasCompliantArgs): Returns if constructor has
6435         CLS-Compliant arguments.
6436         (Constructor.Emit): Override.
6437         (Construcor.IsIdentifierClsCompliant): New method; For constructors
6438         is needed to test only parameters.
6439         (FieldBase.GetSignatureForError): Implemented.
6440         (TypeContainer): New member for storing base interfaces.
6441         (TypeContainer.FindMembers): Search in base interfaces too.
6442
6443         * codegen.cs (GetClsComplianceAttribute): New method that gets
6444         assembly or module CLSCompliantAttribute value.
6445         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
6446         for assembly.
6447         (ModuleClass.Emit): Add error 3012 test.
6448
6449         * const.cs (Emit): Override and call base for CLS-Compliant tests.
6450
6451         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
6452         state for all decl types.
6453         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
6454         if CLS-Compliant tests are required.
6455         (IsClsCompliaceRequired): New method. Analyze whether code
6456         must be CLS-Compliant.
6457         (IsExposedFromAssembly): New method. Returns true when MemberCore
6458         is exposed from assembly.
6459         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
6460         value or gets cached value.
6461         (HasClsCompliantAttribute): New method. Returns true if MemberCore
6462         is explicitly marked with CLSCompliantAttribute.
6463         (IsIdentifierClsCompliant): New abstract method. This method is
6464         used to testing error 3005.
6465         (IsIdentifierAndParamClsCompliant): New method. Common helper method
6466         for identifier and parameters CLS-Compliant testing.
6467         (VerifyClsCompliance): New method. The main virtual method for
6468         CLS-Compliant verifications.
6469         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
6470         null. I don't know why is null (too many public members !).
6471         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
6472         and get value of first CLSCompliantAttribute that found.
6473
6474         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
6475         (VerifyClsCompliance): Override and add extra tests.
6476
6477         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
6478         clscheck- disable CLS-Compliant verification event if assembly is has
6479         CLSCompliantAttribute(true).
6480
6481         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
6482         ApllyAttribute is now called in emit section as in the other cases.
6483         Possible future Emit integration.
6484         (IsIdentifierClsCompliant): New override.
6485         (VerifyClsCompliance): New override.
6486         (GetEnumeratorName): Returns full enum name.
6487
6488         * parameter.cs (GetSignatureForError): Implemented.
6489
6490         * report.cs (WarningData): New struct for Warning message information.
6491         (LocationOfPreviousError): New method.
6492         (Warning): New method. Reports warning based on the warning table.
6493         (Error_T): New method. Reports error based on the error table.
6494
6495         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
6496         verifications are done here.
6497
6498         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
6499
6500         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
6501         CLSCompliantAttribute.
6502         (all_imported_types): New member holds all imported types from other
6503         assemblies.
6504         (LoadAllImportedTypes): New method fills static table with exported types
6505         from all referenced assemblies.
6506         (Modules): New property returns all assembly modules.
6507
6508 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
6509
6510         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
6511         throwing a parser error.
6512
6513         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
6514         which removes the hardcoded get_/set_ prefixes for properties, as
6515         IL allows for the properties to be named something else.  
6516
6517         Bug #56013
6518
6519         * expression.cs: Do not override operand before we know if it is
6520         non-null.  Fix 56207
6521
6522 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6523
6524         * typemanager.cs: support for pinned variables.
6525
6526 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6527
6528         * decl.cs, typemanager.cs: Avoid using an arraylist
6529         as a buffer if there is only one result set.
6530
6531 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6532
6533         * expression.cs: Make sure you cant call a static method
6534         with an instance expression, bug #56174.
6535
6536 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
6537
6538         * class.cs (IsDuplicateImplementation): Improve error reporting to
6539         flag 663 (method only differs in parameter modifier).
6540
6541         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
6542         in preprocessor directives.
6543
6544         * location.cs (LookupFile): Allow for the empty path.
6545
6546         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
6547         better approach for some of that patch, but its failing with the
6548         CharSet enumeration.  For now try/catch will do.
6549
6550         * typemanager.cs: Do not crash if a struct does not have fields.
6551         Fixes 56150.
6552
6553 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6554
6555         * expression.cs: cs0213, cant fix a fixed expression.
6556         fixes 50231.
6557
6558 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6559
6560         * cs-parser.jay: detect invalid embeded statements gracefully.
6561         bug #51113.
6562
6563 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6564
6565         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
6566         As a regex:
6567         s/
6568         the invocation type may not be a subclass of the tye of the item/
6569         The type of the item must be a subclass of the invocation item.
6570         /g
6571
6572         Fixes bug #50820.
6573
6574 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
6575
6576         * attribute.cs: Added methods to get a string and a bool from an
6577         attribute. Required to information from AssemblyKeyFileAttribute,
6578         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
6579         * codegen.cs: Modified AssemblyName creation to include support for
6580         strongnames. Catch additional exceptions to report them as CS1548.
6581         * compiler.csproj: Updated include CryptoConvert.cs.
6582         * compiler.csproj.user: Removed file - user specific configuration.
6583         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
6584         Mono.Security assembly. The original class is maintained and tested in
6585         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
6586         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
6587         like CSC 8.0 (C# v2) supports.
6588         * Makefile: Added CryptoConvert.cs to mcs sources.
6589         * rootcontext.cs: Added new options for strongnames.
6590
6591 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
6592
6593         * driver.cs: For --expect-error, report error code `2'
6594         if the program compiled with no errors, error code `1' if
6595         it compiled with an error other than the one expected.
6596
6597 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
6598
6599         * compiler.csproj: Updated for Visual Studio .NET 2003.
6600         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
6601         * compiler.sln: Updated for Visual Studio .NET 2003.
6602
6603 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
6604
6605         * expression.cs: Fix bug #47234. We basically need to apply the
6606         rule that we prefer the conversion of null to a reference type
6607         when faced with a conversion to 'object' (csc behaviour).
6608
6609 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6610
6611         * statement.cs: Shorter form for foreach, eliminates
6612         a local variable. r=Martin.
6613
6614 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6615
6616         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
6617         checks if we can use brtrue/brfalse to test for 0.
6618         * expression.cs: use the above in the test for using brtrue/brfalse.
6619         cleanup code a bit.
6620
6621 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6622
6623         * expression.cs: Rewrite string concat stuff. Benefits:
6624
6625         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
6626         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
6627         rather than a concat chain.
6628
6629         * typemanager.cs: Add lookups for more concat overloads.
6630
6631 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6632
6633         * expression.cs: Emit shorter il code for array init.
6634
6635         newarr
6636         dup
6637         // set 1
6638
6639         // set 2
6640
6641         newarr
6642         stloc.x
6643
6644         ldloc.x
6645         // set 1
6646
6647         ldloc.x
6648         // set 2
6649
6650 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
6651
6652         * statement.cs: Before, two switch blocks would be merged if the
6653         total size of the blocks (end_item - begin_item + 1) was less than
6654         two times the combined sizes of the blocks.
6655
6656         Now, it will only merge if after the merge at least half of the
6657         slots are filled.
6658
6659         fixes 55885.
6660
6661 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
6662
6663         * class.cs : csc build fix for GetMethods(). See bug #52503.
6664
6665 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
6666
6667         * expression.cs: Make sure fp comparisons work with NaN.
6668         This fixes bug #54303. Mig approved this patch a long
6669         time ago, but we were not able to test b/c the runtime
6670         had a related bug.
6671
6672 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
6673
6674         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
6675
6676 2004-03-19  Martin Baulig  <martin@ximian.com>
6677
6678         * class.cs (MemberCore.IsDuplicateImplementation): Report the
6679         error here and not in our caller.
6680
6681 2004-03-19  Martin Baulig  <martin@ximian.com>
6682
6683         * interface.cs: Completely killed this file.
6684         (Interface): We're now a TypeContainer and live in class.cs.
6685
6686         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
6687         argument; we're now also called for interfaces.
6688         (TypeContainer.DefineMembers): Allow this method being called
6689         multiple times.
6690         (TypeContainer.GetMethods): New public method; formerly known as
6691         Interface.GetMethod().  This is used by PendingImplementation.
6692         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
6693         it's now private and non-static.
6694         (Interface): Moved this here; it's now implemented similar to
6695         Class and Struct.
6696         (Method, Property, Event, Indexer): Added `bool is_interface'
6697         argument to their .ctor's.
6698         (MemberBase.IsInterface): New public field.
6699
6700         * cs-parser.jay: Create normal Method, Property, Event, Indexer
6701         instances instead of InterfaceMethod, InterfaceProperty, etc.
6702         (opt_interface_base): Removed; we now use `opt_class_base' instead.
6703         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
6704
6705 2004-03-19  Martin Baulig  <martin@ximian.com>
6706
6707         * class.cs (MethodCore.IsDuplicateImplementation): New private
6708         method which does the CS0111 checking.
6709         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
6710         Use IsDuplicateImplementation().
6711
6712 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
6713
6714         * decl.cs (FindMemberToOverride): New method to find the correct
6715         method or property to override in the base class.
6716         * class.cs
6717             - Make Method/Property use the above method to find the
6718               version in the base class.
6719             - Remove the InheritableMemberSignatureCompare as it is now
6720               dead code.
6721
6722         This patch makes large code bases much faster to compile, as it is
6723         O(n) rather than O(n^2) to do this validation.
6724
6725         Also, it fixes bug 52458 which is that nested classes are not
6726         taken into account when finding the base class member.
6727
6728         Reviewed/Approved by Martin.
6729
6730 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
6731
6732         * interface.cs: In all interface classes removed redundant
6733         member initialization.
6734
6735 2004-03-16  Martin Baulig  <martin@ximian.com>
6736
6737         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
6738
6739 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
6740
6741         * decl.cs (DefineTypeAndParents): New helper method to define a
6742         type's containers before the type itself is defined;  This is a
6743         bug exposed by the recent changes to Windows.Forms when an
6744         implemented interface was defined inside a class that had not been
6745         built yet.   
6746
6747         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
6748
6749         (Check): Loop correctly to report errors modifiers
6750         (UNSAFE was not in the loop, since it was the same as TOP).
6751
6752         * interface.cs: Every interface member now takes a ModFlags,
6753         instead of a "is_new" bool, which we set on the base MemberCore. 
6754
6755         Every place where we called "UnsafeOk" in the interface, now we
6756         call the proper member (InterfaceMethod.UnsafeOK) instead to get
6757         the unsafe settings from the member declaration instead of the
6758         container interface. 
6759
6760         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
6761
6762         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
6763         `set_indexer_name' to the pending bits (one per type).
6764
6765         We fixed a bug today that was picking the wrong method to
6766         override, since for properties the existing InterfaceMethod code
6767         basically ignored the method name.  Now we make sure that the
6768         method name is one of the valid indexer names.
6769
6770 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
6771  
6772         * support.cs (SeekableStreamReader): Keep track of stream byte
6773         positions and don't mix them with character offsets to the buffer.
6774
6775         Patch from Gustavo Giráldez
6776
6777 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
6778
6779         * interface.cs (InterfaceSetGetBase): Removed double member
6780         initialization, base class does it as well.
6781
6782 2004-03-13  Martin Baulig  <martin@ximian.com>
6783
6784         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
6785         when compiling corlib.
6786
6787 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
6788
6789         * convert.cs (ExplicitConversion): We were reporting an error on
6790         certain conversions (object_type source to a value type, when the
6791         expression was `null') before we had a chance to pass it through
6792         the user defined conversions.
6793
6794         * driver.cs: Replace / and \ in resource specifications to dots.
6795         Fixes 50752
6796
6797         * class.cs: Add check for duplicate operators.  Fixes 52477
6798
6799 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
6800
6801         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
6802         that are in the middle of the statements, not only at the end.
6803         Fixes #54987
6804
6805         * class.cs (TypeContainer.AddField): No longer set the
6806         `HaveStaticConstructor' flag, now we call it
6807         `UserDefineStaticConstructor' to diferentiate the slightly
6808         semantic difference.
6809
6810         The situation is that we were not adding BeforeFieldInit (from
6811         Modifiers.TypeAttr) to classes that could have it.
6812         BeforeFieldInit should be set to classes that have no static
6813         constructor. 
6814
6815         See:
6816
6817         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
6818
6819         And most importantly Zoltan's comment:
6820
6821         http://bugzilla.ximian.com/show_bug.cgi?id=44229
6822
6823         "I think beforefieldinit means 'it's ok to initialize the type sometime 
6824          before its static fields are used', i.e. initialization does not need
6825          to be triggered by the first access to the type. Setting this flag
6826          helps the JIT to compile better code, since it can run the static
6827          constructor at JIT time, and does not need to generate code to call it
6828          (possibly lots of times) at runtime. Unfortunately, mcs does not set
6829          this flag for lots of classes like String. 
6830          
6831          csc sets this flag if the type does not have an explicit static 
6832          constructor. The reasoning seems to be that if there are only static
6833          initalizers for a type, and no static constructor, then the programmer
6834          does not care when this initialization happens, so beforefieldinit
6835          can be used.
6836          
6837          This bug prevents the AOT compiler from being usable, since it 
6838          generates so many calls to mono_runtime_class_init that the AOT code
6839          is much slower than the JITted code. The JITted code is faster, 
6840          because it does not generate these calls if the vtable is type is
6841          already initialized, which is true in the majority of cases. But the
6842          AOT compiler can't do this."
6843
6844 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
6845
6846         * class.cs (MethodData.Emit): Refactor the code so symbolic
6847         information is generated for destructors;  For some reasons we
6848         were taking a code path that did not generate symbolic information
6849         before. 
6850
6851 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6852
6853         * class.cs: Create a Constructor.CheckBase method that
6854         takes care of all validation type code. The method
6855         contains some code that was moved from Define.
6856
6857         It also includes new code that checks for duplicate ctors.
6858         This fixes bug #55148.
6859
6860 2004-03-09  Joshua Tauberer <tauberer@for.net>
6861
6862         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
6863         a { ... }-style array creation invokes EmitStaticInitializers
6864         which is not good for reference-type arrays.  String, decimal
6865         and now null constants (NullCast) are not counted toward
6866         static initializers.
6867
6868 2004-03-05  Martin Baulig  <martin@ximian.com>
6869
6870         * location.cs (SourceFile.HasLineDirective): New public field;
6871         specifies whether the file contains or is referenced by a "#line"
6872         directive.
6873         (Location.DefineSymbolDocuments): Ignore source files which
6874         either contain or are referenced by a "#line" directive.        
6875
6876 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
6877
6878         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
6879         direct access to our parent, so check the method inline there.
6880
6881 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6882
6883         * expression.cs (Invocation.EmitCall): Miguel's last commit
6884         caused a regression. If you had:
6885
6886             T t = null;
6887             t.Foo ();
6888
6889         In Foo the implict this would be null.
6890
6891 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
6892
6893         * expression.cs (Invocation.EmitCall): If the method is not
6894         virtual, do not emit a CallVirt to it, use Call.
6895
6896         * typemanager.cs (GetFullNameSignature): Improve the method to
6897         cope with ".ctor" and replace it with the type name.
6898
6899         * class.cs (ConstructorInitializer.Resolve): Now the method takes
6900         as an argument the ConstructorBuilder where it is being defined,
6901         to catch the recursive constructor invocations.
6902
6903 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
6904
6905         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
6906         routines to check if a type is an enumerable/enumerator allow
6907         classes that implement the IEnumerable or IEnumerator interfaces.
6908
6909         * class.cs (Property, Operator): Implement IIteratorContainer, and
6910         implement SetYields.
6911
6912         (Property.Define): Do the block swapping for get_methods in the
6913         context of iterators.   We need to check if Properties also
6914         include indexers or not.
6915
6916         (Operator): Assign the Block before invoking the
6917         OperatorMethod.Define, so we can trigger the Iterator code
6918         replacement. 
6919
6920         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
6921         Property and Operator classes are not created when we parse the
6922         declarator but until we have the block completed, so we use a
6923         singleton SimpleIteratorContainer.Simple to flag whether the
6924         SetYields has been invoked.
6925
6926         We propagate this setting then to the Property or the Operator to
6927         allow the `yield' to function.
6928
6929 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
6930
6931         * codegen.cs: Implemented attribute support for modules.
6932         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
6933         Assembly/Module functionality.
6934
6935         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
6936         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
6937         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
6938
6939 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
6940
6941         * interface.cs (FindMembers): The operation is performed on all base
6942         interfaces and not only on the first. It is required for future CLS Compliance patch.
6943
6944 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6945
6946         * statement.cs, codegen.cs:
6947         This patch deals with patterns such as:
6948
6949         public class List : IEnumerable {
6950
6951                 public MyEnumerator GetEnumerator () {
6952                         return new MyEnumerator(this);
6953                 }
6954
6955                 IEnumerator IEnumerable.GetEnumerator () {
6956                         ...
6957                 }
6958                 
6959                 public struct MyEnumerator : IEnumerator {
6960                         ...
6961                 }
6962         }
6963
6964         Before, there were a few things we did wrong:
6965         1) we would emit callvirt on a struct, which is illegal
6966         2) we emited ldarg when we needed to emit ldarga
6967         3) we would mistakenly call the interface methods on an enumerator
6968         type that derived from IEnumerator and was in another assembly. For example:
6969
6970         public class MyEnumerator : IEnumerator
6971
6972         Would have the interface methods called, even if there were public impls of the
6973         method. In a struct, this lead to invalid IL code.
6974
6975 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
6976
6977         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
6978           renamed to Emit.
6979
6980         * delegate.cs (Define): Fixed crash when delegate type is undefined.
6981
6982 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
6983
6984         * cs-parser.jay: Fix small regression: we were not testing V2
6985         compiler features correctly.
6986
6987         * interface.cs: If the emit context is null, then create one
6988
6989 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6990
6991         * decl.cs (GetSignatureForError): New virtual method to get full name
6992           for error messages.
6993
6994         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6995           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6996
6997         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6998           Duplicated members and code in these classes has been removed.
6999           Better encapsulation in these classes.
7000
7001 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7002
7003         * assign.cs (Assign.DoResolve): When dealing with compound
7004         assignments, there is a new rule in ECMA C# 2.4 (might have been
7005         there before, but it is documented here) that states that in:
7006
7007         a op= b;
7008
7009         If b is of type int, and the `op' is a shift-operator, then the
7010         above is evaluated as:
7011
7012         a = (int) a op b 
7013
7014         * expression.cs (Binary.ResolveOperator): Instead of testing for
7015         int/uint/long/ulong, try to implicitly convert to any of those
7016         types and use that in pointer arithmetic.
7017
7018         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7019         method to print information for from the type, not from the
7020         null-method we were given.
7021
7022 2004-02-01  Duncan Mak  <duncan@ximian.com>
7023
7024         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7025         parsing for cmd, fixes bug #53694.
7026
7027 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7028
7029         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7030         in the member name duplication tests. Property and operator name duplication
7031         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7032
7033 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7034
7035         * interface.cs (PopulateMethod): Fixed crash when interface method
7036         returns not existing type (error test cs0246-3.cs).
7037
7038 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7039
7040         * cs-parser.jay (interface_accessors): Re-write actions to also
7041         store attributes attached to get and set methods. Fix spelling
7042         while at it.
7043
7044         (inteface_property_declaration): Modify accordingly.
7045
7046         (InterfaceAccessorInfo): New helper class to store information to pass
7047         around between rules that use interface_accessors.
7048
7049         * interface.cs (Emit): Apply attributes on the get and set
7050         accessors of properties and indexers too.
7051
7052         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7053         right MethodBuilder when applying attributes to the get and set accessors.
7054
7055 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7056
7057         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7058
7059 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7060
7061         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7062
7063 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7064
7065         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7066         changes that treat `yield' specially when present before `break'
7067         or `return' tokens.
7068
7069         * cs-tokenizer.cs: yield is no longer a keyword.
7070
7071 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7072
7073         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7074         setting for default constructors.
7075         For default constructors are almost every time set wrong Modifier. The
7076         generated IL code has been alright. But inside mcs this values was
7077         wrong and this was reason why several of my CLS Compliance tests
7078         failed.
7079
7080 2004-01-22  Martin Baulig  <martin@ximian.com>
7081
7082         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7083         not a QualifiedIdentifier.  This is what `type_name_expression'
7084         was previously doing.
7085         (type_name_expression): Removed; the code is now in
7086         `namespace_or_type_name'.
7087         (qualified_identifier): Removed, use `namespace_or_type_name'
7088         instead.
7089         (QualifiedIdentifier): Removed this class.      
7090
7091 2004-01-22  Martin Baulig  <martin@ximian.com>
7092
7093         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7094         not a string as alias name.
7095
7096 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7097
7098         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7099         #52730 bug, and instead compute correctly the need to use a
7100         temporary variable when requesting an address based on the
7101         static/instace modified of the field and the constructor.
7102  
7103 2004-01-21  Martin Baulig  <martin@ximian.com>
7104
7105         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7106         class and namespace before looking up aliases.  Fixes #52517.
7107
7108 2004-01-21  Martin Baulig  <martin@ximian.com>
7109
7110         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7111         assinged in a 'try'; fixes exception4.cs.
7112
7113 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7114         * class.cs : Implemented parameter-less constructor for TypeContainer
7115
7116         * decl.cs: Attributes are now stored here. New property OptAttributes
7117
7118         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7119
7120         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7121
7122 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7123
7124         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7125           (CSharpSignature): New method for indexer and property signature.
7126
7127 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7128
7129         * pending.cs (IsVirtualFilter): Faster implementation.
7130
7131 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7132
7133         * typemanager.cs: Avoid inclusion of same assembly more than once.
7134
7135 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7136
7137         * cs-parser.jay: Fixed problem where the last assembly attribute
7138           has been applied also to following declaration (class, struct, etc.)
7139           
7140 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7141
7142         * class.cs: Added error CS0538, CS0539 reporting.
7143         Fixed crash on Microsoft runtime when field type is void.
7144
7145         * cs-parser.jay: Added error CS0537 reporting.
7146
7147         * pending.cs: Added error CS0535 reporting.
7148         Improved error report for errors CS0536, CS0534.
7149
7150 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7151
7152         Merge a few bits from the Anonymous Method MCS tree.
7153
7154         * statement.cs (ToplevelBlock): New class for toplevel methods,
7155         will hold anonymous methods, lifted variables.
7156
7157         * cs-parser.jay: Create toplevel blocks for delegates and for
7158         regular blocks of code. 
7159
7160 2004-01-20  Martin Baulig  <martin@ximian.com>
7161
7162         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7163         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7164         and `NeedExplicitReturn'; added `IsLastStatement'.
7165         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7166         have a `ReturnLabel' or we're not unreachable.
7167
7168         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7169         child's reachability; don't just override ours with it.  Fixes
7170         #58058 (lluis's example).
7171         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7172         InFinally(), InLoop(), InSwitch() and
7173         BreakCrossesTryCatchBoundary() methods.
7174
7175         * statement.cs (Return): Do all error checking in Resolve().
7176         Unless we are the last statement in a top-level block, always
7177         create a return label and jump to it.
7178         (Break, Continue): Do all error checking in Resolve(); also make
7179         sure we aren't leaving a `finally'.
7180         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7181         statement in a top-level block.
7182         (Block.Flags): Added `IsDestructor'.
7183         (Block.IsDestructor): New public property.
7184
7185 2004-01-20  Martin Baulig  <martin@ximian.com>
7186
7187         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7188
7189 2004-01-20  Martin Baulig  <martin@ximian.com>
7190
7191         * statement.cs (Statement.ResolveUnreachable): New public method.
7192         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7193         (Block.Resolve): Resolve unreachable statements.
7194
7195 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7196
7197         * expression.cs: We need to fix the case where we do
7198         not have a temp variable here.
7199
7200         * assign.cs: Only expression compound assignments need
7201         temporary variables.
7202
7203 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7204
7205         * flowanalysis.cs: Reduce memory allocation in a few ways:
7206           - A block with no variables should not allocate a bit
7207             vector for itself.
7208           - A method with no out parameters does not need any tracking
7209             for assignment of the parameters, so we need not allocate
7210             any data for it.
7211           - The arrays:
7212                 public readonly Type[] VariableTypes;
7213                 public readonly string[] VariableNames;
7214             Are redundant. The data is already stored in the variable
7215             map, so we need not allocate another array for it.
7216           - We need to add alot of checks for if (params | locals) == null
7217             due to the first two changes.
7218
7219 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7220
7221         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7222         implement IMemoryLocation, we store a copy on a local variable and
7223         take the address of it.  Patch from Benjamin Jemlich
7224
7225         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7226         to use a special "type_name_expression" rule which reduces the
7227         number of "QualifiedIdentifier" classes created, and instead
7228         directly creates MemberAccess expressions.
7229
7230 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7231
7232         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7233         that fixes #52853.  Null literal assignment to ValueType
7234
7235         * class.cs (MethodData.Emit): Instead of checking the name of the
7236         method to determine if its a destructor, create a new derived
7237         class from Method called Destructor, and test for that.  
7238
7239         * cs-parser.jay: Create a Destructor object instead of a Method.  
7240
7241         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7242
7243         Fixes: 52933
7244
7245 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7246
7247         * expression.cs (Binary.ResolveOperator): Perform an implicit
7248         conversion from MethodGroups to their delegate types on the
7249         Addition operation.
7250
7251         * delegate.cs: Introduce a new class DelegateCreation that is the
7252         base class for `NewDelegate' and `ImplicitDelegateCreation',
7253         factor some code in here.
7254
7255         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7256         conversion from MethodGroups to compatible delegate types. 
7257
7258         * ecore.cs (Expression.Resolve): Do not flag error 654
7259         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7260         we allow conversions from MethodGroups to delegate types now.
7261
7262         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7263         assignments in v2 either.
7264
7265 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7266
7267         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7268         static read-only fields in ctors.
7269
7270         Applied patch from Benjamin Jemlich 
7271
7272         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7273
7274 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7275
7276         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7277         here to return true, as they can be used like this:
7278
7279                 (XXX) int.MEMBER ()
7280
7281         Fixed 49836 and all the other dups
7282
7283 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7284
7285         * driver.cs: Implement /win32res and /win32icon.
7286
7287 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7288
7289         * cs-parser.jay: Add a rule to improve error handling for the
7290         common mistake of placing modifiers after the type.
7291
7292 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7293
7294         * cs-parser.jay (interface_event_declaration): Catch
7295         initialization of events on interfaces, and report cs0068
7296
7297         * cs-parser.jay (interface_event_declaration): Catch
7298         initialization of events. 
7299
7300         * ecore.cs: Better report missing constructors.
7301
7302         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7303         the error reporting done in the wrong place.  Fix.
7304
7305         * expression.cs (Binary.ResolveOperator): Catch the 
7306         operator + (E x, E y) error earlier, and later allow for implicit
7307         conversions in operator +/- (E e, U x) from U to the underlying
7308         type of E.
7309
7310         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7311         52596, if the container class is abstract, the default constructor
7312         is protected otherwise its public (before, we were always public).
7313
7314         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7315         fixed statement.
7316
7317         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7318         Jemlich that fixes bug #52597, MCS was generating invalid code for
7319         idisposable structs.   Thanks to Ben for following up with this
7320         bug as well.
7321
7322 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7323
7324         * driver.cs: Allow assemblies without code to be generated, fixes
7325         52230.
7326
7327 2004-01-07  Nick Drochak <ndrochak@gol.com>
7328
7329         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7330
7331 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7332
7333         * cs-parser.jay: Add rules to improve error reporting if fields or
7334         methods are declared at the namespace level (error 116)
7335
7336         * Add rules to catch event add/remove
7337
7338 2004-01-04  David Sheldon <dave-mono@earth.li>
7339
7340   * expression.cs: Added matching ")" to error message for 
7341   CS0077
7342
7343 2004-01-03 Todd Berman <tberman@gentoo.org>
7344
7345         * ecore.cs, attribute.cs:
7346         Applying fix from #52429.
7347
7348 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7349
7350         * ecore.cs, expression.cs, statement.cs:
7351         Total rewrite of how we handle branching. We
7352         now handle complex boolean expressions with fewer
7353         jumps. As well if (x == 0) no longer emits a ceq.
7354
7355         if (x is Foo) is much faster now, because we generate
7356         better code.
7357
7358         Overall, we get a pretty big improvement on our benchmark
7359         tests. The code we generate is smaller and more readable.
7360
7361         I did a full two-stage bootstrap. The patch was reviewed
7362         by Martin and Miguel.
7363
7364 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7365
7366         * cs-parser.jay: Make primary_expression not take a QI.
7367         we dont need this because the member_access rule covers
7368         us here. So we replace the rule with just IDENTIFIER.
7369
7370         This has two good effects. First, we remove a s/r conflict.
7371         Second, we allocate many fewer QualifiedIdentifier objects.
7372
7373 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7374
7375         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7376         set the correct information via SRE. This prevents
7377         hanging on the MS runtime. Fixes #29374.
7378
7379 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7380
7381         * convert.cs: correctly handle conversions to value types
7382         from Enum and ValueType as unboxing conversions.
7383
7384         Fixes bug #52569. Patch by Benjamin Jemlich.
7385
7386 2004-01-02  Ravi Pratap  <ravi@ximian.com>
7387
7388         * expression.cs (BetterConversion): Prefer int -> uint
7389         over int -> ulong (csc's behaviour). This fixed bug #52046.
7390
7391 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7392
7393         * decl.cs (MemberCache.FindMembers): now returns a
7394         MemberInfo [].
7395
7396         * typemanager.cs: In general, go with with ^^.
7397         (CopyNewMethods): take an IList.
7398         (RealMemberLookup): Only allocate an arraylist
7399         if we copy from two sets of methods.
7400
7401         This change basically does two things:
7402         1) Fewer array lists allocated due to CopyNewMethods.
7403         2) the explicit cast in MemberList costed ALOT.
7404
7405 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
7406
7407         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
7408         a hashtable to avoid needless string allocations when an identifier is
7409         used more than once (the common case).
7410
7411 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7412
7413         * pending.cs: MS's TypeBuilder.GetInterfaces ()
7414         is broken, it will not return anything. So, we
7415         have to use the information we have in mcs to
7416         do the task.
7417
7418         * typemanager.cs: Add a cache for GetInterfaces,
7419         since this will now be used more often (due to ^^)
7420
7421         (GetExplicitInterfaces) New method that gets the
7422         declared, not effective, interfaces on a type
7423         builder (eg, if you have interface IFoo, interface
7424         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
7425         { IBar }.
7426
7427         This patch makes MCS able to bootstrap itself on
7428         Windows again.
7429
7430 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7431
7432         * expression.cs: Remove the Nop's that Miguel put
7433         in by mistake.
7434
7435 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7436
7437         * report.cs, codegen.cs: Give the real stack trace to
7438         the error when an exception is thrown.
7439
7440 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7441
7442         * decl.cs: only allocate hashtables for ifaces if 
7443         it is an iface!
7444
7445 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7446
7447         * expression.cs: fix the error from cs0121-2.cs
7448         (a parent interface has two child interfaces that
7449         have a function with the same name and 0 params
7450         and the function is called through the parent).
7451
7452 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7453
7454         * class.cs, rootcontext.cs, typmanager.cs: do not
7455         leak pointers.
7456
7457 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7458
7459         * codegen.cs: remove stack for the ec flow branching.
7460         It is already a linked list, so no need.
7461
7462 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7463
7464         * Makefile: Allow custom profiler here.
7465
7466 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7467
7468         * typemanager.cs (LookupType):
7469           - Use a static char [], because split takes
7470             a param array for args, so it was allocating
7471             every time.
7472           - Do not store true in a hashtable, it boxes.
7473
7474 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7475
7476         * flowanalysis.cs: bytify common enums.
7477
7478 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7479
7480         * modifiers.cs: Add a new set of flags for the
7481         flags allowed on explicit interface impls.
7482         * cs-parser.jay: catch the use of modifiers in
7483         interfaces correctly.
7484         * class.cs: catch private void IFoo.Blah ().
7485
7486         All related to bug #50572.
7487
7488 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7489
7490         * decl.cs: Rewrite the consistant accessability checking.
7491         Accessability is not linear, it must be implemented in
7492         a tableish way. Fixes #49704.
7493
7494 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7495
7496         * expression.cs: Handle negation in a checked context.
7497         We must use subtraction from zero. Fixes #38674.
7498
7499 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7500
7501         * class.cs: Ignore static void main in DLLs.
7502         * rootcontext.cs: Handle the target type here,
7503         since we are have to access it from class.cs
7504         * driver.cs: account for the above.
7505
7506 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7507
7508         * report.cs: Give line numbers and files if available.
7509
7510 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
7511
7512         * driver.cs: Implement /addmodule.
7513
7514         * typemanager.cs:  Change 'modules' field so it now contains Modules not
7515         ModuleBuilders.
7516
7517 2003-12-20  Martin Baulig  <martin@ximian.com>
7518
7519         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
7520         (FieldBase.IsAssigned): Removed this field.
7521         (FieldBase.SetAssigned): New public method.
7522         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
7523
7524 2003-12-20  Martin Baulig  <martin@ximian.com>
7525
7526         * expression.cs (LocalVariableReference.DoResolve): Don't set
7527         `vi.Used' if we're called from DoResolveLValue().
7528
7529         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
7530         returns the usage vector it just merged into the current one -
7531         pass this one to UsageWarning().
7532         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
7533         of the `EmitContext', don't call this recursively on our children.
7534
7535 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
7536
7537         * driver.cs: Implement /target:module.
7538
7539 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
7540
7541         * support.cs (CharArrayHashtable): New helper class.
7542
7543         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
7544         char arrays, not strings, so we can avoid creating a string in
7545         consume_identifier if the identifier is a keyword.
7546
7547 2003-12-16  Martin Baulig  <martin@ximian.com>
7548
7549         * statement.cs (LocalInfo.Assigned): Removed this property.
7550         (LocalInfo.Flags): Removed `Assigned'.
7551         (LocalInfo.IsAssigned): New public method; takes the EmitContext
7552         and uses flow analysis.
7553         (Block.UsageWarning): Made this method private.
7554         (Block.Resolve): Call UsageWarning() if appropriate.
7555
7556         * expression.cs (LocalVariableReference.DoResolve): Always set
7557         LocalInfo.Used here.
7558
7559 2003-12-13  Martin Baulig  <martin@ximian.com>
7560
7561         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
7562         any value here; we're now using flow analysis to figure out
7563         whether a statement/block returns a value.
7564
7565 2003-12-13  Martin Baulig  <martin@ximian.com>
7566
7567         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
7568         working again.
7569         (FlowBranching.MergeFinally): Don't call
7570         `branching.CheckOutParameters()' here, this is called in
7571         MergeTopBlock().
7572         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
7573         when adding the `finally' vector.       
7574
7575 2003-12-13  Martin Baulig  <martin@ximian.com>
7576
7577         * flowanalysis.cs
7578         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
7579         actually work and also fix #48962.
7580
7581 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7582
7583         * decl.cs: Do not check System.Object for nested types,
7584         since we know it does not have any. Big bang for buck:
7585
7586         BEFORE:
7587            Run 1:   8.35 seconds
7588            Run 2:   8.32 seconds
7589            corlib:  17.99 seconds
7590         AFTER:
7591            Run 1:   8.17 seconds
7592            Run 2:   8.17 seconds
7593            corlib:  17.39 seconds
7594
7595 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7596
7597         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
7598         time we are returning 0 members, so we save alot here.
7599
7600 2003-12-11  Martin Baulig  <martin@ximian.com>
7601
7602         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
7603         `MergeChild()', also just take the `FlowBranching' as argument;
7604         call Merge() on it and return the result.
7605         (FlowBranching.Merge): We don't need to do anything if we just
7606         have one sibling.
7607
7608 2003-12-11  Martin Baulig  <martin@ximian.com>
7609
7610         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
7611         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
7612         Maurer for this idea.
7613
7614 2003-12-11  Martin Baulig  <martin@ximian.com>
7615
7616         * flowanalysis.cs (MergeResult): This class is now gone; we now
7617         use the `UsageVector' for this.  The reason for this is that if a
7618         branching just has one sibling, we don't need to "merge" them at
7619         all - that's the next step to do.
7620         (FlowBranching.Merge): We now return a `UsageVector' instead of a
7621         `MergeResult'.
7622
7623 2003-12-11  Martin Baulig  <martin@ximian.com>
7624
7625         Reworked flow analyis and made it more precise and bug-free.  The
7626         most important change is that we're now using a special `Reachability'
7627         class instead of having "magic" meanings of `FlowReturns'.  I'll
7628         do some more cleanups and optimizations and also add some more
7629         documentation this week.
7630
7631         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
7632         largely reworked this class.
7633         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
7634         the new `Reachability' class instead of having "magic" values here.
7635         (FlowBranching): We're now using an instance of `Reachability'
7636         instead of having separate `Returns', `Breaks' etc. fields.
7637
7638         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
7639         based on flow analysis; ignore the return value of block.Emit ().
7640
7641 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
7642
7643         * driver.cs typemanager.cs: Find the mono extensions to corlib even
7644         if they are private.
7645
7646 2003-12-09  Martin Baulig  <martin@ximian.com>
7647
7648         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
7649         call them directly on the UsageVector.
7650
7651 2003-12-09  Martin Baulig  <martin@ximian.com>
7652
7653         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
7654         Changed return type from `FlowReturns' to `Reachability'.
7655
7656 2003-12-09  Martin Baulig  <martin@ximian.com>
7657
7658         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
7659         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
7660         `Reachable' fields with a single `Reachability' one.
7661
7662 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7663
7664         * class.cs (FindMembers): Remove foreach's.
7665
7666         Bootstrap times:
7667
7668         BEFORE
7669                 Run 1:   8.74 seconds
7670                 Run 2:   8.71 seconds
7671
7672         AFTER
7673                 Run 1:   8.64 seconds
7674                 Run 2:   8.58 seconds
7675
7676
7677 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7678
7679         * cs-parser.jay:
7680         * gen-treedump.cs:
7681         * statement.cs:
7682         This patch does a few things:
7683                 1. EmptyStatement is now a singleton, so it is never reallocated.
7684                 2. All blah is EmptyStatement constructs have been changed to
7685                    blah == EmptyStatement.Value, which is much faster and valid
7686                    now that EmptyStatement is a singleton.
7687                 3. When resolving a block, rather than allocating a new array for
7688                    the non-empty statements, empty statements are replaced with
7689                    EmptyStatement.Value
7690                 4. Some recursive functions have been made non-recursive.
7691         Mainly the performance impact is from (3), however (1) and (2) are needed for
7692         this to work. (4) does not make a big difference in normal situations, however
7693         it makes the profile look saner.
7694
7695         Bootstrap times:
7696
7697         BEFORE
7698         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
7699         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
7700         Total memory allocated: 56397 KB
7701
7702         AFTER
7703         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
7704         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
7705         Total memory allocated: 55666 KB
7706
7707 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7708
7709         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
7710         than the hashtable in a hashtable version
7711
7712         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
7713         we always end up concating a string. This results in a huge perf
7714         loss, because many strings have to be tracked by the GC. In this
7715         patch, we first use a hashtable that works with two keys, so that
7716         the strings do not need to be concat'ed.
7717
7718         Bootstrap times:
7719         BEFORE
7720                 Run 1:   8.74 seconds
7721                 Run 2:   8.71 seconds
7722
7723         AFTER
7724                 Run 1:   8.65 seconds
7725                 Run 2:   8.56 seconds
7726
7727 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7728
7729         * Makefile: Add a new target `do-time' that does a quick and simple
7730         profile, leaving easy to parse output.
7731
7732 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
7733
7734         * codegen.cs (Init): Create the dynamic assembly with 
7735         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
7736
7737 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7738
7739         * support.cs: Make the PtrHashtable use only one
7740         instance of its comparer.
7741
7742 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
7743
7744         * typemanager.cs: Fix lookup of GetNamespaces.
7745
7746 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
7747
7748         * expression.cs: Removed redundant line.
7749
7750         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
7751         ArrayLists, use for loops with bounds.  
7752
7753         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
7754         arraylist.
7755
7756         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
7757         arraylists, use for loop with bounds.
7758
7759         The above three changes give us a 0.071 second performance
7760         improvement out of 3.294 seconds down to 3.223.  On my machine
7761         the above changes reduced the memory usage by 1,387 KB during
7762         compiler bootstrap.
7763
7764         * cs-parser.jay (QualifiedIdentifier): New class used to represent
7765         QualifiedIdentifiers.  Before we created a new string through
7766         concatenation, and mostly later on, the result would be
7767         manipulated by DecomposeQI through string manipulation.
7768
7769         This reduced the compiler memory usage for bootstrapping from
7770         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
7771         compile times in 0.05 seconds.
7772
7773 2003-11-28  Dick Porter  <dick@ximian.com>
7774
7775         * support.cs: Do string compares with the Invariant culture.
7776
7777         * rootcontext.cs: 
7778         * gen-treedump.cs: 
7779         * expression.cs: 
7780         * driver.cs: 
7781         * decl.cs: 
7782         * codegen.cs: 
7783         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
7784         the comparison is done with the Invariant culture.
7785
7786 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
7787
7788         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7789         GetEnumerator method.
7790
7791         (ProbeCollectionType): Iterate starting at the most specific type
7792         upwards looking for a GetEnumerator
7793
7794         * expression.cs: Shift count can be up to 31 for int/uint and 63
7795         for long/ulong.
7796
7797 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
7798
7799         * statement.cs (Block.LookupLabel): Also look for the label on the
7800         children blocks.  Use a hash table to keep track of visited
7801         nodes. 
7802
7803         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7804         we actually did transform the other operand, otherwise fall back
7805         to the common codepath that casts to long.
7806
7807         * cs-tokenizer.cs: Use the same code pattern as the int case.
7808         Maybe I should do the parsing myself, and avoid depending on the
7809         Parse routines to get this done.
7810
7811 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
7812
7813         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7814         which fixes bug 51347.  This time test it.
7815
7816         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7817         attributes for example can not tell the difference between these.
7818         The difference was only a syntax feature of the language. 
7819
7820         * attribute.cs: Apply attributes to delegates.
7821
7822         * delegate.cs: Call the apply attributes method.
7823
7824 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
7825
7826         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7827         comparing 0 vs Byte.MinValue, not the value
7828
7829         (ImplicitConversionRequired): When reporting a conversion error,
7830         use error 31 to print out the constant error instead of the
7831         simpler 29.
7832
7833         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7834         which fixes bug 51347.
7835
7836 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
7837
7838         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
7839         which fixes the -warnaserror command line option.
7840
7841 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
7842
7843         * cfold.cs (DoNumericPromotions): During constant folding of
7844         additions on UIntConstant, special case intconstants with
7845         IntConstants like we do on the expression binary operator. 
7846
7847 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
7848
7849         * convert.cs (ImplicitReferenceConversion): We were missing a case
7850         (System.Enum are not value types or class types, so we need to
7851         classify them separatedly).
7852
7853         * driver.cs: We do not support error 2007.
7854
7855 2003-11-12 Jackson Harper <jackson@ximian.com>
7856
7857         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
7858         system directory. Also use the full file name so users can
7859         libraries names mscorlib-o-tron.dll in a non system dir.
7860
7861 2003-11-10  Martin Baulig  <martin@ximian.com>
7862
7863         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7864         (TypeManager.InitCoreTypes): Initialize them here, but instead of
7865         calling `ResolveType()' on them, directly assign their `Type'.
7866
7867 2003-11-08  Martin Baulig  <martin@ximian.com>
7868
7869         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7870         return value and the `out parent' parameter.
7871         (TypeContainer.DefineType): Moved the CS0644 check into
7872         GetClassBases().  Don't pass the interface types to the
7873         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7874         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7875
7876         * ecore.cs (TypeExpr.IsAttribute): New property.
7877         (TypeExpr.GetInterfaces): New method.
7878
7879         * interface.cs (Interface.GetInterfaceTypeByName): Return a
7880         TypeExpr instead of a Type.
7881         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7882         (Interface.DefineType): Don't pass the interface types to the
7883         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7884         them later and then call `TypeBulider.AddInterfaceImplementation()'.
7885
7886         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7887         instead of a `Type[]'.
7888         (TypeManager.RegisterBuilder): Likewise.
7889         (TypeManager.AddUserInterface): Likewise.
7890         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7891         `Type[]' and also return a `TypeExpr[]'.
7892         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7893
7894 2003-11-08  Martin Baulig  <martin@ximian.com>
7895
7896         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7897         Expression.     
7898
7899 2003-11-08  Martin Baulig  <martin@ximian.com>
7900
7901         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7902         TypeManager.ResolveExpressionTypes().
7903
7904         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7905         instead of an Expression.
7906         (TypeExpr): This is now an abstract base class for `TypeExpression'.
7907         (TypeExpression): New public class; formerly known as `TypeExpr'.
7908
7909         * expression.cs (ComposedCast): Derive from TypeExpr.
7910
7911         * typemanager.cs (TypeManager.system_*_expr): These are now
7912         TypExpr's instead of Expression's.
7913         (TypeManager.ResolveExpressionTypes): New public static function;
7914         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7915         of them.        
7916
7917 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
7918
7919         * expression.cs (New.DoResolve): Do not dereference value that
7920         might be a null return.
7921
7922         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7923         sure that the constant value has the right type.  Fixes an
7924         unreported bug, similar to 50425.
7925
7926         * const.cs (Const.LookupConstantValue): Call
7927         ImplicitStandardConversionExists before doing a conversion to
7928         avoid havng the TypeManager.ChangeType do conversions.
7929
7930         Reduced the number of casts used
7931
7932         (Const.ChangeType): New routine to enable reuse of the constant
7933         type changing code from statement.
7934
7935         * typemanager.cs (ChangeType): Move common initialization to
7936         static global variables.
7937
7938         Fixes #50425.
7939
7940         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7941         every value type to go through, even if it was void.  Fix that. 
7942
7943         * cs-tokenizer.cs: Use is_identifier_start_character on the start
7944         character of the define, and the is_identifier_part_character for
7945         the rest of the string.
7946
7947 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
7948
7949         * expression.cs (UnaryMutator.EmitCode): When I updated
7950         LocalVariableReference.DoResolve, I overdid it, and dropped an
7951         optimization done on local variable references.
7952
7953 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
7954
7955         * ecore.cs: Convert the return from Ldlen into an int.
7956
7957 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
7958
7959         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7960         the accessibility, this is a special case for toplevel non-public
7961         classes (internal for instance).
7962
7963 2003-10-20  Nick Drochak <ndrochak@gol.com>
7964
7965         * ecore.cs: Fix typo and build.  Needed another right paren.
7966
7967 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
7968
7969         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
7970         `internal' case regular and protected, but not allowing protected
7971         to be evaluated later.  Bug 49840
7972
7973 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
7974
7975         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7976         to kb.Nlast, and not the kb.nFirst to isolate the switch
7977         statement.
7978
7979         Extract the underlying type, so enumerations of long/ulong are
7980         treated like long/ulong.
7981
7982 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
7983
7984         * expression.cs (New): Overload the meaning of RequestedType to
7985         track the possible creation of the NewDelegate type, since
7986         DoResolve is invoked more than once for new constructors on field
7987         initialization.
7988
7989         See bugs: #48800 and #37014
7990
7991         * cs-parser.jay (declare_local_constants): Take an arraylist
7992         instead of a single constant.
7993
7994         (local_constant_declaration): It should take a
7995         constant_declarators, not a constant_declarator.  Fixes 49487
7996
7997         * convert.cs: Fix error report.
7998
7999 2003-10-13 Jackson Harper <jackson@ximian.com>
8000
8001         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8002         bug #49611
8003
8004 2003-10-09  Martin Baulig  <martin@ximian.com>
8005
8006         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8007         to the .ctor.
8008         (MethodCore.DoDefineParameters): Removed the TypeContainer
8009         argument; use the DeclSpace which was passed to the .ctor instead.
8010         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8011         TypeContainer; we only need a DeclSpace here.
8012
8013 2003-10-09  Martin Baulig  <martin@ximian.com>
8014
8015         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8016         to the .ctor.
8017         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8018         EmitContext's .ctor.    
8019
8020 2003-10-09  Martin Baulig  <martin@ximian.com>
8021
8022         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8023         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8024         AsAccessible(), moved them as well.
8025
8026         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8027
8028 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8029
8030         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8031
8032 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8033
8034         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8035         generation for >=, as spotted by Paolo, bug 48679.  
8036         Patch from David Waite.
8037
8038         * cs-tokenizer.cs: Add handling for #pragma.
8039
8040         * cs-parser.jay: Allow for both yield and yield return in the
8041         syntax.  The anti-cobolization of C# fight will go on!
8042
8043         * class.cs (TypeBuilder.DefineType): Catch error condition here
8044         (Parent.DefineType erroring out and returning null).
8045
8046         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8047         coping with enumerations variables, we were mistakenly processing
8048         them as a regular value type instead of built-in types.  Fixes the
8049         bug #48063
8050
8051         * typemanager.cs (IsBuiltinOrEnum): New method.
8052
8053 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8054
8055         * cs-parser.jay: Upgrade: yield now needs the return clause.
8056
8057 2003-09-19  Martin Baulig  <martin@ximian.com>
8058
8059         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8060         `MemberCache parent' argument.  Normally, an interface doesn't
8061         have a parent type except System.Object, but we use this in gmcs
8062         for generic type parameters.
8063
8064 2003-09-18  Martin Baulig  <martin@ximian.com>
8065
8066         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8067         on `type.IsInterface'; don't check whether the type has a parent
8068         to determine whether it's an interface.
8069
8070 2003-09-15  Martin Baulig  <martin@ximian.com>
8071
8072         * class.cs (TypeContainer.DefineType): Added an error flag to
8073         avoid reporting duplicate CS0146's ("class definition is
8074         circular.").
8075
8076         * driver.cs (Driver.MainDriver): Abort if
8077         RootContext.ResolveTree() reported any errors.
8078
8079 2003-09-07  Martin Baulig  <martin@ximian.com>
8080
8081         * report.cs (Error, Warning): Added overloaded versions which take
8082         a `params object[] args' and call String.Format().
8083
8084 2003-09-07  Martin Baulig  <martin@ximian.com>
8085
8086         * decl.cs (DeclSpace..ctor): Don't call
8087         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8088         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8089         (DeclSpace.RecordDecl): New method.
8090
8091         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8092
8093 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8094
8095         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8096         value attributes to be applied to ParameterBuilders.
8097
8098         * class.cs (MethodCore.LabelParameters): Make static and more
8099         generic so that it can be used from other places - like interface
8100         methods, for instance.
8101
8102         * interface.cs (Interface.Emit): Call LabelParameters before
8103         emitting attributes on the InterfaceMethod.
8104
8105 2003-08-26  Martin Baulig  <martin@ximian.com>
8106
8107         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8108         resolving aliases; fixes #47927.
8109
8110 2003-08-26  Martin Baulig  <martin@ximian.com>
8111
8112         * statement.cs (Using.DoResolve): This is internally emitting a
8113         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8114         do not always return.  Fixes #47681.
8115
8116 2003-08-26  Martin Baulig  <martin@ximian.com>
8117
8118         * decl.cs (MemberCore): Moved WarningNotHiding(),
8119         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8120         into MemberBase.
8121         (AdditionResult): Make this nested in DeclSpace.
8122         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8123         argument; call NamespaceEntry.Define() unless we're nested in a
8124         class or struct.
8125
8126         * namespace.cs (Namespace.DefineName): New public function.  This
8127         is called from DeclSpace's .ctor to add 
8128         (Namespace.Lookup): Include DeclSpaces in the lookup.
8129
8130         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8131
8132         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8133
8134 2003-08-25  Martin Baulig  <martin@ximian.com>
8135
8136         * convert.cs (Convert.ExplicitReferenceConversion): When
8137         converting from an interface type to a class, unbox if the target
8138         type is a struct type.  Fixes #47822.
8139
8140 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8141
8142         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8143         #47854.
8144
8145 2003-08-22  Martin Baulig  <martin@ximian.com>
8146
8147         * class.cs (TypeManager.DefineType): When defining a nested type,
8148         call DefineType() on our parent; fixes #47801.
8149
8150 2003-08-22  Martin Baulig  <martin@ximian.com>
8151
8152         * class.cs (MethodData.Define): While checking if a method is an
8153         interface implementation, improve the test a bit more to fix #47654.
8154
8155 2003-08-22  Martin Baulig  <martin@ximian.com>
8156
8157         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8158         correctly; fixes #47722.
8159
8160 2003-08-22  Martin Baulig  <martin@ximian.com>
8161
8162         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8163         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8164
8165         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8166
8167 2003-08-22  Martin Baulig  <martin@ximian.com>
8168
8169         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8170         can only be assigned in static constructors.  Fixes #47161.
8171
8172 2003-08-22  Martin Baulig  <martin@ximian.com>
8173
8174         Rewrote and improved the flow analysis code.
8175
8176         * flowbranching.cs (FlowBranching): Make this class abstract.
8177         (FlowBranching.CreateBranching): New static function to create a
8178         new flow branching.
8179         (FlowBranchingBlock, FlowBranchingException): New classes.
8180         (FlowBranching.UsageVector.Type): New public readonly field.
8181         (FlowBranching.UsageVector.Breaks): Removed the setter.
8182         (FlowBranching.UsageVector.Returns): Removed the setter.
8183         (FlowBranching.UsageVector): Added Break(), Return(),
8184         NeverReachable() and Throw() methods to modify the reachability.
8185         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8186         done by FlowBranching.Merge().
8187         (FlowBranching.UsageVector.MergeChild): New method; merges the
8188         merge result into the current vector.
8189         (FlowBranching.Merge): New abstract method to merge a branching.
8190
8191 2003-08-12  Martin Baulig  <martin@ximian.com>
8192
8193         * expression.cs (Indirection.CacheTemporaries): Create the
8194         LocalTemporary with the pointer type, not its element type.
8195
8196 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8197
8198         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8199         token was a keyword or not.
8200
8201         Add `error' options where an IDENTIFIER was expected;  Provide
8202         CheckToken and CheckIdentifierToken convenience error reporting
8203         functions. 
8204
8205         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8206
8207         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8208         NameSpaceEntry NameSpaceEntry.
8209
8210         (LookupInterfaceOrClass): Avoid creating a full qualified name
8211         from namespace and name: avoid doing lookups when we know the
8212         namespace is non-existant.   Use new Tree.LookupByNamespace which
8213         looks up DeclSpaces based on their namespace, name pair.
8214
8215         * driver.cs: Provide a new `parser verbose' to display the
8216         exception thrown during parsing.  This is turned off by default
8217         now, so the output of a failure from mcs is more graceful.
8218
8219         * namespace.cs: Track all the namespaces defined in a hashtable
8220         for quick lookup.
8221
8222         (IsNamespace): New method
8223
8224 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8225
8226         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8227         we know that we need to concatenate (full typename can never be
8228         null). 
8229
8230         * class.cs: ditto.
8231
8232         * statement.cs: Use a bitfield;  Do not initialize to null things
8233         which are done by the constructor by default.
8234
8235         * cs-parser.jay: bug fix, parameter was 4, not 3.
8236
8237         * expression.cs: Just use the property;
8238
8239         * statement.cs: No need for GetVariableInfo method.
8240
8241 2003-08-08  Martin Baulig  <martin@ximian.com>
8242
8243         * flowanalysis.cs (FlowReturns): This is now nested in the
8244         `FlowBranching' class.
8245         (MyBitVector): Moved this here from statement.cs.
8246         (FlowBranching.SiblingType): New enum type.
8247         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8248
8249 2003-08-07  Martin Baulig  <martin@ximian.com>
8250
8251         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8252         `FlowBranching' class and called `BranchingType'.
8253
8254 2003-08-07  Martin Baulig  <martin@ximian.com>
8255
8256         * flowanalysis.cs: Moved all the control flow analysis code into
8257         its own file.
8258
8259 2003-08-07  Martin Baulig  <martin@ximian.com>
8260
8261         * assign.cs (Assign.DoResolve): `target' must either be an
8262         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8263         #37319.
8264
8265 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8266
8267         * expression.cs (BinaryMethod): This kind of expression is created by the
8268         Binary class if it determines that the operator has to be handled
8269         by a method.
8270
8271         (BinaryDelegate): This kind of expression is created if we are
8272         dealing with a + or - operator on delegates.
8273
8274         (Binary): remove method, argumetns, and DelegateOperator: when
8275         dealing with methods, 
8276
8277         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8278
8279         * statement.cs (Block): use bitfields for the three extra booleans
8280         we had in use.   Remove unused topblock parameter.
8281
8282         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8283
8284         * assign.cs: Drop extra unneeded tests.
8285
8286 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8287
8288         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8289
8290         * statement.cs (Foreach): Use VariableStorage instead of
8291         LocalBuilders.   
8292
8293         * codegen.cs (VariableStorage): New class used by clients that
8294         require a variable stored: locals or fields for variables that
8295         need to live across yield.
8296
8297         Maybe provide a convenience api for EmitThis+EmitLoad?
8298
8299         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8300         these bad boys.
8301
8302 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8303
8304         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8305         RemapParameterLValue): New methods that are used to turn a
8306         precomputed FieldInfo into an expression like this:
8307
8308                 instance.FieldInfo
8309
8310         The idea is to use this instead of making LocalVariableReference
8311         have more than one meaning.
8312
8313         * cs-parser.jay: Add error production to BASE.
8314
8315         * ecore.cs: Deal with TypeManager.GetField returning null, which
8316         is now a valid return value.
8317
8318         (FieldExprNoAddress): New expression for Fields whose address can
8319         not be taken.
8320
8321         * expression.cs (LocalVariableReference): During the resolve
8322         phases, create new expressions if we are in a remapping context.
8323         Remove code that dealt with remapping here.
8324
8325         (ParameterReference): same.
8326
8327         (ProxyInstance): New expression, like the `This' expression, but
8328         it is born fully resolved.  We know what we are doing, so remove
8329         the errors that are targeted to user-provided uses of `this'.
8330
8331         * statement.cs (Foreach): our variable is now stored as an
8332         Expression;  During resolution, follow the protocol, dont just
8333         assume it will return this.
8334
8335 2003-08-06  Martin Baulig  <martin@ximian.com>
8336
8337         * support.cs (SeekableStreamReader.cs): New public class.
8338
8339         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8340         SeekableStreamReader instead of the normal StreamReader.
8341
8342 2003-08-04  Martin Baulig  <martin@ximian.com>
8343
8344         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8345         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8346         deambiguate casts and delegate invocations.
8347         (parenthesized_expression): Use the new tokens to ensure this is
8348         not a cast of method invocation.
8349
8350         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8351         when reading a `)' and Deambiguate_CloseParens () was previously
8352         called.
8353
8354         * expression.cs (ParenthesizedExpression): New class.  This is
8355         just used for the CS0075 test.
8356         (Binary.DoResolve): Check for CS0075.   
8357
8358 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8359
8360         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8361         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8362         reference comparison.
8363
8364         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8365         examine the ReturnType for equality - this is necessary in the
8366         cases of implicit and explicit operators whose signature also
8367         includes the return type.
8368
8369 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8370
8371         * namespace.cs: Cache the result of the namespace computation,
8372         instead of computing it every time.
8373
8374 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8375
8376         * decl.cs: Use a global arraylist that we reuse over invocations
8377         to avoid excesive memory consumption.  Reduces memory usage on an
8378         mcs compile by one meg (45 average).
8379
8380         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8381         private, work around that.
8382
8383 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8384
8385         * literal.cs (IntLiteral): Define Zero and One static literals. 
8386
8387         * cs-parser.jay (integer_literal): use static literals to reduce
8388         memory usage for the most used literals (0, 1 and -1).  211kb
8389         reduced in memory usage.
8390
8391         Replace all calls to `new ArrayList' with `new
8392         ArrayList(4)' which is a good average number for most allocations,
8393         and also requires only 16 bytes of memory for its buffer by
8394         default. 
8395
8396         This reduced MCS memory usage in seven megabytes for the RSS after
8397         bootstrapping.
8398
8399 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8400
8401         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8402         handle params methods the correct way by forming only one
8403         applicable set with params and normal methods in them. Earlier we
8404         were looking at params methods only if we found no normal methods
8405         which was not the correct thing to do.
8406
8407         (Invocation.BetterFunction): Take separate arguments indicating
8408         when candidate and the best method are params methods in their
8409         expanded form.
8410
8411         This fixes bugs #43367 and #46199.
8412
8413         * attribute.cs: Documentation updates.
8414
8415         (CheckAttribute): Rename to CheckAttributeTarget.
8416         (GetValidPlaces): Rename to GetValidTargets.
8417
8418         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8419         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8420
8421         Fixes bug #44468.
8422
8423 2003-07-28  Martin Baulig  <martin@ximian.com>
8424
8425         * class.cs (TypeContainer.DefineMembers): Use the base type's full
8426         name when looking up the base class of a nested class.  Fixes #46977.
8427
8428 2003-07-26  Martin Baulig  <martin@ximian.com>
8429
8430         * expression.cs (Indexers.Indexer): New nested struct; contains
8431         getter, setter and the indexer's type.
8432         (Indexers.Properties): This is now an ArrayList of
8433         Indexers.Indexer's.
8434         (IndexerAccess.DoResolveLValue): Correctly set the type if the
8435         indexer doesn't have any getters.
8436
8437         * assign.cs (Assign.DoResolve): Also do the implicit conversions
8438         for embedded property and indexer assignments.
8439
8440 2003-07-26  Martin Baulig  <martin@ximian.com>
8441
8442         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
8443         preprocessor directive is not the first non-whitespace character
8444         on a line.
8445
8446 2003-07-26  Martin Baulig  <martin@ximian.com>
8447
8448         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
8449         namespace parsing, follow the spec more closely.
8450
8451         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
8452         NamespaceEntry.Lookup().
8453
8454 2003-07-25  Martin Baulig  <martin@ximian.com>
8455
8456         * MethodCore.cs (OverridesSomething): New public field; it's set
8457         from TypeContainer.DefineMembers if this method overrides
8458         something (which doesn't need to be a method).  Fix #39462.
8459
8460 2003-07-25  Ravi Pratap  <ravi@ximian.com>
8461
8462         * typemanager.cs (GetMembers): Ensure that the list of members is
8463         reversed. This keeps things in sync.
8464
8465         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
8466         find an AttributeUsage attribute.
8467
8468         * expression.cs (Invocation.OverloadResolve): Perform the check
8469         which disallows Invoke to be directly called on a Delegate.
8470
8471         (Error_InvokeOnDelegate): Report error cs1533.
8472
8473 2003-07-25  Martin Baulig  <martin@ximian.com>
8474
8475         * expression.cs (Indexers.GetIndexersForType): Only look in the
8476         interface hierarchy if the requested type is already an
8477         interface.  Fixes #46788 while keeping #46502 fixed.
8478
8479 2003-07-25  Martin Baulig  <martin@ximian.com>
8480
8481         * class.cs (TypeContainer.DefineMembers): Check whether all
8482         readonly fields have been assigned and report warning CS0649 if
8483         not.
8484
8485         * statement.cs (LocalInfo.IsFixed): Always return true if this is
8486         a valuetype.
8487
8488 2003-07-24  Ravi Pratap  <ravi@ximian.com>
8489
8490         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
8491         returned from GetMethods to make things consistent with the
8492         assumptions MCS makes about ordering of methods.
8493
8494         This should comprehensively fix bug #45127 and it does :-)
8495
8496         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
8497         ordering is actually reverse.
8498
8499         * Clean up some debug messages I left lying around.
8500
8501         * interface.cs (Populate*): Get rid of code which emits attributes
8502         since the stage in which we emit attributes is the 'Emit' stage,
8503         not the define stage.
8504
8505         (Emit): Move attribute emission for interface members here.
8506
8507 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8508
8509         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8510         closely: we eliminate methods in base types when we have an
8511         applicable method in a top-level type.
8512
8513         Please see section 14.5.5.1 for an exact description of what goes
8514         on. 
8515
8516         This fixes bug #45127 and a host of other related to corlib compilation.
8517
8518         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8519         array is the method corresponding to the top-level type (this is
8520         because of the changes made to icall.c) so we change this
8521         accordingly.
8522
8523         (MethodGroupExpr.Name): This too.
8524
8525         * typemanager.cs (GetElementType): New method which does the right
8526         thing when compiling corlib. 
8527
8528         * everywhere: Make use of the above in the relevant places.
8529
8530 2003-07-22  Martin Baulig  <martin@ximian.com>
8531
8532         * cs-parser.jay (invocation_expression): Moved
8533         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8534         `cast_expression', but create a InvocationOrCast which later
8535         resolves to either an Invocation or a Cast.
8536
8537         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8538         method; call this before EmitStatement() to make sure that this
8539         expression can be used as a statement.
8540
8541         * expression.cs (InvocationOrCast): New class; resolves to either
8542         an Invocation or a Cast.
8543
8544         * statement.cs (StatementExpression): Call ResolveStatement() on
8545         the ExpressionStatement before emitting it.
8546
8547 2003-07-21  Martin Baulig  <martin@ximian.com>
8548
8549         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8550         `ref' and `out' attributes match; fixes #46220.
8551         (MemberAccess.ResolveMemberAccess): You can't reference a type
8552         through an expression; fixes #33180.
8553         (Indexers.GetIndexersForType): Don't return the indexers from
8554         interfaces the class implements; fixes #46502.
8555
8556 2003-07-21  Martin Baulig  <martin@ximian.com>
8557
8558         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8559         CS0661 checks; fixes bug #30442.
8560
8561 2003-07-21  Martin Baulig  <martin@ximian.com>
8562
8563         * decl.cs (AdditionResult): Added `Error'.
8564
8565         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8566
8567         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
8568         makes cs0031.cs actually work.
8569
8570 2003-07-20  Martin Baulig  <martin@ximian.com>
8571
8572         * namespace.cs: Fixed that bug which caused a crash when compiling
8573         the debugger's GUI.
8574
8575 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8576
8577         * typemanager.cs (LookupTypeReflection): Never expose types which
8578         are NotPublic, NestedPrivate, NestedAssembly, or
8579         NestedFamANDAssem.  We used to return these, and later do a check
8580         that would report a meaningful error, but the problem is that we
8581         would not get the real match, if there was a name override.
8582
8583 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8584
8585         * namespace.cs (Namespace, Name): Do not compute the namespace
8586         name dynamically, compute it in the constructor.  This reduced
8587         memory usage by 1697 KB.
8588
8589         * driver.cs: Use --pause to pause at the end.
8590
8591 2003-07-17  Peter Williams  <peter@newton.cx>
8592
8593         * Makefile: Change the name of the test target so that it doesn't
8594         conflict with the recursive test target.
8595
8596 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8597
8598         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8599         AddressOf): Do not use EmitThis, that was wrong, use the actual
8600         this pointer.
8601
8602 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8603
8604         * class.cs (MethodData.Define): While checking if a method is an
8605         interface implementation, improve the test: If we are not public
8606         (use new test here: use the computed MethodAttributes directly,
8607         instead of the parsed modifier flags) check if the `implementing'
8608         method comes from an interface or not.
8609
8610         * pending.cs (VerifyPendingMethods): Slightly better error
8611         message.
8612
8613         * makefile: add test target that does the mcs bootstrap.
8614
8615 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8616
8617         * interface.cs (Define): Do nothing here since there are no
8618         members to populate etc. Move the attribute emission out of here
8619         since this was just totally the wrong place to put it. Attribute
8620         application happens during the 'Emit' phase, not in the 'Define'
8621         phase.
8622
8623         (Emit): Add this method and move the attribute emission here
8624
8625         * rootcontext.cs (EmitCode): Call the Emit method on interface
8626         types too.
8627
8628 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8629
8630         * expression.cs (OverloadResolve): Report error only if Location
8631         is not 'Null' which means that there was a probe going on.
8632
8633 2003-07-14  Martin Baulig  <martin@ximian.com>
8634
8635         * expression.cs (ConditionalLogicalOperator): New public class to
8636         implement user defined conditional logical operators.
8637         This is section 14.11.2 in the spec and bug #40505.
8638
8639 2003-07-14  Martin Baulig  <martin@ximian.com>
8640
8641         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8642
8643 2003-07-14  Martin Baulig  <martin@ximian.com>
8644
8645         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8646
8647         * ecore.cs (IVariable.VerifyFixed): New interface method.
8648
8649         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8650         operator, check whether the variable is actually fixed.  Fixes bug
8651         #36055.  Set a variable definitely assigned when taking its
8652         address as required by the spec.
8653
8654         * statement.cs (LocalInfo.IsFixed): New field.
8655         (LocalInfo.MakePinned): Set `IsFixed' to true.
8656
8657 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8658
8659         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8660         for .ctors, ensure that we only ask for members declared in the
8661         attribute type (BindingFlags.DeclaredOnly).
8662
8663         Fixes bug #43632.
8664
8665         * expression.cs (Error_WrongNumArguments): Report error 1501
8666         correctly the way CSC does.
8667
8668 2003-07-13  Martin Baulig  <martin@ximian.com>
8669
8670         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8671         lookup on the fully qualified name, to make things like "X.X" work
8672         where "X.X" is a fully qualified type name, but we also have a
8673         namespace "X" in the using list.  Fixes #41975.
8674
8675 2003-07-13  Martin Baulig  <martin@ximian.com>
8676
8677         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8678         function. If we're a CompoundAssign, we need to create an embedded
8679         CompoundAssign, not an embedded Assign.
8680         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8681         Fixes #45854.
8682
8683 2003-07-13  Martin Baulig  <martin@ximian.com>
8684
8685         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8686         work to fix bug #46088.
8687
8688 2003-07-13  Ravi Pratap <ravi@ximian.com>
8689
8690         * class.cs (Operator.Emit): Do not emit attributes here - it is
8691         taken care of by the Method class that we delegate too. This takes
8692         care of bug #45876.
8693
8694 2003-07-10  Martin Baulig  <martin@ximian.com>
8695
8696         * expression.cs (TypeOfVoid): New class.
8697         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8698
8699 2003-07-10  Martin Baulig  <martin@ximian.com>
8700
8701         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8702         bug #35957.
8703
8704 2003-07-10  Martin Baulig  <martin@ximian.com>
8705
8706         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8707         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8708
8709         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8710
8711         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8712
8713 2003-07-10  Martin Baulig  <martin@ximian.com>
8714
8715         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8716         of decimal.  Fixes #42850.
8717
8718         NOTE: I also fixed the created byte blob, but this doesn't work on
8719         the MS runtime and csc never produces any byte blobs for decimal
8720         arrays.
8721
8722 2003-07-10  Martin Baulig  <martin@ximian.com>
8723
8724         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8725         structs; fixes #32068.
8726         (Block.AddChildVariableNames): Fixed #44302.
8727
8728 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8729
8730         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8731
8732 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8733
8734         * attribute.cs: And this test is onger needed.
8735
8736 2003-07-08  Martin Baulig  <martin@ximian.com>
8737
8738         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8739         inaccessible types.  Fixes #36313.
8740
8741         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8742
8743         * namespace.cs (NamespaceEntry): Create implicit entries for all
8744         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8745         implicit entries for N1.N2 and N1.
8746
8747 2003-07-08  Martin Baulig  <martin@ximian.com>
8748
8749         Rewrote the handling of namespaces to fix a lot of the issues
8750         wrt. `using' aliases etc.
8751
8752         * namespace.cs (Namespace): Splitted this class into a
8753         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8754
8755         * typemanager.cs (TypeManager.IsNamespace): Removed.
8756         (TypeManager.ComputeNamespaces): Only compute namespaces from
8757         loaded assemblies here, not the namespaces from the assembly we're
8758         currently compiling.
8759
8760 2003-07-08  Martin Baulig  <martin@ximian.com>
8761
8762         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8763
8764 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8765
8766         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8767         already fixed it.  
8768
8769         I thought about the memory savings here, but LookupTypeReflection
8770         is used under already very constrained scenarios.  Compiling
8771         corlib or mcs only exposes one hit, so it would not really reduce
8772         any memory consumption.
8773
8774 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8775
8776         * typemanager.cs: fixes bug #45889 by only adding public types from
8777         other assemblies to the list of known types.
8778
8779 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8780
8781         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8782         on the type we resolved.
8783
8784 2003-07-05  Martin Baulig  <martin@ximian.com>
8785
8786         * pending.cs (PendingImplementation.ParentImplements): Don't
8787         create the proxy if the parent is abstract.
8788
8789         * class.cs (TypeContainer.DefineIndexers): Process explicit
8790         interface implementations first.  Fixes #37714.
8791
8792 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8793
8794         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8795         defined recursively;  but since we modify the input parameters
8796         (left is set to `this' temporarily), we reset this value if the
8797         left_is_explicit is false, which gives the original semantics to
8798         the code.  
8799
8800         * literal.cs (NullPointer): new class used to represent a null
8801         literal in a pointer context.
8802
8803         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8804         type is a pointer, use a NullPointer object instead of a
8805         NullLiteral.   Closes 43687
8806
8807         (ExplicitConversion): Convert pointer values using
8808         the conv opcode to the proper type.
8809
8810         * ecore.cs (New): change ValueTypeVariable property into a method,
8811         that returns whether the valuetype is suitable for being used.
8812
8813         * expression.cs (Binary.DoNumericPromotions): Only return if we
8814         the int constant was a valid uint, and we can return both left and
8815         right as uints.  If not, we continue processing, to trigger the
8816         type conversion.  This fixes 39018.
8817
8818         * statement.cs (Block.EmitMeta): During constant resolution, set
8819         the CurrentBlock property on the emitcontext, so that we resolve
8820         constants propertly.
8821
8822 2003-07-02  Martin Baulig  <martin@ximian.com>
8823
8824         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8825         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8826
8827         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8828         than emitting it here.
8829
8830         * statement.cs: Fixed some more flow analysis bugs.
8831
8832 2003-07-02  Martin Baulig  <martin@ximian.com>
8833
8834         * class.cs (MethodData.Define): When implementing interface
8835         methods, set Final unless we're Virtual.
8836
8837         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8838         check work for interface methods.
8839
8840 2003-07-01  Martin Baulig  <martin@ximian.com>
8841
8842         * ecore.cs (EmitContext.This): Replaced this property with a
8843         GetThis() method which takes a Location argument.  This ensures
8844         that we get the correct error location for a CS0188.
8845
8846 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8847
8848         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8849         ImplicitStandardConversion.
8850
8851         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8852
8853 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8854
8855         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8856         optimization.
8857
8858 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8859
8860         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8861         constructors.
8862
8863         (MethodData.Define): Turn off initlocals for unsafe methods.
8864
8865 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8866
8867         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8868         complete;  Fixes #37521.
8869
8870         * delegate.cs: Use Modifiers.TypeAttr to compute the
8871         TypeAttributes, instead of rolling our own.  This makes the flags
8872         correct for the delegates.
8873
8874 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8875
8876         * class.cs (Constructor.Define): Set the private flag for static
8877         constructors as well.
8878
8879         * cs-parser.jay (statement_expression): Set the return value to
8880         null, to avoid a crash when we catch an error.
8881
8882 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8883
8884         * cs-parser.jay: Applied patch from Jackson that adds support for
8885         extern and unsafe modifiers to destructor declarations.
8886
8887         * expression.cs: Report error 21 if the user is trying to index a
8888         System.Array.
8889
8890         * driver.cs: Add an error message, suggested by the bug report.
8891
8892         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8893         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8894
8895 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8896
8897         * namespace.cs: Add some information to reduce FAQs.
8898
8899 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8900
8901         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8902         underlying enumeration types.  Fixes #43915.
8903
8904         * expression.cs: Treat ushort/short as legal values to be used in
8905         bitwise operations.
8906
8907 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8908
8909         * delegate.cs: transfer custom attributes for paramenters from
8910         the delegate declaration to Invoke and BeginInvoke.
8911
8912 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8913
8914         * attribute.cs: handle custom marshalers and emit marshal info
8915         for fields, too.
8916
8917 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8918
8919         * makefile.gnu: Added anonymous.cs to the compiler sources.
8920
8921 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8922
8923         * iterators.cs: Change the name of the proxy class to include two
8924         underscores.
8925
8926         * cs-parser.jay: Update grammar to include anonymous methods.
8927
8928         * anonymous.cs: new file.
8929
8930 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8931
8932         * class.cs (Field.Define): Add missing test for pointers and
8933         safety. 
8934
8935 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8936
8937         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8938         we use the stobj opcode.
8939
8940         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8941         since it wasn't the correct fix. 
8942
8943         It still is puzzling that we are required to use stobj for IntPtr
8944         which seems to be a ValueType.
8945
8946 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8947
8948         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8949         during regular simple name resolution.   Now, the trick is that
8950         instead of returning for processing the simplename, we do a
8951         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8952         contextual lookup type).   If a match is found, return that, if
8953         not, return for further composition.
8954
8955         This fixes long-standing 30485.
8956
8957         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8958         using the address to initialize an object, do an Stobj instead of
8959         using the regular Stelem.
8960
8961         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8962         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8963         Because if we are a BaseIndexerAccess that value will be true.
8964         Fixes 43643.
8965
8966         * statement.cs (GotoCase.Resolve): Return after reporting an
8967         error, do not attempt to continue. 
8968
8969         * expression.cs (PointerArithmetic.Emit): If our operand is a
8970         long, convert our constants to match the operand before
8971         multiplying.  Convert to I type before adding.   Fixes 43670.
8972
8973 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8974
8975         * enum.cs (ImplicitConversionExists) : Rename to
8976         ImplicitEnumConversionExists to remove ambiguity. 
8977
8978         * ecore.cs (NullCast): New type of cast expression class which
8979         basically is very similar to EmptyCast with the difference being
8980         it still is a constant since it is used only to cast a null to
8981         something else
8982         (eg. (string) null)
8983
8984         * convert.cs (ImplicitReferenceConversion): When casting a null
8985         literal, we return a NullCast.
8986
8987         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8988         should be around anymore.
8989
8990         The renaming (reported was slightly wrong). Corrections:
8991
8992         ConvertImplicitStandard -> ImplicitConversionStandard
8993         ConvertExplicitStandard -> ExplicitConversionStandard
8994
8995         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8996         before passing them in !
8997
8998         * convert.cs (ImplicitConversionStandard): When comparing for
8999         equal expr and target types, ensure that expr is not a
9000         NullLiteral.
9001
9002         In general, we must not be checking (expr_type ==
9003         target_type) in the top level conversion methods
9004         (ImplicitConversion, ExplicitConversion etc). This checking is
9005         done in the methods that they delegate to.
9006
9007 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9008
9009         * convert.cs: Move Error_CannotConvertType,
9010         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9011         ImplicitNumericConversion, ImplicitConversionExists,
9012         ImplicitUserConversionExists, StandardConversionExists,
9013         FindMostEncompassedType, FindMostSpecificSource,
9014         FindMostSpecificTarget, ImplicitUserConversion,
9015         ExplicitUserConversion, GetConversionOperators,
9016         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9017         TryImplicitIntConversion, Error_CannotConvertImplicit,
9018         ConvertImplicitRequired, ConvertNumericExplicit,
9019         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9020         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9021         its own file.
9022
9023         Perform the following renames:
9024
9025         StandardConversionExists -> ImplicitStandardConversionExists
9026         ConvertImplicit -> ImplicitConversion
9027         ConvertImplicitStandard -> ImplicitStandardConversion
9028         TryImplicitIntConversion -> ImplicitIntConversion
9029         ConvertImplicitRequired -> ImplicitConversionRequired
9030         ConvertNumericExplicit -> ExplicitNumericConversion
9031         ConvertReferenceExplicit -> ExplicitReferenceConversion
9032         ConvertExplicit -> ExplicitConversion
9033         ConvertExplicitStandard -> ExplicitStandardConversion
9034
9035 2003-05-19  Martin Baulig  <martin@ximian.com>
9036
9037         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9038         (TypeInfo): Added support for structs having structs as fields.
9039
9040         * ecore.cs (FieldExpr): Implement IVariable.
9041         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9042         VariableInfo for the field.
9043
9044 2003-05-18  Martin Baulig  <martin@ximian.com>
9045
9046         * expression.cs (This.DoResolve): Report a CS0027 if we're
9047         emitting a field initializer.
9048
9049 2003-05-18  Martin Baulig  <martin@ximian.com>
9050
9051         * expression.cs (This.ResolveBase): New public function.
9052         (This.DoResolve): Check for CS0188.
9053
9054         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9055         This.Resolve().
9056
9057         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9058         `instance_expression' to null if we don't have any non-static
9059         methods.
9060
9061 2003-05-18  Martin Baulig  <martin@ximian.com>
9062
9063         Reworked the way how local variables and parameters are handled by
9064         the flow analysis code.
9065
9066         * statement.cs (TypeInfo, VariableMap): New public classes.
9067         (VariableInfo): New public class.  This is now responsible for
9068         checking whether a variable has been assigned.  It is used for
9069         parameters and local variables.
9070         (Block.EmitMeta): Take the InternalParameters as argument; compute
9071         the layout of the flow vectors here.
9072         (Block.LocalMap, Block.ParameterMap): New public properties.
9073         (FlowBranching): The .ctor doesn't get the InternalParameters
9074         anymore since Block.EmitMeta() now computes the layout of the flow
9075         vector.
9076         (MyStructInfo): This class is now known as `StructInfo' and nested
9077         in `TypeInfo'; we don't access this directly anymore.
9078
9079         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9080         property and removed IsAssigned(), IsFieldAssigned(),
9081         SetAssigned() and SetFieldAssigned(); we now call them on the
9082         VariableInfo so we don't need to duplicate this code everywhere.
9083
9084         * expression.cs (ParameterReference): Added `Block block' argument
9085         to the .ctor.
9086         (LocalVariableReference, ParameterReference, This): The new
9087         VariableInfo class is now responsible for all the definite
9088         assignment stuff.
9089
9090         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9091         IsParameterAssigned, SetParameterAssigned): Removed.
9092
9093 2003-05-18  Martin Baulig  <martin@ximian.com>
9094
9095         * typemanager.cs (InitCoreTypes): Try calling
9096         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9097         the 3-args-version.  Corlib now also needs our `void_type'.
9098         (GetMethod): Added overloaded version which takes an optional
9099         `bool report_errors' to allow lookups of optional methods.
9100
9101 2003-05-12  Martin Baulig  <martin@ximian.com>
9102
9103         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9104         only used for locals and not for parameters.
9105
9106 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9107
9108         * support.cs (InternalParameters.ParameterType): Return the
9109         ExternalType of the parameter.
9110
9111         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9112         they were unused.
9113
9114 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9115
9116         * class.cs (MethodData.Define): Do not set the `newslot' on
9117         interface members, if they are also flagged as "override".
9118
9119         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9120         better code for ++i and i++.  This only works for static fields
9121         and local variables.
9122
9123         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9124         want to pull the DeclSpace out of the builder_to_declspace instead
9125         of the TypeBuilder (like in TypeContainer.FindMembers).
9126
9127         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9128         instead of LookupTypeContainer.  Fixes the crash on .NET for
9129         looking up interface members.
9130
9131         * const.cs: Create our own emit context during the Definition
9132         stage, so that constants are evaluated in the proper context, when
9133         a recursive definition happens.
9134
9135 2003-05-11  Martin Baulig  <martin@ximian.com>
9136
9137         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9138         new block for a switch section.
9139         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9140         the adding/lookup in the switch block.  Fixes #39828.
9141
9142 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9143
9144         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9145         functionality: I needed to convert the data after I had performed
9146         the add/sub operation into the operands type size.
9147
9148         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9149         pass the type for the box operation, otherwise the resulting
9150         object would have been of type object.
9151
9152         (BoxedCast): Add constructor to specify the type to box as.
9153
9154 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9155
9156         * iterators.cs: I was reusing the `count' variable inadvertently,
9157         take steps to not allow this to happen.
9158
9159 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9160
9161         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9162         by creating an array at the point where the params starts and
9163         putting all those arguments there, then adjusting the size of the
9164         array.
9165
9166 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9167
9168         * expression.cs (New.AddressOf): Implement interface
9169         IMemoryLocation.  This is used when the `new' operator is used in
9170         the context of an invocation to a method on a value type.
9171
9172         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9173         example. 
9174
9175         * namespace.cs: Also check the using aliases here.
9176
9177         * driver.cs: Move the test for using validity after the types have
9178         been entered, so we do a single pass that also includes the using
9179         aliases. 
9180
9181         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9182         in the regular case.   CreateSiblingForFinally is doing extra
9183         error checking.
9184
9185         * attribute.cs (GetAttributeArgumentExpression): Store the result
9186         on an out value, and use the return value to indicate failure
9187         instead of using null (which is a valid return for Constant.GetValue).
9188
9189         * statement.cs: Perform the analysis flow for the increment
9190         portion after the statement, because this will be the real flow of
9191         execution.  Fixes #42385
9192
9193         * codegen.cs (EmitContext.EmitArgument,
9194         EmitContext.EmitStoreArgument): New helper functions when the
9195         RemapToProxy flag is set.
9196
9197         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9198         function.
9199
9200         Add support for remapping parameters. 
9201
9202         * iterators.cs: Propagate parameter values;  Store parameter
9203         values in the proxy classes.
9204
9205 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9206
9207         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9208         need a proxy reference;  I do not know what I was thinking
9209
9210         * cs-parser.jay (constructor_initializer): catch another error,
9211         and display nice message.
9212
9213         (field_declaration): catch void field declaration
9214         to flag a better error. 
9215
9216         * class.cs (MemberBase.CheckBase): Report an error instead of a
9217         warning if a new protected member is declared in a struct. 
9218         (Field.Define): catch the error of readonly/volatile.
9219
9220         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9221
9222         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9223         volatile variable is taken
9224
9225 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9226
9227         * statement.cs (Fixed.Resolve): Report an error if we are not in
9228         an unsafe context.
9229
9230 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9231
9232         * typemanager.cs: reuse the code that handles type clashes for
9233         delegates and enumerations.
9234
9235         * class.cs (Report28): Always report.
9236
9237         * expression.cs (EncodeAsAttribute): Allow nulls here.
9238
9239 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9240
9241         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9242         the functionality for testing whether an expression is valid for
9243         an attribute here.  Also handle the case of arrays of elements
9244         being stored. 
9245
9246         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9247         encoding a linear array into an array of objects that are suitable
9248         to be passed to an CustomAttributeBuilder.
9249
9250         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9251
9252         * ecore.cs: (FieldExpr): Handle field remapping here.
9253
9254         * iteratators.cs: Pass the instance variable (if the method is an
9255         instance method) to the constructors, so we can access the field
9256         variables on the class.
9257
9258         TODO: Test this with structs.  I think the THIS variable on
9259         structs might have to be a pointer, and not a refenrece
9260
9261 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9262
9263         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9264         local variables to fields in a proxy class.
9265
9266         * iterators.cs (PopulateProxy): Rename our internal fields to
9267         <XXX>.  
9268         Create a <THIS> field if we are an instance method, so we can
9269         reference our parent container variables.
9270         (MapVariable): Called back from the EmitContext code to enter a
9271         new variable to field mapping into the proxy class (we just create
9272         a FieldBuilder).
9273
9274         * expression.cs
9275         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9276         for using the remapped locals to fields.
9277
9278         I placed the code here, because that gives the same semantics to
9279         local variables, and only changes the Emit code.
9280
9281         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9282         statements inside iterators.
9283         (VariableInfo): Add a FieldBuilder for the cases when we are
9284         remapping local variables to fields in a proxy class
9285
9286         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9287         current_block != null.
9288
9289         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9290         not cope with strings, as it has been moved to the
9291         TableSwitchEmit.  Fixed bug in switch generation.
9292
9293         * expression.cs (New.DoResolve): Provide more context for the user
9294         when reporting an error.
9295
9296         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9297         pointers. 
9298
9299         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9300         check the permissions for it.  Note than in a type-resolution
9301         context the check was already present in DeclSpace.ResolveType,
9302         but was missing from the MemberAccess.
9303
9304         (ArrayCreation.CheckIndices): warn if the user has
9305         more nested levels of expressions, but there are no more
9306         dimensions specified.  Avoids crash on bug 41906.
9307
9308 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9309
9310         * statement.cs (Block): replace Implicit bool, for a generic
9311         flags.   
9312         New flag: `Unchecked'.  This is used during the EmitMeta phase
9313         (which is out-of-line with the regular Resolve/Emit process for a
9314         statement, as this is done ahead of time, but still gets a chance
9315         to call constant resolve).
9316
9317         (Block.Flags): new enum for adding a new flag.
9318
9319         (Block.EmitMeta): track the state of unchecked.
9320
9321         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9322         to enable constant resolution to work there as well.
9323
9324 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9325
9326         * typemanager.cs (ienumerable_type): Also look up
9327         System.Collections.IEnumerable. 
9328
9329 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9330
9331         TODO: Test more than one conditional per method.
9332
9333         * class.cs (Indexer.Define): Report the location where the user is
9334         referencing the unsupported feature.
9335
9336         (MethodData): Overload the use of `conditionals' to
9337         minimize the creation of needless ArrayLists.   This saves roughly
9338         212kb on my machine.
9339
9340         (Method): Implement the new IIteratorContainer interface.
9341         (Method.SetYields): Implement the method by setting the ModFlags
9342         to contain METHOD_YIELDS.
9343
9344         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9345         which just got set to null.
9346
9347         * iterators.cs: New file.
9348
9349         (Yield, YieldBreak): New statements.
9350
9351         * statement.cs (Return.Resolve): Flag an error if we are used in
9352         an iterator method.
9353
9354         * codegen.cs (InIterator): New flag set if the code is being
9355         compiled in an iterator method.
9356
9357         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9358         internal modifier, and we just use it to avoid adding extra
9359         fields, as this is seldom used.  
9360
9361         * cs-parser.jay: Add yield_statement (yield and yield break).
9362
9363         * driver.cs: New flag -v2 to turn on version 2 features. 
9364
9365         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9366         hashtable when v2 is enabled.
9367
9368 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9369
9370         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9371         there is already a namespace defined with this name.
9372
9373         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9374         people upgraded their corlibs.
9375
9376         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9377         always use fully qualified types, no need to use the compiler
9378         front end.
9379
9380         (TypeManager.IsNamespace): Use binarysearch.
9381
9382         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9383         AddDelegate): I did not quite use the new IsValid API properly: I
9384         have to pass the short-name and the fullname.  I was passing only
9385         the basename instead of the fullname sometimes. 
9386
9387         (TypeContainer.DefineType): call NamespaceClash.
9388
9389         * interface.cs (Interface.DefineType): use NamespaceClash before
9390         defining the type.
9391
9392         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9393         defining the type.
9394
9395         * enum.cs: (Enum.DefineType): use NamespaceClash before
9396         defining the type.
9397
9398         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9399         speed increase.  First, use the negative_hits cache when we get a
9400         negative.  Second, add the type with its full original name
9401         instead of the new . and + encoded name (reflection uses + to
9402         separate type from a nested type).  Use LookupTypeReflection
9403         directly which bypasses the type->name hashtable (that we already
9404         know does not contain the type.
9405
9406         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9407         location/container type. 
9408
9409         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9410
9411 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9412
9413         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9414
9415         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9416         method is being referenced in the method group from a static
9417         context, and report error 120 if so.
9418
9419         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9420         Error118. 
9421
9422         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9423         is created, we create the A namespace).
9424
9425         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9426         Fixes #41591
9427
9428 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9429
9430         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9431         invocation to ModuleBuilder.GetType with the same values will
9432         return a new type instance, so we need to cache its return
9433         values. 
9434
9435         * expression.cs (Binary.ResolveOperator): Only allow the compare
9436         operators on enums if they are of the same type.
9437
9438         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9439         types of ValueType on their own case.  Before we were giving them
9440         the same treatment as objects.
9441
9442         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9443         fullname.  Short name is used to compare against container name.
9444         Fullname is used to check against defined namespace names.
9445
9446         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9447         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9448
9449         (Method.CheckBase): Call parent.
9450         (MemberBase.CheckBase): Check for protected members on sealed
9451         classes.
9452         (PropertyBase.CheckBase): Call parent.
9453         (Field.Define): Call parent.
9454
9455         * report.cs: Negative error codes are now mapped to 8000 - code,
9456         so that the display is render more nicely.
9457
9458         * typemanager.cs: Do not use try/catch, instead report a regular
9459         error. 
9460
9461         (GetPointerType, GetReferenceType): These methods provide
9462         mechanisms to obtain the T* and T& from a T.  We had the code
9463         previously scattered around the code base, and it also used
9464         TypeManager.LookupType that would go through plenty of caches.
9465         This one goes directly to the type source.
9466
9467         In some places we did the Type.GetType followed by
9468         ModuleBuilder.GetType, but not in others, so this unifies the
9469         processing as well.
9470
9471         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9472         statements now that we have namespace information.
9473
9474         * typemanager.cs (IsNamespace): New method, returns whether the
9475         string presented is a namespace or not.
9476
9477         (ComputeNamespaces): New public entry point, computes the list of
9478         available namespaces, using the GetNamespaces API call in Mono, or
9479         the slower version in MS.NET.   
9480
9481         Now before we start the semantic analysis phase, we have a
9482         complete list of namespaces including everything that the user has
9483         provided.
9484
9485         Deleted old code to cache namespaces in .nsc files.
9486
9487 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9488
9489         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9490         class/struct location definition Location for the implicit
9491         constructor location.
9492
9493         (Operator.Define): Use the location of the operator for the
9494         implicit Method definition.
9495
9496         (Constructor.Emit): use the constructor location for the implicit
9497         base initializer constructor.
9498
9499         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9500         and the Expression class now contains two new methods:
9501
9502         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9503         isolate type lookup from the rest of the resolution process.
9504
9505         Since we use Expressions to hold type definitions due to the way
9506         we parse the input we have historically overloaded Resolve to
9507         perform the Type lookups if a special flag is passed.  Now this is
9508         eliminated and two methods take their place. 
9509
9510         The differences in the two methods between xStep and xTerminal is
9511         that xStep is involved in our current lookup system that uses
9512         SimpleNames to compose a name, while xTerminal is used just to
9513         catch the case where the simplename lookup failed.
9514
9515 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9516
9517         * expression.cs (ResolveMemberAccess): Remove redundant code.
9518         TypeExpr expressions are always born fully resolved.
9519
9520         * interface.cs (PopulateMethod): Do not lookup the types twice.
9521         We were doing it once during SemanticAnalysis and once during
9522         PopulateMethod.
9523
9524         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9525         in local variable type definitions, were being returned as a
9526         SimpleName (we decomposed everything into a string), that is
9527         because primary_expression was being used instead of a type in the
9528         grammar (reduce/reduce conflicts).
9529
9530         The part that was wrong is that we converted the expression into a
9531         string (an oversimplification in one hand, compounded with primary
9532         expressions doing string concatenation).
9533
9534         So things like:
9535
9536         A.B.C [] x;
9537
9538         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9539         using clauses from working on this particular context.  And a type
9540         was being matched directly against "A.B.C[]".
9541
9542         We now use the correct approach, and allow for ComposedCast to be
9543         part of the unary expression.  So the "A.B.C []" become a composed
9544         cast of "A.B.C" (as a nested group of MemberAccess with a
9545         SimpleName at the end) plus the rank composition "[]". 
9546
9547         Also fixes 35567
9548
9549 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9550
9551         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9552         for the access level checking.
9553
9554         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9555         `TypeContainer container', because I kept getting confused when I
9556         was debugging this code.
9557
9558         * expression.cs (Indexers): Instead of tracking getters/setters,
9559         we now track them in parallel.  We create one arraylist less, but
9560         most importantly it is possible now for the LValue code to find a
9561         matching get for a set.
9562
9563         (IndexerAccess.DoResolveLValue): Update the code.
9564         GetIndexersForType has been modified already to extract all the
9565         indexers from a type.  The code assumed it did not.
9566
9567         Also make the code set the correct return type for the indexer.
9568         This was fixed a long time ago for properties, but was missing for
9569         indexers.  It used to be void_type.
9570
9571         (Binary.Emit): Test first for doubles instead of
9572         floats, as they are more common.
9573
9574         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9575         when dealing with floats and the <=, >= operators.  This fixes bug
9576         #39314 
9577
9578         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9579         to load the array value by emitting a load on the foreach variable
9580         type.  This was incorrect.  
9581
9582         We now emit the code to load an element using the the array
9583         variable type, and then we emit the conversion operator.
9584
9585         Fixed #40176
9586
9587 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9588
9589         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9590
9591 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9592
9593         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9594         test for protection before we test for signatures. 
9595
9596         (MethodSignature.ToString): implement.
9597
9598         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9599         to the case where we reduced into a LongConstant.
9600
9601         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9602         depend on whether the information is acurrate, because the
9603         Microsoft runtime will always claim that the array type is public,
9604         regardless of the real state.
9605
9606         If the type is a pointer, another problem happens: the type is
9607         reported as non-public in Microsoft.  
9608
9609         In both cases we have to call CheckAccessLevel recursively with
9610         the underlying type as the argument to be tested.
9611
9612 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9613
9614         * assign.cs (Assign.Emit): If we are dealing with a compound
9615         assignment expression, we should use the code path that stores the
9616         intermediate result in a temporary value.  This fixes #40903.
9617
9618         *expression.cs (Indirection.ToString): Provide ToString method for
9619         debugging. 
9620
9621 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9622
9623         * class.cs: Null out fields holding references to Block objects so
9624         they can be garbage collected.
9625
9626         * expression.cs (OverloadResolve): Remove unused local.
9627
9628 2003-04-07  Martin Baulig  <martin@ximian.com>
9629
9630         * codegen.cs (EmitContext.CurrentFile): New public field.
9631         (EmitContext.Mark): Use the CurrentFile to check whether the
9632         location is in the correct file.
9633         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9634
9635 2003-04-07  Martin Baulig  <martin@ximian.com>
9636
9637         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9638
9639         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9640         location.  [FIXME: The location argument which gets passed to this
9641         method is sometimes wrong!]
9642
9643 2003-04-07  Nick Drochak <ndrochak@gol.com>
9644
9645         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9646
9647 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9648
9649         * expression.cs (Indirection.EmitAssign): We were using the
9650         temporary, but returning immediately instead of continuing the
9651         EmitAssing flow.
9652
9653 2003-04-06  Martin Baulig  <martin@ximian.com>
9654
9655         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9656         if it's a nested child, but also deriving from the outer class.
9657         See test 190.cs.
9658
9659         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9660         nested child, but also deriving from the outer class.  See
9661         test-190.cs.
9662         (FilterWithClosure): We may access private members of the outer
9663         class if we're a nested child and deriving from the outer class.
9664         (RealMemberLookup): Only set `closure_private_ok' if the
9665         `original_bf' contained BindingFlags.NonPublic.
9666
9667 2003-04-05  Martin Baulig  <martin@ximian.com>
9668
9669         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
9670
9671 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9672
9673         * class.cs (Event.Define): Do not allow abstract events to have
9674         initializers. 
9675
9676 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9677
9678         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9679         block in event declarations.
9680
9681         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9682         value type, get its address.
9683
9684         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9685         leaving a class on the stack instead of a boolean value (int
9686         0/1).  Change the code so we compare against null, and then the
9687         result against zero.
9688
9689         * class.cs (TypeContainer.GetClassBases): We were checking for the
9690         parent class being sealed too late.
9691
9692         * expression.cs (Binary.Emit): For <= and >= when dealing with
9693         floating point values, use cgt.un and clt.un instead of cgt and
9694         clt alone.
9695
9696 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9697
9698         * statement.cs: Apply the same optimization as MS: skip the 
9699         GetEnumerator returning an IEnumerator, and use the one returning a 
9700         CharEnumerator instead. This allows us to avoid the try-finally block 
9701         and the boxing.
9702
9703 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9704
9705         * cs-parser.jay: Attributes cannot be applied to
9706                          namespaces. Fixes #40473
9707
9708 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9709
9710         * class.cs:
9711         (Add*): check if the name is valid using the full name for constants,
9712         fields, properties and events.
9713
9714 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9715
9716         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9717         char constants to be part of the enumeration.
9718
9719         * expression.cs (Conditional.DoResolve): Add support for operator
9720         true. Implements the missing functionality from 14.12
9721
9722         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9723         operator true/false as required by the spec.
9724
9725         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9726         implicit conversion to boolean.
9727
9728         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9729         also one where the type implements `operator true'. 
9730
9731         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9732         get an expression that will invoke operator true based on an
9733         expression.  
9734
9735         (GetConversionOperators): Removed the hack that called op_True
9736         here.  
9737
9738         (Expression.ResolveBoolean): Move this from Statement.
9739
9740 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9741
9742         * ecore.cs (FieldExpr): do not allow initialization of initonly
9743         fields on derived classes
9744
9745 2003-03-13  Martin Baulig  <martin@ximian.com>
9746
9747         * statement.cs (Block.Emit): Call ig.BeginScope() and
9748         ig.EndScope() when compiling with debugging info; call
9749         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9750
9751 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9752
9753         * expression.cs (Indexers): Do not construct immediately, allow
9754         for new members to be appended as we go.  Fixes 38143
9755
9756 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9757
9758         * expression.cs: save/restore context when resolving an unchecked
9759         expression.
9760
9761 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9762
9763         * cfold.cs: Catch division by zero in modulus operator during
9764         constant folding.
9765
9766 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9767
9768         * interface.cs (Interface.DefineMembers): Avoid defining members
9769         twice. 
9770
9771 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9772
9773         * driver.cs: handle the +/- options for -noconfig
9774
9775         * statement.cs (Unckeched.Resolve): Also track the state of
9776         unchecked in the Resolve phase.
9777
9778 2003-02-27  Martin Baulig  <martin@ximian.com>
9779
9780         * ecore.cs (Expression.MemberLookup): Don't create a
9781         MethodGroupExpr for something which is not a method.  Fixes #38291.
9782
9783 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9784
9785         * class.cs (MemberBase.CheckParameters): Also check that the type
9786         is unmanaged if it is a pointer.
9787
9788         * expression.cs (SizeOf.Resolve): Add location information.
9789
9790         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9791         a managed type is declared.
9792
9793         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9794         parameter modifiers as well.  Fixes bug 38606
9795
9796         * class.cs: Very sad.  Am backing out the speed up changes
9797         introduced by the ArrayList -> Array in the TypeContainer, as they
9798         were not actually that much faster, and introduced a bug (no error
9799         reports on duplicated methods).
9800
9801         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9802         source first, this will guarantee that we have a valid expression
9803         before calling in lower levels functions that will require a
9804         resolved object.  Then use this original_source in the
9805         target.ResolveLValue instead of the original source that was
9806         passed to us.
9807
9808         Another change.  Use target.Resolve instead of LValueResolve.
9809         Although we are resolving for LValues, we will let the Assign code
9810         take care of that (it will be called again from Resolve).  This
9811         basically allows code like this:
9812
9813         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9814         class Y { void A (X x) { x [0] += o; }
9815
9816         The problem was that the indexer was trying to resolve for
9817         set_Item (idx, object o) and never finding one.  The real set_Item
9818         was set_Item (idx, X).  By delaying the process we get the right
9819         semantics. 
9820
9821         Fixes bug 36505
9822
9823 2003-02-23  Martin Baulig  <martin@ximian.com>
9824
9825         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9826         while calling DoEmit ().
9827
9828         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9829         source files; if you use the #line directive inside a method, the
9830         compiler stops emitting line numbers for the debugger until it
9831         reaches the end of the method or another #line directive which
9832         restores the original file.
9833
9834 2003-02-23  Martin Baulig  <martin@ximian.com>
9835
9836         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9837
9838 2003-02-23  Martin Baulig  <martin@ximian.com>
9839
9840         * statement.cs (Block.AddChildVariableNames): We need to call this
9841         recursively, not just for our immediate children.
9842
9843 2003-02-23  Martin Baulig  <martin@ximian.com>
9844
9845         * class.cs (Event.Define): Always make the field private, like csc does.
9846
9847         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9848         actually work, fixes bug #37521.
9849
9850 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9851
9852         * delegate.cs: When creating the various temporary "Parameters"
9853         classes, make sure that we call the ComputeAndDefineParameterTypes
9854         on those new parameters (just like we do with the formal ones), to
9855         allow them to be resolved in the context of the DeclSpace.
9856
9857         This fixes the bug that Dick observed in Bugzilla #38530.
9858
9859 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9860
9861         * expression.cs (ResolveMemberAccess): When resolving a constant,
9862         do not attempt to pull a constant if the value was not able to
9863         generate a valid constant.
9864
9865         * const.cs (LookupConstantValue): Do not report more errors than required.
9866
9867 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9868
9869         * expression.cs: fixes bug #38328.
9870
9871 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9872
9873         * class.cs: Changed all the various members that can be part of a
9874         class from being an ArrayList to be an Array of the right type.
9875         During the DefineType type_list, interface_list, delegate_list and
9876         enum_list are turned into types, interfaces, delegates and enums
9877         arrays.  
9878
9879         And during the member population, indexer_list, event_list,
9880         constant_list, field_list, instance_constructor_list, method_list,
9881         operator_list and property_list are turned into their real arrays.
9882
9883         Although we could probably perform this operation earlier, for
9884         good error reporting we need to keep the lists and remove the
9885         lists for longer than required.
9886
9887         This optimization was triggered by Paolo profiling the compiler
9888         speed on the output of `gen-sample-program.pl' perl script. 
9889
9890         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9891         not crash in methods like MemberLookupFailed that use this field.  
9892
9893         This problem arises when the compiler fails to resolve a type
9894         during interface type definition for example.
9895
9896 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9897
9898         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9899         inherit from System.Object, so we have to stop at null, not only
9900         when reaching System.Object.
9901
9902 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9903
9904         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9905         DeclaredOnly because the parent indexer might have had a different
9906         name, but did not loop until the top of the hierarchy was reached.
9907
9908         The problem this one fixes is 35492: when a class implemented an
9909         indexer from an interface, we were getting the interface method
9910         (which was abstract) and we were flagging an error (can not invoke
9911         abstract method).
9912
9913         This also keeps bug 33089 functioning, and test-148 functioning.
9914
9915         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9916         out if a method is special is to see if it is declared in a
9917         property or event, or whether it is one of the predefined operator
9918         names.   This should fix correctly #36804.
9919
9920 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9921
9922         The goal here is to remove the dependency on EmptyCast.Peel ().
9923         Killing it completely.
9924
9925         The problem is that currently in a number of places where
9926         constants are expected, we have to "probe" for an EmptyCast, and
9927         Peel, which is not the correct thing to do, as this will be
9928         repetitive and will likely lead to errors. 
9929
9930         The idea is to remove any EmptyCasts that are used in casts that
9931         can be reduced to constants, so we only have to cope with
9932         constants. 
9933
9934         This bug hunt was triggered by Bug 37363 and the desire to remove
9935         the duplicate pattern where we were "peeling" emptycasts to check
9936         whether they were constants.  Now constants will always be
9937         constants.
9938
9939         * ecore.cs: Use an enumconstant here instead of wrapping with
9940         EmptyCast.  
9941
9942         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9943         throwing me off.  By handling this we can get rid of a few hacks.
9944
9945         * statement.cs (Switch): Removed Peel() code.
9946
9947 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9948
9949         * class.cs: Location information for error 508
9950
9951         * expression.cs (New.DoResolve): Add a guard against double
9952         resolution of an expression.  
9953
9954         The New DoResolve might be called twice when initializing field
9955         expressions (see EmitFieldInitializers, the call to
9956         GetInitializerExpression will perform a resolve on the expression,
9957         and later the assign will trigger another resolution
9958
9959         This leads to bugs (#37014)
9960
9961         * delegate.cs: The signature for EndInvoke should contain any ref
9962         or out parameters as well.  We were not doing this in the past. 
9963
9964         * class.cs (Field.Define): Do not overwrite the type definition
9965         inside the `volatile' group.  Turns out that volatile enumerations
9966         were changing the type here to perform a validity test, which
9967         broke conversions. 
9968
9969 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9970
9971         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9972         and structs, we do not want to load the instance variable
9973
9974         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9975         enum_type has to be handled like an object reference (implicit
9976         conversions exists from this to object), but the regular IsClass
9977         and IsValueType tests will never return true for this one.
9978
9979         Also we use TypeManager.IsValueType instead of type.IsValueType,
9980         just for consistency with the rest of the code (this is only
9981         needed if we ever use the construct exposed by test-180.cs inside
9982         corlib, which we dont today).
9983
9984 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9985
9986         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9987         just InternalCall.
9988
9989 2003-02-09  Martin Baulig  <martin@ximian.com>
9990
9991         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9992         (Namespace.DefineNamespaces): New static public method; this is
9993         called when we're compiling with debugging to add all namespaces
9994         to the symbol file.
9995
9996         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9997         pass it to the Namespace's .ctor.
9998
9999         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10000         and MethodBase arguments; pass the namespace ID to the symwriter;
10001         pass the MethodBase instead of the token to the symwriter.
10002         (SymbolWriter.DefineNamespace): New method to add a namespace to
10003         the symbol file.
10004
10005 2003-02-09  Martin Baulig  <martin@ximian.com>
10006
10007         * symbolwriter.cs: New file.  This is a wrapper around
10008         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10009         methods here in near future.
10010
10011 2003-02-09  Martin Baulig  <martin@ximian.com>
10012
10013         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10014         ILGenerator.MarkSequencePoint() which are actually used by the
10015         symbol writer.
10016
10017 2003-02-09  Martin Baulig  <martin@ximian.com>
10018
10019         * location.cs (SourceFile): New public sealed class.  This
10020         contains the name and an index which is used in the location's token.
10021         (Location): Reserve an appropriate number of bits in the token for
10022         the source file instead of walking over that list, this gives us a
10023         really huge performance improvement when compiling with debugging.
10024
10025         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10026         `SourceFile' argument instead of a string.
10027         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10028         but don't parse/tokenize here, we need to generate the list of all
10029         source files before we do that.
10030         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10031         the files.
10032
10033         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10034         instead of a string.
10035
10036         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10037         of a string.
10038
10039 2003-02-09  Martin Baulig  <martin@ximian.com>
10040
10041         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10042         filename on `#line default'.
10043
10044 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10045
10046         * statement.cs: don't clear the pinned var when the fixed statement
10047         returns from the method (fixes bug#37752).
10048
10049 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10050
10051         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10052         to IsValueType.
10053
10054 2003-02-07  Martin Baulig  <martin@ximian.com>
10055
10056         * driver.cs: Removed the `--debug-args' command line argument.
10057
10058         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10059         automatically by the AsssemblyBuilder.
10060         (CodeGen.InitializeSymbolWriter): We don't need to call any
10061         initialization function on the symbol writer anymore.  This method
10062         doesn't take any arguments.
10063
10064 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10065
10066         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10067         from referenced assemblies as well.
10068
10069 2003-02-02  Martin Baulig  <martin@ximian.com>
10070
10071         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10072
10073 2003-02-02  Martin Baulig  <martin@ximian.com>
10074
10075         * class.cs (Constructor.Emit): Open the symbol writer before
10076         emitting the constructor initializer.
10077         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10078         single-stepping through constructor initializers.
10079
10080 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10081
10082         * class.cs: Handle error 549: do not allow virtual methods in
10083         sealed classes. 
10084
10085 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10086
10087         * decl.cs: Check access levels when resolving types
10088
10089 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10090
10091         * statement.cs: Add parameters and locals set in catch blocks that might 
10092         return to set vector
10093
10094 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10095
10096         * class.cs (Operator): Set the SpecialName flags for operators.
10097
10098         * expression.cs (Invocation.DoResolve): Only block calls to
10099         accessors and operators on SpecialName methods.
10100
10101         (Cast.TryReduce): Handle conversions from char constants.
10102
10103
10104 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10105
10106         * statement.cs: small memory and time optimization in FlowBranching.
10107
10108 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10109
10110         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10111         problem that the last fix but in the other sid (Set).
10112
10113         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10114         access when there is no indexer in the hierarchy.
10115
10116 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10117
10118         * class.cs: Combine some if statements.
10119
10120 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10121
10122         * driver.cs: fixed bug #37187.
10123
10124 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10125
10126         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10127         any indexer, it's needed to build a list with all the indexers in the
10128         hierarchy (AllGetters), else we have problems. Fixes #35653.
10129
10130 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10131
10132         * class.cs (MethodData.Define): It is wrong for an interface
10133         implementation to be static in both cases: explicit and implicit.
10134         We were only handling this in one case.
10135
10136         Improve the if situation there to not have negations.
10137
10138         * class.cs (Field.Define): Turns out that we do not need to check
10139         the unsafe bit on field definition, only on usage.  Remove the test.
10140
10141 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10142
10143         * driver.cs: use assembly.Location instead of Codebase (the latest
10144         patch made mcs fail when using MS assemblies).
10145
10146 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10147
10148         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10149         get the path to *corlib.dll.
10150
10151 2003-01-21  Nick Drochak <ndrochak@gol.com>
10152
10153         * cs-tokenizer.cs:
10154         * pending.cs:
10155         * typemanager.cs: Remove compiler warnings
10156
10157 2003-01-20  Duncan Mak  <duncan@ximian.com>
10158
10159         * AssemblyInfo.cs: Bump the version number to 0.19.
10160
10161 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10162
10163         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10164
10165 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10166
10167         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10168
10169 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10170
10171         * cs-parser.jay: Small fix: we were not comparing the constructor
10172         name correctly.   Thanks to Zoltan for the initial pointer.
10173
10174 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10175
10176         * cs-tokenizer.cs: Set file name when specified with #line
10177
10178 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10179
10180         * cs-parser.jay: Only perform the constructor checks here if we
10181         are named like the class;  This will help provider a better
10182         error.  The constructor path is taken when a type definition is
10183         not found, but most likely the user forgot to add the type, so
10184         report that rather than the constructor error.
10185
10186 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10187
10188         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10189         allocations.
10190
10191 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10192
10193         * cs-parser.jay: Add cleanup call.
10194
10195 2003-01-13  Duncan Mak  <duncan@ximian.com>
10196
10197         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10198         consistent with other methods.
10199
10200 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10201
10202         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10203
10204 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10205
10206         * attribute.cs: only set GuidAttr to true when we have a
10207         GuidAttribute.
10208
10209 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10210
10211         * ecore.cs:
10212         * expression.cs:
10213         * typemanager.cs: fixes to allow mcs compile corlib with the new
10214         Type.IsSubclassOf fix.
10215
10216 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10217
10218         * expression.cs (LocalVariableReference.DoResolve): Classify a
10219         constant as a value, not as a variable.   Also, set the type for
10220         the variable.
10221
10222         * cs-parser.jay (fixed_statement): take a type instead of a
10223         pointer_type, so we can produce a better error message later.
10224
10225         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10226         as an error.  
10227
10228         (For.DoEmit): Make inifinite loops have a
10229         non-conditional branch back.
10230
10231         (Fixed.DoEmit): First populate the pinned variables, then emit the
10232         statement, then clear the variables.  Before I was emitting the
10233         code once for each fixed piece.
10234
10235
10236 2003-01-08  Martin Baulig  <martin@ximian.com>
10237
10238         * statement.cs (FlowBranching.MergeChild): A break in a
10239         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10240
10241 2003-01-08  Martin Baulig  <martin@ximian.com>
10242
10243         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10244         lives in the same number space than `param_map'.  Fixes #36154.
10245
10246 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10247
10248         * cs-parser.jay (constructor_declaration): Set the
10249         Constructor.ModFlags before probing for it.  This makes the
10250         compiler report 514, 515 and 132 (the code was there, but got
10251         broken). 
10252
10253         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10254         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10255         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10256
10257 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10258
10259         * enum.cs: create the enum static fields using the enum type.
10260
10261 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10262
10263         * class.cs: don't try to create the ParamBuilder for the return
10264         type if it's not needed (and handle it breaking for the ms runtime
10265         anyway).
10266
10267 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10268
10269         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10270
10271 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10272
10273         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10274         the command.   This showed up while compiling the JANET source
10275         code, which used \r as its only newline separator.
10276
10277 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10278
10279         * class.cs (Method.Define): If we are an operator (because it
10280         reuses our code), then set the SpecialName and HideBySig.  #36128
10281
10282 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10283
10284         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10285         exception, report error 120 `object reference required'.
10286
10287         * driver.cs: Add --pause option, used during to measure the size
10288         of the process as it goes with --timestamp.
10289
10290         * expression.cs (Invocation.DoResolve): Do not allow methods with
10291         SpecialName to be invoked.
10292
10293 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10294
10295         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10296         number before adding it.
10297
10298 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10299
10300         * ecore.cs (StandardImplicitConversion): When in an unsafe
10301         context, we allow conversion between void * to any other pointer
10302         type. This fixes bug #35973.
10303
10304 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10305
10306         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10307         is not thrown when extensionless outputs are used 
10308
10309 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10310
10311         * rootcontext.cs: fixed compilation of corlib.
10312
10313 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10314
10315         * attribute.cs (Attributes.Contains): Add new method.
10316
10317         * class.cs (MethodCore.LabelParameters): if the parameter is an
10318         `out' parameter, check that no attribute `[In]' has been passed.
10319
10320         * enum.cs: Handle the `value__' name in an enumeration.
10321
10322 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10323
10324         * decl.cs: Added special case to allow overrides on "protected
10325         internal" methods
10326
10327 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10328
10329         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10330         since it makes much more sense.
10331
10332         (Attributes.ctor): Don't require a Location parameter.
10333
10334         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10335
10336         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10337         since we already have that information per attribute.
10338
10339         * everywhere : make appropriate changes.
10340
10341         * class.cs (LabelParameters): Write the code which actually
10342         applies attributes to the return type. We can't do this on the MS
10343         .NET runtime so we flag a warning in the case an exception is
10344         thrown.
10345
10346 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10347
10348         * const.cs: Handle implicit null conversions here too.
10349
10350 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10351
10352         * class.cs (MethodCore.LabelParameters): Remove the extra
10353         Type [] parameter since it is completely unnecessary. Instead
10354         pass in the method's attributes so that we can extract
10355         the "return" attribute.
10356
10357 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10358
10359         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10360         of ignoring it and letting the compile continue.
10361
10362         * typemanager.cs (ChangeType): use an extra argument to return an
10363         error condition instead of throwing an exception.
10364
10365 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10366
10367         * expression.cs (Unary.TryReduce): mimic the code for the regular
10368         code path.  Perform an implicit cast in the cases where we can
10369         implicitly convert to one of the integral types, and then reduce
10370         based on that constant.   This fixes bug #35483.
10371
10372 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10373
10374         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10375
10376 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10377
10378         * namespace.cs: fixed bug #35489.
10379
10380 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10381
10382         * class.cs: Remove some dead code.
10383
10384         * cs-parser.jay: Estimate the number of methods needed
10385         (RootContext.MethodCount);
10386
10387         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10388         numbers instead of StringBuilders.
10389
10390         * support.cs (PtrHashtable): Add constructor with initial size;
10391         We can now reduce reallocations of the method table.
10392
10393 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10394
10395         * attribute.cs (ApplyAttributes): Keep track of the emitted
10396         attributes on a per-target basis. This fixes bug #35413.
10397
10398 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10399
10400         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10401         default to the Windows 1252 encoding.
10402
10403         (UnixParseOption): Support version, thanks to Alp for the missing
10404         pointer. 
10405
10406         * AssemblyInfo.cs: Add nice assembly information.
10407
10408         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10409         (bug 35169).
10410
10411         * cs-parser.jay: Allow a trailing comma before the close bracked
10412         in the attribute_section production.
10413
10414         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10415         address of the instance was being taken, I will take this out,
10416         because we take the address of the object immediately here.
10417
10418 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10419
10420         * typemanager.cs (AreMultipleAllowed): Take care of the most
10421         obvious case where attribute type is not in the current assembly -
10422         stupid me ;-)
10423
10424 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10425
10426         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10427         definitions, instead of doing that afterwards.  
10428
10429         Also we use a nice little hack, depending on the constructor, we
10430         know if we are a "composed" name or a simple name.  Hence, we
10431         avoid the IndexOf test, and we avoid 
10432
10433         * codegen.cs: Add code to assist in a bug reporter to track down
10434         the source of a compiler crash. 
10435
10436 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10437
10438         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10439         types have been emitted for a given element and flag an error
10440         if something which does not have AllowMultiple set is used more
10441         than once.
10442
10443         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10444         attribute types and their corresponding AllowMultiple properties
10445
10446         (AreMultipleAllowed): Check the property for a given type.
10447
10448         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10449         property in the case we have a TypeContainer.
10450
10451         (Attributes.AddAttribute): Detect duplicates and just skip on
10452         adding them. This trivial fix catches a pretty gross error in our
10453         attribute emission - global attributes were being emitted twice!
10454
10455         Bugzilla bug #33187 is now fixed.
10456
10457 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10458
10459         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10460         instead of pp_and).
10461
10462         * expression.cs (Binary.ResolveOperator): I can only use the
10463         Concat (string, string, string) and Concat (string, string,
10464         string, string) if the child is actually a concatenation of
10465         strings. 
10466
10467 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10468
10469         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10470         context where we need a 2-character lookahead.
10471
10472         * pending.cs (PendingImplementation): Rework so we can keep track
10473         of interface types all the time, and flag those which were
10474         implemented by parents as optional.
10475
10476 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10477
10478         * expression.cs (Binary.ResolveOperator): Use
10479         String.Concat(string,string,string) or
10480         String.Concat(string,string,string,string) when possible. 
10481
10482         * typemanager: More helper methods.
10483
10484
10485 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10486
10487         * pending.cs: remove the bogus return from GetMissingInterfaces()
10488         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10489
10490 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10491
10492         * namespace.cs: avoid duplicated 'using xxx' being added to
10493         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10494         when we get more than one 'using' statement for the same namespace.
10495         Report a CS0105 warning for it.
10496
10497 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10498
10499         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10500         of calling getChar/putback, uses internal knowledge of it.    
10501
10502         (xtoken): Reorder tokenizer so most common patterns are checked
10503         first.  This reduces the compilation time in another 5% (from 8.11s
10504         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10505
10506         The parsing time is 22% of the compilation in mcs, and from that
10507         64% is spent on the tokenization process.  
10508
10509         I tried using a binary search for keywords, but this is slower
10510         than the hashtable.  Another option would be to do a couple of
10511         things:
10512
10513                 * Not use a StringBuilder, instead use an array of chars,
10514                   with a set value.  Notice that this way we could catch
10515                   the 645 error without having to do it *afterwards*.
10516
10517                 * We could write a hand-parser to avoid the hashtable
10518                   compares altogether.
10519
10520         The identifier consumption process takes 37% of the tokenization
10521         time.  Another 15% is spent on is_number.  56% of the time spent
10522         on is_number is spent on Int64.Parse:
10523
10524                 * We could probably choose based on the string length to
10525                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10526                   computations. 
10527
10528         Another 3% is spend on wrapping `xtoken' in the `token' function.
10529
10530         Handle 0xa0 as whitespace (#34752)
10531
10532 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10533
10534         * typemanager.cs (IsCLRType): New routine to tell whether a type
10535         is one of the builtin types.  
10536
10537         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10538         typecode in more places instead of doing pointer comparissions.
10539         We could leverage some knowledge about the way the typecodes are
10540         laid out.
10541
10542         New code to cache namespaces in assemblies, it is currently not
10543         invoked, to be used soon.
10544
10545         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10546
10547         * expression.cs (Binary.ResolveOperator): specially handle
10548         strings, and do not perform user-defined operator overloading for
10549         built-in types.
10550
10551 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10552
10553         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10554         internalcall as it is a pretty simple operation;  Avoid whenever
10555         possible to call Char.IsLetter.
10556
10557         (consume_identifier): Cut by half the number of
10558         hashtable calls by merging the is_keyword and GetKeyword behavior.
10559
10560         Do not short-circuit, because if we do, we
10561         report errors (ie, #if false && true would produce an invalid
10562         directive error);
10563
10564
10565 2002-11-24  Martin Baulig  <martin@ximian.com>
10566
10567         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10568         check constant ranges and report a CS0221.  Fixes #33186.
10569
10570 2002-11-24  Martin Baulig  <martin@ximian.com>
10571
10572         * cs-parser.jay: Make this work for uninitialized variable
10573         declarations in the `for' initializer.  Fixes #32416.
10574
10575 2002-11-24  Martin Baulig  <martin@ximian.com>
10576
10577         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10578         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10579
10580 2002-11-24  Martin Baulig  <martin@ximian.com>
10581
10582         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10583         argument; if true, we also check for user-defined conversions.
10584         This is only needed if both arguments are of a user-defined type.
10585         Fixes #30443, added test-175.cs.
10586         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10587
10588         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10589
10590 2002-11-24  Martin Baulig  <martin@ximian.com>
10591
10592         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10593         function to get the store opcode.
10594         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10595         only emit the Ldelema if the store opcode is Stobj.  You must run
10596         both test-34 and test-167 to test this.  Fixes #34529.
10597
10598 2002-11-23  Martin Baulig  <martin@ximian.com>
10599
10600         * ecore.cs (Expression.MemberLookup): Added additional
10601         `qualifier_type' argument which is used when we're being called
10602         from MemberAccess.DoResolve() and null if we're called from a
10603         SimpleName lookup.
10604         (Expression.MemberLookupFailed): New method to report errors; this
10605         does the CS1540 check and reports the correct error message.
10606
10607         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10608         argument for the CS1540 check and redone the way how we're dealing
10609         with private members.  See the comment in the source code for details.
10610         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10611         `closure_start_type' to `closure_qualifier_type' and check whether
10612         it's not null.  It was not this filter being broken, it was just
10613         being called with the wrong arguments.
10614
10615         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10616         and pass it the correct `qualifier_type'; this also does the error
10617         handling for us.
10618
10619 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10620
10621         * expression.cs (Invocation.EmitParams): If the we are dealing
10622         with a non-built-in value type, load its address as well.
10623
10624         (ArrayCreation): Use a a pretty constant instead
10625         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10626         static initializers.  
10627
10628         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10629         because they are not really value types, just glorified integers. 
10630
10631         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10632
10633         * ecore.cs: Remove redundant code for enumerations, make them use
10634         the same code path as everything else, fixes the casting issue
10635         with enumerations in Windows.Forms.
10636
10637         * attribute.cs: Do only cast to string if it is a string, the
10638         validation happens later.
10639
10640         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10641         people upgrade their corlibs.
10642
10643         * ecore.cs: Oops, enumerations were not following the entire code path
10644
10645 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10646
10647         * typemanager.cs (FilterWithClosure): Commented out the test for
10648         1540 in typemanager.cs, as it has problems when accessing
10649         protected methods from a parent class (see test-174.cs). 
10650
10651         * attribute.cs (Attribute.ValidateGuid): new method.
10652         (Attribute.Resolve): Use above.
10653
10654 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10655
10656         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10657
10658         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10659         handling for enumerations, as we only needed the TypeContainer
10660         functionality to begin with (this is required for the fix below to
10661         work for enums that reference constants in a container class for
10662         example). 
10663
10664         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10665
10666         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10667         a valid TypeBuilder to perform lookups on.o
10668
10669         * class.cs (InheritableMemberSignatureCompare): Use true in the
10670         call to GetGetMethod and GetSetMethod, because we are comparing
10671         the signature, and we need to get the methods *even* if they are
10672         private. 
10673
10674         (PropertyBase.CheckBase): ditto.
10675
10676         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10677         GotoCase.Resolve): Use Peel on EmpytCasts.
10678
10679         * ecore.cs (EmptyCast): drop child, add Peel method.
10680
10681 2002-11-17  Martin Baulig  <martin@ximian.com>
10682
10683         * ecore.cs (EmptyCast.Child): New public property.
10684
10685         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10686         label resolved to an EmptyCast.  Fixes #34162.
10687         (GotoCase.Resolve): Likewise.
10688         (Block.EmitMeta): Likewise.
10689
10690 2002-11-17  Martin Baulig  <martin@ximian.com>
10691
10692         * expression.cs (Invocation.BetterConversion): Prefer int over
10693         uint; short over ushort; long over ulong for integer literals.
10694         Use ImplicitConversionExists instead of StandardConversionExists
10695         since we also need to check for user-defined implicit conversions.
10696         Fixes #34165.  Added test-173.cs.
10697
10698 2002-11-16  Martin Baulig  <martin@ximian.com>
10699
10700         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10701         with the `true' and `false' literals.  Fixes #33151.
10702
10703 2002-11-16  Martin Baulig  <martin@ximian.com>
10704
10705         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10706         October 22nd; don't do the cs1540 check for static members.
10707
10708         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10709         now using our own filter here and doing the cs1540 check again.
10710
10711 2002-11-16  Martin Baulig  <martin@ximian.com>
10712
10713         * support.cs (InternalParameters): Don't crash if we don't have
10714         any fixed parameters.  Fixes #33532.
10715
10716 2002-11-16  Martin Baulig  <martin@ximian.com>
10717
10718         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10719         when looking up static methods to make this work on Windows.
10720         Fixes #33773.
10721
10722 2002-11-16  Martin Baulig  <martin@ximian.com>
10723
10724         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10725         a setter rather than using PropertyInfo.CanWrite.
10726
10727 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10728
10729         * class.cs: Allow acces to block member by subclasses. Fixes build
10730         breaker.
10731
10732 2002-11-14  Martin Baulig  <martin@ximian.com>
10733
10734         * class.cs (Constructor.Emit): Added the extern/block check.
10735         Fixes bug #33678.
10736
10737 2002-11-14  Martin Baulig  <martin@ximian.com>
10738
10739         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10740         iteration while looking for indexers, this is needed because the
10741         indexer may have a different name in our base classes.  Fixed the
10742         error reporting (no indexers at all, not get accessor, no
10743         overloaded match).  Fixes bug #33089.
10744         (IndexerAccess.DoResolveLValue): Likewise.
10745
10746 2002-11-14  Martin Baulig  <martin@ximian.com>
10747
10748         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10749         indexers.  Fixes the first part of bug #33089.
10750         (MethodSignature.InheritableMemberSignatureCompare): Added support
10751         for properties.
10752
10753 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10754
10755         * attribute.cs (Attribute.Resolve): Catch the
10756         NullReferenceException and report it since it isn't supposed to
10757         happen. 
10758
10759 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10760
10761         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10762         LogicalOr and LogicalAnd that can benefit from recursively
10763         handling EmitBranchable.  The code now should be nice for Paolo.
10764
10765 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10766
10767         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10768         the Type lookups, as we perform quite a number of lookups on
10769         non-Types.  This can be removed once we can deterministically tell
10770         whether we have a type or a namespace in advance.
10771
10772         But this might require special hacks from our corlib.
10773
10774         * TODO: updated.
10775
10776         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10777         and double which avoids a conversion from an integer to a double.
10778
10779         * expression.cs: tiny optimization, avoid calling IsConstant,
10780         because it effectively performs the lookup twice.
10781
10782 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10783
10784         But a bogus return here to keep the semantics of the old code
10785         until the Mono runtime is fixed.
10786
10787         * pending.cs (GetMissingInterfaces): New method used to remove all
10788         the interfaces that are already implemented by our parent
10789         classes from the list of pending methods. 
10790
10791         * interface.cs: Add checks for calls after ResolveTypeExpr.
10792
10793 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10794
10795         * class.cs (Class.Emit): Report warning 67: event not used if the
10796         warning level is beyond 3.
10797
10798         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10799         being a NullLiteral.
10800
10801         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10802         specifiers. 
10803
10804         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10805         path that might fail if a type can not be resolved.
10806
10807         * expression.cs (Binary.Emit): Emit unsigned versions of the
10808         operators. 
10809
10810         * driver.cs: use error 5.
10811
10812 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10813
10814         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10815
10816 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10817
10818         * cs-parser.jay (switch_section): A beautiful patch from Martin
10819         Baulig that fixed 33094.
10820
10821 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10822
10823         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10824         Check whether the base is abstract and report an error if so.
10825
10826         * expression.cs (IndexerAccess.DoResolveLValue,
10827         IndexerAccess.DoResolve): ditto. 
10828
10829         (Invocation.DoResolve): ditto.
10830
10831         (Invocation.FullMethodDesc): Improve the report string.
10832
10833         * statement.cs (Block): Eliminate IsVariableDefined as it is
10834         basically just a wrapper for GetVariableInfo.
10835
10836         * ecore.cs (SimpleName): Use new 
10837
10838         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10839         type, as we return the actual parameter ref/unref state on a
10840         different call.
10841
10842 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10843
10844         * support.cs: Return proper flags REF/OUT fixing the previous
10845         commit.  
10846
10847         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10848         not used to mean `ref' but `ref or out' in ParameterReference
10849
10850         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10851         full type signature instead of calling TypeManger.CSharpName
10852         ourselves. 
10853
10854         * support.cs (InternalParameters.ParameterDesc): Do not compare
10855         directly to the modflags, because REF/OUT will actually be bitsets
10856         if set. 
10857
10858         * delegate.cs (VerifyMethod): Check also the modifiers.
10859
10860         * cs-tokenizer.cs: Fix bug where floating point values with an
10861         exponent where a sign was missing was ignored.
10862
10863         * driver.cs: Allow multiple assemblies to be specified in a single
10864         /r: argument
10865
10866 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10867
10868         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10869         because identifiers after a parenthesis would end up in this kind
10870         of production, and we needed to desamiguate it for having casts
10871         like:
10872
10873                 (UserDefinedType *) xxx
10874
10875 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10876
10877         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10878         we should set on the Bindingflags.NonPublic, but not turn on
10879         private_ok.  private_ok controls whether a Private member is
10880         returned (this is chekced on the filter routine), while the
10881         BindingFlags.NonPublic just controls whether private/protected
10882         will be allowed.   This fixes the problem part of the problem of
10883         private properties being allowed to be used in derived classes.
10884
10885         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10886         so we can call the children DoResolveLValue method (this will
10887         properly signal errors on lvalue assignments to base properties)
10888
10889         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10890         getter are null, and we have a property info, we know that this
10891         happened because the lookup failed, so we report an error 122 for
10892         protection level violation.
10893
10894         We also silently return if setter and getter are null in the
10895         resolve functions, this condition only happens if we have flagged
10896         the error before.  This is the other half of the problem. 
10897
10898         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10899         not have accessibility information, that is why we were returning
10900         true in the filter function in typemanager.cs.
10901
10902         To properly report 122 (property is inaccessible because of its
10903         protection level) correctly, we report this error in ResolveAccess
10904         by failing if both the setter and the getter are lacking (ie, the
10905         lookup failed). 
10906
10907         DoResolve and DoLResolve have been modified to check for both
10908         setter/getter being null and returning silently, the reason being
10909         that I did not want to put the knowledge about this error in upper
10910         layers, like:
10911
10912         int old = Report.Errors;
10913         x = new PropertyExpr (...);
10914         if (old != Report.Errors)
10915                 return null;
10916         else
10917                 return x;
10918
10919         So the property expr is returned, but it is invalid, so the error
10920         will be flagged during the resolve process. 
10921
10922         * class.cs: Remove InheritablePropertySignatureCompare from the
10923         class, as we no longer depend on the property signature to compute
10924         whether it is possible to implement a method or not.
10925
10926         The reason is that calling PropertyInfo.GetGetMethod will return
10927         null (in .NET, in Mono it works, and we should change this), in
10928         cases where the Get Method does not exist in that particular
10929         class.
10930
10931         So this code:
10932
10933         class X { public virtual int A { get { return 1; } } }
10934         class Y : X { }
10935         class Z : Y { public override int A { get { return 2; } } }
10936
10937         Would fail in Z because the parent (Y) would not have the property
10938         defined.  So we avoid this completely now (because the alternative
10939         fix was ugly and slow), and we now depend exclusively on the
10940         method names.
10941
10942         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10943         reference method, instead of using the property.
10944
10945         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10946         routines are gone now.
10947
10948         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10949         names, they were incorrectly named.
10950
10951         * cs-tokenizer.cs: Return are more gentle token on failure. 
10952
10953         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10954         had an out-of-sync index variable, which caused it to remove from
10955         the list of pending methods the wrong method sometimes.
10956
10957 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10958
10959         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10960         CanWrite, because those refer to this particular instance of the
10961         property, and do not take into account the fact that we can
10962         override single members of a property.
10963
10964         Constructor requires an EmitContext.  The resolution process does
10965         not happen here, but we need to compute the accessors before,
10966         because the resolution does not always happen for properties.
10967
10968         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10969         subclass, before we did not update this flag, but we did update
10970         bindingflags. 
10971
10972         (GetAccessors): Drop this routine, as it did not work in the
10973         presence of partially overwritten set/get methods. 
10974
10975         Notice that this broke the cs1540 detection, but that will require
10976         more thinking. 
10977
10978 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10979
10980         * class.cs:
10981         * codegen.cs:
10982         * driver.cs: issue a warning instead of an error if we don't support
10983         debugging for the platform. Also ignore a couple of errors that may
10984         arise when trying to write the symbols. Undo my previous patch.
10985
10986 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10987
10988         * driver.cs: ignore /debug switch except for Unix platforms.
10989
10990 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10991
10992         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10993
10994 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10995
10996         * driver.cs: Do not make mcs-debug conditional, so we do not break
10997         builds that use it.
10998
10999         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11000         review this patch.  But basically after all the children variables
11001         have been merged, the value of "Breaks" was not being set to
11002         new_breaks for Switch blocks.  I think that it should be set after
11003         it has executed.  Currently I set this to the value of new_breaks,
11004         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11005         conservative, but I do not understand this code very well.
11006
11007         I did not break anything in the build, so that is good ;-)
11008
11009         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11010
11011 2002-10-20  Mark Crichton  <crichton@gimp.org>
11012
11013         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11014
11015 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11016
11017         * cfold.cs: Fixed compile blocker.
11018
11019 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11020
11021         * driver.cs: I was chekcing the key, not the file.
11022
11023 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11024
11025         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11026         message that we were generating - we just need to silently return
11027         a null.
11028
11029 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11030
11031         * class.cs (Event.Define): Change my previous commit, as this
11032         breaks the debugger.  This is a temporary hack, as it seems like
11033         the compiler is generating events incorrectly to begin with.
11034
11035         * expression.cs (Binary.ResolveOperator): Added support for 
11036         "U operator - (E x, E y)"
11037
11038         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11039         y)".
11040
11041         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11042         init-only variables, but this path did not take into account that
11043         there might be also instance readonly variables.  Correct this
11044         problem. 
11045
11046         This fixes bug 32253
11047
11048         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11049         delegates as well.
11050
11051         * driver.cs: Change the extension for modules to `netmodule'
11052
11053         * cs-parser.jay: Improved slightly the location tracking for
11054         the debugger symbols.
11055
11056         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11057         modifiers that were specified instead of the hardcoded value
11058         (FamAndAssem).  This was basically ignoring the static modifier,
11059         and others.  Fixes 32429.
11060
11061         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11062         fixed a bug in the process (32476)
11063
11064         * expression.cs (ArrayAccess.EmitAssign): Patch from
11065         hwang_rob@yahoo.ca that fixes bug 31834.3
11066
11067 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11068
11069         * driver.cs: Make the module extension .netmodule.
11070
11071 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11072
11073         * driver.cs: Report an error if the resource file is not found
11074         instead of crashing.
11075
11076         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11077         false, like Emit does.
11078
11079 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11080
11081         * typemanager.cs: Remove unused private member.  Also reported mcs
11082         bug to report this as a warning like csc.
11083
11084 2002-10-15  Martin Baulig  <martin@gnome.org>
11085
11086         * statement.cs (Statement.Emit): Made this a virtual method; emits
11087         the line number info and calls DoEmit().
11088         (Statement.DoEmit): New protected abstract method, formerly knows
11089         as Statement.Emit().
11090
11091         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11092
11093 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11094
11095         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11096         have fixed a remaining problem: not every AddXXXX was adding a
11097         fully qualified name.  
11098
11099         Now everyone registers a fully qualified name in the DeclSpace as
11100         being defined instead of the partial name.  
11101
11102         Downsides: we are slower than we need to be due to the excess
11103         copies and the names being registered this way.  
11104
11105         The reason for this is that we currently depend (on the corlib
11106         bootstrap for instance) that types are fully qualified, because
11107         we dump all the types in the namespace, and we should really have
11108         types inserted into the proper namespace, so we can only store the
11109         basenames in the defined_names array.
11110
11111 2002-10-10  Martin Baulig  <martin@gnome.org>
11112
11113         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11114         from bug #31834, see the bug report for a testcase which is
11115         miscompiled.
11116
11117 2002-10-10  Martin Baulig  <martin@gnome.org>
11118
11119         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11120         flow analysis code for this.
11121
11122         * statement.cs (Do, While, For): Tell the flow analysis code about
11123         infinite loops.
11124         (FlowBranching.UsageVector): Added support for infinite loops.
11125         (Block.Resolve): Moved the dead code elimination here and use flow
11126         analysis to do it.
11127
11128 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11129
11130         * class.cs (Field.Define): Catch cycles on struct type
11131         definitions. 
11132
11133         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11134         fields if the fields are static.  We only need to check instance
11135         fields. 
11136
11137         * expression.cs (As.DoResolve): Test for reference type.
11138
11139         * statement.cs (Using.ResolveExpression): Use
11140         ConvertImplicitRequired, not ConvertImplicit which reports an
11141         error on failture
11142         (Using.ResolveLocalVariableDecls): ditto.
11143
11144         * expression.cs (Binary.ResolveOperator): Report errors in a few
11145         places where we had to.
11146
11147         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11148
11149 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11150
11151         * expression.cs: Use StoreFromPtr instead of extracting the type
11152         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11153
11154         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11155         an enumeration value to a System.Enum, but System.Enum is not a
11156         value type, but an class type, so we need to box.
11157
11158         (Expression.ConvertExplicit): One codepath could return
11159         errors but not flag them.  Fix this.  Fixes #31853
11160
11161         * parameter.cs (Resolve): Do not allow void as a parameter type.
11162
11163 2002-10-06  Martin Baulig  <martin@gnome.org>
11164
11165         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11166         if it's a class type and not a struct.  Fixes #31815.
11167
11168 2002-10-06  Martin Baulig  <martin@gnome.org>
11169
11170         * statement.cs: Reworked the flow analysis code a bit to make it
11171         usable for dead code elimination.
11172
11173 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11174
11175         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11176
11177 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11178
11179         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11180         to fix the test 165, will investigate deeper.
11181
11182 2002-10-04  Martin Baulig  <martin@gnome.org>
11183
11184         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11185         finally blocks actually work.
11186         (Try.Resolve): We don't need to create a sibling for `finally' if
11187         there is no finally block.
11188
11189 2002-10-04  Martin Baulig  <martin@gnome.org>
11190
11191         * class.cs (Constructor.Define): The default accessibility for a
11192         non-default constructor is private, not public.
11193
11194 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11195
11196         * class.cs (Constructor): Make AllowedModifiers public, add
11197         EXTERN.
11198
11199         * cs-parser.jay: Perform the modifiers test here, as the
11200         constructor for the Constructor class usually receives a zero
11201         because of the way we create it (first we create, later we
11202         customize, and we were never checking the modifiers).
11203
11204         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11205         is a version of LookupTypeReflection that includes the type-name
11206         cache.  This can be used as a fast path for functions that know
11207         the fully qualified name and are only calling into *.GetType() to
11208         obtain a composed type.
11209
11210         This is also used by TypeManager.LookupType during its type
11211         composition.
11212
11213         (LookupType): We now also track the real type name, as sometimes
11214         we can get a quey for the real type name from things like
11215         ComposedCast.  This fixes bug 31422.
11216
11217         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11218         complete type fullname, it does not have to go through the type
11219         resolution system to obtain the composed version of the type (for
11220         obtaining arrays or pointers).
11221
11222         (Conditional.Emit): Use the EmitBoolExpression to
11223         generate nicer code, as requested by Paolo.
11224
11225         (ArrayCreation.CheckIndices): Use the patch from
11226         hwang_rob@yahoo.ca to validate the array initializers. 
11227
11228 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11229
11230         * class.cs (ConstructorInitializer.Emit): simplify code by using
11231         Invocation.EmitCall, and at the same time, fix the bugs in calling
11232         parent constructors that took variable arguments. 
11233
11234         * ecore.cs (Expression.ConvertNumericExplicit,
11235         Expression.ImplicitNumericConversion): Remove the code that
11236         manually wrapped decimal (InternalTypeConstructor call is now gone
11237         as well).
11238
11239         * expression.cs (Cast.TryReduce): Also handle decimal types when
11240         trying to perform a constant fold on the type.
11241
11242         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11243
11244         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11245         that only turned off an error report, and did nothing else. 
11246
11247 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11248
11249         * driver.cs: Handle and ignore /fullpaths
11250
11251 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11252
11253         * expression.cs (Binary.ResolveOperator): Catch the case where
11254         DoNumericPromotions returns true, 
11255
11256         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11257
11258 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11259
11260         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11261         report error 70.
11262
11263 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11264
11265         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11266         conversion exists, but it is also required that the conversion be
11267         performed.  This manifested in "(Type64Enum) 2".  
11268
11269         * class.cs (TypeManager.AddMethod): The fix is not to change
11270         AddEnum, because that one was using a fully qualified name (every
11271         DeclSpace derivative does), but to change the AddMethod routine
11272         that was using an un-namespaced name.  This now correctly reports
11273         the duplicated name.
11274
11275         Revert patch until I can properly fix it.  The issue
11276         is that we have a shared Type space across all namespaces
11277         currently, which is wrong.
11278
11279         Options include making the Namespace a DeclSpace, and merge
11280         current_namespace/current_container in the parser.
11281
11282 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11283
11284         * cs-parser.jay: Improve error reporting when we get a different
11285         kind of expression in local_variable_type and
11286         local_variable_pointer_type. 
11287
11288         Propagate this to avoid missleading errors being reported.
11289
11290         * ecore.cs (ImplicitReferenceConversion): treat
11291         TypeManager.value_type as a target just like object_type.   As
11292         code like this:
11293
11294         ValueType v = 1;
11295
11296         Is valid, and needs to result in the int 1 being boxed before it
11297         is assigned to the value type v.
11298
11299         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11300         to validate the enumeration name.
11301
11302         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11303         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11304         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11305
11306         * ecore.cs (TryImplicitIntConversion): When doing an
11307         implicit-enumeration-conversion, check if the type is 64-bits and
11308         perform a conversion before passing to EnumConstant.
11309
11310 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11311
11312         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11313         report ambiguous type references.  Unlike the MS version, we
11314         report what the ambiguity is.   Innovation at work ;-)
11315
11316         (DeclSpace.FindType): Require a location argument to
11317         display when we display an ambiguous error.
11318
11319         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11320
11321         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11322
11323         * expression.cs (EmitDynamicInitializers): Apply patch from
11324         hwang_rob@yahoo.ca that fixes the order in which we emit our
11325         initializers. 
11326
11327 2002-09-21  Martin Baulig  <martin@gnome.org>
11328
11329         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11330         delegate takes no arguments.
11331
11332 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11333
11334         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11335         from integers.
11336
11337         * expression.cs: Extract the underlying type.
11338
11339         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11340
11341         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11342
11343 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11344
11345         * class.cs (TypeContainer.DefineType): We can not use the nice
11346         PackingSize with the size set to 1 DefineType method, because it
11347         will not allow us to define the interfaces that the struct
11348         implements.
11349
11350         This completes the fixing of bug 27287
11351
11352         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11353         means also structs.  This fixes part of the problem. 
11354         (Expresion.ImplicitReferenceConversionExists): ditto.
11355
11356         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11357         error if there were no errors reported during the type lookup
11358         process, to avoid duplicates or redundant errors.  Without this
11359         you would get an ambiguous errors plus a type not found.  We have
11360         beaten the user enough with the first error.  
11361
11362         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11363         reference. 
11364
11365         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11366         during the resolution process, stop the lookup, this avoids
11367         repeated error reports (same error twice).
11368
11369         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11370
11371         * typemanager.cs (LookupType): Redo the type lookup code to match
11372         the needs of System.Reflection.  
11373
11374         The issue is that System.Reflection requires references to nested
11375         types to begin with a "+" sign instead of a dot.  So toplevel
11376         types look like: "NameSpace.TopLevelClass", and nested ones look
11377         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11378         levels. 
11379
11380 2002-09-19  Martin Baulig  <martin@gnome.org>
11381
11382         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11383         says that a method always returns or always throws an exception,
11384         don't report the CS0161.
11385
11386         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11387         set `Returns = new_returns'.
11388
11389 2002-09-19  Martin Baulig  <martin@gnome.org>
11390
11391         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11392         to an enum constant, check for a CS0176.
11393
11394 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11395
11396         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11397         for operators that must be in pairs and report errors.
11398
11399         * ecore.cs (SimpleName.DoResolveType): During the initial type
11400         resolution process, when we define types recursively, we must
11401         check first for types in our current scope before we perform
11402         lookups in the enclosing scopes.
11403
11404         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11405
11406         (Invocation.VerifyArgumentsCompat): Call
11407         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11408         I thought we were supposed to always call this, but there are a
11409         few places in the code where we dont do it.
11410
11411 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11412
11413         * driver.cs: Add support in -linkres and -resource to specify the
11414         name of the identifier.
11415
11416 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11417
11418         * ecore.cs (StandardConversionExists): Sync with the conversion
11419         code: allow anything-* to void* conversions.
11420
11421         (FindMostSpecificSource): Use an Expression argument
11422         instead of a Type, because we might be handed over a Literal which
11423         gets a few more implicit conversions that plain types do not.  So
11424         this information was being lost.
11425
11426         Also, we drop the temporary type-holder expression when not
11427         required.
11428
11429 2002-09-17  Martin Baulig  <martin@gnome.org>
11430
11431         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11432         this is an explicit interface implementation.
11433
11434 2002-09-17  Martin Baulig  <martin@gnome.org>
11435
11436         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11437         different `IndexerName' attributes.
11438
11439         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11440         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11441         virtual CommonResolve().
11442
11443 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11444
11445         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11446         and convert that to the UnderlyingType.
11447
11448         * statement.cs (Foreach.Resolve): Indexers are just like variables
11449         or PropertyAccesses.
11450
11451         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11452         inside quoted strings, we were not doing this before.
11453
11454 2002-09-16  Martin Baulig  <martin@gnome.org>
11455
11456         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11457         resolve it.  This is needed for the definite assignment check of the
11458         instance expression, fixes bug #29846.
11459         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11460
11461 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11462
11463         * parameter.cs: Fix compile error.  Cannot reference static member
11464         from an instance object.  Is this an mcs bug?
11465
11466 2002-09-14  Martin Baulig  <martin@gnome.org>
11467
11468         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11469         multiple times.  Fixes bug #30295, added test-166.cs.
11470
11471 2002-09-14  Martin Baulig  <martin@gnome.org>
11472
11473         * statement.cs (Block.Emit): Don't emit unreachable code.
11474         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11475         `break' statements.
11476         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11477
11478 2002-09-14  Martin Baulig  <martin@gnome.org>
11479
11480         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11481         is set.
11482
11483 2002-09-14  Martin Baulig  <martin@gnome.org>
11484
11485         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11486         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11487         be false on the ms runtime.
11488
11489 2002-09-13  Martin Baulig  <martin@gnome.org>
11490
11491         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11492         the CS0038 error message.
11493
11494 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11495
11496         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11497         constant inside, return it.
11498
11499 2002-09-12  Martin Baulig  <martin@gnome.org>
11500
11501         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11502         implicit conversion can be done between enum types.
11503
11504         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11505         check whether an implicit conversion to the current enum's UnderlyingType
11506         exists and report an error if not.
11507
11508         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11509         without debugging support.
11510
11511         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11512         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11513
11514 2002-09-12  Martin Baulig  <martin@gnome.org>
11515
11516         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11517
11518         * ecore.cs (IMemberExpr.DeclaringType): New property.
11519         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11520         nonstatic member of an outer type (CS0038).
11521
11522 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11523
11524         * driver.cs: Activate the using-error detector at warning level
11525         4 (at least for MS-compatible APIs).
11526
11527         * namespace.cs (VerifyUsing): Small buglett fix.
11528
11529         * pending.cs (PendingImplementation): pass the container pointer. 
11530
11531         * interface.cs (GetMethods): Allow for recursive definition.  Long
11532         term, I would like to move every type to support recursive
11533         definitions, not the current ordering mechanism that we have right
11534         now.
11535
11536         The situation is this: Attributes are handled before interfaces,
11537         so we can apply attributes to interfaces.  But some attributes
11538         implement interfaces, we will now handle the simple cases
11539         (recursive definitions will just get an error).  
11540
11541         * parameter.cs: Only invalidate types at the end if we fail to
11542         lookup all types.  
11543
11544 2002-09-09  Martin Baulig  <martin@gnome.org>
11545
11546         * ecore.cs (PropertyExpr.Emit): Also check for
11547         TypeManager.system_int_array_get_length so this'll also work when
11548         compiling corlib.  Fixes #30003.
11549
11550 2002-09-09  Martin Baulig  <martin@gnome.org>
11551
11552         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11553         and throw an exception if we can't get the type's size.  Fixed #30040,
11554         added test-165.cs.
11555
11556 2002-09-09  Martin Baulig  <martin@gnome.org>
11557
11558         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11559
11560         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11561         context.  Fixes bug #30027.
11562
11563         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11564         virtual functions.  Fixes bug #30043, added test-164.cs.
11565
11566 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11567
11568         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11569
11570 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11571
11572         * driver.cs: Use an object to get the windows codepage since it's not a
11573         static property.
11574
11575 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11576
11577         * statement.cs (For.Emit): for infinite loops (test == null)
11578         return whether there is a break inside, not always "true".
11579
11580         * namespace.cs (UsingEntry): New struct to hold the name of the
11581         using definition, the location where it is defined, and whether it
11582         has been used in a successful type lookup.
11583
11584         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11585         strings.
11586
11587         * decl.cs: ditto.
11588
11589 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11590
11591         * attribute.cs : Fix incorrect code which relied on catching
11592         a NullReferenceException to detect a null being passed in
11593         where an object was expected.
11594
11595 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11596
11597         * statement.cs (Try): flag the catch variable as assigned
11598
11599         * expression.cs (Cast): Simplified by using ResolveType instead of
11600         manually resolving.
11601
11602         * statement.cs (Catch): Fix bug by using ResolveType.
11603
11604 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11605
11606         * expression.cs (BetterConversion): Special case for when we have
11607         a NullLiteral as the argument and we have to choose between string
11608         and object types - we choose string the way csc does.
11609
11610         * attribute.cs (Attribute.Resolve): Catch the
11611         NullReferenceException and report error #182 since the Mono
11612         runtime no more has the bug and having this exception raised means
11613         we tried to select a constructor which takes an object and is
11614         passed a null.
11615
11616 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11617
11618         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11619         message (1502, 1503) when we can't locate a method after overload
11620         resolution. This is much more informative and closes the bug
11621         Miguel reported.
11622
11623         * interface.cs (PopulateMethod): Return if there are no argument
11624         types. Fixes a NullReferenceException bug.
11625
11626         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11627         expressions too. Previously we were checking only in one place for
11628         positional arguments leaving out named arguments.
11629
11630         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11631         type to the enum type is not allowed. Remove code corresponding to
11632         that.
11633
11634         (ConvertNumericExplicit): Allow explicit conversions from
11635         the underlying type to enum type. This precisely follows the spec
11636         and closes a bug filed by Gonzalo.
11637
11638 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11639
11640         * compiler.csproj:
11641         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11642
11643 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11644
11645         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11646         it was important that we stored the right value after the
11647         reduction in `converted'.
11648
11649 2002-09-04  Martin Baulig  <martin@gnome.org>
11650
11651         * location.cs (Location.SymbolDocument): Use full pathnames for the
11652         source files.
11653
11654 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11655
11656         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11657         of the expression resolve mechanism, because that will catch the
11658         SimpleName error failures.
11659
11660         (Conditional): If we can not resolve the
11661         expression, return, do not crash.
11662
11663 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11664
11665         * cs-tokenizer.cs:
11666         (location): display token name instead of its number.
11667
11668 2002-08-28  Martin Baulig  <martin@gnome.org>
11669
11670         * expression.cs (Binary.ResolveOperator): Don't silently return
11671         but return an error if an operator cannot be applied between two
11672         enum types.
11673
11674 2002-08-28  Martin Baulig  <martin@gnome.org>
11675
11676         * class.cs (Constructor.Define): Set the permission attributes
11677         correctly instead of making all constructors public.
11678
11679 2002-08-28  Martin Baulig  <martin@gnome.org>
11680
11681         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11682         for private members before reporting a CS0103; if we find anything,
11683         it's a CS0122.
11684
11685 2002-08-28  Martin Baulig  <martin@gnome.org>
11686
11687         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11688         to check whether `closure_start_type == closure_invocation_type',
11689         we also need to check whether `m.DeclaringType == closure_invocation_type'
11690         before bypassing the permission checks.  We might be accessing
11691         protected/private members from the base class.
11692         (TypeManager.RealMemberLookup): Only set private_ok if private
11693         members were requested via BindingFlags.NonPublic.
11694
11695         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11696
11697         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11698         MethodGroupExpr.IsExplicitImpl if appropriate.
11699         (Invocation.DoResolve): Don't report the CS0120 for explicit
11700         interface implementations.
11701
11702 2002-08-27  Martin Baulig  <martin@gnome.org>
11703
11704         * expression.cs (Invocation.DoResolve): If this is a static
11705         method and we don't have an InstanceExpression, we must report
11706         a CS0120.
11707
11708 2002-08-25  Martin Baulig  <martin@gnome.org>
11709
11710         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11711         `==' between a valuetype and an object.
11712
11713 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11714
11715         * ecore.cs (TypeExpr): Provide a ToString method.
11716
11717 2002-08-24  Martin Baulig  <martin@gnome.org>
11718
11719         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11720         now called proggie.dbg and it's a binary file.
11721
11722 2002-08-23  Martin Baulig  <martin@gnome.org>
11723
11724         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11725
11726 2002-08-23  Martin Baulig  <martin@gnome.org>
11727
11728         * struct.cs (MyStructInfo.ctor): Make this work with empty
11729         structs; it's not allowed to use foreach() on null.
11730
11731 2002-08-23  Martin Baulig  <martin@gnome.org>
11732
11733         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11734         writer the full pathname of the generated assembly.
11735
11736 2002-08-23  Martin Baulig  <martin@gnome.org>
11737
11738         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11739         A `finally' block never returns or breaks; improved handling of
11740         unreachable code.
11741
11742 2002-08-23  Martin Baulig  <martin@gnome.org>
11743
11744         * statement.cs (Throw.Resolve): Allow `throw null'.
11745
11746 2002-08-23  Martin Baulig  <martin@gnome.org>
11747
11748         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11749         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11750         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11751         MemberLookup would return a wrong event if this is an explicit
11752         interface implementation and the class has an event with the same
11753         name.
11754
11755 2002-08-23  Martin Baulig  <martin@gnome.org>
11756
11757         * statement.cs (Block.AddChildVariableNames): New public method.
11758         (Block.AddChildVariableName): Likewise.
11759         (Block.IsVariableNameUsedInChildBlock): Likewise.
11760         (Block.AddVariable): Check whether a variable name has already
11761         been used in a child block.
11762
11763         * cs-parser.jay (declare_local_variables): Mark all variable names
11764         from the current block as being used in a child block in the
11765         implicit block.
11766
11767 2002-08-23  Martin Baulig  <martin@gnome.org>
11768
11769         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11770         find the symbol writer.
11771
11772         * driver.cs: csc also allows the arguments to /define being
11773         separated by commas, not only by semicolons.
11774
11775 2002-08-23  Martin Baulig  <martin@gnome.org>
11776
11777         * interface.cs (Interface.GetMembers): Added static check for events.
11778
11779 2002-08-15  Martin Baulig  <martin@gnome.org>
11780
11781         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11782         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11783
11784         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11785         why the MethodData.EmitDestructor() change was necessary.
11786
11787 2002-08-20  Martin Baulig  <martin@gnome.org>
11788
11789         * class.cs (TypeContainer.FindMembers): Added static check for events.
11790
11791         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11792
11793         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11794         use Type.GetEvents(), not Type.FindMembers().
11795
11796 2002-08-20  Martin Baulig  <martin@gnome.org>
11797
11798         * decl.cs (MemberCache): Added a special method cache which will
11799         be used for method-only searched.  This ensures that a method
11800         search will return a MethodInfo with the correct ReflectedType for
11801         inherited methods.      
11802
11803 2002-08-20  Martin Baulig  <martin@gnome.org>
11804
11805         * decl.cs (DeclSpace.FindMembers): Made this public.
11806
11807 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11808
11809         * delegate.cs: fixed build on windows.
11810         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11811
11812 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11813
11814         * ecore.cs (StandardConversionExists): Return a false
11815         if we are trying to convert the void type to anything else
11816         since that is not allowed.
11817
11818         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11819         we flag error 70 in the event an event is trying to be accessed
11820         directly from outside the declaring type.
11821
11822 2002-08-20  Martin Baulig  <martin@gnome.org>
11823
11824         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11825         MemberCache from typemanager.cs to decl.cs.
11826
11827 2002-08-19  Martin Baulig  <martin@gnome.org>
11828
11829         * class.cs (TypeContainer): Implement IMemberContainer.
11830         (TypeContainer.DefineMembers): Create the MemberCache.
11831         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11832         return public members if BindingFlags.Public was given, check
11833         whether members are static.
11834
11835 2002-08-16  Martin Baulig  <martin@gnome.org>
11836
11837         * decl.cs (DeclSpace.Define): Splitted this in Define and
11838         DefineMembers.  DefineMembers is called first and initializes the
11839         MemberCache.
11840
11841         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11842         DefineMembers() on all our DeclSpaces.
11843
11844         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11845         but call DefineMembers() on all nested interfaces.  We call their
11846         Define() in our new Define() function.
11847
11848         * interface.cs (Interface): Implement IMemberContainer.
11849         (Interface.Define): Moved all code except the attribute stuf to
11850         DefineMembers().
11851         (Interface.DefineMembers): Initialize the member cache.
11852
11853         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11854         need this anymore since we can use MemberCache.FindMembers directly.
11855
11856 2002-08-19  Martin Baulig  <martin@gnome.org>
11857
11858         * typemanager.cs (MemberCache): When creating the cache for an
11859         interface type, add all inherited members.
11860         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11861         to `out bool used_cache' and documented it.
11862         (TypeManager.MemberLookup): If we already used the cache in the first
11863         iteration, we don't need to do the interfaces check.
11864
11865 2002-08-19  Martin Baulig  <martin@gnome.org>
11866
11867         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11868         here from IMemberFinder and don't implement this interface anymore.
11869         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11870
11871         * typemanager.cs (IMemberFinder): This interface is now only used by
11872         classes which actually support the member cache.
11873         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11874         since we only put DeclSpaces into this Hashtable.
11875         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11876         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11877
11878 2002-08-16  Martin Baulig  <martin@gnome.org>
11879
11880         * typemanager.cs (ICachingMemberFinder): Removed.
11881         (IMemberFinder.MemberCache): New property.
11882         (TypeManager.FindMembers): Merged this with RealFindMembers().
11883         This function will never be called from TypeManager.MemberLookup()
11884         so we can't use the cache here, just the IMemberFinder.
11885         (TypeManager.MemberLookup_FindMembers): Check whether the
11886         IMemberFinder has a MemberCache and call the cache's FindMembers
11887         function.
11888         (MemberCache): Rewrote larger parts of this yet another time and
11889         cleaned it up a bit.
11890
11891 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11892
11893         * driver.cs (LoadArgs): Support quoting.
11894
11895         (Usage): Show the CSC-like command line arguments.
11896
11897         Improved a few error messages.
11898
11899 2002-08-15  Martin Baulig  <martin@gnome.org>
11900
11901         * typemanager.cs (IMemberContainer.Type): New property.
11902         (IMemberContainer.IsInterface): New property.
11903
11904         The following changes are conditional to BROKEN_RUNTIME, which is
11905         defined at the top of the file.
11906
11907         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11908         class'es members, but add all members from TypeHandle.ObjectType
11909         if we're an interface.
11910         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11911         is the current type.
11912         (MemberCache.CacheEntry.Container): Removed this field.
11913         (TypeHandle.GetMembers): Include inherited members.
11914
11915 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11916
11917         * typemanager.cs: fixed compilation and added a comment on a field that
11918         is never used.
11919
11920 2002-08-15  Martin Baulig  <martin@gnome.org>
11921
11922         * class.cs (ConstructorInitializer.Resolve): In the
11923         Expression.MemberLookup call, use the queried_type as
11924         invocation_type.
11925
11926         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11927         declared' attribute, it's always true.
11928         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11929         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11930         temporary wrapper for FindMembers which tells MemberLookup whether
11931         members from the base classes are included in the return value.
11932         This will go away soon.
11933         (TypeManager.MemberLookup): Use this temporary hack here; once the
11934         new MemberCache is completed, we don't need to do the DeclaredOnly
11935         looping here anymore since the MemberCache will take care of this.
11936         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11937         (MemberCache): When creating the MemberCache for a class, get
11938         members from the current class and all its base classes.
11939         (MemberCache.CacheEntry.Container): New field.  This is a
11940         temporary hack until the Mono runtime is fixed to distinguish
11941         between ReflectedType and DeclaringType.  It allows us to use MCS
11942         with both the MS runtime and the unfixed Mono runtime without
11943         problems and without accecting performance.
11944         (MemberCache.SearchMembers): The DeclaredOnly looping from
11945         TypeManager.MemberLookup is now done here.      
11946
11947 2002-08-14  Martin Baulig  <martin@gnome.org>
11948
11949         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11950         Type.GetFields on dynamic types but get the fields from the
11951         corresponding TypeContainer.
11952         (MyStructInfo.GetStructInfo): Added check for enum types.
11953
11954         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11955         (MemberList.SyncRoot): Implemented.
11956         (TypeManager.FilterWithClosure): No need to check permissions if
11957         closure_start_type == closure_invocation_type, don't crash if
11958         closure_invocation_type is null.
11959
11960 2002-08-13  Martin Baulig  <martin@gnome.org>
11961
11962         Rewrote TypeContainer.FindMembers to use a member cache.  This
11963         gives us a speed increase of about 35% for the self-hosting MCS
11964         build and of about 15-20% for the class libs (both on GNU/Linux).
11965
11966         * report.cs (Timer): New class to get enhanced profiling.  This
11967         whole class is "TIMER" conditional since it remarkably slows down
11968         compilation speed.
11969
11970         * class.cs (MemberList): New class.  This is an IList wrapper
11971         which we're now using instead of passing MemberInfo[]'s around to
11972         avoid copying this array unnecessarily.
11973         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11974         (ICachingMemberFinder, IMemberContainer): New interface.
11975         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11976         has already been checked, otherwise use it for the name comparision.
11977         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11978         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11979         if possible.  Returns a MemberList, not a MemberInfo [].
11980         (TypeHandle): New class, implements IMemberContainer.  We create
11981         one instance of this class per type, it contains a MemberCache
11982         which is used to do the member lookups.
11983         (MemberCache): New class.  Each instance of this class contains
11984         all members of a type and a name-based hash table.
11985         (MemberCache.FindMembers): This is our new member lookup
11986         function.  First, it looks up all members of the requested name in
11987         the hash table.  Then, it walks this list and sorts out all
11988         applicable members and returns them.
11989
11990 2002-08-13  Martin Baulig  <martin@gnome.org>
11991
11992         In addition to a nice code cleanup, this gives us a performance
11993         increase of about 1.4% on GNU/Linux - not much, but it's already
11994         half a second for the self-hosting MCS compilation.
11995
11996         * typemanager.cs (IMemberFinder): New interface.  It is used by
11997         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11998         Enum, Delegate or Interface.
11999         (TypeManager.finder_to_member_finder): New PtrHashtable.
12000         (TypeManager.finder_to_container): Removed.
12001         (TypeManager.finder_to_delegate): Removed.
12002         (TypeManager.finder_to_interface): Removed.
12003         (TypeManager.finder_to_enum): Removed.
12004
12005         * interface.cs (Interface): Implement IMemberFinder.
12006
12007         * delegate.cs (Delegate): Implement IMemberFinder.
12008
12009         * enum.cs (Enum): Implement IMemberFinder.
12010
12011         * class.cs (TypeContainer): Implement IMemberFinder.
12012
12013 2002-08-12  Martin Baulig  <martin@gnome.org>
12014
12015         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12016
12017 2002-08-12  Martin Baulig  <martin@gnome.org>
12018
12019         * ecore.cs (ITypeExpression): New interface for expressions which
12020         resolve to a type.
12021         (TypeExpression): Renamed to TypeLookupExpression.
12022         (Expression.DoResolve): If we're doing a types-only lookup, the
12023         expression must implement the ITypeExpression interface and we
12024         call DoResolveType() on it.
12025         (SimpleName): Implement the new ITypeExpression interface.
12026         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12027         hack, the situation that we're only looking up types can't happen
12028         anymore when this method is called.  Moved the type lookup code to
12029         DoResolveType() and call it.
12030         (SimpleName.DoResolveType): This ITypeExpression interface method
12031         is now doing the types-only lookup.
12032         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12033         (ResolveFlags): Added MaskExprClass.
12034
12035         * expression.cs (MemberAccess): Implement the ITypeExpression
12036         interface.
12037         (MemberAccess.DoResolve): Added support for a types-only lookup
12038         when we're called via ITypeExpression.DoResolveType().
12039         (ComposedCast): Implement the ITypeExpression interface.
12040
12041         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12042         Expression.Resolve() with ResolveFlags.Type instead.
12043
12044 2002-08-12  Martin Baulig  <martin@gnome.org>
12045
12046         * interface.cs (Interface.Define): Apply attributes.
12047
12048         * attribute.cs (Attribute.ApplyAttributes): Added support for
12049         interface attributes.
12050
12051 2002-08-11  Martin Baulig  <martin@gnome.org>
12052
12053         * statement.cs (Block.Emit): Only check the "this" variable if we
12054         do not always throw an exception.
12055
12056         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12057         whether the property has a set accessor.
12058
12059 2002-08-11  Martin Baulig  <martin@gnome.org>
12060
12061         Added control flow analysis support for structs.
12062
12063         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12064         with control flow analysis turned off.
12065         (IVariable): New interface.
12066         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12067         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12068         (FieldExpr.DoResolve): Resolve the instance expression with flow
12069         analysis turned off and do the definite assignment check after the
12070         resolving when we know what the expression will resolve to.
12071
12072         * expression.cs (LocalVariableReference, ParameterReference):
12073         Implement the new IVariable interface, only call the flow analysis
12074         code if ec.DoFlowAnalysis is true.
12075         (This): Added constructor which takes a Block argument.  Implement
12076         the new IVariable interface.
12077         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12078         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12079         This does the definite assignment checks for struct members.
12080
12081         * class.cs (Constructor.Emit): If this is a non-static `struct'
12082         constructor which doesn't have any initializer, call
12083         Block.AddThisVariable() to tell the flow analysis code that all
12084         struct elements must be initialized before control returns from
12085         the constructor.
12086
12087         * statement.cs (MyStructInfo): New public class.
12088         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12089         argument to this indexer.  If non-zero, check an individual struct
12090         member, not the whole struct.
12091         (FlowBranching.CheckOutParameters): Check struct members.
12092         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12093         overloaded versions of these methods which take an additional
12094         `int field_idx' argument to check struct members.
12095         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12096         overloaded versions of these methods which take an additional
12097         `string field_name' argument to check struct member.s
12098         (VariableInfo): Implement the IVariable interface.
12099         (VariableInfo.StructInfo): New public property.  Returns the
12100         MyStructInfo instance of the variable if it's a struct or null.
12101         (Block.AddThisVariable): New public method.  This is called from
12102         Constructor.Emit() for non-static `struct' constructor which do
12103         not have any initializer.  It creates a special variable for the
12104         "this" instance variable which will be checked by the flow
12105         analysis code to ensure that all of the struct's fields are
12106         initialized before control returns from the constructor.
12107         (UsageVector): Added support for struct members.  If a
12108         variable/parameter is a struct with N members, we reserve a slot
12109         in the usage vector for each member.  A struct is considered fully
12110         initialized if either the struct itself (slot 0) or all its
12111         members are initialized.
12112
12113 2002-08-08  Martin Baulig  <martin@gnome.org>
12114
12115         * driver.cs (Driver.MainDriver): Only report an error CS5001
12116         if there were no compilation errors.
12117
12118         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12119         `UnsafeContext' property to determine whether the parent is in
12120         unsafe context rather than checking the parent's ModFlags:
12121         classes nested in an unsafe class are unsafe as well.
12122
12123 2002-08-08  Martin Baulig  <martin@gnome.org>
12124
12125         * statement.cs (UsageVector.MergeChildren): Distinguish between
12126         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12127         we return.  Added test17() and test18() to test-154.cs.
12128
12129 2002-08-08  Martin Baulig  <martin@gnome.org>
12130
12131         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12132         Family access, make sure the invoking type isn't a subclass of the
12133         queried type (that'd be a CS1540).
12134
12135         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12136         this method which takes an additional `Type invocation_type'.
12137
12138         * expression.cs (BaseAccess.DoResolve): Use the base type as
12139         invocation and query type.
12140         (MemberAccess.DoResolve): If the lookup failed and we're about to
12141         report a CS0122, try a lookup with the ec.ContainerType - if this
12142         succeeds, we must report a CS1540.
12143
12144 2002-08-08  Martin Baulig  <martin@gnome.org>
12145
12146         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12147         (MethodGroupExpr): Implement the IMemberExpr interface.
12148
12149         * expression (MemberAccess.ResolveMemberAccess): No need to have
12150         any special code for MethodGroupExprs anymore, they're now
12151         IMemberExprs.   
12152
12153 2002-08-08  Martin Baulig  <martin@gnome.org>
12154
12155         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12156         Family, FamANDAssem and FamORAssem permissions.
12157         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12158
12159 2002-08-08  Martin Baulig  <martin@gnome.org>
12160
12161         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12162         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12163         or loop block.
12164
12165 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12166
12167         * driver.cs: implemented /resource option to embed managed resources.
12168
12169 2002-08-07  Martin Baulig  <martin@gnome.org>
12170
12171         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12172         (FieldBase.HasFieldInitializer): New public property.
12173         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12174         returns the field initializer and makes sure it is only resolved once.
12175         (TypeContainer.EmitFieldInitializers): Call
12176         FieldBase.GetInitializerExpression to get the initializer, this ensures
12177         that it isn't resolved multiple times.
12178
12179         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12180         the resolving process (SimpleName/MemberLookup) that we're currently
12181         emitting a field initializer (which must not access any instance members,
12182         this is an error CS0236).
12183
12184         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12185         argument, if the `IsFieldInitializer' flag is set, we must report and
12186         error CS0236 and not an error CS0120.   
12187
12188 2002-08-07  Martin Baulig  <martin@gnome.org>
12189
12190         * ecore.cs (IMemberExpr): New public interface.
12191         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12192         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12193         if the expression is an IMemberExpr.
12194
12195         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12196         to be null, implicitly default to `this' if we're non-static in
12197         this case.  Simplified the code a lot by using the new IMemberExpr
12198         interface.  Also fixed bug #28176 here.
12199
12200 2002-08-06  Martin Baulig  <martin@gnome.org>
12201
12202         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12203         ParameterReferences during semantic analysis so that we can do a
12204         type-only search when resolving Cast, TypeOf and SizeOf.
12205         (block): Pass the `current_local_parameters' to the Block's
12206         constructor.
12207
12208         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12209         argument to the constructor.
12210         (ConstructorInitializer.Resolve): Create a temporary implicit
12211         block with the parameters.
12212
12213         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12214         references here if we aren't doing a type-only search.
12215
12216         * statement.cs (Block): Added constructor which takes a
12217         `Parameters parameters' argument.
12218         (Block.Parameters): New public property.
12219
12220         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12221         to `Parameters' and made it public readonly.
12222
12223 2002-08-06  Martin Baulig  <martin@gnome.org>
12224
12225         * ecore.cs (Expression.Warning): Made this public as well.
12226
12227         * report.cs (Report.Debug): Print the contents of collections.
12228
12229 2002-08-06  Martin Baulig  <martin@gnome.org>
12230
12231         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12232         used to tell Resolve() which kinds of expressions it may return.
12233         (Expression.Resolve): Added overloaded version of this method which
12234         takes a `ResolveFlags flags' argument.  This can be used to tell
12235         Resolve() which kinds of expressions it may return.  Reports a
12236         CS0118 on error.
12237         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12238         ResolveFlags.SimpleName.
12239         (Expression.Error118): Added overloaded version of this method which
12240         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12241         which kinds of expressions are allowed.
12242
12243         * expression.cs (Argument.ResolveMethodGroup): New public method.
12244         Resolves an argument, but allows a MethodGroup to be returned.
12245         This is used when invoking a delegate.
12246
12247         * TODO: Updated a bit.
12248
12249 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12250
12251         Fixed compilation with csc.
12252
12253         * ecore.cs: Expression.Error made public. Is this correct? Should
12254         Warning be made public too?
12255
12256         * expression.cs: use ea.Location instead of ea.loc.
12257         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12258
12259 2002-08-06  Martin Baulig  <martin@gnome.org>
12260
12261         * ecore.cs (Expression.loc): Moved the location here instead of
12262         duplicating it in all derived classes.
12263         (Expression.Location): New public property.
12264         (Expression.Error, Expression.Warning): Made them non-static and
12265         removed the location argument.
12266         (Expression.Warning): Added overloaded version which takes an
12267         `int level' argument.
12268         (Expression.Error118): Make this non-static and removed the
12269         expression and location arguments.
12270         (TypeExpr): Added location argument to the constructor.
12271
12272         * expression.cs (StaticCallExpr): Added location argument to
12273         the constructor.
12274         (Indirection, PointerArithmetic): Likewise.
12275         (CheckedExpr, UnCheckedExpr): Likewise.
12276         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12277         (StringPtr): Likewise.
12278
12279
12280 2002-08-05  Martin Baulig  <martin@gnome.org>
12281
12282         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12283
12284         * assign.cs (Assign.DoResolve): Check whether the source
12285         expression is a value or variable.
12286
12287         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12288         while resolving the corresponding blocks.
12289
12290         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12291         an error, don't silently return null.
12292
12293         * statement.cs (Block.AddVariable): Do the error reporting here
12294         and distinguish between CS0128 and CS0136.
12295         (Block.DoResolve): Report all unused labels (warning CS0164).
12296         (LabeledStatement): Pass the location to the constructor.
12297         (LabeledStatement.HasBeenReferenced): New property.
12298         (LabeledStatement.Resolve): Set it to true here.
12299
12300         * statement.cs (Return.Emit): Return success even after reporting
12301         a type mismatch error (CS0126 or CS0127), this is what csc does and
12302         it avoids confusing the users with any consecutive errors.
12303
12304 2002-08-05  Martin Baulig  <martin@gnome.org>
12305
12306         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12307
12308         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12309
12310         * expression.cs (MemberAccess.DoResolve): Silently return if an
12311         error has already been reported.
12312
12313         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12314         error has already been reported.
12315
12316 2002-08-05  Martin Baulig  <martin@gnome.org>
12317
12318         * statement.cs (UsageVector): Only initialize the `parameters'
12319         vector if we actually have any "out" parameters.
12320
12321 2002-08-05  Martin Baulig  <martin@gnome.org>
12322
12323         * expression.cs (Binary.ResolveOperator): When combining delegates,
12324         they must have the same type.
12325
12326 2002-08-05  Martin Baulig  <martin@gnome.org>
12327
12328         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12329         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12330         work with the ms runtime and we also don't need it: if we're a
12331         PropertyBuilder and not in the `indexer_arguments' hash, then we
12332         are a property and not an indexer.
12333
12334         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12335         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12336         since the latter one doesn't work with the ms runtime.
12337
12338 2002-08-03  Martin Baulig  <martin@gnome.org>
12339
12340         Fixed bugs #27998 and #22735.
12341
12342         * class.cs (Method.IsOperator): New public field.
12343         (Method.CheckBase): Report CS0111 if there's already a method
12344         with the same parameters in the current class.  Report CS0508 when
12345         attempting to change the return type of an inherited method.
12346         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12347         and it's not marked abstract or extern.
12348         (PropertyBase): New abstract base class for Property and Indexer.
12349         (PropertyBase.CheckBase): Moved here from Property and made it work
12350         for indexers.
12351         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12352         the same so we can reuse it there.
12353         (Property, Indexer): Derive from PropertyBase.
12354         (MethodSignature.inheritable_property_signature_filter): New delegate
12355         to find properties and indexers.
12356
12357         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12358         argument and improved error reporting.
12359
12360         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12361         EmptyReadOnlyParameters and made it a property.
12362
12363         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12364         version of this method which takes a `PropertyInfo indexer'.
12365         (TypeManager.RegisterIndexer): New method.
12366
12367         * class.cs: Added myself as author of this file :-)
12368
12369 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12370
12371         * class.cs: fixed compilation on windoze.
12372
12373 2002-08-03  Martin Baulig  <martin@gnome.org>
12374
12375         * interface.cs (Interface.GetInterfaceBases): Check whether all
12376         base interfaces are at least as accessible than the current one.
12377
12378         * class.cs (TypeContainer.GetClassBases): Check whether base types
12379         are at least as accessible than the current type.
12380         (TypeContainer.AsAccessible): Implemented and made non-static.
12381         (MemberBase.CheckParameters): Report errors if the accessibility
12382         checks fail.
12383
12384         * delegate.cs (Delegate.Delegate): The default visibility is
12385         internal for top-level types and private for nested types.
12386         (Delegate.Define): Report errors if the accessibility checks fail.
12387
12388         * enum.cs (Enum.Enum): The default visibility is internal for
12389         top-level types and private for nested types.
12390         (Enum.DefineType): Compute the correct visibility.
12391
12392         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12393         function which takes a `bool is_toplevel' instead of a TypeContainer.
12394
12395         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12396         builtin type.
12397
12398 2002-08-02  Martin Baulig  <martin@gnome.org>
12399
12400         * expression.cs (LocalVariableReferenc): Added constructor which
12401         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12402         (LocalVariableReference.IsReadOnly): New property.
12403         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12404         variable is readonly, use our own readonly flag to do this; you can
12405         use the new constructor to get a writable reference to a read-only
12406         variable.
12407
12408         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12409         reference to the local variable.
12410
12411 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12412
12413         * rootcontext.cs (ResolveCore): Also include System.Exception
12414
12415         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12416         we reach an EmptyStatement.
12417
12418         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12419         is also fine.
12420
12421         * expression.cs (Binary.ResolveOperator): Check error result in
12422         two places.
12423
12424         use brtrue/brfalse directly and avoid compares to null.
12425
12426 2002-08-02  Martin Baulig  <martin@gnome.org>
12427
12428         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12429         Fixes bug #28407, added test-155.cs.
12430
12431 2002-08-01  Martin Baulig  <martin@gnome.org>
12432
12433         * class.cs (Event.EmitDefaultMethod): Make this work with static
12434         events.  Fixes #28311, added verify-3.cs.
12435
12436 2002-08-01  Martin Baulig  <martin@gnome.org>
12437
12438         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12439         `is_disposable' fields.
12440         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12441         `hm.is_disposable' if we're using the collection pattern.
12442         (Foreach.EmitCollectionForeach): Use the correct type for the
12443         enumerator's local variable, only emit the try/finally block if
12444         necessary (fixes #27713).
12445
12446 2002-08-01  Martin Baulig  <martin@gnome.org>
12447
12448         * ecore.cs (Expression.report118): Renamed to Error118 and made
12449         it public static.
12450
12451         * statement.cs (Throw.Resolve): Check whether the expression is of
12452         the correct type (CS0118) and whether the type derives from
12453         System.Exception (CS0155).
12454         (Catch.Resolve): New method.  Do the type lookup here and check
12455         whether it derives from System.Exception (CS0155).
12456         (Catch.CatchType, Catch.IsGeneral): New public properties.
12457
12458         * typemanager.cs (TypeManager.exception_type): Added.
12459
12460 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12461
12462         * driver.cs: Updated About function.
12463
12464 2002-07-31  Martin Baulig  <martin@gnome.org>
12465
12466         Implemented Control Flow Analysis.
12467
12468         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12469         (EmitContext.CurrentBranching): Added.
12470         (EmitContext.StartFlowBranching): Added.
12471         (EmitContext.EndFlowBranching): Added.
12472         (EmitContext.KillFlowBranching): Added.
12473         (EmitContext.IsVariableAssigned): Added.
12474         (EmitContext.SetVariableAssigned): Added.
12475         (EmitContext.IsParameterAssigned): Added.
12476         (EmitContext.SetParameterAssigned): Added.
12477         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12478         Added control flow analysis stuff here.
12479
12480         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12481         resolve the expression as lvalue.
12482         (LocalVariableReference.DoResolve): Check whether the variable has
12483         already been assigned.
12484         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12485         the parameter as assigned here.
12486         (ParameterReference.DoResolve): Check whether the parameter has already
12487         been assigned.
12488         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12489         expression as lvalue.
12490
12491         * statement.cs (FlowBranching): New class for the flow analysis code.
12492         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12493         (LabeledStatement.IsDefined): New public property.
12494         (LabeledStatement.AddUsageVector): New public method to tell flow
12495         analyis that the label may be reached via a forward jump.
12496         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12497         flow analysis.
12498         (VariableInfo.Number): New public field.  This is used by flow analysis
12499         to number all locals of a block.
12500         (Block.CountVariables): New public property.  This is the number of
12501         local variables in this block (including the locals from all parent
12502         blocks).
12503         (Block.EmitMeta): Number all the variables.
12504
12505         * statement.cs: Added flow analysis support to all classes.
12506
12507 2002-07-31  Martin Baulig  <martin@gnome.org>
12508
12509         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12510         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12511         then use this argument.
12512
12513         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12514
12515         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12516         use this to specify /define options.
12517
12518 2002-07-29  Martin Baulig  <martin@gnome.org>
12519
12520         * statement.cs (Fixed): Moved all code that does variable lookups
12521         and resolvings from Emit to Resolve.
12522
12523         * statement.cs (For): Moved all code that does variable lookups
12524         and resolvings from Emit to Resolve.
12525
12526         * statement.cs (Using): Moved all code that does variable lookups
12527         and resolvings from Emit to Resolve.
12528
12529 2002-07-29  Martin Baulig  <martin@gnome.org>
12530
12531         * attribute.cs (Attribute.Resolve): Explicitly catch a
12532         System.NullReferenceException when creating the
12533         CustromAttributeBuilder and report a different warning message.
12534
12535 2002-07-29  Martin Baulig  <martin@gnome.org>
12536
12537         * support.cs (ParameterData.ParameterName): Added method to
12538         get the name of a parameter.
12539
12540         * typemanager.cs (TypeManager.IsValueType): New public method.
12541
12542 2002-07-29  Martin Baulig  <martin@gnome.org>
12543
12544         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12545         is a flag which specifies that it's either ref or out.
12546         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12547         the out parameter to `out Parameter.Modifier mod', also set the
12548         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12549
12550         * support.cs (InternalParameters.ParameterModifier): Distinguish
12551         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12552         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12553
12554         * expression.cs (Argument.GetParameterModifier): Distinguish
12555         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12556         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12557
12558 2002-07-29  Martin Baulig  <martin@gnome.org>
12559
12560         * expression.cs (ParameterReference.ParameterReference): Added
12561         `Location loc' argument to the constructor.
12562
12563         * cs-parser.jay: Pass location to ParameterReference.
12564
12565 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12566
12567         * statement.cs (Try): Initialize the location.
12568
12569         * cs-parser.jay: pass location to Try.
12570
12571         * expression.cs (Unary.Reduce): Change the prototype to return
12572         whether a constant fold could be performed or not.  The result is
12573         returned in an out parameters.  In the case of Indirection and
12574         AddressOf, we want to perform the full tests.
12575
12576 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12577
12578         * statement.cs (Statement.Emit): Flag dead code.
12579
12580 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12581
12582         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12583
12584 2002-07-27  Martin Baulig  <martin@gnome.org>
12585
12586         * class.cs (MethodData.Define): Put back call to
12587         TypeManager.AddMethod(), accidentally commented this out.
12588
12589         * report.cs (Debug): New public method to print debugging information,
12590         this is `[Conditional ("DEBUG")]'.
12591
12592 2002-07-26  Martin Baulig  <martin@gnome.org>
12593
12594         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12595         (switch_statement): Push the current_block to the switch_stack and
12596         pop it again when we're done with the switch.
12597         (switch_section): The new block is a child of the current_block.
12598         Fixes bug #24007, added test-152.cs.
12599
12600 2002-07-27  Martin Baulig  <martin@gnome.org>
12601
12602         * expression.cs (Invocation.EmitArguments): When calling a varargs
12603         function with only its fixed arguments, we need to pass an empty
12604         array.
12605
12606 2002-07-27  Martin Baulig  <martin@gnome.org>
12607
12608         Mono 0.13 has been released.
12609
12610 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12611
12612         * driver.cs: Rename --resource to --linkres, because that is what
12613         we do currently, we dont support --resource yet.
12614
12615         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12616
12617 2002-07-25  Martin Baulig  <martin@gnome.org>
12618
12619         * class.cs (MethodData): New public class.  This is a `method builder'
12620         class for a method or one accessor of a Property/Indexer/Event.
12621         (MethodData.GetMethodFlags): Moved here from MemberBase.
12622         (MethodData.ApplyAttributes): Likewise.
12623         (MethodData.ApplyObsoleteAttribute): Likewise.
12624         (MethodData.ApplyConditionalAttribute): Likewise.
12625         (MethodData.ApplyDllImportAttribute): Likewise.
12626         (MethodData.CheckAbstractAndExternal): Likewise.
12627         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12628         (MethodData.Emit): Formerly known as Method.Emit().
12629         (MemberBase): Moved everything which was specific to a single
12630         accessor/method to MethodData.
12631         (Method): Create a new MethodData and call Define() and Emit() on it.
12632         (Property, Indexer, Event): Create a new MethodData objects for each
12633         accessor and call Define() and Emit() on them.
12634
12635 2002-07-25  Martin Baulig  <martin@gnome.org>
12636
12637         Made MethodCore derive from MemberBase to reuse the code from there.
12638         MemberBase now also checks for attributes.
12639
12640         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12641         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12642         as virtual.
12643         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12644         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12645         (MemberBase.ApplyAttributes): New virtual method; applies the
12646         attributes to a method or accessor.
12647         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12648         (MemberBase.ApplyConditionalAttribute): Likewise.
12649         (MemberBase.ApplyDllImportAttribute): Likewise.
12650         (MemberBase.CheckAbstractAndExternal): Likewise.
12651         (MethodCore.ParameterTypes): This is now a property instead of a
12652         method, it's initialized from DoDefineParameters().
12653         (MethodCore.ParameterInfo): Removed the set accessor.
12654         (MethodCore.DoDefineParameters): New protected virtual method to
12655         initialize ParameterTypes and ParameterInfo.
12656         (Method.GetReturnType): We can now simply return the MemberType.
12657         (Method.GetMethodFlags): Override the MemberBase version and add
12658         the conditional flags.
12659         (Method.CheckBase): Moved some code from Define() here, call
12660         DoDefineParameters() here.
12661         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12662         here to avoid some larger code duplication.
12663         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12664         ensure that abstract and external accessors don't declare a body.
12665
12666         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12667         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12668         lookup in the attribute's parent classes, so we need to abort as soon
12669         as we found the first match.
12670         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12671         the attribute has no arguments.
12672
12673         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12674         of a Method.
12675
12676 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12677
12678         * cs-parser.jay: reverted previous patch.
12679
12680 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12681
12682         * cs-parser.jay: fixed bug #22119.
12683
12684 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12685
12686         * attribute.cs: fixed compilation. The error was:
12687         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12688         be assigned to before control leaves the current method."
12689         [FIXME:  Filed as bug #28186: MCS must report this error.]
12690
12691 2002-07-25  Martin Baulig  <martin@gnome.org>
12692
12693         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12694         method to pull the condition name ouf of a Conditional attribute.
12695         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12696         the obsolete message and error flag out of an Obsolete attribute.
12697
12698         * class.cs (Method.GetMethodFlags): New public method to get the
12699         TypeManager.MethodFlags for this method.
12700         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12701         private methods.
12702         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12703         if we're overriding a virtual function, set the new private variable
12704         `parent_method'; call the new TypeManager.AddMethod().
12705
12706         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12707         the MethodBuilder and the Method in a PtrHashtable.
12708         (TypeManager.builder_to_method): Added for this purpose.
12709         (TypeManager.MethodFlags): Added IsObsoleteError.
12710         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12711         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12712         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12713         the message from the attribute.
12714
12715 2002-07-24  Martin Baulig  <martin@gnome.org>
12716
12717         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12718         preprocessor directives, ensure that the argument to #define/#undef is
12719         exactly one identifier and that it's actually an identifier.
12720
12721         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12722         did not work ....
12723
12724 2002-07-24  Martin Baulig  <martin@gnome.org>
12725
12726         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12727         initialize it to TypeManager.object_type in the constructor.
12728         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12729         of the `hm.get_current' method if we're using the collection pattern.
12730         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12731         for the explicit conversion to make it work when we're using the collection
12732         pattern and the `Current' property has a different return type than `object'.
12733         Fixes #27713.
12734
12735 2002-07-24  Martin Baulig  <martin@gnome.org>
12736
12737         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12738         does not match, but don't report any errors.  This method is called in
12739         order for all methods in a MethodGroupExpr until a matching method is
12740         found, so we don't want to bail out if the first method doesn't match.
12741         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12742         matches, report the 123.  Fixes #28070.
12743
12744 2002-07-24  Martin Baulig  <martin@gnome.org>
12745
12746         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12747         TypeManager.TypeToCoreType() to the top of the method so the
12748         following equality checks will work.  Fixes #28107.
12749
12750 2002-07-24  Martin Baulig  <martin@gnome.org>
12751
12752         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12753         operand is of type uint, and the other operand is of type sbyte,
12754         short or int, the operands are converted to type long." -
12755         Actually do what this comment already told us.  Fixes bug #28106,
12756         added test-150.cs.
12757
12758 2002-07-24  Martin Baulig  <martin@gnome.org>
12759
12760         * class.cs (MethodBase): New abstract class.  This is now a base
12761         class for Property, Indexer and Event to avoid some code duplication
12762         in their Define() and DefineMethods() methods.
12763         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12764         generic methods for Define() and DefineMethods().
12765         (FieldBase): Derive from MemberBase, not MemberCore.
12766         (Property): Derive from MemberBase, not MemberCore.
12767         (Property.DefineMethod): Moved all the code from this method to the
12768         new MethodBase.DefineAccessor(), just call it with appropriate
12769         argumetnts.
12770         (Property.Define): Call the new Property.DoDefine(), this does some
12771         sanity checks and we don't need to duplicate the code everywhere.
12772         (Event): Derive from MemberBase, not MemberCore.
12773         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12774         accessors, this will also make them work with interface events.
12775         (Indexer): Derive from MemberBase, not MemberCore.
12776         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12777         (Indexer.Define): Use the new MethodBase functions.
12778
12779         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12780         argument to the constructor.
12781         (Interface.FindMembers): Added support for interface events.
12782         (Interface.PopluateEvent): Implemented.
12783
12784         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12785
12786 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12787
12788         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12789         but this is required to check for a method name being the same as
12790         the containing class.  
12791
12792         Handle this now.
12793
12794 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12795
12796         * interface.cs: initialize variable.
12797
12798 2002-07-23  Martin Baulig  <martin@gnome.org>
12799
12800         Implemented the IndexerName attribute in interfaces.
12801
12802         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12803         name if this is an explicit interface implementation.
12804         (Indexer.InterfaceIndexerName): New public variable.  If we're
12805         implementing an interface indexer, this is the IndexerName in that
12806         interface.  Otherwise, it's the IndexerName.
12807         (Indexer.DefineMethod): If we're implementing interface indexer,
12808         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12809         and Pending.ImplementIndexer methods.
12810         (Indexer.Define): Also define the PropertyBuilder if we're
12811         implementing an interface indexer and this is neither an explicit
12812         interface implementation nor do the IndexerName match the one in
12813         the interface.
12814
12815         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12816         If a method is defined here, then we always need to create a proxy
12817         for it.  This is used when implementing interface indexers.
12818         (Pending.IsInterfaceIndexer): New public method.
12819         (Pending.ImplementIndexer): New public method.
12820         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12821         This is used when implementing interface indexers to define a proxy
12822         if necessary.
12823         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12824         define a proxy if necessary.
12825
12826         * interface.cs (Interface.IndexerName): New public variable.
12827         (Interface.PopulateIndexer): Set the IndexerName.
12828         (Interface.DefineIndexers): New private method.  Populate all the
12829         indexers and make sure their IndexerNames match.
12830
12831         * typemanager.cs (IndexerPropertyName): Added support for interface
12832         indexers.
12833
12834 2002-07-22  Martin Baulig  <martin@gnome.org>
12835
12836         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12837         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12838         ret if HasReturnLabel.
12839         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12840         variables.
12841
12842         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12843         and set the ec.LoopBeginTryCatchLevel.
12844         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12845         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12846         the current ec.TryCatchLevel, the branch goes out of an exception
12847         block.  In this case, we need to use Leave and not Br.
12848
12849 2002-07-22  Martin Baulig  <martin@gnome.org>
12850
12851         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12852         block unless the block does not always return or it is contained in
12853         another try { ... } catch { ... } block.  Fixes bug #26506.
12854         Added verify-1.cs to the test suite.
12855
12856 2002-07-22  Martin Baulig  <martin@gnome.org>
12857
12858         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12859         then we do not always return.  Fixes bug #24985.
12860
12861 2002-07-22  Martin Baulig  <martin@gnome.org>
12862
12863         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12864         lookup on a per-class level; ie. walk up the class hierarchy until we
12865         found at least one applicable method, then choose the best among them.
12866         Fixes bug #24463 and test-29.cs.
12867
12868 2002-07-22  Martin Baulig  <martin@gnome.org>
12869
12870         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12871         return types of the methods.  The return type is not part of the
12872         signature and we must not check it to make the `new' modifier work.
12873         Fixes bug #27999, also added test-147.cs.
12874         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12875
12876         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12877         on the method's return type.
12878
12879 2002-07-21  Martin Baulig  <martin@gnome.org>
12880
12881         * assign.cs: Make this work if the rightmost source is a constant and
12882         we need to do an implicit type conversion.  Also adding a few more tests
12883         to test-38.cs which should have caught this.
12884
12885         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12886         target in the makefile for this.  The makefile.gnu is primarily intended
12887         for end-users who don't want to debug the compiler.
12888
12889 2002-07-21  Martin Baulig  <martin@gnome.org>
12890
12891         * assign.cs: Improved the Assign class so it can now handle embedded
12892         assignments (X = Y = Z = something).  As a side-effect this'll now also
12893         consume less local variables.  test-38.cs now passes with MCS, added
12894         a few new test cases to that test.
12895
12896 2002-07-20  Martin Baulig  <martin@gnome.org>
12897
12898         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12899         instructions.  Fixes bug #27977, also added test-146.cs.
12900
12901 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12902
12903         * cs-tokenizer.cs: fixed getHex ().
12904
12905 2002-07-19  Martin Baulig  <martin@gnome.org>
12906
12907         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12908         not Type.GetType() to lookup the array type.  This is needed when
12909         we're constructing an array of a user-defined type.
12910         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12911         single-dimensional arrays, but also for single-dimensial arrays of
12912         type decimal.
12913
12914 2002-07-19  Martin Baulig  <martin@gnome.org>
12915
12916         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12917         this function is called, it's not allowed to share LocalBuilders
12918         among ILGenerators.
12919
12920 2002-07-19  Martin Baulig  <martin@gnome.org>
12921
12922         * expression.cs (Argument.Resolve): Report an error 118 when trying
12923         to pass a type as argument.
12924
12925 2002-07-18  Martin Baulig  <martin@gnome.org>
12926
12927         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12928         Conv_R_Un for the signed `long' type.
12929
12930 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12931
12932         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12933         `expr' for the temporary result, as that will fail if we do
12934         multiple resolves on the same expression.
12935
12936 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12937
12938         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12939         ec.TypeContainer for looking up aliases. 
12940
12941         * class.cs (TypeContainer): Remove LookupAlias from here.
12942
12943         * decl.cs (DeclSpace); Move here.
12944
12945 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12946
12947         * class.cs (FindMembers): Only call filter if the constructor
12948         bulider is not null.
12949
12950         Also handle delegates in `NestedTypes' now.  Now we will perform
12951         type lookups using the standard resolution process.  This also
12952         fixes a bug.
12953
12954         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12955         This uses Expressions (the limited kind that can be parsed by the
12956         tree) instead of strings.
12957
12958         * expression.cs (ComposedCast.ToString): Implement, used to flag
12959         errors since now we have to render expressions.
12960
12961         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12962         FormArrayType. 
12963
12964         * ecore.cs (SimpleName.ToString): ditto.
12965
12966         * cs-parser.jay: Instead of using strings to assemble types, use
12967         Expressions to assemble the type (using SimpleName, ComposedCast,
12968         MemberAccess).  This should fix the type lookups in declarations,
12969         because we were using a different code path for this.
12970
12971         * statement.cs (Block.Resolve): Continue processing statements
12972         even when there is an error.
12973
12974 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12975
12976         * class.cs (Event.Define): Also remove the `remove' method from
12977         the list of pending items.
12978
12979         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12980         generate more compact code. 
12981
12982 2002-07-17  Martin Baulig  <martin@gnome.org>
12983
12984         * const.cs (Const.LookupConstantValue): Add support for constant
12985         `unchecked' and `checked' expressions.
12986         Also adding test case test-140.cs for this.
12987
12988 2002-07-17  Martin Baulig  <martin@gnome.org>
12989
12990         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12991         check whether mi.ReturnType implements the IEnumerator interface; the
12992         `==' and the IsAssignableFrom() will fail in this situation.
12993
12994 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12995
12996         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12997         here too.
12998
12999 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13000
13001         * expression.cs: fixed bug #27811.
13002
13003 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13004
13005         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13006         Molaro: when we are a ref, the value already contains a pointer
13007         value, do not take the address of it.
13008
13009 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13010         * removed mb-parser.jay and mb-tokenizer.cs
13011
13012 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13013
13014         * expression.cs: check against the building corlib void type.
13015
13016 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13017
13018         * ecore.cs: fix for valuetype static readonly fields: when 
13019         initializing them, we need their address, not the address of a copy.
13020
13021 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13022
13023         * typemanager.cs: register also enum_type in corlib.
13024
13025 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13026
13027         * class.cs: allow calling this (but not base) initializers in structs.
13028
13029 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13030
13031         * ecore.cs: make sure we compare against the building base types
13032         in GetTypeSize ().
13033
13034 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13035
13036         * typemanager.cs: fix TypeToCoreType() to handle void and object
13037         (corlib gets no more typerefs after this change).
13038
13039 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13040
13041         * expression.cs (ArrayCreation.EmitArrayArguments): use
13042         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13043
13044         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13045         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13046         array indexes, the runtime actually forbids them.
13047
13048         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13049         for array arguments here.
13050
13051         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13052         instead of the default for ValueTypes.
13053
13054         (New.DoEmit): Use IsValueType instead of
13055         IsSubclassOf (value_type)
13056         (New.DoResolve): ditto.
13057         (Invocation.EmitCall): ditto.
13058
13059         * assign.cs (Assign): ditto.
13060
13061         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13062         Statements *are* currently doing part of their resolution during
13063         Emit.  
13064
13065         Expressions do always resolve during resolve, but statements are
13066         only required to propagate resolution to their children.
13067
13068 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13069
13070         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13071
13072         (LoadAssembly): Do not add the dll if it is already specified
13073
13074         (MainDriver): Add the System directory to the link path at the end,
13075         after all the other -L arguments. 
13076
13077         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13078         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13079         ldelem.u1) and using the opposite for sbytes.
13080
13081         This fixes Digger, and we can finally run it.
13082
13083         * driver.cs (UnixParseOption): Move the option parsing here.  
13084         (CSCParseOption): Implement CSC-like parsing of options.
13085
13086         We now support both modes of operation, the old Unix way, and the
13087         new CSC-like way.  This should help those who wanted to make cross
13088         platform makefiles.
13089
13090         The only thing broken is that /r:, /reference: and /lib: are not
13091         implemented, because I want to make those have the same semantics
13092         as the CSC compiler has, and kill once and for all the confussion
13093         around this.   Will be doing this tomorrow.
13094
13095         * statement.cs (Unsafe.Resolve): The state is checked during
13096         resolve, not emit, so we have to set the flags for IsUnsfe here.
13097
13098 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13099
13100         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13101         not catch the Error_ObjectRefRequired in SimpleName (as it is
13102         possible to have a class/instance variable name that later gets
13103         deambiguated), we have to check this here.      
13104
13105 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13106
13107         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13108         make static and put into Expression.
13109
13110         (Event.Define): Register the private field of the event with the 
13111         TypeManager so that GetFieldFromEvent can get at it.
13112
13113         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13114         keep track of the private field associated with an event which
13115         has no accessors.
13116
13117         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13118         private field.
13119
13120         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13121
13122 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13123
13124         * expression.cs (Binary.EmitBranchable): this routine emits the
13125         Binary expression in a branchable context.  This basically means:
13126         we need to branch somewhere, not just get the value on the stack.
13127
13128         This works together with Statement.EmitBoolExpression.
13129
13130         * statement.cs (Statement.EmitBoolExpression): Use
13131         EmitBranchable. 
13132
13133 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13134
13135         * statement.cs (For): Reduce the number of jumps in loops.
13136
13137         (For): Implement loop inversion for the For statement.
13138
13139         (Break): We can be breaking out of a Try/Catch controlled section
13140         (foreach might have an implicit try/catch clause), so we need to
13141         use Leave instead of Br.
13142
13143         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13144         now).  If the instace expression supports IMemoryLocation, we use
13145         the AddressOf method from the IMemoryLocation to extract the
13146         address instead of emitting the instance.
13147
13148         This showed up with `This', as we were emitting the instance
13149         always (Emit) instead of the Address of This.  Particularly
13150         interesting when This is a value type, as we dont want the Emit
13151         effect (which was to load the object).
13152
13153 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13154
13155         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13156
13157         * statement.cs (Checked): Set the CheckedState during the resolve
13158         process too, as the ConvCast operations track the checked state on
13159         the resolve process, and not emit.
13160
13161         * cs-parser.jay (namespace_member_declaration): Flag that we have
13162         found a declaration when we do.  This is used to flag error 1529
13163
13164         * driver.cs: Report ok when we display the help only.
13165
13166 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13167
13168         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13169
13170 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13171
13172         * cs-tokenizer.cs (define): We also have to track locally the
13173         defines.  AllDefines is just used for the Conditional Attribute,
13174         but we also need the local defines for the current source code. 
13175
13176 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13177
13178         * statement.cs (While, For, Do): These loops can exit through a
13179         Break statement, use this information to tell whether the
13180         statement is the last piece of code.
13181
13182         (Break): Flag that we break.
13183
13184         * codegen.cs (EmitContexts): New `Breaks' state variable.
13185
13186 2002-07-03  Martin Baulig  <martin@gnome.org>
13187
13188         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13189         modifiers in method declarations in structs.  Otherwise, you won't
13190         be able to override things like Object.Equals().
13191
13192 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13193
13194         * class.cs (Method, Property, Indexer): Do not allow the public
13195         modifier to be used in explicit interface implementations.
13196
13197         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13198         override modifiers in method declarations in structs
13199
13200 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13201
13202         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13203         integer or real overflow, report an error
13204
13205 2002-07-02  Martin Baulig  <martin@gnome.org>
13206
13207         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13208         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13209         to tell the runtime about our newly created System.Object and
13210         System.ValueType types.
13211
13212 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13213
13214         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13215         struct instead of Ldarg/Starg.
13216
13217 2002-07-02  Martin Baulig  <martin@gnome.org>
13218
13219         * expression.cs (Indirection.Indirection): Call
13220         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13221
13222 2002-07-02  Martin Baulig  <martin@gnome.org>
13223
13224         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13225         ValueType, call TypeManager.TypeToCoreType() on it.
13226         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13227         the OpCodes.Newarr argument.
13228
13229 2002-07-02  Martin Baulig  <martin@gnome.org>
13230
13231         * expression.cs (Invocation.EmitCall): When compiling corlib,
13232         replace all calls to the system's System.Array type to calls to
13233         the newly created one.
13234
13235         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13236         System.Array methods.
13237         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13238         from the system's System.Array type which must be replaced.
13239
13240 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13241
13242         * typemanager.cs: load unverifiable_code_ctor so we can build
13243         corlib using the correct type. Avoid using GetTypeCode() with
13244         TypeBuilders.
13245         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13246         TypeManager.object_type to allow building corlib.
13247
13248 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13249
13250         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13251
13252 2002-07-01  Martin Baulig  <martin@gnome.org>
13253
13254         * class.cs: Make the last change actually work, we need to check
13255         whether `ifaces != null' to avoid a crash.
13256
13257 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13258
13259         * class.cs: when we build structs without fields that implement
13260         interfaces, we need to add the interfaces separately, since there is
13261         no API to both set the size and add the interfaces at type creation
13262         time.
13263
13264 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13265
13266         * expression.cs: the dimension arguments to the array constructors
13267         need to be converted if they are a long.
13268
13269 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13270
13271         * class.cs: don't emit ldarg.0 if there is no parent constructor
13272         (fixes showstopper for corlib).
13273
13274 2002-06-29  Martin Baulig  <martin@gnome.org>
13275
13276         MCS now compiles corlib on GNU/Linux :-)
13277
13278         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13279         ie. check for MethodImplOptions.InternalCall.
13280
13281         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13282         and TypeManager.attribute_type are null, so we must explicitly check
13283         whether parent is not null to find out whether it's an attribute type.
13284         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13285         and SetBuilder, not only if the property is neither abstract nor external.
13286         This is necessary to set the MethodImplOptions on the accessor methods.
13287         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13288         SetBuilder, see Property.Emit().
13289
13290         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13291         populate "System.Object", "System.ValueType" and "System.Attribute" since
13292         they've already been populated from BootCorlib_PopulateCoreTypes().
13293
13294 2002-06-29  Martin Baulig  <martin@gnome.org>
13295
13296         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13297         is the NullLiteral, we also need to make sure that target_type is not
13298         an enum type.   
13299
13300 2002-06-29  Martin Baulig  <martin@gnome.org>
13301
13302         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13303         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13304         before calling BootstrapCorlib_ResolveDelegate ().
13305
13306 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13307
13308         * statement.cs: fixed build-breaker. All tests passed ok.
13309
13310 2002-06-27  Martin Baulig  <martin@gnome.org>
13311
13312         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13313         for System.Decimal when compiling corlib.
13314
13315 2002-06-27  Martin Baulig  <martin@gnome.org>
13316
13317         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13318         switch blocks which contain nothing but a default clause.
13319
13320 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13321
13322        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13323
13324 2002-06-27  Martin Baulig  <martin@gnome.org>
13325
13326         * ecore.cs (PropertyExpr.PropertyExpr): Call
13327         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13328
13329         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13330         is already a TypeBuilder.
13331
13332 2002-06-27  Martin Baulig  <martin@gnome.org>
13333
13334         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13335         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13336         the "from an array-type to System.Array" case.  This makes it work
13337         when compiling corlib.
13338
13339 2002-06-27  Martin Baulig  <martin@gnome.org>
13340
13341         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13342         non-static PropertyExpr, set its InstanceExpression.  This makes
13343         the `ICollection.Count' property work in System/Array.cs.
13344
13345 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13346
13347         * driver.cs: Made error handling more consistent.  Errors now
13348         tracked by Report class, so many methods which used to return int
13349         now return void.  Main() now prints success/failure and 
13350         errors/warnings message.
13351
13352         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13353         the magic number return values (123 and 124).  Now, if the
13354         expected error occurs, the compiler exits with success (exit value
13355         0).  If the compilation completes without seeing that particular
13356         error, the compiler exits with failure (exit value 1).  The
13357         makefile in mcs/errors has been changed to handle the new behaviour.
13358
13359         * report.cs: Made 'expected error' number a property and renamed
13360         it from 'Probe' to 'ExpectedError'.
13361
13362         * genericparser.cs: Removed error handling support, since it is
13363         now all done by Report class.
13364
13365         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13366         class, so parse() no longer returns an int.
13367
13368         * namespace.cs: Use Report.Error instead of GenericParser.error
13369
13370 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13371
13372         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13373         TypeContainer.AddOperator): At the front of the list put the
13374         explicit implementations, so they get resolved/defined first. 
13375
13376 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13377
13378         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13379         interface type is implemented by this TypeContainer.  Used during
13380         explicit interface implementation.
13381
13382         (Property.Define, Indexer.Define, Method.Define): Validate that
13383         the given interface in the explicit implementation is one of the
13384         base classes for the containing type.
13385
13386         Also if we are explicitly implementing an interface, but there is
13387         no match in the pending implementation table, report an error.
13388
13389         (Property.Define): Only define the property if we are
13390         not explicitly implementing a property from an interface.  Use the
13391         correct name also for those properties (the same CSC uses,
13392         although that is really not needed).
13393
13394         (Property.Emit): Do not emit attributes for explicitly implemented
13395         properties, as there is no TypeBuilder.
13396
13397         (Indexer.Emit): ditto.
13398
13399         Hiding then means that we do not really *implement* a pending
13400         implementation, which makes code fail.
13401
13402 2002-06-22  Martin Baulig  <martin@gnome.org>
13403
13404         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13405         the return value of Object.GetType().  [FIXME: we need to do this whenever
13406         we get a type back from the reflection library].
13407
13408 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13409
13410         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13411
13412 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13413
13414         * attribute.cs: Return null if we can not look up the type.
13415
13416         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13417         the interface types found.
13418
13419         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13420         interface types found.
13421
13422         * typemanager.cs (GetInterfaces): Make this routine returns alll
13423         the interfaces and work around the lame differences between
13424         System.Type and System.Reflection.Emit.TypeBuilder in the results
13425         result for GetInterfaces.
13426
13427         (ExpandInterfaces): Given an array of interface types, expand and
13428         eliminate repeated ocurrences of an interface.  This expands in
13429         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13430         be IA, IB, IC.
13431
13432 2002-06-21  Martin Baulig  <martin@gnome.org>
13433
13434         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13435         on System.Enum.
13436
13437 2002-06-21  Martin Baulig  <martin@gnome.org>
13438
13439         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13440         and called with one of the core types, return the corresponding typebuilder for
13441         that type.
13442
13443         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13444         element type.
13445
13446 2002-06-21  Martin Baulig  <martin@gnome.org>
13447
13448         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13449         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13450         (Expression.ConvertReferenceExplicit): Likewise.
13451
13452         * expression.cs (ElementAccess.DoResolve): Likewise.
13453         (ElementAccess.DoResolveLValue): Likewise.
13454
13455 2002-06-10  Martin Baulig  <martin@gnome.org>
13456
13457         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13458         add the "value" parameter to the parameter list.
13459
13460         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13461         to our caller.
13462
13463 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13464
13465         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13466         the argument to an int, uint, long or ulong, per the spec.  Also
13467         catch negative constants in array creation.
13468
13469 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13470
13471         * class.cs: do not allow the same interface to appear twice in
13472         the definition list.
13473
13474 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13475
13476         * ecore.cs: don't use ldlen with System.Array.
13477
13478 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13479
13480         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13481
13482 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13483
13484         * modifiers.cs: produce correct field attributes for protected
13485         internal. Easy fix so miguel can work on ther harder stuff:-)
13486
13487 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13488
13489         * pending.cs: New file.  Move the code from class.cs here.
13490         Support clearning the pending flag for all methods (when not doing
13491         explicit interface implementation).
13492
13493 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13494
13495         * rootcontext.cs: added a couple more types needed to bootstrap.
13496
13497 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13498
13499         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13500         constructor in the type, instead of any constructor in the type
13501         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13502         a bug in the Mono runtime when applying the params attribute). 
13503
13504 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13505         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13506
13507 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13508
13509         * expression.cs (Unary.ResolveOperator): Use TypeManager
13510         to resolve the type.
13511
13512 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13513
13514         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13515         attached.
13516
13517         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13518         with each member too.
13519
13520         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13521         field builders too - this takes care of the enum member case.
13522
13523 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13524
13525         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13526         address-of operator on both value types and pointers.
13527
13528 2002-06-10  Martin Baulig  <martin@gnome.org>
13529
13530         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13531         PropertyBuilder to the `property_builders' list.
13532
13533         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13534         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13535         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13536         find any indexers which are inherited from an interface.
13537
13538 2002-06-09  Martin Baulig  <martin@gnome.org>
13539
13540         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13541         the same type as the constant if necessary.  There's also a test-130.cs
13542         for this.
13543
13544         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13545
13546         * typemanager.cs (TypeManager.ChangeType): Previously known as
13547         Enum.ChangeEnumType().
13548
13549 2002-06-09  Martin Baulig  <martin@gnome.org>
13550
13551         * expression.cs (Cast.TryReduce): Added support for consts.
13552
13553 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13554
13555         * class.cs (Accessor): Hold attributes information so we can pass
13556         it along.
13557
13558         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13559         Modify to pass in attributes attached to the methods.
13560
13561         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13562
13563         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13564         to handle the Accessor kind :-)
13565
13566         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13567
13568 2002-06-08  Martin Baulig  <martin@gnome.org>
13569
13570         * expression.cs (Unary.TryReduceNegative): Added support for
13571         ULongConstants.
13572
13573 2002-06-08  Martin Baulig  <martin@gnome.org>
13574
13575         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13576         name can't be found in the `defined_names' - the caller will do a
13577         MemberLookup in this case and thus find methods in System.Enum
13578         such as Enum.IsDefined().
13579
13580 2002-06-08  Martin Baulig  <martin@gnome.org>
13581
13582         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13583         Convert.ChangeType() which works with TypeBuilder created types.
13584         (Enum.LookupEnumValue, Enum.Define): Use it here.
13585
13586         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13587         `TypeBuilder.BaseType != null' check.
13588         (TypeContainer.FindMembers): Only lookup parent members if we
13589         actually have a parent.
13590         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13591         (ConstructorInitializer.Resolve): Likewise.
13592
13593         * interface.cs (Interface.FindMembers): Added
13594         `TypeBuilder.BaseType != null' check.
13595
13596         * rootcontext.cs (RootContext.ResolveCore): Added
13597         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13598         classes_second_stage.
13599
13600         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13601         debug_type and trace_type when compiling with --nostdlib.       
13602
13603 2002-06-07  Martin Baulig  <martin@gnome.org>
13604
13605         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13606         (AddField): Set it to true when adding a non-static field.
13607         (DefineType): Use `have_nonstatic_fields' to find out whether we
13608         have non-static fields, not `Fields != null'.
13609
13610 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13611
13612         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13613         dereferencing a null on the static-field code path)
13614
13615 2002-05-30  Martin Baulig  <martin@gnome.org>
13616
13617         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13618         to take command line arguments.  Use reflection to call the new
13619         custom `Initialize' function on the symbol writer and pass it the
13620         command line arguments.
13621
13622         * driver.cs (--debug-args): New command line argument to pass command
13623         line arguments to the symbol writer.
13624
13625 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13626
13627         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13628         the target type for indexers and properties.  Thanks to Joe for
13629         catching this.
13630
13631 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13632
13633         * typemanager.cs (MethodFlags): returns the method flags
13634         (Obsolete/ShouldIgnore) that control warning emission and whether
13635         the invocation should be made, or ignored. 
13636
13637         * expression.cs (Invocation.Emit): Remove previous hack, we should
13638         not do this on matching a base type, we should do this based on an attribute
13639
13640         Only emit calls to System.Diagnostics.Debug and
13641         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13642         on the command line.
13643
13644         * rootcontext.cs: Global settings for tracing and debugging.
13645
13646         * cs-tokenizer.cs (define): New utility function to track
13647         defines.   Set the global settings for TRACE and DEBUG if found.
13648
13649 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13650
13651         * interface.cs (Populate*): Pass in the TypeContainer as well as
13652         the DeclSpace as parameters so that we can create EmitContexts and
13653         then use that to apply attributes etc.
13654
13655         (PopulateMethod, PopulateEvent, PopulateProperty)
13656         (PopulateIndexer): Apply attributes everywhere.
13657
13658         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13659         etc.
13660
13661         (ApplyAttributes): Update accordingly.
13662
13663         We now apply interface attributes for all members too.
13664
13665 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13666
13667         * class.cs (Indexer.Define); Correctly check if we are explicit
13668         implementation (instead of checking the Name for a ".", we
13669         directly look up if the InterfaceType was specified).
13670
13671         Delay the creation of the PropertyBuilder.
13672
13673         Only create the PropertyBuilder if we are not an explicit
13674         interface implementation.   This means that explicit interface
13675         implementation members do not participate in regular function
13676         lookups, and hence fixes another major ambiguity problem in
13677         overload resolution (that was the visible effect).
13678
13679         (DefineMethod): Return whether we are doing an interface
13680         implementation. 
13681
13682         * typemanager.cs: Temporary hack until we get attributes in
13683         interfaces (Ravi is working on that) and we get IndexerName
13684         support in interfaces.
13685
13686         * interface.cs: Register the indexers as properties.
13687
13688         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13689         warning, I have verified that this is a bug in the .NET runtime
13690         (JavaScript suffers of the same problem).
13691
13692         * typemanager.cs (MemberLookup): When looking up members for
13693         interfaces, the parent of an interface is the implicit
13694         System.Object (so we succeed in searches of Object methods in an
13695         interface method invocation.  Example:  IEnumerable x;  x.ToString
13696         ()) 
13697
13698 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13699
13700         * class.cs (Event): Events should also register if they do
13701         implement the methods that an interface requires.
13702
13703         * typemanager.cs (MemberLookup); use the new GetInterfaces
13704         method. 
13705
13706         (GetInterfaces): The code used to lookup interfaces for a type is
13707         used in more than one place, factor it here. 
13708
13709         * driver.cs: Track the errors at the bottom of the file, we kept
13710         on going.
13711
13712         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13713         instance if the method we are calling is static!
13714
13715 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13716
13717         * attribute.cs (ApplyAttributes): Make this function filter out
13718         the IndexerName attribute (as that attribute in reality is never
13719         applied) and return the string constant for the IndexerName
13720         attribute. 
13721
13722         * class.cs (TypeContainer.Emit): Validate that all the indexers
13723         have the same IndexerName attribute, and if so, set the
13724         DefaultName attribute on the class. 
13725
13726         * typemanager.cs: The return value might contain other stuff (not
13727         only methods).  For instance, consider a method with an "Item"
13728         property and an Item method.
13729
13730         * class.cs: If there is a problem with the parameter types,
13731         return. 
13732
13733 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13734
13735         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13736         looks at user defined conversion after making a call to 
13737         StandardConversionExists - we need this for overload resolution.
13738
13739         * expression.cs : Update accordingly the various method calls.
13740
13741         This fixes 2 bugs filed against implicit user defined conversions 
13742
13743 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13744
13745         * statement.cs: Track the result of the assignment.
13746
13747 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13748
13749         * expression.cs (MemberAccess): Improved error reporting for
13750         inaccessible members.
13751
13752 2002-05-22  Martin Baulig  <martin@gnome.org>
13753
13754         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13755         itself with debugging support.
13756
13757 2002-05-22  Martin Baulig  <martin@gnome.org>
13758
13759         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13760         Removed, this isn't needed anymore.
13761
13762 2002-05-20  Martin Baulig  <martin@gnome.org>
13763
13764         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13765         be underlying type for an enum.
13766
13767 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13768
13769         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13770         that splits out the loading of just the core types.
13771
13772         * rootcontext.cs (ResolveCore): Split the struct resolution in
13773         two, so we can load the enumeration underlying types before any
13774         enums are used.
13775
13776         * expression.cs (Is): Bandaid until we fix properly Switch (see
13777         bug #24985 for details).
13778
13779         * typemanager.cs (ImplementsInterface): The hashtable will contain
13780         a null if there are no interfaces implemented.
13781
13782 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13783
13784         * cs-parser.jay (indexer_declarator): It is fine to have array
13785         parameters
13786
13787 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13788
13789         * typemanager.cs: (RegisterBuilder): New function used to register
13790         TypeBuilders that implement interfaces.  Since
13791         TypeBuilder.GetInterfaces (as usual) does not work with lame
13792         Reflection.Emit. 
13793         (AddUserType): register interfaces.
13794
13795         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13796         dealing with TypeBuilder.  Also, arrays are showing up as
13797         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13798         methods can not be invoked on them!
13799
13800         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13801         (ImplicitReferenceConversionExists): Split out from
13802         StandardConversionExists. 
13803
13804         * expression.cs (As): We were only implementing one of the three
13805         cases for the as operator.  We now implement them all.
13806         (Is): Implement the various other cases for Is as well.
13807
13808         * typemanager.cs (CACHE): New define used to control if we want or
13809         not the FindMembers cache.  Seems to have a negative impact on
13810         performance currently
13811
13812         (MemberLookup): Nested types have full acess to
13813         enclosing type members
13814
13815         Remove code that coped with instance/static returns for events, we
13816         now catch this in RealFindMembers.
13817
13818         (RealFindMembers): only perform static lookup if the instance
13819         lookup did not return a type or an event.  
13820
13821 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13822
13823         * assign.cs (CompoundAssign): We pass more semantic information
13824         now to Compound Assignments than we did before: now we have all
13825         the information at hand, and now we resolve the target *before* we
13826         do the expression expansion, which allows the "CacheValue" method
13827         to have the effect we intended (before, a [x] += 1 would generate
13828         two differen ArrayAccess expressions from the ElementAccess,
13829         during the resolution process).
13830
13831         (CompoundAssign.DoResolve): Resolve target and original_source here.
13832
13833 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13834
13835         * expression.cs (ArrayAccess): dropped debugging information. 
13836
13837         * typemanager.cs: Small bug fix: I was always returning i_members,
13838         instead of one of i_members or s_members (depending on which had
13839         the content).
13840
13841         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13842         method is invoked before any code generation takes place, and it
13843         is a mechanism to inform that the expression will be invoked more
13844         than once, and that the method should use temporary values to
13845         avoid having side effects
13846
13847         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13848
13849         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13850         implementation.
13851
13852         * expression.cs (Indirection, ArrayAccess): Add support for
13853         CacheTemporaries in these two bad boys. 
13854
13855         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13856         ldobj or ldind_ref.  
13857         (StoreFromPtr): Handle stobj as well.
13858
13859         * expression.cs (UnaryMutator): Share more code.
13860
13861         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13862         down: I was not tracking the Filter function as well, which
13863         was affecting the results of the cache.
13864
13865 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13866
13867         * attribute.cs: Remove the hack to handle the CharSet property on
13868         StructLayouts. 
13869
13870 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13871
13872         * attribute.cs (DoResolve): More uglyness, we now only try to
13873         resolve the attribute partially, to extract the CharSet
13874         information (only if we are a StructLayout attribute).  Otherwise 
13875
13876         (GetExtraTypeInfo): Add some code to conditionally kill in the
13877         future this.   I am more and more convinced that the .NET
13878         framework has special code to handle the attribute setting on
13879         certain elements.
13880
13881         * expression.cs (IsParamsMethodApplicable): Revert my previous
13882         foreach change here, it was wrong.
13883
13884 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13885
13886         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13887         (pp_expr): do not abort on unknown input, just return.
13888         (eval): abort if there are pending chars.
13889
13890         * attribute.cs (Attribute.Resolve): Positional parameters are
13891         optional.  Deal with that case.
13892
13893         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13894         the Ansi/Unicode/Auto information for the type.
13895
13896         (TypeContainer.DefineType): instantiate the EmitContext here, as
13897         we will be using it during the type definition (to resolve
13898         attributes) and during the emit phase.
13899
13900         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13901         to pull type information out of the attributes
13902
13903         (Attribute.Resolve): track the constructor builder, and allow for
13904         multiple invocations (structs and classes will use this).
13905
13906         * ecore.cs (MemberLookupFinal): new version with all the
13907         parameters customizable.
13908
13909         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13910         constructors.  Return if the result value is null (as the error
13911         would have been flagged already by MemberLookupFinal)
13912
13913         Do not allow instances of abstract classes or interfaces to be
13914         created.
13915
13916         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13917         We have to compare the assembly property here when dealing with
13918         FamANDAssem and Assembly access modifiers, because we might be
13919         creating an assembly from *modules* (that means that we are not
13920         getting TypeBuilders for types defined in other modules that are
13921         part of this assembly).
13922
13923         (Method.Emit): If the method is marked abstract and has a body,
13924         emit an error. 
13925
13926         (TypeContainer.DefineMembers): If both the defined member and the
13927         parent name match are methods, then do not emit any warnings: let
13928         the Method.Define routine take care of flagging warnings.  But if
13929         there is a mismatch (method overrides something else, or method is
13930         overriwritten by something, then emit warning).
13931
13932         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13933         set to null, this means `do not check for the return type on the
13934         signature'. 
13935
13936         (Method.Define): set the return type for the method signature to
13937         null, so that we get methods with the same name and parameters and
13938         different return types.  This is used to flag warning 114 (you are
13939         hiding a method, and you probably want to use the new/override
13940         keywords instead).
13941
13942         * typemanager.cs (MemberLookup): Implemented proper access
13943         control, closing a long standing set of bug reports.  The problem
13944         was that the Framework only has two bits: Public and NonPublic,
13945         and NonPublic includes private and protected methods, but we need
13946         to enforce the FamANDAssem, FamOrAssem and Family. 
13947
13948 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13949
13950         * statement.cs (GotoCase): Return true: Ammounts to giving up
13951         knowledge on whether we return or not, and letting the other case
13952         be responsible for it.
13953
13954 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13955
13956         * driver.cs: Do not load directories for each file processed, only
13957         do it if there is a pattern.
13958
13959         * ecore.cs: Report readonly assigns here as well, as we might have
13960         been resolved only by MemberAccess.
13961
13962         (SimpleName.SimpleNameResolve): Also be useful for LValue
13963         resolution.   We need this to propagate assign to local readonly variables
13964
13965         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13966         do not want to reuse potential criteria memory.
13967
13968         * class.cs (MyEventBuilder): Set reflected_type;
13969
13970         * ecore.cs (Constantify): Added support for constifying bools.
13971
13972         (RootContext.LookupType): Added a cache for values looked up in
13973         the declaration space.
13974
13975         * typemanager.cs (FindMembers): Now is a front-end to
13976         RealFindMembers, and provides a two-level hashtable-based cache to
13977         the request.  
13978
13979         15% performance improvement: from 22.5 to 19.2 seconds.
13980
13981         * expression.cs (IsParamsMethodApplicable): use foreach.
13982         (Invocation.DoResolve): ditto.
13983         (New.DoResolve): ditto.
13984         (ArrayCreation.DoResolve): ditto.
13985
13986         * ecore.cs (FindMostEncompassingType): use foreach.
13987
13988         * delegate.cs (NewDelegate.DoResolve): Use foreach
13989
13990         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13991         (RemoveMethods): use foreach.
13992
13993         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13994         nested foreach statements instead of for, and also break out of
13995         the inner loop once a match is found.
13996
13997         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13998
13999 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14000
14001         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14002         we actually unwrap the expression to allow for extra information
14003         to be extracted. 
14004
14005         * expression.cs: Use Shr_Un on unsigned operations. 
14006
14007 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14008
14009         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14010         applicable operators was not being considered correctly. This closes
14011         the bug Miguel reported.
14012
14013 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14014
14015         * attribute.cs: check that the type derives from System.Attribute
14016         and report the correct error in that case (moved the duplicate code to
14017         its own method, too).
14018
14019 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14020
14021         * attribute.cs: lookup attribute type name as the spec says: first the
14022         bare attribute name and then name + "Attribute" (nant compiles with
14023         mcs after this fix).
14024
14025 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14026
14027         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14028         Because of the way we parse things, we should try to see if a
14029         UIntConstant can fit in an integer.
14030
14031 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14032
14033         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14034         when we are in an explicit context.
14035
14036         (ConvertReferenceExplicit): When converting from Iface type S to Class
14037         T make sure the rules are implemented as an OR.
14038
14039         * parameter.cs (ParameterType): Make it a property for now although the
14040         purpose really isn't anything immediate.
14041
14042         * expression.cs (Is*Applicable): Do better checking on the parameter type
14043         of a ref/out parameter. The ones from the system assemblies are already 
14044         marked with the correct type so we don't need to do any correction.
14045
14046         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14047         the object type is standard too so include that.
14048
14049 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14050
14051         * ecore.cs (StandardConversionExists): Augment with missing code:
14052         deal with IntConstant, LongConstants and Enumerations.
14053
14054         * assign.cs: Report the error, instead of failing silently
14055
14056         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14057         typecontainer that they are declared, because the
14058         typecontainer/namespace will have the list of using clauses that
14059         need to be applied.
14060
14061         Assembly Attributes were escaping the normal registration
14062         mechanism. 
14063
14064         (EmitCode): Apply attributes within an EmitContext that represents
14065         the container they were declared on.
14066
14067         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14068
14069 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14070
14071         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14072         Revamp completely - make much cleaner as we now operate only
14073         on a set of Types.
14074
14075         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14076         to implement the logic detailed in the spec more correctly.
14077
14078         (UserDefinedConversion): Update accordingly.
14079
14080 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14081
14082         * statement.cs: Return flow analysis information up.
14083
14084         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14085         and the default.
14086
14087         (token): Do not consume an extra character before calling
14088         decimal_digits.
14089
14090 2002-05-06  Piers Haken <piersh@friskit.com>
14091
14092         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14093
14094 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14095
14096         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14097         EmitContext during the instance constructor initializer
14098         resolution, to stop access to instance variables.
14099
14100         This is mandated by the spec, last paragraph of the `constructor
14101         initializers' section. 
14102
14103 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14104
14105         * cs-parser.jay, class.cs (Accessor): new class used to represent
14106         an accessor (get or set).  In the past we used `null' to represent
14107         a missing accessor.  But this is ambiguous because there was no
14108         way to tell in abstract indexers/properties if one of them was
14109         specified.
14110
14111         Now there is a way of addressing that.
14112
14113         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14114         instead of FindMembers.
14115
14116         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14117         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14118
14119         * attribute.cs: Treat indexers and properties as the same in terms
14120         of applying attributes
14121
14122         * ecore.cs (FindMostEncompassedType): Use statically initialized
14123         EmptyExpressions()s like we do elsewhere to avoid creating useless
14124         objects (and we take this out of the tight loop).
14125
14126         (GetConversionOperators): Move the code to extract the actual
14127         operators to a separate routine to clean things up.
14128
14129 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14130
14131         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14132         events are always registered FieldBuilders.
14133
14134         * class.cs (FieldBase): New class shared by Fields 
14135
14136         * delegate.cs: If we are a toplevel delegate, use our full name.
14137         If we are a nested delegate, then only use our tail name.
14138
14139 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14140
14141         * expression.cs (IsApplicable): Ensure that we add the "&" to
14142         ref/out types before comparing it with the type of the argument.
14143
14144         (IsParamsMethodApplicable): Ditto.
14145
14146         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14147         silly me ;-)
14148
14149         * delegate.cs : Handle the case when we have more than one applicable
14150         method. Flag an error only when we finish checking all.
14151
14152 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14153
14154         * expression.cs: Add support for boolean static initializers.
14155
14156 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14157
14158         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14159
14160         * parameter.cs (ComputeParameterTypes,
14161         ComputeAndDefineParameterTypes): Better error handling: now we
14162         clear the `types' cache if we fail during any of the type lookups.
14163         We also return the status code correctly to our caller
14164
14165         * delegate.cs: If we fail to define a delegate, abort the extra
14166         steps. 
14167
14168         * expression.cs (Binary.ResolveOperator): for
14169         operator==(object,object) and operator !=(object, object) we also
14170         have to verify that there is an implicit conversion from one to
14171         the other.
14172
14173         (ArrayAccess.DoResolve): Array Access can operate on
14174         non-variables. 
14175
14176 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14177
14178         * assign.cs (CompoundAssign): A new class used as a "flag" that
14179         the assignment actually is happening as part of a compound
14180         assignment operator.
14181
14182         During compound assignment, a few new rules exist to enable things
14183         like:
14184
14185         byte b |= 1 + 2
14186
14187         From the spec:
14188
14189         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14190         to the type of x) if y is implicitly convertible to the type of x,
14191         and the operator is a builtin operator and the return type of the
14192         operator is explicitly convertible to the type of x. 
14193
14194         * rootcontext.cs: Reset warning level to 2.  4 catches various
14195         "interesting" features in mcs, we must clean this up at some
14196         point, but currently am trying to kill other bugs ;-)
14197
14198         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14199         in container classes as well.  
14200
14201         * expression.cs (Binary.ResolveOperator): Handle string case
14202         before anything else (as operator overloading does emit an error
14203         before doing anything else).
14204
14205         This code could go away when we move to a table driven model, but
14206         i could not come up with a good plan last night.
14207
14208 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14209
14210         * typemanager.cs (CSharpName): reimplementation using regex.
14211         * class.cs: added null check for fields in Emit
14212         * rootcontext.cs: set warninglevel to 4
14213
14214 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14215
14216         * typemanager.cs (CSharpName): reimplemented with Lupus
14217         suggestion.
14218
14219 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14220
14221         * statement.cs (If): correclty implement Resolve, because we were
14222         not catching sem errors in there.  The same process is needed
14223         everywhere else. 
14224         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14225
14226
14227         (Statement.Warning_DeadCodeFound): Factorize code.
14228         (While): Report dead code here too.
14229
14230         (Statement): Added Resolve virtual method to allow
14231         for resolution split from the emit code.
14232
14233 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14234
14235         * statement.cs (EmitBoolExpression): No longer try to resolve the
14236         expression here.    
14237         (MakeBoolean): New utility function that resolve, implicitly
14238         converts to boolean and tags the expression. 
14239
14240
14241         (If, Do): Implement dead code elimination.
14242         (While): Implement loop inversion
14243
14244         (Do, While, For, If): Resolve the expression prior to calling our
14245         code generation.
14246
14247 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14248
14249         * class.cs:
14250           - added method Report28 (warning: program has more than one entry point)
14251           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14252           - modified method Method.Define, the part at the end of the method
14253
14254         * rootcontext.cs: added static public Location EntryPointLocation;
14255           
14256         * ../errors/cs0028.cs : Add test case for the above warning.              
14257
14258         * typemanager.cs:
14259           - modified method CSharpName to allow arrays of primitive type to
14260             be printed nicely (e.g. instead of System.Int32[][] it now prints
14261             int[][])
14262           - added method CSharpSignature: returns the signature of a method
14263             in string format to be used in reporting errors, warnings, etc.
14264
14265         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14266         with String.Empty.
14267
14268 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14269
14270         * delegate.cs (Define): Fix extremely silly bug where I was
14271         setting the type of the 'object' parameter of the BeginInvoke
14272         method to System.IAsyncResult instead of System.Object ;-)
14273
14274 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14275
14276         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14277         here. 
14278
14279         (Constructor.Emit): return if we fail to initialize the
14280         constructor.  Another door closed!  
14281
14282         * expression.cs (New.DoResolve): Improve error message (from -6 to
14283         1501).  Use DeclaredOnly lookup to find the exact constructor.
14284
14285         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14286         loop.  This is useful.
14287
14288         * cs-parser.jay: Adjust the default parameters so that destructors
14289         have the proper signature.
14290
14291 2002-04-26  Martin Baulig  <martin@gnome.org>
14292
14293         * driver.cs (LoadAssembly): If `assembly' contains any characters
14294         which are only valid in path names and not in assembly names
14295         (currently slash, backslash and point), use Assembly.LoadFrom ()
14296         instead of Assembly.Load () on the `assembly' (before iteration
14297         over the link_paths).
14298
14299 2002-04-26  Martin Baulig  <martin@gnome.org>
14300
14301         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14302
14303 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14304
14305         * class.cs (Property): use the new typemanager.MemberLookup
14306
14307         (TypeContainer.MemberLookup): Implement using the
14308         TypeManager.MemberLookup now. 
14309
14310         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14311         and return MemberInfos, so that these can be used without an
14312         EmitContext (what we had before).
14313
14314 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14315
14316         * expression.cs: Fix the case where the argument to params if the
14317         type of the params.  I omitted handling this before.   Fixed
14318
14319 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14320
14321         * driver.cs: Call BootCorlib_PopulateCoreType
14322
14323         * class.cs (Property.CheckBase): Check for properties only, not
14324         for all members. 
14325
14326         * interface.cs: Temporary hack: try/catch around the
14327         CustomAttributeBuilder, because I am getting an exception that I
14328         do not understand.
14329
14330         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14331         types whose definitions are required to be there (attributes are
14332         defined before standard types).
14333
14334         Compute definitions as we boot the various types, as they are used
14335         immediately (value_type class will need object_type, but if we do
14336         not initialize object_type, we will pass a null, which will let
14337         the runtime pick the System.Object from the existing corlib, which
14338         is not what we want).
14339
14340 2002-04-22  Patrik Torstensson <totte@labs2.com>
14341
14342         * cs-tokenizer.cs: fixed a number of trim() issues.
14343
14344 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14345
14346         * expression.cs (Argument.Type): Ensure that we return the correct
14347         type when we have out or ref parameters [in which case we 
14348         append a "&"].
14349
14350 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14351
14352         * class.cs (Property, Indexer): Allow extern modifier in there. 
14353
14354         * typemanager.cs (InitBaseTypes): Initializes object_type and
14355         value_type, since those will be used early on during the bootstrap
14356         process to compile corlib.
14357
14358         (InitCoreTypes): Move code from here to InitBaseTypes.
14359
14360 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14361
14362         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14363         single-dimension arrays as using the ldlen opcode.  
14364
14365         Daniel Lewis discovered this optimization.  
14366
14367         * typemanager.cs: Add signature for System.Array::get_Length
14368
14369 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14370
14371         * statement.cs: report the error when the foreach does not apply to an
14372         array nor a collection.
14373
14374 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14375
14376         * expression.cs: Add implicit conversions to the operator ~.
14377
14378         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14379
14380         * typemanager.cs: Locate the decimal constructor.
14381
14382 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14383
14384         * attribute.cs: use the new property of TypeOf.
14385         * expression.cs: added 'get' property around typearg.
14386
14387         These changes fix a build breaker reported by NickD. Is this the
14388         correct way to fix?  If not, please, revert my changes and make it
14389         work :-).
14390
14391 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * attribute.cs: Add support for typeof in attribute invocations.
14394         I am not sure that this is right though.
14395
14396 2002-04-14  Duncan Mak  <duncan@ximian.com>
14397
14398         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14399         Binary.Operator.Division case.
14400
14401 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14402
14403         * class.cs (DefineType): Ensure that we do a proper check on
14404         attribute types and also register it with the TypeManager.
14405
14406         (TypeContainer.Targets): The default for attribute types is
14407         AttributeTargets.All.
14408
14409         * attribute.cs (ApplyAttributes): Registering the attribute type
14410         is done elsewhere, not when we discover we have a Usage attribute.
14411
14412 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14413
14414         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14415         and get rid of is_delegate parameter.
14416
14417         * everywhere : update.
14418
14419 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14420
14421         * cs-parser.jay (compilation_unit): Revamp completely to use
14422         some new ideas that I got from Rhys' grammar to solve the problems
14423         with assembly level attributes.
14424
14425         (outer_declaration): New grammar production.
14426
14427         (attribute_sections): Add.
14428
14429         (opt_attributes): Base on attribute_sections
14430
14431         (namespace_declaration): Allow opt_attributes to tackle the case
14432         when we have assembly level attributes - we are clever in this
14433         regard now ;-)
14434
14435         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14436         attributes in the non-global context.
14437
14438         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14439         instead of SetGlobalAttributes.
14440
14441         * class.cs, rootcontext.cs : Ensure we define and generate 
14442         attribute types before anything else.
14443
14444         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14445         and flag the new error -20 for the case when the attribute type
14446         does not have valid targets specified. csc does not catch this.
14447
14448         * ../errors/errors.txt : update for error # -20
14449
14450 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14451
14452         * support.cs (InternalParameters.ParameterModifier): Do some null
14453         checking and return sane values.
14454
14455         * class.cs (Method.Define): If we are a PInvoke method, ensure
14456         that we are static and extern. Report error # 601
14457
14458         * ../errors/cs0601.cs : Add test case for the above error.
14459
14460 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14461
14462         * rootcontext.cs (attribute_types): We need to keep type of
14463         all attribute types separately and emit code for them first.
14464
14465         (RegisterAttribute) : Implement.
14466
14467         * class.cs (DefineType): Check if the current Type is a custom
14468         attribute type and register it accordingly.
14469
14470         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14471         adding the first attribute twice and rename to
14472
14473         (SetGlobalAttributes): this.
14474
14475         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14476         lookups.
14477
14478         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14479         if we are processing global arguments. Hmm, I am unsure of this.
14480
14481 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14482
14483         * expression.cs: added static array of strings to avoid calling
14484         Enum.ToString () for Operator in Binary. Significant recover of
14485         performance.
14486
14487 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14488
14489         * class.cs (FindMembers): Allow the Builders of the various
14490         members to be null.  If they are skip them.  This only happens
14491         during the PInvoke declaration.
14492
14493 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14494
14495         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14496         failure, so we do not keep going afterwards.
14497
14498         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14499         wanted to pass `false' as the `is_delegate' argument.  If this is
14500         the case, why not use delegate_type == null to mean `is_delegate =
14501         false' and anything else as is_delegate = true.
14502
14503 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14504
14505         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14506         code for the section, not the beginning of the tests.
14507
14508 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14509
14510         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14511
14512         * expression.cs (Binary): same.  Warn about errors where we have
14513         Enum/Enum in operator + as well.
14514
14515 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14516
14517         * statement.cs:
14518                 - added support for switch(bool)
14519                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14520                 - add TableSwitchEmit() to handle table-based switch statements
14521
14522 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14523
14524         * expression.cs (Invocation.OverloadResolve): Factor out code which
14525         does parameter compatibility checking with arguments so that we can 
14526         re-use the code even from Delegate.VerifyApplicability
14527
14528         (VerifyArgumentsCompat): Move above code here.
14529
14530         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14531         and instead make a call to the above method.
14532
14533 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14534
14535         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14536         We use it to keep track of classes which are attribute types.
14537
14538 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14539
14540         * delegate.cs (Delegate.Define): Correctly define the types in the
14541         presence of fixed and array parameters.
14542
14543         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14544         doing FindMembers.
14545
14546         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14547         include NonPublic after the first iteration.
14548
14549         * class.cs (Indexer.CheckBase): Only check if both parents are
14550         non-null. 
14551
14552         * cs-parser.jay (accessor_body): If empty, set to null.
14553
14554         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14555         same code path here to resolve constants names that we did have in
14556         MemberAccess.DoResolve.  There is too much code duplicated here.
14557
14558 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14559
14560         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14561
14562         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14563         to MakeUnionSet.
14564
14565         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14566         tokens, numbers and strings.
14567
14568         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14569         parenthesis.
14570
14571         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14572         asyncronous parameters and the regular parameters.  
14573
14574         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14575         specify the target directory.
14576
14577         * expression.cs: (This.DoResolve): Simplify
14578         (As.Emit): Optimize, do not generate IsInst if the expression is
14579         always of the given type.
14580
14581         (Is.DoResolve): Bug fix, we were reporting both always/never for
14582         the is expression.
14583
14584         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14585         creating too many unnecessary arrays.
14586
14587 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14588
14589         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14590         fields instead of rolling our own initializer.   Takes care of all
14591         implicit conversions, and drops unnecessary static checks/argument.
14592
14593 2002-03-31  Dick Porter  <dick@ximian.com>
14594
14595         * driver.cs: use the GetDirectories() return values properly, and
14596         use "/" as path separator.
14597
14598 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14599
14600         * expression.cs (Unary): Optimize - - expr into expr.
14601         (Binary): Optimize a + (-b) into a -b.
14602
14603         * codegen.cs (CodeGen): Made all methods static.
14604
14605 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14606
14607         * rootcontext.cs: 
14608
14609         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14610         TypeBuilder property.
14611
14612         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14613         instead. 
14614
14615         * tree.cs: Removed the various RecordXXXX, and replaced with a
14616         single RecordDecl.  Removed all the accessor methods, and just
14617         left a single access point Type 
14618
14619         * enum.cs: Rename DefineEnum to DefineType.
14620
14621         * decl.cs: New abstract method `DefineType' used to unify the
14622         Defines for Enumerations, Interfaces, TypeContainers and
14623         Delegates.
14624
14625         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14626         LookupBaseClasses method that used to live in class.cs and
14627         interface.cs here, and renamed to FindType.
14628
14629         * delegate.cs: Implement DefineType.  Take advantage of the
14630         refactored pattern for locating the parent builder without taking
14631         the parent_builder argument (which we know does not work if we are
14632         nested, and triggering a toplevel definition).
14633
14634 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14635
14636         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14637         accessibility of a member has changed during override and report
14638         an error if so.
14639
14640         * class.cs (Method.Define, Property.Define): Only complain on
14641         overrides if the method is private, any other accessibility is
14642         fine (and since we just checked the permission is the same, we are
14643         good to go).
14644
14645         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14646         and elif are processed always.  The other pre-processing
14647         directives are only processed if we are "taking" the path
14648
14649 2002-03-29  Martin Baulig  <martin@gnome.org>
14650
14651         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14652         current location is not Null.
14653
14654         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14655         a separate method so we can profile it.
14656
14657         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14658         `span.Seconds' are just seconds, but no minutes or hours.
14659         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14660
14661 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14662
14663         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14664         Remove the gratuitous set of Final:
14665
14666                                 // If an interface implementation, then we can set Final.
14667                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14668                                     implementing.DeclaringType.IsInterface)
14669                                         flags |= MethodAttributes.Final;
14670
14671         I do not know what I was smoking when I used that.
14672
14673
14674         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14675         step into fixing the name resolution issues for delegates and
14676         unifying the toplevel name resolution.
14677
14678 2002-03-28  Martin Baulig  <martin@gnome.org>
14679
14680         * class.cs (Method.Emit): If we have a symbol writer, call its
14681         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14682         tell it about the current method.
14683
14684         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14685         writer that we're going to emit the first byte of IL code for a new
14686         statement (a new source line).
14687         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14688         EmitContext.Mark() before emitting any code.
14689
14690         * location.cs (SymbolDocument): Return null when we're Null.
14691
14692         * statement.cs (Statement): Moved the `Location loc' variable here.
14693         (Statement.EmitBoolExpression): If we have a symbol writer, call
14694         ec.Mark() before emitting any code to tell it that we're at the
14695         beginning of a new statement.
14696         (StatementExpression): Added `Location' argument to the constructor.
14697         (Block): Added public readonly variable `StartLocation' and public
14698         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14699         (Block): Added constructor which takes a start and end location.
14700         (Block.SetEndLocation): New method. This sets the end location.
14701         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14702         local variables we create.
14703         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14704         each statement and do also mark the begin and end of the block.
14705
14706         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14707         tell it the current lexer.Location, use Location.Null for the end of the
14708         block.
14709         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14710         current block, set its end location using SetEndLocation().
14711         (statement_expression): StatementExpression constructor now takes the
14712         lexer.Location as additional argument.
14713         (for_statement, declare_local_variables): Likewise.
14714         (declare_local_variables): When creating a new implicit block, use the
14715         new Block constructor and pass it the lexer.Location.
14716
14717 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14718
14719         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14720         members also on the parent interfaces recursively.
14721
14722 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14723
14724         * report.cs: Use new formats, since Gonzalo finished the missing
14725         bits. 
14726
14727         * expression.cs (Binary.ResolveOperator): added missing operator|
14728         operator& and operator^ for bool/bool.
14729
14730         * cs-parser.jay: CheckDef now takes a Location argument that is
14731         used to report errors more precisly (instead of reporting the end
14732         of a definition, we try to track something which is a lot closer
14733         to the source of the problem).
14734
14735         * cs-tokenizer.cs: Track global token use, so we can properly flag
14736         the use of #define/#undef after the first token has been seen.
14737
14738         Also, rename the reportXXXX to Error_DescriptiveName
14739
14740         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14741         TypeContainer, so that Enum and Interface can use this too.
14742
14743         * class.cs (TypeContainer.LookupInterfaceOrClass,
14744         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14745         `builder' argument.  Typically this was used to pass the parent
14746         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14747         the definition).  
14748
14749         The problem is that a nested class could trigger the definition of
14750         a toplevel class, and the builder would be obviously wrong in that
14751         case. 
14752
14753         So we drop this argument, and we compute dynamically the
14754         TypeBuilder/ModuleBuilder (the correct information was available
14755         to us anyways from DeclSpace.Parent)
14756
14757         * interface.cs (Interface.DefineInterface): Drop builder
14758         parameter cleanup like class.cs
14759
14760         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14761         like class.cs
14762
14763         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14764         values. 
14765
14766         (Try.Emit): Propagate the returns value from the statement.
14767
14768         (Return.Emit): Even if we are leavning 
14769
14770         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14771
14772         * modifiers.cs: Fix the computation of MethodAttributes flags.
14773
14774 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14775
14776         * driver.cs: allow compilation of files that start with '/'.
14777         Add a default case when checking the argument of --target.
14778
14779 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14780
14781         * interface.cs: Implement the same search algorithm for types in
14782         the interface code.
14783
14784         * delegate.cs: Do not allow multiple definition.
14785
14786         * Recovered ChangeLog that got accidentally amputated
14787
14788         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14789
14790         * rootcontext.cs: Load manually enum to allow core classes to
14791         contain enumerations.
14792
14793         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14794         Update to new static methods in TypeManager.
14795
14796         * typemanager.cs (GetMethod, GetConstructor): Use our
14797         implementation of FindMembers to find the members, since during
14798         corlib compilation, the types are TypeBuilders and GetMethod and
14799         GetConstructor do not work.
14800
14801         Make all methods in TypeManager static.
14802
14803         (InitCodeHelpers): Split the functionality from
14804         the InitCodeTypes function.
14805
14806         * driver.cs: Call InitCodeHelpers after we have populated the
14807         types. 
14808
14809         * cs-parser.jay (delegate_declaration): we did not used to compute
14810         the delegate name correctly for void delegates.
14811
14812 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14813
14814         * rootcontext.cs (RootContext): Init the interface_resolve_order
14815         and type_container_resolve_order always.
14816
14817         (ResolveCore, BootstrapCorlib_ResolveClass,
14818         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14819         compiler when compiling with --nostdlib
14820
14821         * class.cs (TypeContainer.DefineType): Check that our parent is
14822         not null.  This test is most important when we are bootstraping
14823         the core types.
14824
14825         * codegen.cs: Split out the symbol writing code.
14826
14827 2002-03-25  Martin Baulig  <martin@gnome.org>
14828
14829         * driver.cs (-g): Made -g an alias for --debug.
14830
14831 2002-03-24  Martin Baulig  <martin@gnome.org>
14832
14833         * codegen.cs (SymbolWriter): New public variable. Returns the
14834         current symbol writer.
14835         (CodeGen): Added `bool want_debugging_support' argument to the
14836          constructor. If true, tell the ModuleBuild that we want debugging
14837         support and ask it for the ISymbolWriter.
14838         (Save): If we have a symbol writer, call it's Close() method after
14839         saving the assembly.
14840
14841         * driver.c (--debug): New command line argument to create a
14842         debugger information file.
14843
14844         * location.cs (SymbolDocument): New public property. Returns an
14845         ISymbolDocumentWriter object for the current source file or null
14846         if we don't have a symbol writer.
14847
14848 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14849
14850         * driver.cs (LoadAssembly): Correctly return when all the paths
14851         have been tried and not before.
14852
14853         * statement.cs (Switch.Emit): return the actual coverage for this
14854         statement (returns/not-returns)
14855
14856         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14857         switch of the statement if we are the last switch section.  That
14858         kills two problems: try/catch problems (we used to emit an empty
14859         nop at the end) and switch statements where all branches would
14860         return. 
14861
14862 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14863
14864         * driver.cs: Add default assemblies (the equivalent to the
14865         Microsoft CSC.RSP file)
14866
14867         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14868         also update tokens_seen and set it to false.
14869
14870         * driver.cs: Implement --recurse for Mike.
14871
14872         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14873         correctly splitting out the paths.
14874
14875 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14876
14877         * interface.cs (Interface.PopulateProperty): Instead of using
14878         `parent' as the declaration space for the set parameters, use
14879         `this' 
14880
14881         * support.cs (InternalParameters): InternalParameters constructor
14882         takes a DeclSpace instead of a TypeContainer.
14883
14884         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14885         types are being initialized, load the address of it before calling
14886         the function.  
14887
14888         (New): Provide a mechanism to disable the generation of local
14889         value type temporaries when the caller will be providing us with
14890         an address to store it.
14891
14892         (ArrayCreation.EmitDynamicInitializers): Use it.
14893
14894 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14895
14896         * expression.cs (Invocation.EmitArguments): Only probe for array
14897         property if there is more than one argument.  Sorry about that.
14898
14899         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14900         empty param arrays.
14901
14902         * class.cs (Method.LabelParameters): Fix incorrect code path that
14903         prevented the `ParamArrayAttribute' from being applied to the
14904         params attribute.
14905
14906 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14907
14908         * support.cs (ReflectionParameters): Correctly compute whether the
14909         last argument is a params array.  Fixes the problem with
14910         string.Split ('a')
14911
14912         * typemanager.cs: Make the assemblies array always be non-null
14913         (empty, but non-null)
14914
14915         * tree.cs (RecordDecl): New function that abstracts the recording
14916         of names.  This reports error 101, and provides a pointer to the
14917         previous declaration.  Fixes a crash in the compiler.
14918
14919         * cs-parser.jay (constructor_declaration): Update to new grammar,
14920         and provide a constructor_body that can be empty.
14921
14922 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14923
14924         * driver.cs: Add support for --resources.
14925
14926         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14927         Make all types for the various array helper methods be integer.
14928
14929         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14930         CheckState to ConvCast.
14931
14932         (ConvCast): Now it takes a `checked' state argument, to avoid
14933         depending on the emit context for the conversion, and just using
14934         the resolve time setting.
14935
14936         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14937         instead of Invocation.EmitArguments.  We do not emit the original
14938         arguments, instead we emit those which have been converted to
14939         unsigned int expressions.
14940
14941         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14942
14943         * codegen.cs: ditto.
14944
14945         * expression.cs (LocalVariableReference): Drop the use of the
14946         Store function that depended on the variable index.
14947
14948         * statement.cs (VariableInfo): Drop the `Idx' property from this
14949         class, as this is not taking into account the indexes for
14950         temporaries tat we generate during the execution, getting the
14951         indexes wrong.
14952
14953         * class.cs: First emit class initializers, then call the parent
14954         constructor. 
14955
14956         * expression.cs (Binary): Fix opcode emision.
14957         (UnaryMutator.EmitCode): Support checked code generation
14958
14959         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14960         matches for events for both the Static and Instance scans,
14961         pointing to the same element.   Fix that.
14962
14963 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14964
14965         * rootcontext.cs (ResolveTree): Always set the
14966         interface_resolve_order, because nested interfaces will be calling
14967         into us.
14968
14969         * class.cs (GetInterfaceOrClass): Track the same resolution
14970         process used by TypeManager.LookupType.  This fixes the nested
14971         type lookups in class declarations (separate path from
14972         LookupType). 
14973
14974         (TypeContainer.DefineType): Also define nested interfaces.
14975         (TypeContainer.RegisterOrder): New public function used to
14976         register the order in which child interfaces need to be closed.
14977
14978         Nested interfaces need to be closed after their parents have been
14979         created. 
14980
14981         * interface.cs (InterfaceAttr): Put all the logic for computing
14982         the interface attribute here. 
14983
14984         (DefineInterface): Register our interface order with the
14985         RootContext or with the TypeContainer depending on the case.
14986
14987 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14988
14989         * cs-parser.jay: rework foreach statement to work with the new
14990         changes to the policy on SimpleNames.
14991
14992         * report.cs: support Stacktrace on warnings as well.
14993
14994         * makefile: drop --unsafe and /unsafe from the compile.
14995
14996 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14997
14998         * ecore.cs (StandardConversionExists): Modify to take an Expression
14999         as the first parameter. Ensure we do null -> reference type conversion
15000         checking.
15001
15002         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15003         temporary Expression objects.
15004
15005 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15006
15007         * interface.cs: workaround bug in method overloading resolution
15008         (there is already a bugzilla bug for it).
15009
15010 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15011
15012         We could also solve this problem by having a separate path for
15013         performing type lookups, instead of DoResolve, we could have a
15014         ResolveType entry point, and only participating pieces of the
15015         production (simplename, deref, array) would implement this. 
15016
15017         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15018         signal SimpleName to only resolve type names and not attempt to
15019         resolve anything else.
15020
15021         * expression.cs (Cast): Set the flag.
15022
15023         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15024
15025         * class.cs: Only report 108 if there is no `new' modifier.
15026
15027         * cs-parser.jay: rework foreach statement to work with the new
15028         changes to the policy on SimpleNames.
15029
15030         * report.cs: support Stacktrace on warnings as well.
15031
15032         * makefile: drop --unsafe and /unsafe from the compile.
15033
15034 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15035
15036         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15037         lookups here, instead of doing that at parse time.  This means
15038         that our grammar will not introduce `LocalVariableReferences' as
15039         expressions at this point.  That solves the problem of code like
15040         this:
15041
15042         class X {
15043            static void Main ()
15044            { int X = 1;
15045             { X x = null }}}
15046
15047         This is only half the fix.  The full fix requires parameters to
15048         also be handled in this way.
15049
15050         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15051         makes the use more obvious of the DeclSpace.  The
15052         ec.TypeContainer.TypeBuilder is now only used to pull the
15053         TypeBuilder for it.
15054
15055         My theory is that I can get rid of the TypeBuilder completely from
15056         the EmitContext, and have typecasts where it is used (from
15057         DeclSpace to where it matters).  
15058
15059         The only pending problem is that the code that implements Aliases
15060         is on TypeContainer, and probably should go in DeclSpace.
15061
15062         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15063         lookups here, instead of doing that at parse time.  This means
15064         that our grammar will not introduce `LocalVariableReferences' as
15065         expressions at this point.  That solves the problem of code like
15066         this:
15067
15068         class X {
15069            static void Main ()
15070            { int X = 1;
15071             { X x = null }}}
15072
15073         This is only half the fix.  The full fix requires parameters to
15074         also be handled in this way.
15075
15076         * class.cs (Property.DefineMethod): When implementing an interface
15077         method, set newslot, when implementing an abstract method, do not
15078         set the flag (before we tried never setting it, or always setting
15079         it, which is the difference).
15080         (Indexer.DefineMethod): same.
15081         (Method.DefineMethod): same.
15082
15083         * ecore.cs: Only set the status used flag if we get back a Field.
15084
15085         * attribute.cs: Temporary hack, so Paolo can keep working.
15086
15087 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15088
15089         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15090         the unmanaged type in the case we have a MarshalAs attribute.
15091
15092         (Resolve): Handle the case when we are parsing the special MarshalAs
15093         attribute [we need to store the unmanaged type to use later]
15094
15095         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15096         MarshalAs Attribute.
15097
15098         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15099         on parameters and accordingly set the marshalling info.
15100
15101 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15102
15103         * class.cs: Optimizing slightly by removing redundant code after
15104         we switched to the `NoTypes' return value.
15105         (Property.DefineMethod): use NoTypes here too.
15106
15107         This fixes the bug I introduced in my last batch of changes.
15108
15109 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15110
15111         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15112
15113         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15114         Enums since those are types too. 
15115
15116         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15117
15118         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15119         thanks to a call during the lookup process.
15120
15121 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15122
15123         * statement.cs (Foreach): Lots of work to accomodate a particular
15124         kind of foreach statement that I had not kept in mind.  It is
15125         possible to have foreachs on classes that provide a GetEnumerator
15126         method that return objects that implement the "pattern" for using
15127         a foreach, there is no need to support GetEnumerator
15128         specifically. 
15129
15130         This is needed to compile nant.
15131
15132         * decl.cs: Only report 114 if the member is not `Finalize' and if
15133         the warning level is at least 2.
15134
15135         * class.cs: Moved the compare function from Method to
15136         MethodSignature. 
15137
15138         (MethodSignature.InheritableMemberSignatureCompare): Add new
15139         filter function that is used to extract inheritable methods from a
15140         class. 
15141
15142         (Method.Define): Use the new `inheritable_method_signature_filter'
15143         delegate
15144
15145         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15146         command. 
15147
15148 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15149
15150         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15151
15152         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15153
15154         * expression.cs: Pass location information to
15155         ConvertImplicitStandard. 
15156
15157         * class.cs: Added debugging code to track return values from
15158         interfaces. 
15159
15160 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15161
15162         * expression.cs (Is.DoResolve): If either side of the `is' is an
15163         interface, do not flag the warning.
15164
15165         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15166         for interfaces
15167
15168         * report.cs: Allow for --fatal to be used with --probe.
15169
15170         * typemanager.cs (NoTypes): Move the definition for the empty Type
15171         array here. 
15172
15173         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15174         properties. 
15175         (TypeContainer.DefineProxy): New function used to proxy to parent
15176         implementations when implementing interfaces.
15177         (TypeContainer.ParentImplements): used to lookup if our parent
15178         implements a public function that is required by an interface.
15179         (TypeContainer.VerifyPendingMethods): Hook this up.
15180
15181         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15182         `modules' and `assemblies' arraylists into arrays.  We only grow
15183         these are the very early start up of the program, so this improves
15184         the speedof LookupType (nicely measured).
15185
15186         * expression.cs (MakeByteBlob): Replaced unsafe code with
15187         BitConverter, as suggested by Paolo.
15188
15189         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15190         folding of string concatenation, but if either side is a string,
15191         and the other is not, then return null, and let the runtime use
15192         the concatenation on the string plus the object (using
15193         `Object.ToString'). 
15194
15195 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15196
15197         Constant Folding has been implemented now.
15198
15199         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15200         the error instead on types that are not supported in one's
15201         complement. 
15202
15203         * constant.cs (Constant and all children): New set of functions to
15204         perform implict and explicit conversions.
15205
15206         * ecore.cs (EnumConstant): Implement the new functions to perform
15207         conversion by proxying to the child expression.
15208
15209         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15210         own separate setting that can not be turned off from the command
15211         line using --unchecked or --checked and is only controlled using
15212         the checked/unchecked statements and expressions.  This setting is
15213         used by the constant folder to flag errors.
15214
15215         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15216         ConstantCheckState as well.   
15217
15218         During Resolve, they also have to flag the state, because the
15219         constant folder runs completely in the Resolve phase.
15220
15221         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15222         well.
15223
15224 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15225
15226         * cfold.cs: New file, this file contains the constant folder.
15227
15228         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15229         argument to track whether we are using the resulting address to
15230         load or store a value and provide better error messages. 
15231
15232         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15233         new AddressOf arguments.
15234
15235         * statement.cs (Foreach.EmitCollectionForeach): Update
15236
15237         * expression.cs (Argument.Emit): Call AddressOf with proper
15238         arguments to track usage.
15239
15240         (New.DoEmit): Call AddressOf with new arguments.
15241
15242         (Unary.Emit): Adjust AddressOf call.
15243
15244 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15245
15246         * cs-parser.jay (member_access): Change the case for pre-defined types
15247         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15248         this suggestion.
15249
15250         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15251         a method body.
15252
15253         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15254         essentially like methods and apply attributes like MethodImplOptions to them too.
15255
15256         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15257         not being null.
15258
15259         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15260         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15261         is the DeclSpace.
15262
15263         * Update code everywhere accordingly.
15264
15265         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15266
15267         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15268
15269 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15270
15271         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15272         try performing lookups against those instead of jumping straight into using
15273         the 'using' clauses.
15274
15275         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15276
15277         (LookupType): Perform lookups in implicit parents too.
15278
15279         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15280         sequence as RootContext.LookupType. 
15281
15282         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15283         the various cases of namespace lookups into this method.
15284
15285 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15286
15287         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15288         in positional arguments)
15289
15290         * class.cs (Operator): Update the AllowedModifiers to contain
15291         extern. 
15292
15293         * cs-parser.jay: Update operator declaration to allow for the
15294         operator body to be empty.
15295
15296         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15297         values. 
15298
15299 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15300
15301         * class.cs (Method.Emit): Label parameters.
15302
15303         * driver.cs: Return 1 or 0 as the program exit code.
15304
15305 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15306
15307         * expression.cs: Special case the `null' object when trying to
15308         auto-compute the type, as anything can be explicitly converted to
15309         that. 
15310
15311         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15312         spotting this Paolo.
15313
15314         (Expression.ImplicitNumericConversion): Perform comparissions of
15315         the type using the underlying type in the case of an enumeration
15316         rather than using the enumeration type for the compare.
15317
15318         Cope with the underlying == type case, which is not possible to
15319         catch before. 
15320
15321         (Expression.ConvertNumericExplicit): Perform comparissions of
15322         the type using the underlying type in the case of an enumeration
15323         rather than using the enumeration type for the compare.
15324
15325         * driver.cs: If the user does not supply an extension, assume .exe
15326
15327         * cs-parser.jay (if_statement): Rewrote so that we can track the
15328         location for the if statement.
15329
15330         * expression.cs (Binary.ConstantFold): Only concat strings when
15331         the operation is "+", not everything ;-)
15332
15333         * statement.cs (Statement.EmitBoolExpression): Take a location
15334         argument. 
15335         (If, While, Do): Track location.
15336
15337         * expression.cs (Binary.ResolveOperator): In the object + string
15338         case, I was missing a call to ConvertImplicit
15339
15340 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15341
15342         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15343         Location arguments. Ensure we use RootContext.LookupType to do our work
15344         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15345
15346         * interface.cs (PopulateMethod): Handle the type of the parameter being
15347         null gracefully.
15348
15349         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15350         have a params method with no fixed arguments and a call is made with no
15351         arguments.
15352
15353 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15354
15355         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15356         the verbatim-string-literal
15357
15358         * support.cs (InternalParameters.ParameterModifier): handle null
15359         fixed parameters.
15360         (InternalParameters.ParameterType): ditto.
15361
15362         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15363         duplicating the name of the variable parameter.
15364         (GetParameterByName): Fix bug where we were not looking up array
15365         paramters if they were the only present (thanks Paolo!).
15366         (GetParameterInfo): We only have an empty set of types if both
15367         fixed and array are set to null.
15368         (GetParameterInfo-idx): Handle FixedParameter == null
15369
15370         * cs-parser.jay: Handle the case where there is no catch
15371         statements (missing null test).
15372
15373 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15374
15375         * driver.cs (MainDriver): Be conservative on our command line
15376         handling.
15377
15378         Catch DirectoryNotFoundException when calling GetFiles.
15379
15380         (SplitPathAndPattern): Used to split the input specification into
15381         a path and a pattern that we can feed to Directory.GetFiles.
15382
15383 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15384
15385         * statement.cs (Fixed): Implement the last case of the Fixed
15386         statement (string handling).
15387
15388         * expression.cs (StringPtr): New class used to return a char * to
15389         a string;  Used by the Fixed statement.
15390
15391         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15392
15393         * expression.cs (Binary.ResolveOperator): Remove redundant
15394         MemberLookup pn parent type.
15395         Optimize union call, we do not need a union if the types are the same.
15396         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15397         type.
15398
15399         Specialize the use of MemberLookup everywhere, instead of using
15400         the default settings. 
15401
15402         (StackAlloc): Implement stackalloc keyword.
15403
15404         * cs-parser.jay: Add rule to parse stackalloc.
15405
15406         * driver.cs: Handle /h, /help, /?
15407
15408         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15409         before we supported unsafe code.
15410
15411         * makefile: add --unsafe to the self compilation of mcs.
15412
15413 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15414
15415         * expression.cs (PointerArithmetic): New class that is used to
15416         perform pointer arithmetic.
15417         (Binary.Resolve): Handle pointer arithmetic
15418         Handle pointer comparission.
15419         (ArrayPtr): Utility expression class that is used to take the
15420         address of an array.
15421
15422         (ElementAccess): Implement array access for pointers
15423
15424         * statement.cs (Fixed): Implement fixed statement for arrays, we
15425         are missing one more case before we are done.
15426
15427         * expression.cs (Indirection): Implement EmitAssign and set the
15428         ExprClass to Variable.  This allows pointer dereferences to be
15429         treated as variables, and to have values assigned to them.
15430
15431         * ecore.cs (Expression.StoreFromPtr): New utility function to
15432         store values dereferencing.
15433
15434 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15435
15436         * expression.cs (Binary.ResolveOperator): Ensure that we are
15437         not trying to operate on a void type - this fixes the reported
15438         bug.
15439
15440         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15441         the parent implementation is sealed.
15442
15443         * ../errors/cs0239.cs : Add.
15444
15445         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15446
15447         * typemanager.cs (unverifiable_code_type): Corresponds to 
15448         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15449         which have unsafe code in them.
15450
15451         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15452         unsafe context.
15453
15454 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15455
15456         * cs-tokenizer.cs: Add support for @"litreal strings"
15457
15458         Make tokenizer accept pre-processor directives
15459         on any column (remove the old C-like limitation). 
15460
15461         * rootcontext.cs (EmitCode): Emit any global attributes.
15462         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15463
15464         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15465
15466         * cs-parser.jay: Add support for global attributes.  
15467
15468 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15469
15470         * expression.cs (Indirection): New helper class.  Unary will
15471         create Indirection classes to be able to implement the
15472         IMemoryLocation interface on it.
15473
15474 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15475
15476         * cs-parser.jay (fixed_statement): reference the right statement.
15477
15478         * statement.cs (Fixed.Emit): Finish implementing the fixed
15479         statement for the &x case.
15480
15481 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15482
15483         * class.cs (Property.Define, Method.Define): Remove newslot when
15484         `implementing'.  
15485
15486         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15487         wrong.  NewSlot should only be used if the `new' keyword is present.
15488
15489         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15490         locating our system dir.  Sorry about this.
15491
15492 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15493
15494         * driver.cs (GetSystemDir): Compute correctly the location of our
15495         system assemblies.  I was using the compiler directory instead of
15496         the library directory.
15497
15498 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15499
15500         * expression.cs (BetterFunction): Put back in what Miguel commented out
15501         since it is the correct fix. The problem is elsewhere ;-)
15502
15503         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15504         parameters of the parms method are themselves compatible or not !
15505
15506         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15507         to check that a class implements an interface before saying that an implicit
15508         conversion was allowed. Use ImplementsInterface to do the checking.
15509
15510 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15511
15512         * class.cs (Method.Define): Track whether we are an explicit
15513         implementation or not.  And only call DefineMethodOverride if we
15514         are an explicit implementation.
15515
15516         (Property.DefineMethod): Ditto.
15517
15518 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15519
15520         * expression.cs (BetterFunction): Catch hideous bug which was
15521          preventing us from detecting ambiguous calls due to implicit casts i.e
15522         cs0121.
15523
15524 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15525
15526         * support.cs (Pair): Remove un-needed method.  I figured why I was
15527         getting the error in cs-parser.jay, the variable in a foreach loop
15528         is readonly, and the compiler does not really treat this as a variable.
15529
15530         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15531         instead of EQUALS in grammar.  
15532
15533         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15534
15535         * expression.cs (Unary.DoResolve): Check whether the argument is
15536         managed or not.
15537
15538 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15539
15540         * support.cs: Api for Pair to set a value.  Despite the fact that
15541         the variables are public the MS C# compiler refuses to compile
15542         code that accesses the field if the variable is part of a foreach
15543         statement. 
15544
15545         * statement.cs (Fixed): Begin implementation of the fixed
15546         statement.
15547
15548         (Block.AddVariable): Return the VariableInfo on success and null
15549         on failure instead of true/false. 
15550
15551         * cs-parser.jay (foreach): Catch errors on variables already
15552         defined (we were ignoring this value before) and properly unwind
15553         the block hierarchy
15554
15555         (fixed_statement): grammar for the fixed statement.
15556
15557 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15558
15559         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15560         pointer types to be incretemented.
15561
15562         (SizeOf): Implement.
15563
15564         * cs-parser.jay (pointer_member_access): Implement
15565         expr->IDENTIFIER production.
15566
15567         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15568         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15569         on safe contexts.
15570
15571         (Unary): Implement indirection.
15572
15573         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15574         use in non-unsafe context).
15575
15576         (SimpleName.DoResolve): Check for pointers in field access on safe
15577         contexts. 
15578
15579         (Expression.LoadFromPtr): Factor the load-indirect code in this
15580         function.  This was duplicated in UnboxCast and ParameterReference
15581
15582 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15583
15584         * expression.cs (ComposedCast): report an error if a pointer cast
15585         is used in a safe region.
15586
15587         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15588         pointer type casts in unsafe context.
15589
15590         * codegen.cs (EmitContext): Set up IsUnsafe.
15591
15592         * cs-parser.jay (non_expression_type): Add productions for pointer
15593         casts. 
15594
15595         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15596         code.  We should not use force into static mode if the method is
15597         not virtual.  Fixes bug in MIS
15598
15599         * statement.cs (Do.Emit, While.Emit, For.Emit,
15600         Statement.EmitBoolExpression): Add support to Do and While to
15601         propagate infinite loop as `I do return' semantics.
15602
15603         Improve the For case to also test for boolean constants.
15604
15605         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15606         to the list of attributes we can add.
15607
15608         Remove `EmitContext' argument.
15609
15610         * class.cs (Method.Define): Apply parameter attributes.
15611         (Constructor.Define): Apply parameter attributes.
15612         (MethodCore.LabelParameters): Move here the core of labeling
15613         parameters. 
15614
15615         * support.cs (ReflectionParameters.ParameterModifier,
15616         InternalParameters.ParameterModifier): Use IsByRef on the type and
15617         only return the OUT bit for these parameters instead of in/out/ref
15618         flags.
15619
15620         This is because I miss-understood things.  The ParameterInfo.IsIn
15621         and IsOut represent whether the parameter has the [In] and [Out]
15622         attributes set.  
15623
15624 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15625
15626         * ecore.cs (FieldExpr.Emit): Release temporaries.
15627
15628         * assign.cs (LocalTemporary.Release): new function.
15629
15630         * codegen.cs (EmitContext.GetTemporaryStorage,
15631         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15632         temporary storage.  Now we can "put back" localbuilders when we
15633         are done with them
15634
15635 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15636
15637         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15638         need to make a copy of the variable to generate verifiable code.
15639
15640 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * driver.cs: Compute dynamically the system directory.
15643
15644         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15645         Slower, but more generally useful.  Used by the abstract
15646         registering implementation. 
15647
15648         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15649         the rules for the special rule on Type/instances.  First check if
15650         we have the same name, and if so, try that special static path
15651         rather than the instance path.
15652
15653 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15654
15655         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15656         for, while and if.
15657
15658         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15659         Enum, ValueType, Delegate or Array for non-corlib compiles.
15660
15661         * cs-tokenizer.cs: Catch long identifiers (645)
15662
15663         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15664         piece of code.
15665
15666         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15667         fix, we were returning too early, so we were not registering
15668         pending methods from abstract classes.
15669
15670         Do not register pending methods if the class is abstract.
15671
15672         * expression.cs (Conditional.DoResolve): Report circular implicit
15673         conversions when we neecd to compute it for conditional
15674         expressions. 
15675
15676         (Is.DoResolve): If the expression is always of the provided type,
15677         flag warning 183.  If the expression can not ever be of the
15678         provided type flag warning 184.
15679
15680         * class.cs: Catch 169 as well.
15681
15682         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15683         read. 
15684
15685 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15686
15687         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15688
15689 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15690
15691         * interface.cs: (PopulateMethod): Check for pointers being defined
15692         only if the unsafe context is active.
15693         (PopulateProperty): ditto.
15694         (PopulateIndexer): ditto.
15695
15696         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15697         specified.  If pointers are present, make sure that they are
15698         present in an unsafe context.
15699         (Constructor, Constructor.Define): ditto.
15700         (Field, Field.Define): ditto.
15701         (Property, Property.Define): ditto.
15702         (Event, Event.Define): ditto.
15703
15704         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15705         hashtable if there are classes or structs defined.
15706
15707         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15708         code, as the constant resolution moved.
15709
15710         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15711         the metadata, so we can flag error 133. 
15712
15713         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15714         pointer is being declared in an unsafe context.
15715
15716 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15717
15718         * modifiers.cs (Modifiers.Check): Require a Location argument.
15719         Report error 227 for Unsafe use.
15720
15721         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15722
15723         * statement.cs (For.Emit): If the test is null, then report that
15724         we do `return', as we wont reach anything afterwards.
15725
15726         (Switch.SwitchGoverningType): Track the expression that matched
15727         the conversion.
15728
15729         * driver.cs: Allow negative numbers as an error code to flag.
15730
15731         * cs-parser.jay: Handle 1551.
15732
15733         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15734
15735 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15736
15737         * cs-parser.jay: Report 1518 (type declaration can only contain
15738         class, struct, interface, enum or delegate)
15739
15740         (switch_label): Report 1523 (keywords `case' or `default' must
15741         preced code)
15742
15743         (opt_switch_sections): Report 1522 (empty switch)
15744
15745         * driver.cs: Report 1515 (response file specified multiple times)
15746         Report 1516 (Source file specified multiple times).
15747
15748         * expression.cs (Argument.Resolve): Signal 1510
15749
15750         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15751         access not allowed in static code)
15752
15753 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15754
15755         * typemanager.cs (IsPointerType): Utility method which we are going
15756         to need a lot.
15757
15758         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15759         the object type, so we take care of that.
15760
15761         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15762
15763         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15764         added to non-params parameters :-)
15765
15766         * typemanager.cs (CSharpName): Include 'void' type too. 
15767
15768         (void_ptr_type): Include in the set of core types.
15769
15770         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15771         duplicating code.
15772
15773         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15774         an unsafe context.
15775
15776         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15777         completely forgotten about it.
15778
15779 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15780
15781         * cs-parser.jay (pointer_type): Add. This begins our implementation
15782         of parsing rules for unsafe code.
15783
15784         (unsafe_statement): Implement.
15785
15786         (embedded_statement): Modify to include the above.
15787
15788         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15789
15790         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15791         if the current context is an unsafe one.
15792
15793         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15794         are handled differently, we need separate rules for them.
15795
15796         (local_variable_declaration): Update to use local_variable_pointer_type
15797         to allow variable declarations of unmanaged pointer types.
15798
15799         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15800         in unsafe contexts.
15801
15802         * ../errors/cs0214.cs : Add.
15803
15804 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15805
15806         * makefile: remove 'response' file when cleaning.
15807
15808 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15809
15810         * cs-parser.jay: Report 1524.
15811
15812 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15813
15814         * typemanager.cs (RegisterMethod): drop checking if we have
15815         registered this from here
15816
15817 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15818
15819         * class.cs (Method.EmitDestructor): Implement calling our base
15820         destructor. 
15821
15822         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15823         value of InFinally.
15824
15825         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15826         this routine and will wrap the call in a try/catch block.  Deal
15827         with the case.
15828
15829 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15830
15831         * ecore.cs (Expression.MemberLookup): instead of taking a
15832         parameter `same_type' that was used to tell whether we could
15833         access private members we compute our containing type from the
15834         EmitContext.
15835
15836         (FieldExpr): Added partial support for volatile fields.  This does
15837         not work for volatile fields exposed from assemblies, as I can not
15838         figure out how to extract the modreq from it.
15839
15840         Updated all the source files to use this.
15841
15842         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15843         because it is referenced by MemberLookup very often. 
15844
15845 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15846
15847         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15848         TypeBuilder.GetCustomAttributes to retrieve what we need.
15849
15850         Get rid of redundant default_member_attr_type as this is the same as
15851         default_member_type which already exists.
15852
15853         * interface.cs, attribute.cs : Update accordingly.
15854
15855 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15856
15857         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15858         work for TYpeBuilders though.  Ravi, can you please fix this?
15859
15860         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15861
15862         * expression.cs (Argument.Emit): Handle the case of ref objects
15863         being passed to ref functions;  
15864
15865         (ParameterReference.EmitLoad): Loads the content of the pointer
15866         without dereferencing.
15867
15868 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15869
15870         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15871
15872 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15873
15874         * class.cs (Indexer.DefineMethod): Incorporate the interface
15875         type in the name of the method if we are doing explicit interface
15876         implementation.
15877
15878         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15879
15880         (BetterConversion): Fix extremely trivial bug where we were referring to
15881         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15882         again !
15883
15884         * ../errors/bug16.cs : Add although we have fixed it.
15885
15886 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15887
15888         * expression.cs (BaseIndexer): Begin implementation.
15889
15890         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15891
15892         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15893         production directly to remove a shift/reduce, and implement
15894         explicit interface implementation.
15895
15896         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15897         after a floating point suffix.
15898
15899         * expression.cs (DoNumericPromotions): Improved the conversion for
15900         uint/uint.  If we have a constant, we avoid doing a typecast to a
15901         larger type.
15902
15903         * class.cs (Indexer): Implement explicit interface implementation
15904         for indexers.
15905
15906 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15907
15908         * class.cs: make the default instance constructor public and hidebysig.
15909
15910 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15911
15912         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15913         so we can call it from elsewhere.
15914
15915         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15916         we emit it internally if the class has a defined indexer; otherwise the user
15917         emits it by decorating the class definition with the DefaultMemberAttribute.
15918
15919         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15920         attribute is not used on a type which defines an indexer.
15921
15922         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15923         character when we skip whitespace.
15924
15925         * ../errors/cs0646.cs : Add.
15926
15927 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15928
15929         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15930         again. 
15931
15932         * makefile: Add practical target `mcs3.exe' which builds the third
15933         generation compiler. 
15934
15935         * expression.cs (New): Fix structures constructor calling.
15936
15937         * class.cs (Property, Method, Indexer): Emit Final flag on the
15938         method if we are an interface implementation and we are not
15939         abstract. 
15940
15941         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15942         whether this property is referencing a `base' method.
15943
15944         * expression.cs (Invocation.EmitCall): take an extra argument:
15945         is_base, this is used to determine whether the `call' or
15946         `callvirt' opcode should be used.
15947
15948
15949         * delegate.cs: update EmitCall.
15950
15951         * class.cs (Method.Define): Set NewSlot for the cases where we are
15952         not implementing an interface method.
15953
15954         (Property.Define): ditto.
15955
15956 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15957
15958         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15959         'r'.  Allows mcs to parse itself fully.
15960
15961 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15962
15963         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15964         of the number of initializers that require the InitializeArray method.
15965
15966         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15967         update the above field where necessary.
15968
15969         (MakeByteBlob): Update accordingly.
15970
15971         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15972         greater than 2.
15973
15974         (EmitDynamicInitializers): Update in accordance with the new optimization.
15975
15976         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15977         same OpCode applies.
15978
15979         * cs-parser.jay : Fix some glaring errors I introduced.
15980
15981 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15982
15983         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15984         so that we can check for name clashes there too.
15985
15986         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15987         for interface indexers.
15988
15989         * interfaces.cs (Define): Emit the default member attribute.
15990
15991         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15992         variable was being referred to while setting the value ;-)
15993
15994 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15995
15996         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15997         byte-by-byte information when we know the data is zero.
15998
15999         Make the block always a multiple of 4, because
16000         DefineInitializedData has a bug.
16001
16002         * assign.cs: Fix, we should assign from the temporary, not from
16003         the source. 
16004
16005         * expression.cs (MakeByteBlob): Fix my incorrect code.
16006
16007 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16008
16009         * typemanager.cs (EnumToUnderlying): This function is used to get
16010         the underlying type from an enumeration, because it does not
16011         always work. 
16012
16013         * constant.cs: Use the I4_S form for values between -128 and 127.
16014
16015         * statement.cs (Block.LookupLabel): Looks up a label.
16016         (Block): Drop support for labeled blocks.
16017
16018         (LabeledStatement): New kind of statement that represents a label
16019         only.
16020
16021         (Goto): Finally implement this bad boy.
16022
16023         * cs-parser.jay: Update to reflect new mechanism to implement
16024         labels.
16025
16026 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16027
16028         * codegen.cs (EmitContext.This): a codegen property that keeps the
16029         a single instance of this instead of creating many different this
16030         instances. 
16031
16032         * delegate.cs (Delegate.DoResolve): Update to use the property;
16033
16034         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16035
16036         * expression.cs (BaseAccess.DoResolve): Ditto.
16037
16038 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16039
16040         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16041         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16042
16043         (InitCoreTypes): Update accordingly.
16044
16045         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16046         so we can quickly store the state.
16047
16048         (ApplyAttributes): Set the correct implementation flags
16049         for InternalCall methods.
16050
16051 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16052
16053         * expression.cs (EmitCall): if a method is not virtual, then do
16054         not use callvirt on it.
16055
16056         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16057         user defined stuff) requires the use of stobj, which takes an
16058         address on the stack instead of an array and an index.  So emit
16059         the Ldelema operation for it.
16060
16061         (EmitStoreOpcode): Use stobj for valuetypes.
16062
16063         (UnaryMutator.EmitCode): Use the right 1 value depending on
16064         whether we are dealing with int64/uint64, float or doubles.
16065
16066         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16067         constructors that I implemented last night.
16068
16069         (Constructor.IsDefault): Fix to work properly for static
16070         constructors.
16071
16072         * cs-parser.jay (CheckDef): report method signature errors.
16073         Update error number 103 to be 132.
16074
16075         * decl.cs: New AdditionResult enumeration value: MethodExists.
16076         Although we do this check for methods later on in the semantic
16077         analysis, catching repeated default constructors is so easy that
16078         we catch these here. 
16079
16080         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16081         promotions code.
16082
16083         (ParameterReference.EmitAssign, Emit): handle
16084         bools as bytes.
16085
16086         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16087         (ArrayAccess.EmitStoreOpcode): ditto.
16088
16089         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16090
16091         * expression.cs (MakeByteBlob): Complete all the missing types
16092         (uint, short, ushort, byte, sbyte)
16093
16094         * class.cs: Only init instance field initializers on instance
16095         constructors. 
16096
16097         Rename `constructors' to instance_constructors. 
16098
16099         (TypeContainer.AddConstructor): Only add constructors to the list
16100         if it is not static.
16101
16102         Make sure that we handle default_static_constructor independently
16103         everywhere where we handle instance_constructors
16104
16105 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16106
16107         * class.cs: Do not lookup or create a base initializer for a
16108         static constructor.
16109
16110         (ConstructorInitializer.Resolve): use the proper type to lookup
16111         for constructors.
16112
16113         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16114
16115         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16116         in DeclSpace. 
16117
16118         * decl.cs: CloseType is now an virtual method, the default
16119         implementation just closes this type.
16120
16121 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16122
16123         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16124         to PreserveSig by default. Also emit HideBySig on such methods.
16125
16126         Basically, set the defaults to standard values.
16127
16128         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16129         argument, if candidate is better, it can't be worse than the best !
16130
16131         (Invocation): Re-write bits to differentiate between methods being
16132         applicable in their expanded form and their normal form - for params
16133         methods of course.
16134
16135         Get rid of use_standard everywhere as only standard conversions are allowed
16136         in overload resolution. 
16137
16138         More spec conformance.
16139
16140 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16141
16142         * driver.cs: Add --timestamp, to see where the compiler spends
16143         most of its time.
16144
16145         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16146         `this' in static code.
16147
16148         (SimpleName.DoResolve): Implement in terms of a helper function
16149         that allows static-references to be passed upstream to
16150         MemberAccess.
16151
16152         (Expression.ResolveWithSimpleName): Resolve specially simple
16153         names when called by MemberAccess to implement the special
16154         semantics. 
16155
16156         (Expression.ImplicitReferenceConversion): Handle conversions from
16157         Null to reference types before others, as Null's type is
16158         System.Object. 
16159
16160         * expression.cs (Invocation.EmitCall): Handle the special case of
16161         calling methods declared on a reference type from a ValueType
16162         (Base classes System.Object and System.Enum)
16163
16164         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16165         the left hand side is a TypeExpr, not on every enumeration. 
16166
16167         (Binary.Resolve): If types are reference types, then do a cast to
16168         object on operators != and == of both arguments.
16169
16170         * typemanager.cs (FindMembers): Extract instance and static
16171         members if requested.
16172
16173         * interface.cs (PopulateProperty): Use void_type instead of null
16174         as the return type for the setter method.
16175
16176         (PopulateIndexer): ditto.
16177
16178 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16179
16180         * support.cs (ReflectionParameters): Fix minor bug where we
16181         were examining the wrong parameter for the ParamArray attribute.
16182
16183         Cope with requests for the type of the parameter at position
16184         greater than the params parameter's. We now return the element
16185         type of the params array as that makes more sense.
16186
16187         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16188         accordingly as we no longer have to extract the element type
16189         ourselves.
16190
16191         (Invocation.OverloadResolve): Update.
16192
16193 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16194
16195         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16196         against IEnumerator, test whether the return value is a descendant
16197         of the IEnumerator interface.
16198
16199         * class.cs (Indexer.Define): Use an auxiliary method to implement
16200         the other bits of the method definition.  Begin support for
16201         explicit interface implementation.
16202
16203         (Property.DefineMethod): Use TypeManager.void_type instead of null
16204         for an empty return value.
16205
16206 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16207
16208         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16209         dealing with a FieldExpr which is composed of a FieldBuilder, in
16210         the code path we did extract the constant, but we should have
16211         obtained the underlying value to be able to cast it (otherwise we
16212         end up in an infinite loop, this is what Ravi was running into).
16213
16214         (ArrayCreation.UpdateIndices): Arrays might be empty.
16215
16216         (MemberAccess.ResolveMemberAccess): Add support for section
16217         14.5.4.1 that deals with the special case of E.I when E is a type
16218         and something else, that I can be a reference to a static member.
16219
16220         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16221         handle a particular array type to create byte blobs, it is just
16222         something we dont generate byteblobs for.
16223
16224         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16225         arguments. 
16226
16227         * location.cs (Push): remove the key from the hashtable that we
16228         are about to add.   This happens for empty files.
16229
16230         * driver.cs: Dispose files after we have parsed them.
16231
16232         (tokenize): new function that only runs the tokenizer on its
16233         input, for speed testing.
16234
16235 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16236
16237         * class.cs (Event.Define): Define the private field only if there
16238         are no accessors defined.
16239
16240         * expression.cs (ResolveMemberAccess): If there is no associated
16241         field with the event, that means we have an event defined with its
16242         own accessors and we should flag error cs0070 since transforming
16243         ourselves into a field is not valid in that case.
16244
16245         * ecore.cs (SimpleName.DoResolve): Same as above.
16246
16247         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16248         and charset to sane values.
16249
16250 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16251
16252         * assign.cs (DoResolve): Perform check on events only if they 
16253         are being accessed outside the declaring type.
16254
16255         * cs-parser.jay (event_declarations): Update rules to correctly
16256         set the type of the implicit parameter etc.
16257
16258         (add_accessor, remove_accessor): Set current local parameters.
16259
16260         * expression.cs (Binary): For delegate addition and subtraction,
16261         cast the return value from the method into the appropriate delegate
16262         type.
16263
16264 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16265
16266         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16267         of these as the workaround is unnecessary.
16268
16269         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16270         delegate data - none of that is needed at all.
16271
16272         Re-write bits to extract the instance expression and the delegate method
16273         correctly.
16274
16275         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16276         on delegates too.
16277
16278         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16279         of attaching attributes instead of duplicating code everywhere.
16280
16281         * everywhere : Update code to do attribute emission using the above method.
16282
16283 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16284
16285         * expression.cs (IsParamsMethodApplicable): if there are not
16286         parameters, return immediately.
16287
16288         * ecore.cs: The 0 literal can be implicity converted to an enum
16289         type. 
16290
16291         (SimpleName.DoResolve): First lookup the type, then lookup the
16292         members. 
16293
16294         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16295         want to get its address.  If the InstanceExpression is not
16296         addressable, store the result in a temporary variable, then get
16297         the address of it.
16298
16299         * codegen.cs: Only display 219 errors on warning level or above. 
16300
16301         * expression.cs (ArrayAccess): Make it implement the
16302         IMemoryLocation interface.
16303
16304         (Binary.DoResolve): handle the operator == (object a, object b)
16305         and operator != (object a, object b) without incurring into a
16306         BoxedCast (because 5 != o should never be performed).
16307
16308         Handle binary enumerator operators.
16309
16310         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16311         value type, otherwise use Ldelem_ref.
16312
16313         Use precomputed names;
16314
16315         (AddressOf): Implement address of
16316
16317         * cs-parser.jay (labeled_statement): Fix recursive block
16318         addition by reworking the production.
16319
16320         * expression.cs (New.DoEmit): New has a special case:
16321                 
16322                  If we are dealing with a ValueType, we have a few
16323                  situations to deal with:
16324                 
16325                     * The target of New is a ValueType variable, that is
16326                       easy, we just pass this as the variable reference
16327                 
16328                     * The target of New is being passed as an argument,
16329                       to a boxing operation or a function that takes a
16330                       ValueType.
16331                 
16332                       In this case, we need to create a temporary variable
16333                       that is the argument of New.
16334
16335
16336 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16337
16338         * rootcontext.cs (LookupType): Check that current_type is not null before
16339         going about looking at nested types.
16340
16341         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16342         not implement the IAssignMethod interface any more.
16343
16344         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16345         where we tranform them into FieldExprs if they are being resolved from within
16346         the declaring type.
16347
16348         * ecore.cs (SimpleName.DoResolve): Do the same here.
16349
16350         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16351
16352         * ../errors/bug10.cs : Add.
16353
16354         * ../errors/cs0070.cs : Add.
16355
16356         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16357
16358         * assign.cs : Get rid of EventIsLocal everywhere.
16359
16360 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16361
16362         * ecore.cs (ConvertIntLiteral): finished the implementation.
16363
16364         * statement.cs (SwitchLabel): Convert the value we are using as a
16365         key before looking up the table.
16366
16367 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16368
16369         * codegen.cs (EmitTopBlock): Require a Location argument now.
16370
16371         * cs-parser.jay (constructor_declarator): We need to setup
16372         current_local_parameters before we parse the
16373         opt_constructor_initializer, to allow the variables to be bound
16374         to the constructor arguments.
16375
16376         * rootcontext.cs (LookupType): First lookup nested classes in our
16377         class and our parents before we go looking outside our class.
16378
16379         * expression.cs (ConstantFold): Extract/debox the values at the
16380         beginnning. 
16381
16382         * rootcontext.cs (EmitCode): Resolve the constants first before we
16383         resolve the types.  This is not really needed, but it helps debugging.
16384
16385         * statement.cs: report location.
16386
16387         * cs-parser.jay: pass location to throw statement.
16388
16389         * driver.cs: Small bug fix.
16390
16391         * report.cs: Updated format to be 4-zero filled digits.
16392
16393 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16394
16395         * expression.cs (CheckIndices): Fix minor bug where the wrong
16396         variable was being referred to ;-)
16397
16398         (DoEmit): Do not call EmitStaticInitializers when the 
16399         underlying type is System.Object.
16400
16401 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16402
16403         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16404         and do the usual workaround for SRE.
16405
16406         * class.cs (MyEventBuilder.EventType): New member to get at the type
16407         of the event, quickly.
16408
16409         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16410
16411         * assign.cs (Assign.DoResolve): Handle the case when the target
16412         is an EventExpr and perform the necessary checks.
16413
16414         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16415         interface.
16416
16417         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16418
16419         (EventExpr): Set the type in the constructor itself since we 
16420         are meant to be born fully resolved.
16421
16422         (EventExpr.Define): Revert code I wrote earlier.
16423                 
16424         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16425         instance expression is null. The instance expression is a This in that case
16426         or a null, depending on whether it is a static method or not.
16427
16428         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16429         refers to more than one method.
16430
16431         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16432         and accordingly flag errors.
16433
16434 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16435
16436         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16437
16438 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16439
16440         * location.cs (ToString): Provide useful rutine.
16441
16442 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16443
16444         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16445         objects, return the actual integral boxed.
16446
16447         * statement.cs (SwitchLabel): define an ILLabel for each
16448         SwitchLabel. 
16449
16450         (Switch.CheckSwitch): If the value is a Literal, extract
16451         the underlying literal.
16452
16453         Also in the unused hashtable we had, add the SwitchLabel so we can
16454         quickly look this value up.
16455
16456         * constant.cs: Implement a bunch of new constants.  Rewrite
16457         Literal based on this.  Made changes everywhere to adapt to this.
16458
16459         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16460         dereferencing array only once, and also copes with enumrations.
16461
16462         bytes are two bytes wide, not one.
16463
16464         (Cast): Perform constant conversions.
16465
16466         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16467         wrappers to the literals here.
16468
16469         * expression.cs (DoNumericPromotions): long literals can converted
16470         to ulong implicity (this is taken care of elsewhere, but I was
16471         missing this spot).
16472
16473         * ecore.cs (Expression.Literalize): Make the return type Literal,
16474         to improve type checking.
16475
16476         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16477
16478 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16479
16480         * literal.cs: Revert code from ravi that checked the bounds.  The
16481         bounds are sane by the definition of the type itself. 
16482
16483         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16484         need to actually look up in our parent hierarchy for interfaces
16485         implemented. 
16486
16487         * const.cs: Use the underlying type for enumerations
16488
16489         * delegate.cs: Compute the basename for the delegate creation,
16490         that should fix the delegate test case, and restore the correct
16491         Type Lookup semantics in rootcontext
16492
16493         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16494         referencing a nested type with the Reflection API is using the "+"
16495         sign. 
16496
16497         * cs-parser.jay: Do not require EOF token at the end.
16498
16499 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16500
16501         * rootcontext.cs (LookupType): Concatenate type names with
16502         a '.' instead of a '+' The test suite passes again.
16503
16504         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16505         field of the enumeration.
16506
16507         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16508         the case when the member is an EventExpr.
16509
16510         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16511         static has an associated instance expression.
16512
16513         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16514
16515         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16516
16517         * class.cs (Event.Define): Register event and perform appropriate checks
16518         for error #111.
16519
16520         We define the Add and Remove methods even if the use provides none because
16521         in that case, we provide default implementations ourselves.
16522
16523         Define a private field of the type of the event. This is done by the CSC compiler
16524         and we should be doing it too ;-)
16525
16526         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16527         More methods we use in code we generate.
16528
16529         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16530         is important.
16531
16532         (InitCoreTypes): Update accordingly for the above.
16533
16534         * class.cs (Event.Emit): Generate code for default accessors that we provide
16535
16536         (EmitDefaultMethod): Do the job in the above.
16537
16538         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16539         appropriate place.
16540
16541 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16542
16543         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16544         builders even if we were missing one.
16545
16546         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16547         pass the Basename as our class name instead of the Name.  The
16548         basename will be correctly composed for us.
16549
16550         * parameter.cs (Paramters): Now takes a Location argument.
16551
16552         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16553         make all the code call directly LookupType in RootContext and take
16554         this chance to pass the Location information everywhere.
16555
16556         * Everywhere: pass Location information.
16557
16558 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16559
16560         * class.cs (Constructor.Define): Updated way of detecting the
16561         length of the parameters.
16562
16563         (TypeContainer.DefineType): Use basename as the type name for
16564         nested types.
16565
16566         (TypeContainer.Define): Do not recursively define types here, as
16567         definition is taken care in order by the RootContext.
16568
16569         * tree.cs: Keep track of namespaces in a per-file basis.
16570
16571         * parameter.cs (Parameter.ComputeSignature): Update to use
16572         DeclSpace. 
16573
16574         (Parameters.GetSignature): ditto.
16575
16576         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16577         instead of a TypeContainer.
16578
16579         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16580         resolve names.  Because we need to be resolve in our context, not
16581         our parents.
16582
16583         * driver.cs: Implement response files.
16584
16585         * class.cs (TypeContainer.DefineType): If we are defined, do not
16586         redefine ourselves.
16587
16588         (Event.Emit): Emit the code for add/remove handlers.
16589         (Event.Define): Save the MethodBuilders for add/remove.
16590
16591         * typemanager.cs: Use pair here too.
16592
16593         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16594         DictionaryEntry requires the first argument to be non-null.  
16595
16596         (enum_declaration): Compute full name for registering the
16597         enumeration.
16598
16599         (delegate_declaration): Instead of using
16600         formal_parameter_list, use opt_formal_parameter_list as the list
16601         can be empty.
16602
16603         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16604         (EventParsing): New property that controls whether `add' and
16605         `remove' are returned as tokens or identifiers (for events);
16606
16607 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16608
16609         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16610         use MyEventBuilder only and let it wrap the real builder for us.
16611
16612         (MyEventBuilder): Revamp constructor etc.
16613
16614         Implement all operations that we perform on EventBuilder in precisely the same
16615         way here too.
16616
16617         (FindMembers): Update to use the EventBuilder member.
16618
16619         (Event.Emit): Update accordingly.
16620
16621 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16622
16623         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16624         by calling the appropriate methods.
16625
16626         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16627         useful.
16628
16629         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16630
16631 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16632
16633         * delegate.cs (Delegate.Populate): Check that the return type
16634         and various parameters types are indeed accessible.
16635
16636         * class.cs (Constructor.Define): Same here.
16637
16638         (Field.Define): Ditto.
16639
16640         (Event.Define): Ditto.
16641
16642         (Operator.Define): Check that the underlying Method defined itself
16643         correctly - so it's MethodBuilder should not be null.
16644
16645         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16646         expression happens to be null.
16647
16648         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16649         members but as of now we don't seem to be able to do anything really useful with it.
16650
16651         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16652         not the EventBuilder.
16653
16654 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16655
16656         * cs-tokenizer.cs: Add support for defines.
16657         Add support for #if, #elif, #else, #endif
16658
16659         (eval_var): evaluates a variable.
16660         (eval): stubbed for evaluating functions.
16661
16662         * cs-parser.jay: Pass the defines information
16663
16664         * driver.cs: Add --define command line option.
16665
16666         * decl.cs: Move MemberCore here.
16667
16668         Make it the base class for DeclSpace.  This allows us to catch and
16669         report 108 and 109 for everything now.
16670
16671         * class.cs (TypeContainer.Define): Extract all the members
16672         before populating and emit the warning 108 (new keyword required
16673         to override) instead of having each member implement this.
16674
16675         (MemberCore.Define): New abstract method, we will be using this in
16676         the warning reporting engine in Populate.
16677
16678         (Operator.Define): Adjust to new MemberCore protocol. 
16679
16680         * const.cs (Const): This does not derive from Expression, it is a
16681         temporary object we use to create fields, it is a MemberCore. 
16682
16683         * class.cs (Method.Define): Allow the entry point to be in a
16684         specific class.
16685
16686         * driver.cs: Rewrite the argument handler to clean it up a bit.
16687
16688         * rootcontext.cs: Made it just an auxiliary namespace feature by
16689         making everything static.
16690
16691         * driver.cs: Adapt code to use RootContext type name instead of
16692         instance variable.
16693
16694         * delegate.cs: Remove RootContext argument.
16695
16696         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16697         argument. 
16698
16699         * class.cs (Event.Define): The lookup can fail.
16700
16701         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16702
16703         * expression.cs: Resolve the this instance before invoking the code.
16704
16705 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16706
16707         * cs-parser.jay: Add a production in element_access that allows
16708         the thing to become a "type" reference.  This way we can parse
16709         things like "(string [])" as a type.
16710
16711         Note that this still does not handle the more complex rules of
16712         casts. 
16713
16714
16715         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16716
16717         * ecore.cs: (CopyNewMethods): new utility function used to
16718         assemble the list of methods from running FindMembers.
16719
16720         (MemberLookup): Rework FindMembers so that 
16721
16722 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16723
16724         * class.cs (TypeContainer): Remove Delegates who fail to be
16725         defined.
16726
16727         * delegate.cs (Populate): Verify that we dont get null return
16728         values.   TODO: Check for AsAccessible.
16729
16730         * cs-parser.jay: Use basename to emit error 574 (destructor should
16731         have the same name as container class), not the full name.
16732
16733         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16734         possible representation.  
16735
16736         Also implements integer type suffixes U and L.
16737
16738 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16739
16740         * expression.cs (ArrayCreation.DoResolve): We need to do the
16741         argument resolution *always*.
16742
16743         * decl.cs: Make this hold the namespace.  Hold the root context as
16744         well.
16745         (LookupType): Move here.
16746
16747         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16748
16749         * location.cs (Row, Name): Fixed the code, it was always returning
16750         references to the first file.
16751
16752         * interface.cs: Register properties defined through interfaces.
16753
16754         * driver.cs: Add support for globbing on the command line
16755
16756         * class.cs (Field): Make it derive from MemberCore as well.
16757         (Event): ditto.
16758
16759 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16760
16761         * class.cs (Event::Define): Check that the type of the event is a delegate
16762         type else flag error #66.
16763
16764         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16765         same.
16766
16767         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16768         values of EntryPoint, CharSet etc etc.
16769
16770         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16771
16772         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16773         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16774         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16775         which needs this to do its work.
16776
16777         * ../errors/cs0066.cs : Add.
16778
16779 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16780
16781         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16782         helper functions.
16783
16784         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16785         clears out the parameters field.
16786         (MemberSignatureCompare): Cleanup
16787
16788         (MemberCore): New base class used to share code between MethodCore
16789         and Property.
16790
16791         (RegisterRequiredImplementations) BindingFlags.Public requires
16792         either BindingFlags.Instace or Static.  Use instance here.
16793
16794         (Property): Refactored code to cope better with the full spec.
16795
16796         * parameter.cs (GetParameterInfo): Return an empty array instead
16797         of null on error.
16798
16799         * class.cs (Property): Abstract or extern properties have no bodies.
16800
16801         * parameter.cs (GetParameterInfo): return a zero-sized array.
16802
16803         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16804         method modifier validation to the typecontainer so we can reuse
16805         this on properties.
16806
16807         (MethodCore.ParameterTypes): return an empty sized array of types.
16808
16809         (Property.Define): Test property modifier validity.
16810
16811         Add tests for sealed/override too.
16812
16813         (Method.Emit): abstract or extern methods have no bodies.
16814
16815 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16816
16817         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16818         thing.
16819
16820         (Method::Define, ::Emit): Modify accordingly.
16821
16822         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16823
16824         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16825
16826         * makefile: Pass in /unsafe.
16827
16828 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16829
16830         * class.cs (MakeKey): Kill routine.
16831
16832         * class.cs (TypeContainer.Define): Correctly define explicit
16833         method implementations (they require the full interface name plus
16834         the method name).
16835
16836         * typemanager.cs: Deply the PtrHashtable here and stop using the
16837         lame keys.  Things work so much better.
16838
16839         This of course broke everyone who depended on `RegisterMethod' to
16840         do the `test for existance' test.  This has to be done elsewhere.
16841
16842         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16843         the object stupid Equals method (because, that like fails all over
16844         the place).  We still do not use it.
16845
16846         * class.cs (TypeContainer.SetRequiredInterface,
16847         TypeContainer.RequireMethods): Killed these two routines and moved
16848         all the functionality to RegisterRequiredImplementations.
16849
16850         (TypeContainer.RegisterRequiredImplementations): This routine now
16851         registers all the implementations required in an array for the
16852         interfaces and abstract methods.  We use an array of structures
16853         which can be computed ahead of time to reduce memory usage and we
16854         also assume that lookups are cheap as most classes will not
16855         implement too many interfaces.
16856
16857         We also avoid creating too many MethodSignatures.
16858
16859         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16860         clear the "pending" bit if we find that there are problems with
16861         the declaration.
16862
16863         (TypeContainer.VerifyPendingMethods): Update to report errors of
16864         methods that look like implementations but are not.
16865
16866         (TypeContainer.Define): Add support for explicit interface method
16867         implementation. 
16868
16869 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16870
16871         * typemanager.cs: Keep track of the parameters here instead of
16872         being a feature of the TypeContainer.
16873
16874         * class.cs: Drop the registration of parameters here, as
16875         InterfaceMethods are also interface declarations.
16876
16877         * delegate.cs: Register methods with the TypeManager not only with
16878         the TypeContainer.  This code was buggy.
16879
16880         * interface.cs: Full registation here.
16881
16882 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16883
16884         * expression.cs: Remove reducer for binary expressions, it can not
16885         be done this way.
16886
16887         * const.cs: Put here the code that used to go into constant.cs
16888
16889         * constant.cs: Put here the code for constants, this is a new base
16890         class for Literals.
16891
16892         * literal.cs: Make Literal derive from Constant.
16893
16894 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16895
16896         * statement.cs (Return.Emit): Report error 157 if the user
16897         attempts to return from a finally block.
16898
16899         (Return.Emit): Instead of emitting a return, jump to the end of
16900         the function.
16901
16902         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16903         LocalBuilder to store the result of the function.  ReturnLabel is
16904         the target where we jump.
16905
16906
16907 2001-12-09  Radek Doulik  <rodo@ximian.com>
16908
16909         * cs-parser.jay: remember alias in current namespace
16910
16911         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16912         namespaces
16913
16914         * class.cs (LookupAlias): lookup alias in my_namespace
16915
16916         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16917         aliases hashtable
16918         (LookupAlias): lookup alias in this and if needed in parent
16919         namespaces
16920
16921 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16922
16923         * support.cs: 
16924
16925         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16926         making things static.  I need this to avoid passing the
16927         TypeContainer when calling ParameterType.
16928
16929         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16930         that did string manipulation to compute the type and then call
16931         GetType.  Use Parameter.ParameterType instead.
16932
16933         * cs-tokenizer.cs: Consume the suffix for floating values.
16934
16935         * expression.cs (ParameterReference): figure out whether this is a
16936         reference parameter or not.  Kill an extra variable by computing
16937         the arg_idx during emission.
16938
16939         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16940         function that returns whether a parameter is an out/ref value or not.
16941
16942         (Parameter.ParameterType): The type of the parameter (base,
16943         without ref/out applied).
16944
16945         (Parameter.Resolve): Perform resolution here.
16946         (Parameter.ExternalType): The full type (with ref/out applied).
16947
16948         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16949         support for expressions on the using statement.
16950
16951 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16952
16953         * statement.cs (Using.EmitLocalVariableDecls): Split the
16954         localvariable handling of the using statement.
16955
16956         (Block.EmitMeta): Keep track of variable count across blocks.  We
16957         were reusing slots on separate branches of blocks.
16958
16959         (Try.Emit): Emit the general code block, we were not emitting it. 
16960
16961         Check the type of the declaration to be an IDisposable or
16962         something that can be implicity converted to it. 
16963
16964         Emit conversions if required.
16965
16966         * ecore.cs (EmptyExpression): New utility class.
16967         (Expression.ImplicitConversionExists): New utility function.
16968
16969 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16970
16971         * statement.cs (Using): Implement.
16972
16973         * expression.cs (LocalVariableReference): Support read only variables.
16974
16975         * statement.cs: Remove the explicit emit for the Leave opcode.
16976         (VariableInfo): Add a readonly field.
16977
16978 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16979
16980         * ecore.cs (ConvCast): new class used to encapsulate the various
16981         explicit integer conversions that works in both checked and
16982         unchecked contexts.
16983
16984         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16985         properly generate the overflow opcodes.
16986
16987 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16988
16989         * statement.cs: The correct type for the EmptyExpression is the
16990         element_type, not the variable type.  Ravi pointed this out.
16991
16992 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16993
16994         * class.cs (Method::Define): Handle PInvoke methods specially
16995         by using DefinePInvokeMethod instead of the usual one.
16996
16997         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16998         above to do the task of extracting information and defining the method.
16999
17000 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17001
17002         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17003         of the condition for string type.
17004
17005         (Emit): Move that here. 
17006
17007         (ArrayCreation::CheckIndices): Keep string literals in their expression
17008         form.
17009
17010         (EmitDynamicInitializers): Handle strings appropriately.
17011
17012 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17013
17014         * codegen.cs (EmitContext): Replace multiple variables with a
17015         single pointer to the current Switch statement.
17016
17017         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17018         EmitContext.
17019
17020 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17021
17022         * statement.cs 
17023
17024         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17025         default'.
17026
17027         (Foreach.Emit): Foreach on arrays was not setting
17028         up the loop variables (for break/continue).
17029
17030         (GotoCase): Semi-implented.
17031
17032 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17033
17034         * attribute.cs (CheckAttribute): Handle system attributes by using
17035         Attribute.GetAttributes to examine information we need.
17036
17037         (GetValidPlaces): Same here.
17038
17039         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17040
17041         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17042
17043         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17044
17045         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17046
17047         (Method::Emit): Handle the case when we are a PInvoke method.
17048
17049 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17050
17051         * expression.cs: Use ResolveWithSimpleName on compound names.
17052
17053 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17054
17055         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17056         before trying to reduce it.
17057
17058         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17059
17060         * constant.cs (LookupConstantValue): Implement.
17061
17062         (EmitConstant): Use the above in emitting the constant.
17063
17064         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17065         that are user-defined by doing a LookupConstantValue on them.
17066
17067         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17068         too, like above.
17069
17070 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17071
17072         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17073
17074         (BaseAccess.DoResolve): Implement.
17075
17076         (MemberAccess.DoResolve): Split this routine into a
17077         ResolveMemberAccess routine that can be used independently
17078
17079 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17080
17081         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17082         As that share bits of the implementation.  Is returns a boolean,
17083         while As returns the Type that is being probed.
17084
17085 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17086
17087         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17088         instead of a Literal - much easier.
17089
17090         (EnumInTransit): Remove - utterly useless :-)
17091
17092         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17093
17094         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17095
17096         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17097         chain when we have no associated expression.
17098
17099 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17100
17101         * constant.cs (Define): Use Location while reporting the errror.
17102
17103         Also emit a warning when 'new' is used and there is no inherited
17104         member to hide.
17105
17106         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17107         populated.
17108
17109         (LookupEnumValue): Implement to lookup an enum member's value and define it
17110         if necessary.
17111
17112         (Populate): Re-write accordingly to use the above routine.
17113
17114 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17115
17116         * expression.cs (This): Fix prototype for DoResolveLValue to
17117         override the base class DoResolveLValue.
17118
17119         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17120         declarations) 
17121
17122         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17123         (we need to load the address of the field here).  This fixes
17124         test-22. 
17125
17126         (FieldExpr.DoResolveLValue): Call the DoResolve
17127         function to initialize the Instance expression.
17128
17129         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17130         correctly the GetEnumerator operation on a value type.
17131
17132         * cs-parser.jay: Add more simple parsing error catches.
17133
17134         * statement.cs (Switch): Add support for string switches.
17135         Handle null specially.
17136
17137         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17138
17139 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17140
17141         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17142
17143         (declare_local_constant): New helper function.
17144
17145         * statement.cs (AddConstant): Keep a separate record of constants
17146
17147         (IsConstant): Implement to determine if a variable is a constant.
17148
17149         (GetConstantExpression): Implement.
17150
17151         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17152
17153         * statement.cs (IsVariableDefined): Re-write.
17154
17155 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17156
17157         * class.cs (TypeContainer::FindMembers): Look for constants
17158         in the case when we are looking for MemberTypes.Field
17159
17160         * expression.cs (MemberAccess::DoResolve): Check that in the
17161         case we are a FieldExpr and a Literal, we are not being accessed
17162         by an instance reference.
17163
17164         * cs-parser.jay (local_constant_declaration): Implement.
17165
17166         (declaration_statement): Implement for constant declarations.
17167
17168 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17169
17170         * statement.cs (Switch): Catch double defaults.
17171
17172         (Switch): More work on the switch() statement
17173         implementation.  It works for integral values now, need to finish
17174         string support.
17175
17176
17177 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17178
17179         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17180         integer literals into other integer literals.  To be used by
17181         switch. 
17182
17183 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17184
17185         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17186         some memory.
17187
17188         (EmitDynamicInitializers): Cope with the above since we extract data
17189         directly from ArrayData now.
17190
17191         (ExpectInitializers): Keep track of whether initializers are mandatory
17192         or not.
17193
17194         (Bounds): Make it a hashtable to prevent the same dimension being 
17195         recorded for every element in that dimension.
17196
17197         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17198         from being found.
17199
17200         Also fix bug which was causing the indices to be emitted in the reverse
17201         order.
17202
17203 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17204
17205         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17206         unfinished.  They do not work, because the underlying code is
17207         sloppy.
17208
17209 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17210
17211         * cs-parser.jay: Remove bogus fixme.
17212
17213         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17214         on Switch statement.
17215
17216 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17217
17218         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17219         the same. 
17220
17221         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17222         parameter. Apparently, any expression is allowed. 
17223
17224         (ValidateInitializers): Update accordingly.
17225
17226         (CheckIndices): Fix some tricky bugs thanks to recursion.
17227
17228         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17229         I was being completely brain-dead.
17230
17231         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17232         and re-write acordingly.
17233
17234         (DelegateInvocation): Re-write accordingly.
17235
17236         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17237
17238         (MakeByteBlob): Handle types more correctly.
17239
17240         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17241         initialization from expressions but it is incomplete because I am a complete
17242         Dodo :-|
17243
17244 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17245
17246         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17247         on If.  Basically, we have to return `true' (ie, we do return to
17248         our caller) only if both branches of the if return.
17249
17250         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17251         short-circuit operators, handle them as short circuit operators. 
17252
17253         (Cast.DoResolve): Resolve type.
17254         (Cast.Cast): Take an expression as the target type.
17255
17256         * cs-parser.jay (cast_expression): Remove old hack that only
17257         allowed a limited set of types to be handled.  Now we take a
17258         unary_expression and we resolve to a type during semantic
17259         analysis.
17260
17261         Use the grammar productions from Rhys to handle casts (this is
17262         not complete like Rhys syntax yet, we fail to handle that corner
17263         case that C# has regarding (-x), but we will get there.
17264
17265 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17266
17267         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17268         field which is an array type.
17269
17270         * cs-parser.jay (declare_local_variables): Support array initialization too.
17271
17272         * typemanager.cs (MakeKey): Implement.
17273
17274         (everywhere): Use the above appropriately.
17275
17276         * cs-parser.jay (for_statement): Update for array initialization while
17277         declaring variables.
17278
17279         * ecore.cs : The error message was correct, it's the variable's names that
17280         were misleading ;-) Make the code more readable.
17281
17282         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17283         the correct type etc.
17284
17285         (ConvertExplicit): Handle Enum types by examining the underlying type.
17286
17287 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17288
17289         * parameter.cs (GetCallingConvention): Always return
17290         CallingConventions.Standard for now.
17291
17292 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17293
17294         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17295         and `r' after calling DoNumericPromotions.
17296
17297         * ecore.cs: Fix error message (the types were in the wrong order).
17298
17299         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17300         BindingFlags.Instance as well 
17301
17302         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17303         implicit int literal conversion in an empty cast so that we
17304         propagate the right type upstream.
17305
17306         (UnboxCast): new class used to unbox value types.
17307         (Expression.ConvertExplicit): Add explicit type conversions done
17308         by unboxing.
17309
17310         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17311         the target type before applying the implicit LongLiterals to ULong
17312         literal cast.
17313
17314 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17315
17316         * cs-parser.jay (for_statement): Reworked the way For works: now
17317         we declare manually any variables that are introduced in
17318         for_initializer to solve the problem of having out-of-band code
17319         emition (that is what got for broken).
17320
17321         (declaration_statement): Perform the actual variable declaration
17322         that used to be done in local_variable_declaration here.
17323
17324         (local_variable_declaration): Do not declare anything, just pass
17325         the information on a DictionaryEntry
17326
17327 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17328
17329         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17330         re-write of the logic to now make it recursive.
17331
17332         (UpdateIndices): Re-write accordingly.
17333
17334         Store element data in a separate ArrayData list in the above methods.
17335
17336         (MakeByteBlob): Implement to dump the array data into a byte array.
17337
17338 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17339
17340         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17341         into CheckIndices.
17342
17343         * constant.cs (Define): Implement.
17344
17345         (EmitConstant): Re-write fully.
17346
17347         Pass in location info.
17348
17349         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17350         respectively.
17351
17352         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17353         DictionaryEntry since we need location info too.
17354
17355         (constant_declaration): Update accordingly.
17356
17357         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17358         code into another method : UpdateIndices.
17359
17360 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17361
17362         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17363         some type checking etc.
17364
17365 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17366
17367         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17368         bits to provide dimension info if the user skips doing that.
17369
17370         Update second constructor to store the rank correctly.
17371
17372 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17373
17374         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17375         and try to implement.
17376
17377         * ../errors/cs0150.cs : Add.
17378
17379         * ../errors/cs0178.cs : Add.
17380
17381 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17382
17383         * statement.cs: Implement foreach on multi-dimensional arrays. 
17384
17385         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17386         name of the params argument.
17387
17388         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17389         initializing the array.
17390
17391         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17392         we can use this elsewhere.
17393
17394         * statement.cs: Finish implementation of foreach for single
17395         dimension arrays.
17396
17397         * cs-parser.jay: Use an out-of-band stack to pass information
17398         around, I wonder why I need this.
17399
17400         foreach_block: Make the new foreach_block the current_block.
17401
17402         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17403         function used to return a static Parameters structure.  Used for
17404         empty parameters, as those are created very frequently.
17405
17406         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17407
17408 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17409
17410         * interface.cs : Default modifier is private, not public. The
17411         make verify test passes again.
17412
17413 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17414
17415         * support.cs (ReflectionParameters): Fix logic to determine
17416         whether the last parameter is a params one. Test 9 passes again.
17417
17418         * delegate.cs (Populate): Register the builders we define with
17419         RegisterParameterForBuilder. Test 19 passes again.
17420
17421         * cs-parser.jay (property_declaration): Reference $6 instead
17422         of $$ to get at the location.
17423
17424         (indexer_declaration): Similar stuff.
17425
17426         (attribute): Ditto.
17427
17428         * class.cs (Property): Register parameters for the Get and Set methods
17429         if they exist. Test 23 passes again.
17430
17431         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17432         call to EmitArguments as we are sure there aren't any params arguments. 
17433         Test 32 passes again.
17434
17435         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17436         IndexOutOfRangeException. 
17437
17438         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17439         Test 33 now passes again.
17440
17441 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17442
17443         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17444         broke a bunch of things.  Will have to come up with a better way
17445         of tracking locations.
17446
17447         * statement.cs: Implemented foreach for single dimension arrays.
17448
17449 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17450
17451         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17452         an error.  This removes the lookup from the critical path.
17453
17454         * cs-parser.jay: Removed use of temporary_loc, which is completely
17455         broken. 
17456
17457 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17458
17459         * support.cs (ReflectionParameters.ParameterModifier): Report
17460         whether the argument is a PARAMS argument or not.
17461
17462         * class.cs: Set the attribute `ParamArrayAttribute' on the
17463         parameter argument.
17464
17465         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17466         and cons_param_array_attribute (ConstructorInfo for
17467         ParamArrayAttribute)., 
17468
17469         * codegen.cs: Emit the return using the `Return' statement, that
17470         way we can report the error correctly for missing return values. 
17471
17472         * class.cs (Method.Emit): Clean up.
17473
17474         * expression.cs (Argument.Resolve): Take another argument: the
17475         location where this argument is used.  Notice that this is not
17476         part of the "Argument" class as to reduce the size of the
17477         structure (we know the approximate location anyways).
17478
17479         Test if the argument is a variable-reference, if not, then
17480         complain with a 206.
17481
17482         (Argument.Emit): Emit addresses of variables.
17483
17484         (Argument.FullDesc): Simplify.
17485
17486         (Invocation.DoResolve): Update for Argument.Resolve.
17487
17488         (ElementAccess.DoResolve): ditto.
17489
17490         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17491         method should be virtual, as this method is always virtual.
17492
17493         (NewDelegate.DoResolve): Update for Argument.Resolve.
17494
17495         * class.cs (ConstructorInitializer.DoResolve): ditto.
17496
17497         * attribute.cs (Attribute.Resolve): ditto.
17498
17499 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17500
17501         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17502
17503         * expression.cs (ParameterReference): Drop IStackStorage and implement
17504         IAssignMethod instead. 
17505
17506         (LocalVariableReference): ditto.
17507
17508         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17509         IAssignMethod instead. 
17510
17511 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17512
17513         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17514         enumerations that are used in heavily used structures derive from
17515         byte in a laughable and pathetic attempt to reduce memory usage.
17516         This is the kind of pre-optimzations that you should not do at
17517         home without adult supervision.
17518
17519         * expression.cs (UnaryMutator): New class, used to handle ++ and
17520         -- separatedly from the other unary operators.  Cleans up the
17521         code, and kills the ExpressionStatement dependency in Unary.
17522
17523         (Unary): Removed `method' and `Arguments' from this class, making
17524         it smaller, and moving it all to SimpleCall, so I can reuse this
17525         code in other locations and avoid creating a lot of transient data
17526         strucutres when not required.
17527
17528         * cs-parser.jay: Adjust for new changes.
17529
17530 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17531
17532         * enum.cs (Enum.Populate): If there is a failure during
17533         definition, return
17534
17535         * cs-parser.jay (opt_enum_base): we used to catch type errors
17536         here, but this is really incorrect.  The type error should be
17537         catched during semantic analysis.
17538
17539 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17540
17541         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17542         current_local_parameters as expected since I, in my stupidity, had forgotten
17543         to do this :-)
17544
17545         * attribute.cs (GetValidPlaces): Fix stupid bug.
17546
17547         * class.cs (Method::Emit): Perform check on applicability of attributes.
17548
17549         (Constructor::Emit): Ditto.
17550
17551         (Field::Emit): Ditto.
17552
17553         (Field.Location): Store location information.
17554
17555         (Property, Event, Indexer, Operator): Ditto.
17556
17557         * cs-parser.jay (field_declaration): Pass in location for each field.
17558
17559         * ../errors/cs0592.cs : Add.
17560
17561 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17562
17563         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17564
17565         (InitCoreTypes): Update accordingly.
17566
17567         (RegisterAttrType, LookupAttr): Implement.
17568
17569         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17570         info about the same.
17571
17572         (Resolve): Update to populate the above as necessary.
17573
17574         (Error592): Helper.
17575
17576         (GetValidPlaces): Helper to the above.
17577
17578         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17579
17580         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17581
17582 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17583
17584         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17585
17586         * ../errors/cs0617.cs : Add.
17587
17588 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17589
17590         * enum.cs (Emit): Rename to Populate to be more consistent with what
17591         we expect it to do and when exactly it is called.
17592
17593         * class.cs, rootcontext.cs : Update accordingly.
17594
17595         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17596         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17597
17598         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17599
17600         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17601         of a fieldinfo using the above, when dealing with a FieldBuilder.
17602
17603 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17604
17605         * ../errors/cs0031.cs : Add.
17606
17607         * ../errors/cs1008.cs : Add.
17608
17609         * ../errrors/cs0543.cs : Add.
17610
17611         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17612         enum type.
17613
17614         (FindMembers): Implement.
17615
17616         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17617         enums and delegates too.
17618
17619         (enum_types): Rename to builder_to_enum.
17620
17621         (delegate_types): Rename to builder_to_delegate.
17622
17623         * delegate.cs (FindMembers): Implement.
17624
17625 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17626
17627         * typemanager.cs (IsEnumType): Implement.
17628
17629         * enum.cs (Emit): Re-write parts to account for the underlying type
17630         better and perform checking etc.
17631
17632         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17633         of the underlying type.
17634
17635         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17636         value
17637
17638         * enum.cs (error31): Helper to report error #31.
17639
17640         * cs-parser.jay (enum_declaration): Store location of each member too.
17641
17642         * enum.cs (member_to_location): New hashtable. 
17643
17644         (AddEnumMember): Update location hashtable.
17645
17646         (Emit): Use the location of each member while reporting errors.
17647
17648 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17649
17650         * cs-parser.jay: A for_initializer if is a
17651         local_variable_declaration really ammount to have an implicit
17652         block with the variable declaration and no initializer for for.
17653
17654         * statement.cs (For.Emit): Cope with null initializers.
17655
17656         This fixes the infinite loop on for initializers.
17657
17658 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17659
17660         * enum.cs: More cleanup.
17661
17662         * ecore.cs: Remove dead code.
17663
17664         * class.cs (Property.Emit): More simplification.
17665         (Event.Emit): ditto.
17666
17667         Reworked to have less levels of indentation.
17668
17669 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17670
17671         * class.cs (Property): Emit attributes.
17672
17673         (Field): Ditto.
17674
17675         (Event): Ditto.
17676
17677         (Indexer): Ditto.
17678
17679         (Operator): Ditto.
17680
17681         * enum.cs (Emit): Ditto.
17682
17683         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17684         Enums too.
17685
17686         * class.cs (Field, Event, etc.): Move attribute generation into the
17687         Emit method everywhere.
17688
17689         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17690         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17691         as we had no way of defining nested enums !
17692
17693         * rootcontext.cs : Adjust code accordingly.
17694
17695         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17696
17697 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17698
17699         * expression.cs (EvalConstantExpression): Move into ecore.cs
17700
17701         * enum.cs (Enum): Rename some members and make them public and readonly
17702         according to our convention.
17703
17704         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17705         nothing else.
17706
17707         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17708
17709         (Enum::Emit): Write a simple version for now which doesn't try to compute
17710         expressions. I shall modify this to be more robust in just a while.
17711
17712         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17713
17714         (TypeContainer::CloseType): Create the Enum types too.
17715
17716         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17717
17718         * expression.cs (EvalConstantExpression): Get rid of completely.
17719
17720         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17721         user-defined values and other cases.
17722
17723         (IsValidEnumLiteral): Helper function.
17724
17725         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17726         out there in the case we had a literal FieldExpr.
17727
17728         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17729
17730         (Literalize): Revamp a bit to take two arguments.
17731
17732         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17733
17734 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17735
17736         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17737
17738         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17739
17740         (Resolve): Use the above to ensure we have proper initializers.
17741
17742 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17743
17744         * expression.cs (Expression::EvalConstantExpression): New method to 
17745         evaluate constant expressions.
17746
17747         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17748
17749 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17750
17751         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17752         in an array.
17753
17754         (Binary.ResolveOperator): Handle operator != (object a, object b)
17755         and operator == (object a, object b);
17756
17757         (Binary.DoNumericPromotions): Indicate whether the numeric
17758         promotion was possible.
17759
17760         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17761         Implement.  
17762
17763         Made the ArrayAccess implement interface IAssignMethod instead of
17764         IStackStore as the order in which arguments are passed reflects
17765         this.
17766
17767         * assign.cs: Instead of using expr.ExprClass to select the way of
17768         assinging, probe for the IStackStore/IAssignMethod interfaces.
17769
17770         * typemanager.cs: Load InitializeArray definition.
17771
17772         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17773         static data that can be used to initialize arrays. 
17774
17775 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17776
17777         * expression.cs: Handle operator== and operator!= for booleans.
17778
17779         (Conditioal.Reduce): Implement reducer for the ?: operator.
17780
17781         (Conditional.Resolve): Implement dead code elimination.
17782
17783         (Binary.Resolve): Catch string literals and return a new
17784         concatenated string.
17785
17786         (Unary.Reduce): Implement reduction of unary expressions.
17787
17788         * ecore.cs: Split out the expression core handling here.
17789
17790         (Expression.Reduce): New method used to perform constant folding
17791         and CSE.  This is needed to support constant-expressions. 
17792
17793         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17794         targets, and optimize for !x.
17795
17796 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17797
17798         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17799         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17800         set custom atttributes.
17801
17802         * literal.cs (Literal::GetValue): New abstract method to return the actual
17803         value of the literal, cast as an object.
17804
17805         (*Literal): Implement GetValue method.
17806
17807         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17808         expressions to the arraylist but objects of type Argument.
17809
17810         * class.cs (TypeContainer::Emit): Emit our attributes too.
17811
17812         (Method::Emit, Constructor::Emit): Ditto.
17813
17814         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17815         to be ignoring earlier.
17816
17817 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17818
17819         * attribute.cs (AttributeSection::Define): Implement to do the business
17820         of constructing a CustomAttributeBuilder.
17821
17822         (Attribute): New trivial class. Increases readability of code.  
17823
17824         * cs-parser.jay : Update accordingly.
17825
17826         (positional_argument_list, named_argument_list, named_argument): New rules
17827
17828         (attribute_arguments): Use the above so that we are more correct.
17829
17830 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17831
17832         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17833         to perform all checks for a method with a params parameter.
17834
17835         (Invocation::OverloadResolve): Update to use the above method and therefore
17836         cope correctly with params method invocations.
17837
17838         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17839         params too.
17840
17841         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17842         constructors in our parent too because we can't afford to miss out on 
17843         protected ones ;-)
17844
17845         * attribute.cs (AttributeSection): New name for the class Attribute
17846
17847         Other trivial changes to improve readability.
17848
17849         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17850         use the new class names.
17851
17852 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17853
17854         * class.cs (Method::Define): Complete definition for params types too
17855
17856         (Indexer::Define): Ditto.
17857
17858         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17859         Cope everywhere with a request for info about the array parameter.
17860
17861 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17862
17863         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17864
17865         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17866         local_variable_type to extract the string corresponding to the type.
17867
17868         (local_variable_type): Fixup the action to use the new helper method.
17869
17870         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17871         go.
17872
17873         * expression.cs : Clean out code which uses the above.
17874
17875 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17876
17877         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17878         and bale out if necessary by returning a false.
17879
17880         (RegisterProperty): Ditto.
17881
17882         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17883         and print out appropriate error messages.
17884
17885         * interface.cs (everywhere): Ditto.
17886
17887         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17888         location to constructor.
17889
17890         * class.cs (Property, Event, Indexer): Update accordingly.
17891
17892         * ../errors/cs111.cs : Added.
17893
17894         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17895         of a method, as laid down by the spec.
17896
17897         (Invocation::OverloadResolve): Use the above method.
17898
17899 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17900
17901         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17902         now take a TypeContainer and a Parameters object.
17903
17904         (ParameterData): Modify return type of ParameterModifier method to be 
17905         Parameter.Modifier and not a string.
17906
17907         (ReflectionParameters, InternalParameters): Update accordingly.
17908
17909         * expression.cs (Argument::GetParameterModifier): Same here.
17910
17911         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17912         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17913         symbol in it at all so maybe this is only for now.
17914
17915 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17916
17917         * support.cs (InternalParameters): Constructor now takes an extra argument 
17918         which is the actual Parameters class.
17919
17920         (ParameterDesc): Update to provide info on ref/out modifiers.
17921
17922         * class.cs (everywhere): Update call to InternalParameters to pass in
17923         the second argument too.
17924
17925         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17926         to return the modifier info [ref/out etc]
17927
17928         (InternalParameters, ReflectionParameters): Implement the above.
17929
17930         * expression.cs (Argument::ParameterModifier): Similar function to return
17931         info about the argument's modifiers.
17932
17933         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17934         too.
17935
17936         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17937         a new SetFormalParameters object which we pass to InternalParameters.
17938
17939 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17940
17941         * expression.cs (NewArray): Merge into the ArrayCreation class.
17942
17943 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17944
17945         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17946         NewUserdefinedArray into one as there wasn't much of a use in having
17947         two separate ones.
17948
17949         * expression.cs (Argument): Change field's name to ArgType from Type.
17950
17951         (Type): New readonly property which returns the proper type, taking into 
17952         account ref/out modifiers.
17953
17954         (everywhere): Adjust code accordingly for the above.
17955
17956         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17957         whether we are emitting for a ref or out parameter.
17958
17959         * expression.cs (Argument::Emit): Use the above field to set the state.
17960
17961         (LocalVariableReference::Emit): Update to honour the flag and emit the
17962         right stuff.
17963
17964         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17965
17966         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17967
17968         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17969
17970         (ReflectionParameters, InternalParameters): Implement the above method.
17971
17972         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17973         reporting errors.
17974
17975         (Invocation::FullMethodDesc): Ditto. 
17976
17977 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17978
17979         * cs-parser.jay: Add extra production for the second form of array
17980         creation. 
17981
17982         * expression.cs (ArrayCreation): Update to reflect the above
17983         change. 
17984
17985         * Small changes to prepare for Array initialization.
17986
17987 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17988
17989         * typemanager.cs (ImplementsInterface): interface might be null;
17990         Deal with this problem;
17991
17992         Also, we do store negative hits on the cache (null values), so use
17993         this instead of calling t.GetInterfaces on the type everytime.
17994
17995 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17996
17997         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17998
17999         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18000         split functionality out into different classes.
18001
18002         (New::FormArrayType): Move into NewBuiltinArray.
18003
18004         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18005         quite useless.
18006
18007         (NewBuiltinArray): New class to handle creation of built-in arrays.
18008
18009         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18010         account creation of one-dimensional arrays.
18011
18012         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18013
18014         (NewUserdefinedArray::DoResolve): Implement.
18015
18016         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18017
18018         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18019         we maintain inside the TypeManager. This is necessary to perform lookups on the
18020         module builder.
18021
18022         (LookupType): Update to perform GetType on the module builders too.     
18023
18024         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18025
18026         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18027
18028 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18029
18030         * expression.cs (New::DoResolve): Implement guts of array creation.
18031
18032         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18033
18034 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18035
18036         * expression.cs: Fix bug I introduced lsat night that broke
18037         Delegates. 
18038
18039         (Expression.Resolve): Report a 246 error (can not resolve name)
18040         if we find a SimpleName in the stream.
18041
18042         (Expression.ResolveLValue): Ditto.
18043
18044         (Expression.ResolveWithSimpleName): This function is a variant of
18045         ResolveName, this one allows SimpleNames to be returned without a
18046         warning.  The only consumer of SimpleNames is MemberAccess
18047
18048 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18049
18050         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18051         might arrive here.  I have my doubts that this is correct.
18052
18053         * statement.cs (Lock): Implement lock statement.
18054
18055         * cs-parser.jay: Small fixes to support `lock' and `using'
18056
18057         * cs-tokenizer.cs: Remove extra space
18058
18059         * driver.cs: New flag --checked, allows to turn on integer math
18060         checking. 
18061
18062         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18063         Threading.Monitor.Exit 
18064
18065 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18066
18067         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18068         Expression Class to be IndexerAccess.
18069
18070         Notice that Indexer::DoResolve sets the eclass to Value.
18071
18072 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18073
18074         * class.cs (TypeContainer::Emit): Emit code for indexers.
18075
18076         * assign.cs (IAssignMethod): New interface implemented by Indexers
18077         and Properties for handling assignment.
18078
18079         (Assign::Emit): Simplify and reuse code. 
18080
18081         * expression.cs (IndexerAccess, PropertyExpr): Implement
18082         IAssignMethod, clean up old code. 
18083
18084 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18085
18086         * typemanager.cs (ImplementsInterface): New method to determine if a type
18087         implements a given interface. Provides a nice cache too.
18088
18089         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18090         method.
18091
18092         (ConvertReferenceExplicit): Ditto.
18093
18094         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18095         various methods, with correct names etc.
18096
18097         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18098         Operator.UnaryNegation.
18099
18100         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18101         we have a unary plus or minus operator.
18102
18103         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18104         UnaryMinus.
18105
18106         * everywhere : update accordingly.
18107
18108         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18109         respectively.
18110
18111         * class.cs (Method::Define): For the case where we are implementing a method
18112         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18113         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18114
18115 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18116
18117         * interface.cs (FindMembers): Implement to work around S.R.E
18118         lameness.
18119
18120         * typemanager.cs (IsInterfaceType): Implement.
18121
18122         (FindMembers): Update to handle interface types too.
18123
18124         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18125         use IsAssignableFrom as that is not correct - it doesn't work.
18126
18127         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18128         and accordingly override EmitStatement.
18129
18130         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18131         using the correct logic :-)
18132
18133 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18134
18135         * ../errors/cs-11.cs : Add to demonstrate error -11 
18136
18137 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18138
18139         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18140         then pass this as a hint to ResolveLValue.
18141
18142         * expression.cs (FieldExpr): Add Location information
18143
18144         (FieldExpr::LValueResolve): Report assignment to readonly
18145         variable. 
18146
18147         (Expression::ExprClassFromMemberInfo): Pass location information.
18148
18149         (Expression::ResolveLValue): Add new method that resolves an
18150         LValue. 
18151
18152         (Expression::DoResolveLValue): Default invocation calls
18153         DoResolve. 
18154
18155         (Indexers): New class used to keep track of indexers in a given
18156         Type. 
18157
18158         (IStackStore): Renamed from LValue, as it did not really describe
18159         what this did.  Also ResolveLValue is gone from this interface and
18160         now is part of Expression.
18161
18162         (ElementAccess): Depending on the element access type
18163
18164         * typemanager.cs: Add `indexer_name_type' as a Core type
18165         (System.Runtime.CompilerServices.IndexerNameAttribute)
18166
18167         * statement.cs (Goto): Take a location.
18168
18169 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18170
18171         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18172         if two delegates are compatible.
18173
18174         (NewDelegate::DoResolve): Update to take care of the case when
18175         we instantiate a delegate from another delegate.
18176
18177         * typemanager.cs (FindMembers): Don't even try to look up members
18178         of Delegate types for now.
18179
18180 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18181
18182         * delegate.cs (NewDelegate): New class to take care of delegate
18183         instantiation.
18184
18185         * expression.cs (New): Split the delegate related code out into 
18186         the NewDelegate class.
18187
18188         * delegate.cs (DelegateInvocation): New class to handle delegate 
18189         invocation.
18190
18191         * expression.cs (Invocation): Split out delegate related code into
18192         the DelegateInvocation class.
18193
18194 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18195
18196         * expression.cs (New::DoResolve): Implement delegate creation fully
18197         and according to the spec.
18198
18199         (New::DoEmit): Update to handle delegates differently.
18200
18201         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18202         because of which we were printing out arguments in reverse order !
18203
18204         * delegate.cs (VerifyMethod): Implement to check if the given method
18205         matches the delegate.
18206
18207         (FullDelegateDesc): Implement.
18208
18209         (VerifyApplicability): Implement.
18210
18211         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18212         delegate invocations too.
18213
18214         (Invocation::Emit): Ditto.
18215
18216         * ../errors/cs1593.cs : Added.
18217
18218         * ../errors/cs1594.cs : Added.
18219
18220         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18221
18222 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18223
18224         * typemanager.cs (intptr_type): Core type for System.IntPtr
18225
18226         (InitCoreTypes): Update for the same.
18227
18228         (iasyncresult_type, asynccallback_type): Ditto.
18229
18230         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18231         correct.
18232
18233         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18234         too.
18235
18236         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18237         the builders for the 4 members of a delegate type :-)
18238
18239         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18240         type.
18241
18242         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18243
18244         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18245
18246 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18247
18248         * statement.cs (Break::Emit): Implement.   
18249         (Continue::Emit): Implement.
18250
18251         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18252         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18253         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18254         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18255         end loop
18256
18257         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18258         properties that track the label for the current loop (begin of the
18259         loop and end of the loop).
18260
18261 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18262
18263         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18264         use of emitting anything at all.
18265
18266         * class.cs, rootcontext.cs : Get rid of calls to the same.
18267
18268         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18269
18270         (Populate): Define the constructor correctly and set the implementation
18271         attributes.
18272
18273         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18274         have been defined.
18275
18276         (AddDelegateType): Implement.
18277
18278         (IsDelegateType): Implement helper method.
18279
18280         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18281
18282         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18283         and accordingly handle it.
18284
18285         * delegate.cs (Populate): Take TypeContainer argument.
18286         Implement bits to define the Invoke method. However, I still haven't figured out
18287         how to take care of the native int bit :-(
18288
18289         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18290         Qualify the name of the delegate, not its return type !
18291
18292         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18293         conversion.
18294
18295         (StandardConversionExists): Checking for array types turns out to be recursive.
18296
18297         (ConvertReferenceExplicit): Implement array conversion.
18298
18299         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18300
18301 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18302
18303         * cs-parser.jay (delegate_declaration): Store the fully qualified
18304         name as it is a type declaration.
18305
18306         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18307         readonly.
18308
18309         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18310         as TypeContainer::DefineType.
18311
18312         (Populate): Method in which all the definition of the various methods (Invoke)
18313         etc is done.
18314
18315         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18316         see.
18317
18318         (CloseDelegate): Finally creates the delegate.
18319
18320         * class.cs (TypeContainer::DefineType): Update to define delegates.
18321         (Populate, Emit and CloseType): Do the same thing here too.
18322
18323         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18324         delegates in all these operations.
18325
18326 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18327
18328         * expression.cs: LocalTemporary: a new expression used to
18329         reference a temporary that has been created.
18330
18331         * assign.cs: Handle PropertyAccess back here, so that we can
18332         provide the proper semantic access to properties.
18333
18334         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18335         a few more explicit conversions. 
18336
18337         * modifiers.cs: `NEW' modifier maps to HideBySig.
18338
18339         * expression.cs (PropertyExpr): Make this into an
18340         ExpressionStatement, and support the EmitStatement code path. 
18341
18342         Perform get/set error checking, clean up the interface.
18343
18344         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18345         them into toplevel access objects.
18346
18347 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18348
18349         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18350         SRE.
18351
18352         * typemanager.cs: Keep track here of our PropertyBuilders again to
18353         work around lameness in SRE.
18354
18355 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18356
18357         * expression.cs (LValue::LValueResolve): New method in the
18358         interface, used to perform a second resolution pass for LValues. 
18359
18360         (This::DoResolve): Catch the use of this in static methods.
18361
18362         (This::LValueResolve): Implement.
18363
18364         (This::Store): Remove warning, assigning to `this' in structures
18365         is 
18366
18367         (Invocation::Emit): Deal with invocation of
18368         methods on value types.  We need to pass the address to structure
18369         methods rather than the object itself.  (The equivalent code to
18370         emit "this" for structures leaves the entire structure on the
18371         stack instead of a pointer to it). 
18372
18373         (ParameterReference::DoResolve): Compute the real index for the
18374         argument based on whether the method takes or not a `this' pointer
18375         (ie, the method is static).
18376
18377         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18378         value types returned from functions when we need to invoke a
18379         method on the sturcture.
18380
18381
18382 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18383
18384         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18385         defining the type in the Modulebuilder or Typebuilder. This is to take
18386         care of nested types which need to be defined on the TypeBuilder using
18387         DefineNestedMethod.
18388
18389         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18390         methods in RootContext, only ported to be part of TypeContainer.
18391
18392         (TypeContainer::GetInterfaceOrClass): Ditto.
18393
18394         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18395
18396         * interface.cs (Interface::DefineInterface): New method. Does exactly
18397         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18398         too.
18399
18400         (Interface::GetInterfaces): Move from RootContext here and port.
18401
18402         (Interface::GetInterfaceByName): Same here.
18403
18404         * rootcontext.cs (ResolveTree): Re-write.
18405
18406         (PopulateTypes): Re-write.
18407
18408         * class.cs (TypeContainer::Populate): Populate nested types too.
18409         (TypeContainer::Emit): Emit nested members too.
18410
18411         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18412         instead just use the name argument passed in as it is already fully
18413         qualified.
18414
18415         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18416         to TypeContainer mapping to see if a type is user-defined.
18417
18418         * class.cs (TypeContainer::CloseType): Implement. 
18419
18420         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18421         the default constructor.
18422
18423         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18424         twice.
18425
18426         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18427
18428         * interface.cs (CloseType): Create the type here.
18429
18430         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18431         the hierarchy.
18432
18433         Remove all the methods which are now in TypeContainer.
18434
18435 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18436
18437         * delegate.cs (Define): Re-write bits to define the delegate
18438         correctly.
18439
18440 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18441
18442         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18443
18444         * expression.cs (ImplicitReferenceConversion): handle null as well
18445         as a source to convert to any reference type.
18446
18447         * statement.cs (Return): Perform any implicit conversions to
18448         expected return type.  
18449
18450         Validate use of return statement.  
18451
18452         * codegen.cs (EmitContext): Pass the expected return type here.
18453
18454         * class.cs (Method, Constructor, Property): Pass expected return
18455         type to EmitContext.
18456
18457 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18458
18459         * expression.cs: Make DoResolve take an EmitContext instead of a
18460         TypeContainer.
18461
18462         Replaced `l' and `location' for `loc', for consistency.
18463
18464         (Error, Warning): Remove unneeded Tc argument.
18465
18466         * assign.cs, literal.cs, constant.cs: Update to new calling
18467         convention. 
18468
18469         * codegen.cs: EmitContext now contains a flag indicating whether
18470         code is being generated in a static method or not.
18471
18472         * cs-parser.jay: DecomposeQI, new function that replaces the old
18473         QualifiedIdentifier.  Now we always decompose the assembled
18474         strings from qualified_identifier productions into a group of
18475         memberaccesses.
18476
18477 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18478
18479         * rootcontext.cs: Deal with field-less struct types correctly now
18480         by passing the size option to Define Type.
18481
18482         * class.cs: Removed hack that created one static field. 
18483
18484 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18485
18486         * statement.cs: Moved most of the code generation here. 
18487
18488 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18489
18490         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18491         seem very right.
18492
18493         (ElementAccess): Remove useless bits for now - keep checks as the spec
18494         says.
18495
18496 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18497
18498         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18499         and start performing checks according to the spec.
18500
18501 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18502
18503         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18504         rank_specifiers instead.
18505
18506         (rank_specifiers): Change the order in which the rank specifiers are stored
18507
18508         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18509
18510         * expression.cs (ElementAccess): Implement the LValue interface too.
18511
18512 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18513
18514         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18515         except that user defined conversions are not included.
18516
18517         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18518         perform the conversion of the return type, if necessary.
18519
18520         (New::DoResolve): Check whether we are creating an array or an object
18521         and accordingly do the needful.
18522
18523         (New::Emit): Same here.
18524
18525         (New::DoResolve): Implement guts of array creation.
18526
18527         (New::FormLookupType): Helper function.
18528
18529 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18530
18531         * codegen.cs: Removed most of the code generation here, and move the
18532         corresponding code generation bits to the statement classes. 
18533
18534         Added support for try/catch/finalize and throw.
18535
18536         * cs-parser.jay: Added support for try/catch/finalize.
18537
18538         * class.cs: Catch static methods having the flags override,
18539         virtual or abstract.
18540
18541         * expression.cs (UserCast): This user cast was not really doing
18542         what it was supposed to do.  Which is to be born in fully resolved
18543         state.  Parts of the resolution were being performed at Emit time! 
18544
18545         Fixed this code.
18546
18547 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18548
18549         * expression.cs: Implicity convert the result from UserCast.
18550
18551 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18552
18553         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18554         prevented it from working correctly. 
18555
18556         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18557         merely ConvertImplicit.
18558
18559 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18560
18561         * typemanager.cs: Make the LookupTypeContainer function static,
18562         and not per-instance.  
18563
18564         * class.cs: Make static FindMembers (the one that takes a Type
18565         argument). 
18566
18567         * codegen.cs: Add EmitForeach here.
18568
18569         * cs-parser.jay: Make foreach a toplevel object instead of the
18570         inline expansion, as we need to perform semantic analysis on it. 
18571
18572 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18573
18574         * expression.cs (Expression::ImplicitUserConversion): Rename to
18575         UserDefinedConversion.
18576
18577         (Expression::UserDefinedConversion): Take an extra argument specifying 
18578         whether we look for explicit user conversions too.
18579
18580         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18581
18582         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18583
18584         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18585         with the appropriate arguments.
18586
18587         * cs-parser.jay (cast_expression): Record location too.
18588
18589         * expression.cs (Cast): Record location info.
18590
18591         (Expression::ConvertExplicit): Take location argument.
18592
18593         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18594         to determine if we are doing explicit conversions.
18595
18596         (UserCast::Emit): Update accordingly.
18597
18598         (Expression::ConvertExplicit): Report an error if everything fails.
18599
18600         * ../errors/cs0030.cs : Add.
18601
18602 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18603
18604         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18605         virtual and newslot bits. 
18606
18607         * class.cs (TypeContainer::RegisterRequiredImplementations):
18608         Record methods we need.
18609
18610         (TypeContainer::MakeKey): Helper function to make keys for
18611         MethodBases, since the Methodbase key is useless.
18612
18613         (TypeContainer::Populate): Call RegisterRequiredImplementations
18614         before defining the methods.   
18615
18616         Create a mapping for method_builders_to_methods ahead of time
18617         instead of inside a tight loop.
18618
18619         (::RequireMethods):  Accept an object as the data to set into the
18620         hashtable so we can report interface vs abstract method mismatch.
18621
18622 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18623
18624         * report.cs: Make all of it static.
18625
18626         * rootcontext.cs: Drop object_type and value_type computations, as
18627         we have those in the TypeManager anyways.
18628
18629         Drop report instance variable too, now it is a global.
18630
18631         * driver.cs: Use try/catch on command line handling.
18632
18633         Add --probe option to debug the error reporting system with a test
18634         suite. 
18635
18636         * report.cs: Add support for exiting program when a probe
18637         condition is reached.
18638
18639 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18640
18641         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18642         we do a forcible conversion regardless of type, to check if 
18643         ForceConversion returns a null.
18644
18645         (Binary::error19): Use location to report error.
18646
18647         (Unary::error23): Use location here too.
18648
18649         * ../errors/cs0019.cs : Check in.
18650
18651         * ../errors/cs0023.cs : Check in.
18652
18653         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18654         case of a non-null MethodInfo object with a length of 0 !
18655
18656         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18657         an applicable member - according to the spec :-)
18658         Also fix logic to find members in base types.
18659
18660         (Unary::ResolveOperator): Same here.
18661
18662         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18663         as I was getting thoroughly confused between this and error19 :-)
18664
18665         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18666         (::FindMostEncompassedType): Implement.
18667         (::FindMostEncompassingType): Implement.
18668         (::StandardConversionExists): Implement.
18669
18670         (UserImplicitCast): Re-vamp. We now need info about most specific
18671         source and target types so that we can do the necessary conversions.
18672
18673         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18674         mathematical union with no duplicates.
18675
18676 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18677
18678         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18679         in order from base classes to child classes, so that we can in
18680         child classes look up in our parent for method names and
18681         attributes (required for handling abstract, virtual, new, override
18682         constructs: we need to instrospect our base class, and if we dont
18683         populate the classes in order, the introspection might be
18684         incorrect.  For example, a method could query its parent before
18685         the parent has any methods and would determine that the parent has
18686         no abstract methods (while it could have had them)).
18687
18688         (RootContext::CreateType): Record the order in which we define the
18689         classes.
18690
18691 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18692
18693         * class.cs (TypeContainer::Populate): Also method definitions can
18694         fail now, keep track of this.
18695
18696         (TypeContainer::FindMembers): Implement support for
18697         DeclaredOnly/noDeclaredOnly flag.
18698
18699         (Constructor::Emit) Return the ConstructorBuilder.
18700
18701         (Method::Emit) Return the MethodBuilder. 
18702         Check for abstract or virtual methods to be public.
18703
18704         * rootcontext.cs (RootContext::CreateType): Register all the
18705         abstract methods required for the class to be complete and the
18706         interface methods that must be implemented. 
18707
18708         * cs-parser.jay: Report error 501 (method requires body if it is
18709         not marked abstract or extern).
18710
18711         * expression.cs (TypeOf::Emit): Implement.
18712
18713         * typemanager.cs: runtime_handle_type, new global type.
18714
18715         * class.cs (Property::Emit): Generate code for properties.
18716
18717 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18718
18719         * expression.cs (Unary::ResolveOperator): Find operators on base type
18720         too - we now conform exactly to the spec.
18721
18722         (Binary::ResolveOperator): Same here.
18723
18724         * class.cs (Operator::Define): Fix minor quirk in the tests.
18725
18726         * ../errors/cs0215.cs : Added.
18727
18728         * ../errors/cs0556.cs : Added.
18729
18730         * ../errors/cs0555.cs : Added.
18731
18732 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18733
18734         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18735         single integer which is really efficient
18736
18737 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18738
18739         *  expression.cs (Expression::ImplicitUserConversion): Use location
18740         even in the case when we are examining True operators.
18741  
18742         * class.cs (Operator::Define): Perform extensive checks to conform
18743         with the rules for operator overloading in the spec.
18744
18745         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18746         some of the other conversions mentioned in the spec.
18747
18748         * typemanager.cs (array_type): New static member for the System.Array built-in
18749         type.
18750
18751         (cloneable_interface): For System.ICloneable interface.
18752
18753         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18754         we start resolving the tree and populating types.
18755
18756         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18757  
18758 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18759
18760         * expression.cs (Expression::ExprClassFromMemberInfo,
18761         Expression::Literalize): Create literal expressions from
18762         FieldInfos which are literals.
18763
18764         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18765         type casts, because they were wrong.  The test suite in tests
18766         caught these ones.
18767
18768         (ImplicitNumericConversion): ushort to ulong requires a widening
18769         cast. 
18770
18771         Int32 constant to long requires widening cast as well.
18772
18773         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18774         for integers because the type on the stack is not i4.
18775
18776 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18777
18778         * expression.cs (report118): require location argument. 
18779
18780         * parameter.cs: Do not dereference potential null value.
18781
18782         * class.cs: Catch methods that lack the `new' keyword when
18783         overriding a name.  Report warnings when `new' is used without
18784         anything being there to override.
18785
18786         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18787
18788         * class.cs: Only add constructor to hashtable if it is non-null
18789         (as now constructors can fail on define).
18790
18791         (TypeManager, Class, Struct): Take location arguments.
18792
18793         Catch field instance initialization in structs as errors.
18794
18795         accepting_filter: a new filter for FindMembers that is static so
18796         that we dont create an instance per invocation.
18797
18798         (Constructor::Define): Catch errors where a struct constructor is
18799         parameterless 
18800
18801         * cs-parser.jay: Pass location information for various new
18802         constructs. 
18803
18804         * delegate.cs (Delegate): take a location argument.
18805
18806         * driver.cs: Do not call EmitCode if there were problesm in the
18807         Definition of the types, as many Builders wont be there. 
18808
18809         * decl.cs (Decl::Decl): Require a location argument.
18810
18811         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18812         into integers, and find the most appropiate integer for it.
18813
18814         * literal.cs: Implement ULongLiteral.
18815
18816         * rootcontext.cs: Provide better information about the location of
18817         failure when CreateType fails.
18818
18819 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18820
18821         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18822         as well.
18823
18824         * expression.cs (Binary::CheckShiftArguments): Add missing type
18825         computation.
18826         (Binary::ResolveOperator): Add type to the logical and and logical
18827         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18828         before.
18829
18830         (Binary::DoNumericPromotions): In the case where either argument
18831         is ulong (and most signed types combined with ulong cause an
18832         error) perform implicit integer constant conversions as well.
18833
18834 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18835
18836         * expression.cs (UserImplicitCast): Method should always be
18837         non-null. 
18838         (Invocation::BetterConversion): Simplified test for IntLiteral.
18839
18840         (Expression::ImplicitNumericConversion): Split this routine out.
18841         Put the code that performs implicit constant integer conversions
18842         here. 
18843
18844         (Expression::Resolve): Become a wrapper around DoResolve so we can
18845         check eclass and type being set after resolve.
18846
18847         (Invocation::Badness): Remove this dead function
18848
18849         (Binary::ResolveOperator): Do not compute the expensive argumnets
18850         unless we have a union for it.
18851
18852         (Probe::Emit): Is needs to do an isinst and then
18853         compare against null.
18854
18855         (::CanConvert): Added Location argument.  If the Location argument
18856         is null (Location.Null), then we do not report errors.  This is
18857         used by the `probe' mechanism of the Explicit conversion.  We do
18858         not want to generate an error for something that the user
18859         explicitly requested to be casted.  But the pipeline for an
18860         explicit cast first tests for potential implicit casts.
18861
18862         So for now, if the Location is null, it means `Probe only' to
18863         avoid adding another argument.   Might have to revise this
18864         strategy later.
18865
18866         (ClassCast): New class used to type cast objects into arbitrary
18867         classes (used in Explicit Reference Conversions).
18868
18869         Implement `as' as well.
18870
18871         Reverted all the patches from Ravi below: they were broken:
18872
18873                 * The use of `level' as a mechanism to stop recursive
18874                   invocations is wrong.  That was there just to catch the
18875                   bug with a strack trace but not as a way of addressing
18876                   the problem.
18877
18878                   To fix the problem we have to *understand* what is going
18879                   on and the interactions and come up with a plan, not
18880                   just get things going.
18881
18882                 * The use of the type conversion cache that I proposed
18883                   last night had an open topic: How does this work across
18884                   protection domains.  A user defined conversion might not
18885                   be public in the location where we are applying the
18886                   conversion, a different conversion might be selected
18887                   (ie, private A->B (better) but public B->A (worse),
18888                   inside A, A->B applies, but outside it, B->A will
18889                   apply).
18890
18891                 * On top of that (ie, even if the above is solved),
18892                   conversions in a cache need to be abstract.  Ie, `To
18893                   convert from an Int to a Short use an OpcodeCast', not
18894                   `To convert from an Int to a Short use the OpcodeCast on
18895                   the variable 5' (which is what this patch was doing).
18896
18897 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18898
18899         * expression.cs (Invocation::ConversionExists): Re-write to use
18900         the conversion cache
18901
18902         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18903         cache all conversions done, not just user-defined ones.
18904
18905         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18906         to determine if a conversion exists instead of acutually trying to 
18907         perform the conversion. It's faster too.
18908
18909         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18910         and only then attempt the implicit conversion.
18911
18912 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18913
18914         * expression.cs (ConvertImplicit): Use a cache for conversions
18915         already found. Check level of recursion and bail out if necessary.
18916
18917 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18918
18919         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18920         Export standard methods that we expect for string operations.
18921
18922         * statement.cs (Block::UsageWarning): Track usage of variables and
18923         report the errors for not used variables.
18924
18925         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18926         operator. 
18927
18928 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18929
18930         * codegen.cs: remove unnneded code 
18931
18932         * expression.cs: Removed BuiltinTypeAccess class
18933
18934         Fix the order in which implicit conversions are
18935         done.  
18936
18937         The previous fixed dropped support for boxed conversions (adding a
18938         test to the test suite now)
18939
18940         (UserImplicitCast::CanConvert): Remove test for source being null,
18941         that code is broken.  We should not feed a null to begin with, if
18942         we do, then we should track the bug where the problem originates
18943         and not try to cover it up here.
18944
18945         Return a resolved expression of type UserImplicitCast on success
18946         rather than true/false.  Ravi: this is what I was talking about,
18947         the pattern is to use a static method as a "constructor" for
18948         objects. 
18949
18950         Also, do not create arguments until the very last minute,
18951         otherwise we always create the arguments even for lookups that
18952         will never be performed. 
18953
18954         (UserImplicitCast::Resolve): Eliminate, objects of type
18955         UserImplicitCast are born in a fully resolved state. 
18956
18957         * typemanager.cs (InitCoreTypes): Init also value_type
18958         (System.ValueType). 
18959
18960         * expression.cs (Cast::Resolve): First resolve the child expression.
18961
18962         (LValue): Add new method AddressOf to be used by
18963         the `&' operator.  
18964
18965         Change the argument of Store to take an EmitContext instead of an
18966         ILGenerator, because things like FieldExpr need to be able to call
18967         their children expression to generate the instance code. 
18968
18969         (Expression::Error, Expression::Warning): Sugar functions for
18970         reporting errors.
18971
18972         (Expression::MemberLookup): Accept a TypeContainer instead of a
18973         Report as the first argument.
18974
18975         (Expression::ResolvePrimary): Killed.  I still want to improve
18976         this as currently the code is just not right.
18977
18978         (Expression::ResolveMemberAccess): Simplify, but it is still
18979         wrong. 
18980
18981         (Unary::Resolve): Catch errors in AddressOf operators.
18982
18983         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18984         index to a byte for the short-version, or the compiler will choose
18985         the wrong Emit call, which generates the wrong data.
18986
18987         (ParameterReference::Emit, ::Store): same.
18988
18989         (FieldExpr::AddressOf): Implement.
18990
18991         * typemanager.cs: TypeManager: made public variable instead of
18992         property.
18993
18994         * driver.cs: document --fatal.
18995
18996         * report.cs (ErrorMessage, WarningMessage): new names for the old
18997         Error and Warning classes.
18998
18999         * cs-parser.jay (member_access): Turn built-in access to types
19000         into a normal simplename
19001
19002 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19003
19004         * expression.cs (Invocation::BetterConversion): Fix to cope
19005         with q being null, since this was introducing a bug.
19006
19007         * expression.cs (ConvertImplicit): Do built-in conversions first.
19008
19009 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19010
19011         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19012
19013 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19014
19015         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19016         I had introduced long ago (what's new ?).
19017
19018         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19019         the work of all the checking. 
19020         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19021         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19022
19023         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19024         that is the right way. 
19025
19026         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19027         overloading resolution. Use everywhere instead of cutting and pasting code.
19028
19029         (Binary::ResolveOperator): Use MakeUnionSet.
19030
19031         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19032         we have to convert to bool types. Not complete yet.
19033
19034 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19035
19036         * typemanager.cs (TypeManager::CSharpName): support ushort.
19037
19038         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19039         to provide an expression that performsn an implicit constant int
19040         conversion (section 6.1.6).
19041         (Expression::ConvertImplicitRequired): Reworked to include
19042         implicit constant expression conversions.
19043
19044         (Expression::ConvertNumericExplicit): Finished.
19045
19046         (Invocation::Emit): If InstanceExpression is null, then it means
19047         that we perform a call on this.
19048
19049 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19050
19051         * expression.cs (Unary::Emit): Remove some dead code.
19052         (Probe): Implement Resolve and Emit for `is'.
19053         (Expression::ConvertImplicitRequired): Attempt to do constant
19054         expression conversions here.  Maybe should be moved to
19055         ConvertImplicit, but I am not sure.
19056         (Expression::ImplicitLongConstantConversionPossible,
19057         Expression::ImplicitIntConstantConversionPossible): New functions
19058         that tell whether is it possible to apply an implicit constant
19059         expression conversion.
19060
19061         (ConvertNumericExplicit): Started work on explicit numeric
19062         conversions.
19063
19064         * cs-parser.jay: Update operator constants.
19065
19066         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19067         (Parameters::GetSignature): Hook up VerifyArgs here.
19068         (Parameters::VerifyArgs): Verifies that no two arguments have the
19069         same name. 
19070
19071         * class.cs (Operator): Update the operator names to reflect the
19072         ones that the spec expects (as we are just stringizing the
19073         operator names).
19074
19075         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19076         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19077         previous usage did only work for our methods.
19078         (Expression::ConvertImplicit): Handle decimal implicit numeric
19079         conversions as well.
19080         (Expression::InternalTypeConstructor): Used to invoke constructors
19081         on internal types for default promotions.
19082
19083         (Unary::Emit): Implement special handling for the pre/post
19084         increment/decrement for overloaded operators, as they need to have
19085         the same semantics as the other operators.
19086
19087         (Binary::ResolveOperator): ditto.
19088         (Invocation::ConversionExists): ditto.
19089         (UserImplicitCast::Resolve): ditto.
19090
19091 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19092
19093         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19094         operator, return after emitting body. Regression tests pass again !
19095
19096         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19097         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19098         (Invocation::OverloadResolve): Ditto.
19099         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19100
19101         * everywhere : update calls to the above methods accordingly.
19102
19103 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19104
19105         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19106
19107         * expression.cs (ExpressionStatement): New base class used for
19108         expressions that can appear in statements, so that we can provide
19109         an alternate path to generate expression that do not leave a value
19110         on the stack.
19111
19112         (Expression::Emit, and all the derivatives): We no longer return
19113         whether a value is left on the stack or not.  Every expression
19114         after being emitted leaves a single value on the stack.
19115
19116         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19117         facilties of ExpressionStatement if possible.
19118
19119         * cs-parser.jay: Update statement_expression.
19120
19121 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19122
19123         * driver.cs: Change the wording of message
19124
19125 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19126
19127         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19128         the type of the expression to the return type of the method if
19129         we have an overloaded operator match ! The regression tests pass again !
19130         (Unary::ResolveOperator): Ditto.
19131
19132         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19133         to find "op_Implicit", not "implicit" ;-)
19134         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19135         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19136
19137         * everywhere : Correct calls to the above accordingly.
19138
19139         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19140         (ConvertImplicit): Do user-defined conversion if it exists.
19141
19142 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19143
19144         * assign.cs: track location.
19145         (Resolve): Use implicit conversions on assignment.
19146
19147         * literal.cs: Oops.  Not good, Emit of short access values should
19148         pass (Bytes) or the wrong argument will be selected.
19149
19150         * expression.cs (Unary::Emit): Emit code for -expr.
19151
19152         (Unary::ResolveOperator): Handle `Substract' for non-constants
19153         (substract from zero from the non-constants).
19154         Deal with Doubles as well. 
19155
19156         (Expression::ConvertImplicitRequired): New routine that reports an
19157         error if no implicit conversion exists. 
19158
19159         (Invocation::OverloadResolve): Store the converted implicit
19160         expressions if we make them
19161
19162 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19163
19164         * class.cs (ConstructorInitializer): Take a Location argument.
19165         (ConstructorBaseInitializer): Same here.
19166         (ConstructorThisInitializer): Same here.
19167
19168         * cs-parser.jay : Update all calls accordingly.
19169
19170         * expression.cs (Unary, Binary, New): Take location argument.
19171         Update accordingly everywhere.
19172
19173         * cs-parser.jay : Update all calls to the above to take a location
19174         argument.
19175
19176         * class.cs : Ditto.
19177
19178 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19179
19180         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19181         (Invocation::BetterConversion): Same here
19182         (Invocation::ConversionExists): Ditto.
19183
19184         (Invocation::ConversionExists): Implement.
19185
19186 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19187
19188         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19189         Also take an additional TypeContainer argument.
19190
19191         * All over : Pass in TypeContainer as argument to OverloadResolve.
19192
19193         * typemanager.cs (CSharpName): Update to check for the string type and return
19194         that too.
19195
19196         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19197         a given method.
19198
19199 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19200
19201         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19202         (Invocation::BetterFunction): Implement.
19203         (Invocation::BetterConversion): Implement.
19204         (Invocation::ConversionExists): Skeleton, no implementation yet.
19205
19206         Okay, things work fine !
19207
19208 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19209
19210         * typemanager.cs: declare and load enum_type, delegate_type and
19211         void_type. 
19212
19213         * expression.cs (Expression::Emit): Now emit returns a value that
19214         tells whether a value is left on the stack or not.  This strategy
19215         might be reveted tomorrow with a mechanism that would address
19216         multiple assignments.
19217         (Expression::report118): Utility routine to report mismatches on
19218         the ExprClass.
19219
19220         (Unary::Report23): Report impossible type/operator combination
19221         utility function.
19222
19223         (Unary::IsIncrementableNumber): Whether the type can be
19224         incremented or decremented with add.
19225         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19226         complemented. 
19227         (Unary::ResolveOperator): Implement ++, !, ~,
19228
19229         (Invocation::Emit): Deal with new Emit convetion.
19230
19231         * All Expression derivatives: Updated their Emit method to return
19232         whether they leave values on the stack or not.
19233
19234         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19235         stack for expressions that are statements. 
19236
19237 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19238
19239         * expression.cs (LValue): New interface.  Must be implemented by
19240         LValue objects.
19241         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19242         LValue interface.
19243
19244         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19245         interface for generating code, simplifies the code.
19246
19247 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19248
19249         * expression.cs (everywhere): Comment out return statements in ::Resolve
19250         methods to avoid the warnings.
19251
19252 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19253
19254         * driver.cs (parse): Report error 2001 if we can not open the
19255         source file.
19256
19257         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19258         not resolve it.
19259
19260         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19261         object. 
19262
19263         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19264         otherwise nested blocks end up with the same index.
19265
19266         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19267
19268         * expression.cs:  Instead of having FIXMEs in the Resolve
19269         functions, throw exceptions so it is obvious that we are facing a
19270         bug. 
19271
19272         * cs-parser.jay (invocation_expression): Pass Location information.
19273
19274         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19275         Use a basename for those routines because .NET does not like paths
19276         on them. 
19277
19278         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19279         already defined.
19280
19281 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19282
19283         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19284         are loading the correct data types (throws an exception if not).
19285         (TypeManager::InitCoreTypes): Use CoreLookupType
19286
19287         * expression.cs (Unary::ResolveOperator): return the child
19288         expression for expressions which are just +expr.
19289         (Unary::ResolveOperator): Return negative literals for -LITERAL
19290         expressions (otherwise they are Unary {Literal}).
19291         (Invocation::Badness): Take into account `Implicit constant
19292         expression conversions'.
19293
19294         * literal.cs (LongLiteral): Implement long literal class.
19295         (IntLiteral): export the `Value' of the intliteral. 
19296
19297 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19298
19299         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19300
19301         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19302         instead of 'Operator'
19303
19304         * expression.cs (Binary::ResolveOperator): Update accordingly.
19305         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19306         and 'Minus'
19307
19308         * cs-parser.jay (unary_expression): Update to use the new names.
19309
19310         * gen-treedump.cs (GetUnary): Same here.
19311
19312         * expression.cs (Unary::Resolve): Implement.
19313         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19314         operators are found instead of making noise ;-)
19315         (Unary::ResolveOperator): New method to do precisely the same thing which
19316         Binary::ResolveOperator does for Binary expressions.
19317         (Unary.method, .Arguments): Add.
19318         (Unary::OperName): Implement.   
19319         (Unary::ForceConversion): Copy and Paste !
19320
19321         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19322         a unary operator.
19323
19324         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19325         for the inbuilt operators. Only overloading works for now ;-)
19326
19327 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19328
19329         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19330         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19331
19332         * expression.cs (This::Emit): Implement. 
19333         (This::Resolve): Implement.
19334         (TypeOf:Resolve): Implement.
19335         (Expression::ResolveSimpleName): Add an implicit this to instance
19336         field references. 
19337         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19338         Bind instance variable to Field expressions.
19339         (FieldExpr::Instance): New field used to track the expression that
19340         represents the object instance.
19341         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19342         binding 
19343         (FieldExpr::Emit): Implement.
19344
19345         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19346         the last instruction contains a return opcode to avoid generating
19347         the last `ret' instruction (this generates correct code, and it is
19348         nice to pass the peverify output).
19349
19350         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19351         initializer for static and instance variables.
19352         (Constructor::Emit): Allow initializer to be null in the case of
19353         static constructors.  Only emit initializer for instance
19354         constructors. 
19355
19356         (TypeContainer::FindMembers): Return a null array if there are no
19357         matches.
19358
19359         Also fix the code for the MemberTypes.Method branch, as it was not
19360         scanning that for operators (or tried to access null variables before).
19361
19362         * assign.cs (Assign::Emit): Handle instance and static fields. 
19363
19364         * TODO: Updated.
19365
19366         * driver.cs: Stop compilation if there are parse errors.
19367
19368         * cs-parser.jay (constructor_declaration): Provide default base
19369         initializer for non-static constructors.
19370         (constructor_declarator): Do not provide a default base
19371         initializers if none was specified.
19372         Catch the fact that constructors should not have parameters.
19373
19374         * class.cs: Do not emit parent class initializers for static
19375         constructors, that should be flagged as an error.
19376
19377 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19378
19379         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19380         Move back code into TypeContainer::Populate.
19381
19382 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19383
19384         * class.cs (TypeContainer::AddConstructor): Fix the check to
19385         compare against Name, not Basename. 
19386         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19387
19388         * cs-parser.jay : Update accordingly.
19389
19390         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19391         for methods, don't forget to look into the operators too.
19392         (RegisterMethodBuilder): Helper method to take care of this for
19393         methods, constructors and operators.
19394         (Operator::Define): Completely revamp.
19395         (Operator.OperatorMethod, MethodName): New fields.
19396         (TypeContainer::Populate): Move the registering of builders into
19397         RegisterMethodBuilder.
19398         (Operator::Emit): Re-write.
19399
19400         * expression.cs (Binary::Emit): Comment out code path to emit method
19401         invocation stuff for the case when we have a user defined operator. I am
19402         just not able to get it right !
19403
19404 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19405
19406         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19407         argument. 
19408
19409         (Expression::MemberLookup): Provide a version that allows to
19410         specify the MemberTypes and BindingFlags. 
19411
19412         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19413         so it was not fetching variable information from outer blocks.
19414
19415         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19416         Beforefieldinit as it was buggy.
19417
19418         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19419         that Ravi put here.  
19420
19421         * class.cs (Constructor::Emit): Only emit if block is not null.
19422         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19423         deal with this by semantically definining it as if the user had
19424         done it.
19425
19426         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19427         constructors as we now "emit" them at a higher level.
19428
19429         (TypeContainer::DefineDefaultConstructor): Used to define the
19430         default constructors if none was provided.
19431
19432         (ConstructorInitializer): Add methods Resolve and Emit. 
19433
19434         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19435
19436 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19437
19438         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19439         the default constructor builder with our hashtable for methodbuilders
19440         to methodcores.
19441
19442         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19443         and argument_count is 0 in which case we have a match.
19444         (Binary::ResolveOperator): More null checking and miscellaneous coding
19445         style cleanup.
19446
19447 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19448
19449         * rootcontext.cs (IsNameSpace): Compare against null.
19450
19451         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19452
19453         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19454         and Unary::Operator.
19455
19456         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19457         accordingly.
19458
19459         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19460         we have overloaded operators.
19461         (Binary::ResolveOperator): Implement the part which does the operator overload
19462         resolution.
19463
19464         * class.cs (Operator::Emit): Implement.
19465         (TypeContainer::Emit): Emit the operators we have too.
19466
19467         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19468         the case when we have a user-defined operator.
19469
19470 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19471
19472         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19473
19474 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19475
19476         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19477         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19478         (Constructor::Emit): Implement.
19479         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19480         if we have no work to do. 
19481         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19482         Emit method.
19483
19484         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19485         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19486
19487         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19488         of parent.parent.
19489
19490 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19491
19492         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19493         in the source.
19494         (Tree::RecordNamespace): Method to do what the name says ;-)
19495         (Tree::Namespaces): Property to get at the namespaces hashtable.
19496
19497         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19498         keep track.
19499
19500         * rootcontext.cs (IsNamespace): Fixed it :-)
19501
19502 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19503
19504         * class.cs (TypeContainer::FindMembers): Add support for
19505         constructors. 
19506         (MethodCore): New class that encapsulates both the shared aspects
19507         of a Constructor and a Method.  
19508         (Method, Constructor): Factored pieces into MethodCore.
19509
19510         * driver.cs: Added --fatal which makes errors throw exceptions.
19511         Load System assembly as well as part of the standard library.
19512
19513         * report.cs: Allow throwing exceptions on errors for debugging.
19514
19515         * modifiers.cs: Do not use `parent', instead use the real type
19516         container to evaluate permission settings.
19517
19518         * class.cs: Put Ravi's patch back in.  He is right, and we will
19519         have to cope with the
19520
19521 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19522
19523         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19524         FamORAssem, not FamANDAssem.
19525
19526 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19527
19528         * driver.cs: Added --parse option that only parses its input files
19529         and terminates.
19530
19531         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19532         incorrect.  IsTopLevel is not used to tell whether an object is
19533         root_types or not (that can be achieved by testing this ==
19534         root_types).  But to see if this is a top-level *class* (not
19535         necessarly our "toplevel" container). 
19536
19537 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19538
19539         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19540         parent instead of a direct call to GetType.
19541
19542 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19543
19544         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19545         Modifiers.TypeAttr. This should just be a call to that method.
19546
19547         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19548         object so that we can determine if we are top-level or not.
19549
19550         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19551         TypeContainer too.
19552
19553         * enum.cs (Enum::Define): Ditto.
19554
19555         * modifiers.cs (FieldAttr): Re-write.
19556
19557         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19558         (TypeContainer::HaveStaticConstructor): New property to provide access
19559         to precisely that info.
19560
19561         * modifiers.cs (MethodAttr): Re-write.
19562         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19563
19564         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19565         of top-level types as claimed.
19566
19567 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19568
19569         * expression.cs (MemberLookup): Fruitless attempt to lookup
19570         constructors.  Maybe I need to emit default constructors?  That
19571         might be it (currently .NET emits this for me automatically).
19572         (Invocation::OverloadResolve): Cope with Arguments == null.
19573         (Invocation::EmitArguments): new function, shared by the new
19574         constructor and us.
19575         (Invocation::Emit): Handle static and instance methods.  Emit
19576         proper call instruction for virtual or non-virtual invocations.
19577         (New::Emit): Implement.
19578         (New::Resolve): Implement.
19579         (MemberAccess:Resolve): Implement.
19580         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19581         to track instances.
19582         (FieldExpr::Resolve): Set type.
19583
19584         * support.cs: Handle empty arguments.
19585                 
19586         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19587         SimpleLookup): Auxiliary routines to help parse a qualifier
19588         identifier.  
19589
19590         Update qualifier_identifier rule.
19591
19592         * codegen.cs: Removed debugging messages.
19593
19594         * class.cs: Make this a global thing, this acts just as a "key" to
19595         objects that we might have around.
19596
19597         (Populate): Only initialize method_builders_to_methods once.
19598
19599         * expression.cs (PropertyExpr): Initialize type from the
19600         PropertyType. 
19601
19602         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19603         Resolve pattern.  Attempt to implicitly convert value to boolean.
19604         Emit code.
19605
19606         * expression.cs: Set the type for the int32/int32 argument case.
19607         (Binary::ResolveOperator): Set the return type to boolean for
19608         comparission operators
19609
19610         * typemanager.cs: Remove debugging print code.
19611
19612         (Invocation::Resolve): resolve type.
19613
19614         * class.cs: Allocate a MemberInfo of the correct size, as the code
19615         elsewhere depends on the test to reflect the correct contents.
19616
19617         (Method::) Keep track of parameters, due to System.Reflection holes
19618
19619         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19620         mapping here.
19621
19622         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19623         of the exact size and return that.
19624
19625         (Class::LookupMethodByBuilder): New function that maps
19626         MethodBuilders to its methods.  Required to locate the information
19627         on methods because System.Reflection bit us again.
19628
19629         * support.cs: New file, contains an interface ParameterData and
19630         two implementations: ReflectionParameters and InternalParameters
19631         used to access Parameter information.  We will need to grow this
19632         as required.
19633
19634         * expression.cs (Invocation::GetParameterData): implement a cache
19635         and a wrapper around the ParameterData creation for methods. 
19636         (Invocation::OverloadResolve): Use new code.
19637
19638 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19639
19640         * class.cs (TypeContainer::EmitField): Remove and move into 
19641         (Field::Define): here and modify accordingly.
19642         (Field.FieldBuilder): New member.
19643         (TypeContainer::Populate): Update accordingly.
19644         (TypeContainer::FindMembers): Implement.
19645
19646 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19647
19648         * statement.cs: (VariableInfo::VariableType): New field to be
19649         initialized with the full type once it is resolved. 
19650
19651 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19652
19653         * parameter.cs (GetParameterInfo): Use a type cache to compute
19654         things only once, and to reuse this information
19655
19656         * expression.cs (LocalVariableReference::Emit): Implement.
19657         (OpcodeCast::Emit): fix.
19658
19659         (ParameterReference::Resolve): Implement.
19660         (ParameterReference::Emit): Implement.
19661
19662         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19663         that are expressions need to stay as Expressions.
19664
19665         * typemanager.cs (CSharpName): Returns the C# name of a type if
19666         possible. 
19667
19668         * expression.cs (Expression::ConvertImplicit): New function that
19669         implements implicit type conversions.
19670
19671         (Expression::ImplicitReferenceConversion): Implements implicit
19672         reference conversions.
19673
19674         (EmptyCast): New type for transparent casts.
19675
19676         (OpcodeCast): New type for casts of types that are performed with
19677         a sequence of bytecodes.
19678
19679         (BoxedCast): New type used for casting value types into reference
19680         types.  Emits a box opcode.
19681
19682         (Binary::DoNumericPromotions): Implements numeric promotions of
19683         and computation of the Binary::Type.
19684
19685         (Binary::EmitBranchable): Optimization.
19686
19687         (Binary::Emit): Implement code emission for expressions.
19688
19689         * typemanager.cs (TypeManager): Added two new core types: sbyte
19690         and byte.
19691
19692 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19693
19694         * class.cs (TypeContainer::FindMembers): Method which does exactly
19695         what Type.FindMembers does, only we don't have to use reflection. No
19696         implementation yet.
19697
19698         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19699         typecontainer objects as we need to get at them.
19700         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19701
19702         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19703         typecontainer object.
19704
19705         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19706         of just a Report object.
19707
19708 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19709
19710         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19711         "remove_"
19712         (TypeContainer::Populate): Now define the delegates of the type too.
19713         (TypeContainer.Delegates): Property to access the list of delegates defined
19714         in the type.
19715
19716         * delegates.cs (Delegate::Define): Implement partially.
19717
19718         * modifiers.cs (TypeAttr): Handle more flags.
19719
19720 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19721
19722         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19723         and not <=
19724         (Operator::Define): Re-write logic to get types by using the LookupType method
19725         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19726         (Indexer::Define): Ditto.
19727         (Event::Define): Ditto.
19728         (Property::Define): Ditto.
19729
19730 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19731
19732         * class.cs (TypeContainer::Populate): Now define operators too. 
19733         (TypeContainer.Operators): New property to access the list of operators
19734         in a type.
19735         (Operator.OperatorMethodBuilder): New member to hold the method builder
19736         for the operator we are defining.
19737         (Operator::Define): Implement.
19738
19739 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19740
19741         * class.cs (Event::Define): Make the prefixes of the accessor methods
19742         addOn_ and removeOn_ 
19743
19744         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19745         of the location being passed in too. Ideally, this should go later since all
19746         error reporting should be done through the Report object.
19747
19748         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19749         (Populate): Iterate thru the indexers we have and define them too.
19750         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19751         for the get and set accessors.
19752         (Indexer::Define): Implement.
19753
19754 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19755
19756         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19757         my previous implementation, did not work.
19758
19759         * typemanager.cs: Add a couple of missing types (the longs).
19760
19761         * literal.cs: Use TypeManager.bool_type instead of getting it.
19762
19763         * expression.cs (EventExpr): New kind of expressions.
19764         (Expressio::ExprClassFromMemberInfo): finish
19765
19766 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19767
19768         * assign.cs: Emit stores to static fields differently.
19769
19770 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19771
19772         * Merge in changes and adjust code to tackle conflicts. Backed out my
19773         code in Assign::Resolve ;-) 
19774
19775 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19776
19777         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19778         instead Report.Error and also pass in the location.
19779         (CSharpParser::Lexer): New readonly property to return the reference
19780         to the Tokenizer object.
19781         (declare_local_variables): Use Report.Error with location instead of plain 
19782         old error.
19783         (CheckDef): Ditto.
19784
19785         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19786         (Operator.CheckBinaryOperator): Ditto.
19787
19788         * cs-parser.jay (operator_declarator): Update accordingly.
19789
19790         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19791         (CheckBinaryOperator): Same here.
19792
19793         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19794         on the name without any prefixes of namespace names etc. This is because we
19795         already might have something already fully qualified like 
19796         'System.Console.WriteLine'
19797
19798         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19799
19800 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19801
19802         * cs-tokenizer.cs (location): Return a string which also contains
19803         the file name.
19804
19805         * expression.cs (ElementAccess): New class for expressions of the
19806         type 'element access.'
19807         (BaseAccess): New class for expressions of the type 'base access.'
19808         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19809         respectively.
19810
19811         * cs-parser.jay (element_access): Implement action.
19812         (base_access): Implement actions.
19813         (checked_expression, unchecked_expression): Implement.
19814
19815         * cs-parser.jay (local_variable_type): Correct and implement.
19816         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19817
19818         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19819
19820         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19821         name and the specifiers.
19822
19823         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19824
19825         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19826         making them all public ;-)
19827
19828         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19829         class anyways.
19830
19831 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19832
19833         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19834         PropertyExprs.
19835         (FieldExpr, PropertyExprs): New resolved expressions.
19836         (SimpleName::MemberStaticCheck): Perform static checks for access
19837         to non-static fields on static methods. Maybe this should be
19838         generalized for MemberAccesses. 
19839         (SimpleName::ResolveSimpleName): More work on simple name
19840         resolution. 
19841
19842         * cs-parser.jay (primary_expression/qualified_identifier): track
19843         the parameter index.
19844
19845         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19846         (EmitContext::EmitBoolExpression): Chain to expression generation
19847         instead of temporary hack.
19848         (::EmitStatementExpression): Put generic expression code generation.
19849
19850         * assign.cs (Assign::Emit): Implement variable assignments to
19851         local variables, parameters and fields.
19852
19853 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19854
19855         * statement.cs (Block::GetVariableInfo): New method, returns the
19856         VariableInfo for a variable name in a block.
19857         (Block::GetVariableType): Implement in terms of GetVariableInfo
19858
19859         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19860         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19861
19862 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19863
19864         * cs-parser.jay (operator_declaration): Continue on my quest : update
19865         to take attributes argument.
19866         (event_declaration): Ditto.
19867         (enum_declaration): Ditto.
19868         (indexer_declaration): Ditto.
19869
19870         * class.cs (Operator::Operator): Update constructor accordingly.
19871         (Event::Event): Ditto.
19872
19873         * delegate.cs (Delegate::Delegate): Same here.
19874
19875         * enum.cs (Enum::Enum): Same here.
19876
19877 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19878
19879         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19880
19881         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19882
19883         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19884         being passed around as an arraylist.
19885         (Attributes::AddAttribute): Method to add attribute sections.
19886
19887         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19888         (struct_declaration): Update accordingly.
19889         (constant_declaration): Update.
19890         (field_declaration): Update.
19891         (method_header): Update.
19892         (fixed_parameter): Update.
19893         (parameter_array): Ditto.
19894         (property_declaration): Ditto.
19895         (destructor_declaration): Ditto.
19896
19897         * class.cs (Struct::Struct): Update constructors accordingly.
19898         (Class::Class): Ditto.
19899         (Field::Field): Ditto.
19900         (Method::Method): Ditto.
19901         (Property::Property): Ditto.
19902         (TypeContainer::OptAttribute): update property's return type.
19903
19904         * interface.cs (Interface.opt_attributes): New member.
19905         (Interface::Interface): Update to take the extra Attributes argument.
19906
19907         * parameter.cs (Parameter::Parameter): Ditto.
19908
19909         * constant.cs (Constant::Constant): Ditto.
19910
19911         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19912         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19913         the attributes as a parameter.
19914         (InterfaceProperty): Update constructor call.
19915         (InterfaceEvent): Ditto.
19916         (InterfaceMethod): Ditto.
19917         (InterfaceIndexer): Ditto.
19918
19919         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19920         pass the attributes too.
19921         (interface_event_declaration): Ditto.
19922         (interface_property_declaration): Ditto.
19923         (interface_method_declaration): Ditto.
19924         (interface_declaration): Ditto.
19925
19926 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19927
19928         * class.cs (Method::Define): Track the "static Main" definition to
19929         create an entry point. 
19930
19931         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19932         EntryPoint if we find it. 
19933
19934         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19935         (EmitContext::ig): Make this variable public.
19936
19937         * driver.cs: Make the default output file be the first file name
19938         with the .exe extension.  
19939
19940         Detect empty compilations
19941
19942         Handle various kinds of output targets.  Handle --target and
19943         rename -t to --dumper.
19944
19945         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19946         methods inherited from Expression return now an Expression.  This
19947         will is used during the tree rewriting as we resolve them during
19948         semantic analysis.
19949
19950         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19951         the spec.  Missing entirely is the information about
19952         accessability of elements of it.
19953
19954         (Expression::ExprClassFromMemberInfo): New constructor for
19955         Expressions that creates a fully initialized Expression based on
19956         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19957         a Type.
19958
19959         (Invocation::Resolve): Begin implementing resolution of invocations.
19960
19961         * literal.cs (StringLiteral):  Implement Emit.
19962
19963 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19964
19965         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19966         member.
19967
19968 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19969
19970         * cs-parser.jay (attribute_arguments): Implement actions.
19971         (attribute): Fix bug in production. Implement action.
19972         (attribute_list): Implement.
19973         (attribute_target): Implement.
19974         (attribute_target_specifier, opt_target_specifier): Implement
19975         (CheckAttributeTarget): New method to check if the attribute target
19976         is valid.
19977         (attribute_section): Implement.
19978         (opt_attributes): Implement.
19979
19980         * attribute.cs : New file to handle attributes.
19981         (Attribute): Class to hold attribute info.
19982
19983         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19984         (attribute_section): Modify production to use 2 different rules to 
19985         achieve the same thing. 1 s/r conflict down !
19986         Clean out commented, useless, non-reducing dimension_separator rules.
19987
19988         * class.cs (TypeContainer.attributes): New member to hold list
19989         of attributes for a type.
19990         (Struct::Struct): Modify to take one more argument, the attribute list.
19991         (Class::Class): Ditto.
19992         (Field::Field): Ditto.
19993         (Method::Method): Ditto.
19994         (Property::Property): Ditto.
19995
19996         * cs-parser.jay (struct_declaration): Update constructor call to
19997         pass in the attributes too.
19998         (class_declaration): Ditto.
19999         (constant_declaration): Ditto.
20000         (field_declaration): Ditto.
20001         (method_header): Ditto.
20002         (fixed_parameter): Ditto.
20003         (parameter_array): Ditto.
20004         (property_declaration): Ditto.
20005
20006         * constant.cs (Constant::Constant): Update constructor similarly.
20007         Use System.Collections.
20008
20009         * parameter.cs (Parameter::Parameter): Update as above.
20010
20011 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20012
20013         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20014         (TypeContainer.delegates): New member to hold list of delegates.
20015
20016         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20017         this time as I seem to be on crack ;-)
20018
20019 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20020
20021         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20022         tell whether an identifier represents a namespace.
20023
20024         * expression.cs (NamespaceExpr): A namespace expression, used only
20025         temporarly during expression resolution.
20026         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20027         utility functions to resolve names on expressions.
20028
20029 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20030
20031         * codegen.cs: Add hook for StatementExpressions. 
20032
20033         * class.cs: Fix inverted test for static flag in methods.
20034
20035 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20036
20037         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20038         to make it coincide with MS' number.
20039         (Operator::CheckBinaryOperator): Ditto.
20040
20041         * ../errors/errors.txt : Remove error numbers added earlier.
20042
20043         * ../errors/cs1019.cs : Test case for error # 1019
20044
20045         * ../errros/cs1020.cs : Test case for error # 1020
20046
20047         * cs-parser.jay : Clean out commented cruft.
20048         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20049         used anywhere - non-reducing rule.
20050         (namespace_declarations): Non-reducing rule - comment out.
20051
20052         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20053         with TypeContainer::AddEnum.
20054
20055         * delegate.cs : New file for delegate handling classes.
20056         (Delegate): Class for declaring delegates.
20057
20058         * makefile : Update.
20059
20060         * cs-parser.jay (delegate_declaration): Implement.
20061
20062 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20063
20064         * class.cs (Event::Define): Implement.
20065         (Event.EventBuilder): New member.
20066
20067         * class.cs (TypeContainer::Populate): Update to define all enums and events
20068         we have.
20069         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20070         readonly fields for all these cases ?
20071
20072 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20073
20074         * class.cs (Property): Revamp to use the convention of making fields readonly.
20075         Accordingly modify code elsewhere.
20076
20077         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20078         the Define method of the Property class.
20079
20080         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20081         trivial bug.
20082         (TypeContainer::Populate): Update to define all the properties we have. Also
20083         define all enumerations.
20084
20085         * enum.cs (Define): Implement.
20086
20087 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20088
20089         * cs-parser.jay (overloadable_operator): The semantic value is an
20090         enum of the Operator class.
20091         (operator_declarator): Implement actions.
20092         (operator_declaration): Implement.
20093
20094         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20095         validity of definitions.
20096         (Operator::CheckBinaryOperator): Static method to check for binary operators
20097         (TypeContainer::AddOperator): New method to add an operator to a type.
20098
20099         * cs-parser.jay (indexer_declaration): Added line to actually call the
20100         AddIndexer method so it gets added ;-)
20101
20102         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20103         already taken care of by the MS compiler ?  
20104
20105 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20106
20107         * class.cs (Operator): New class for operator declarations.
20108         (Operator::OpType): Enum for the various operators.
20109
20110 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20111
20112         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20113         ostensibly handle this in semantic analysis.
20114
20115         * cs-parser.jay (general_catch_clause): Comment out
20116         (specific_catch_clauses, specific_catch_clause): Ditto.
20117         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20118         (catch_args, opt_catch_args): New productions.
20119         (catch_clause): Rewrite to use the new productions above
20120         (catch_clauses): Modify accordingly.
20121         (opt_catch_clauses): New production to use in try_statement
20122         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20123         and re-write the code in the actions to extract the specific and
20124         general catch clauses by being a little smart ;-)
20125
20126         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20127         Hooray, try and catch statements parse fine !
20128
20129 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20130
20131         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20132         string from the hashtable of variables.
20133
20134         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20135         I end up making that mistake ;-)
20136         (catch_clauses): Fixed gross error which made Key and Value of the 
20137         DictionaryEntry the same : $1 !!
20138
20139 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20140
20141         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20142
20143         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20144         when the add and remove accessors are specified. 
20145
20146 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20147
20148         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20149         information about indexer_declarator.
20150         (indexer_declarator): Implement actions.
20151         (parsing_indexer): New local boolean used to keep track of whether
20152         we are parsing indexers or properties. This is necessary because 
20153         implicit_parameters come into picture even for the get accessor in the 
20154         case of an indexer.
20155         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20156
20157         * class.cs (Indexer): New class for indexer declarations.
20158         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20159         (TypeContainer::indexers): New member to hold list of indexers for the
20160         type.
20161
20162 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20163
20164         * cs-parser.jay (add_accessor_declaration): Implement action.
20165         (remove_accessor_declaration): Implement action.
20166         (event_accessors_declaration): Implement
20167         (variable_declarators): swap statements for first rule - trivial.
20168
20169         * class.cs (Event): New class to hold information about event
20170         declarations.
20171         (TypeContainer::AddEvent): New method to add an event to a type
20172         (TypeContainer::events): New member to hold list of events.
20173
20174         * cs-parser.jay (event_declaration): Implement actions.
20175
20176 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20177
20178         * cs-parser.jay (dim_separators): Implement. Make it a string
20179         concatenating all the commas together, just as they appear.
20180         (opt_dim_separators): Modify accordingly
20181         (rank_specifiers): Update accordingly. Basically do the same
20182         thing - instead, collect the brackets here.
20183         (opt_rank_sepcifiers): Modify accordingly.
20184         (array_type): Modify to actually return the complete type string
20185         instead of ignoring the rank_specifiers.
20186         (expression_list): Implement to collect the expressions
20187         (variable_initializer): Implement. We make it a list of expressions
20188         essentially so that we can handle the array_initializer case neatly too.
20189         (variable_initializer_list): Implement.
20190         (array_initializer): Make it a list of variable_initializers
20191         (opt_array_initializer): Modify accordingly.
20192
20193         * expression.cs (New::NType): Add enumeration to help us
20194         keep track of whether we have an object/delegate creation
20195         or an array creation.
20196         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20197         members to hold data about array creation.
20198         (New:New): Modify to update NewType
20199         (New:New): New Overloaded contructor for the array creation
20200         case.
20201
20202         * cs-parser.jay (array_creation_expression): Implement to call
20203         the overloaded New constructor.
20204
20205 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20206
20207         * class.cs (TypeContainer::Constructors): Return member
20208         constructors instead of returning null.
20209
20210 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20211
20212         * typemanager.cs (InitCoreTypes): Initialize the various core
20213         types after we have populated the type manager with the user
20214         defined types (this distinction will be important later while
20215         compiling corlib.dll)
20216
20217         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20218         on Expression Classification.  Now all expressions have a method
20219         `Resolve' and a method `Emit'.
20220
20221         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20222         generation from working.     Also add some temporary debugging
20223         code. 
20224
20225 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20226
20227         * codegen.cs: Lots of code generation pieces.  This is only the
20228         beginning, will continue tomorrow with more touches of polish.  We
20229         handle the fundamentals of if, while, do, for, return.  Others are
20230         trickier and I need to start working on invocations soon.
20231
20232         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20233         s.InitStatement. 
20234
20235         * codegen.cs (EmitContext): New struct, used during code
20236         emission to keep a context.   Most of the code generation will be
20237         here. 
20238
20239         * cs-parser.jay: Add embedded blocks to the list of statements of
20240         this block.  So code generation proceeds in a top down fashion.
20241
20242 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20243
20244         * statement.cs: Add support for multiple child blocks.
20245
20246 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20247
20248         * codegen.cs (EmitCode): New function, will emit the code for a
20249         Block of code given a TypeContainer and its ILGenerator. 
20250
20251         * statement.cs (Block): Standard public readonly optimization.
20252         (Block::Block constructors): Link children. 
20253         (Block::Child): Child Linker.
20254         (Block::EmitVariables): Emits IL variable declarations.
20255
20256         * class.cs: Drop support for MethodGroups here, delay until
20257         Semantic Analysis.
20258         (Method::): Applied the same simplification that I did before, and
20259         move from Properties to public readonly fields.
20260         (Method::ParameterTypes): Returns the parameter types for the
20261         function, and implements a cache that will be useful later when I
20262         do error checking and the semantic analysis on the methods is
20263         performed.
20264         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20265         and made a method, optional argument tells whether this is a class
20266         or a structure to apply the `has-this' bit.
20267         (Method::GetCallingConvention): Implement, returns the calling
20268         convention. 
20269         (Method::Define): Defines the type, a second pass is performed
20270         later to populate the methods.
20271
20272         (Constructor::ParameterTypes): implement a cache similar to the
20273         one on Method::ParameterTypes, useful later when we do semantic
20274         analysis. 
20275
20276         (TypeContainer::EmitMethod):  New method.  Emits methods.
20277
20278         * expression.cs: Removed MethodGroup class from here.
20279
20280         * parameter.cs (Parameters::GetCallingConvention): new method.
20281
20282 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20283
20284         * class.cs (TypeContainer::Populate): Drop RootContext from the
20285         argument. 
20286
20287         (Constructor::CallingConvention): Returns the calling convention.
20288         (Constructor::ParameterTypes): Returns the constructor parameter
20289         types. 
20290
20291         (TypeContainer::AddConstructor): Keep track of default constructor
20292         and the default static constructor.
20293
20294         (Constructor::) Another class that starts using `public readonly'
20295         instead of properties. 
20296
20297         (Constructor::IsDefault): Whether this is a default constructor. 
20298
20299         (Field::) use readonly public fields instead of properties also.
20300
20301         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20302         track of static constructors;  If none is used, turn on
20303         BeforeFieldInit in the TypeAttributes. 
20304
20305         * cs-parser.jay (opt_argument_list): now the return can be null
20306         for the cases where there are no arguments. 
20307
20308         (constructor_declarator): If there is no implicit `base' or
20309         `this', then invoke the default parent constructor. 
20310
20311         * modifiers.cs (MethodAttr): New static function maps a set of
20312         modifiers flags into a MethodAttributes enum
20313         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20314         MethodAttr, TypeAttr to represent the various mappings where the
20315         modifiers are used.
20316         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20317
20318 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20321         method arguments.
20322
20323         * interface.cs (PopulateIndexer): Implemented the code generator
20324         for interface indexers.
20325
20326 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20327
20328         * interface.cs (InterfaceMemberBase): Now we track the new status
20329         here.  
20330
20331         (PopulateProperty): Implement property population.  Woohoo!  Got
20332         Methods and Properties going today. 
20333
20334         Removed all the properties for interfaces, and replaced them with
20335         `public readonly' fields. 
20336
20337 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20338
20339         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20340         initialize their hashtables/arraylists only when they are needed
20341         instead of doing this always.
20342
20343         * parameter.cs: Handle refs and out parameters.
20344
20345         * cs-parser.jay: Use an ArrayList to construct the arguments
20346         instead of the ParameterCollection, and then cast that to a
20347         Parameter[] array.
20348
20349         * parameter.cs: Drop the use of ParameterCollection and use
20350         instead arrays of Parameters.
20351
20352         (GetParameterInfo): Use the Type, not the Name when resolving
20353         types. 
20354
20355 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20356
20357         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20358         and instead use public readonly fields.
20359
20360         * class.cs: Put back walking code for type containers.
20361
20362 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20363
20364         * class.cs (MakeConstant): Code to define constants.
20365
20366         * rootcontext.cs (LookupType): New function.  Used to locate types 
20367
20368
20369 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20370
20371         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20372         this System.Reflection code is.  Kudos to Microsoft
20373
20374         * typemanager.cs: Implement a type cache and avoid loading all
20375         types at boot time.  Wrap in LookupType the internals.  This made
20376         the compiler so much faster.  Wow.  I rule!
20377
20378         * driver.cs: Make sure we always load mscorlib first (for
20379         debugging purposes, nothing really important).
20380
20381         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20382         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20383
20384         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20385         on namespaces that have been imported using the `using' keyword.
20386
20387         * class.cs (TypeContainer::TypeAttr): Virtualize.
20388         (Class::TypeAttr): Return attributes suitable for this bad boy.
20389         (Struct::TypeAttr): ditto.
20390         Handle nested classes.
20391         (TypeContainer::) Remove all the type visiting code, it is now
20392         replaced with the rootcontext.cs code
20393
20394         * rootcontext.cs (GetClassBases): Added support for structs. 
20395
20396 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20397
20398         * interface.cs, statement.cs, class.cs, parameter.cs,
20399         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20400         Drop use of TypeRefs, and use strings instead.
20401
20402 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20403
20404         * rootcontext.cs: 
20405
20406         * class.cs (Struct::Struct): set the SEALED flags after
20407         checking the modifiers.
20408         (TypeContainer::TypeAttr): new property, returns the
20409         TypeAttributes for a class.  
20410
20411         * cs-parser.jay (type_list): Oops, list production was creating a
20412         new list of base types.
20413
20414         * rootcontext.cs (StdLib): New property.
20415         (GetInterfaceTypeByName): returns an interface by type name, and
20416         encapsulates error handling here.
20417         (GetInterfaces): simplified.
20418         (ResolveTree): Encapsulated all the tree resolution here.
20419         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20420         types. 
20421
20422         * driver.cs: Add support for --nostdlib, to avoid loading the
20423         default assemblies.
20424         (Main): Do not put tree resolution here. 
20425
20426         * rootcontext.cs: Beginning of the class resolution.
20427
20428 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20429
20430         * rootcontext.cs: Provide better error reporting. 
20431
20432         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20433
20434         * rootcontext.cs (CreateInterface): Handle the case where there
20435         are no parent interfaces.
20436
20437         (CloseTypes): Routine to flush types at the end.
20438         (CreateInterface): Track types.
20439         (GetInterfaces): Returns an array of Types from the list of
20440         defined interfaces.
20441
20442         * typemanager.c (AddUserType): Mechanism to track user types (puts
20443         the type on the global type hash, and allows us to close it at the
20444         end). 
20445
20446 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20447
20448         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20449         RecordInterface instead.
20450
20451         * cs-parser.jay: Updated to reflect changes above.
20452
20453         * decl.cs (Definition): Keep track of the TypeBuilder type that
20454         represents this type here.  Not sure we will use it in the long
20455         run, but wont hurt for now.
20456
20457         * driver.cs: Smaller changes to accomodate the new code.
20458
20459         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20460         when done. 
20461
20462         * rootcontext.cs (CreateInterface):  New method, used to create
20463         the System.TypeBuilder type for interfaces.
20464         (ResolveInterfaces): new entry point to resolve the interface
20465         hierarchy. 
20466         (CodeGen): Property, used to keep track of the code generator.
20467
20468 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20469
20470         * cs-parser.jay: Add a second production for delegate_declaration
20471         with `VOID'.
20472
20473         (enum_body): Put an opt_comma here instead of putting it on
20474         enum_body or enum_member_declarations so we can handle trailing
20475         commas on enumeration members.  Gets rid of a shift/reduce.
20476
20477         (type_list): Need a COMMA in the middle.
20478
20479         (indexer_declaration): Tell tokenizer to recognize get/set
20480
20481         * Remove old targets.
20482
20483         * Re-add the parser target.
20484
20485 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20486
20487         * cs-parser.jay: Add precendence rules for a number of operators
20488         ot reduce the number of shift/reduce conflicts in the grammar.
20489
20490 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20491
20492         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20493         and put it here.
20494
20495         Get rid of old crufty code.
20496
20497         * rootcontext.cs: Use this to keep track of the parsed
20498         representation and the defined types available to the program. 
20499
20500         * gen-treedump.cs: adjust for new convention.
20501
20502         * type.cs: Split out the type manager, and the assembly builder
20503         from here. 
20504
20505         * typemanager.cs: the type manager will live here now.
20506
20507         * cil-codegen.cs: And the code generator here. 
20508
20509 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20510
20511         * makefile: Fixed up for easy making.
20512
20513 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20514
20515         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20516         the 
20517
20518         (unary_expression): Expand pre_increment_expression and
20519         post_decrement_expression to reduce a shift/reduce.
20520
20521 2001-07-11  Simon Cozens
20522
20523         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20524
20525         Improve allow_keyword_as_indent name.
20526
20527 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20528
20529         * Adjustments for Beta2. 
20530
20531 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20532
20533         * decl.cs: Added `Define' abstract method.
20534         (InTransit): new property, used to catch recursive definitions. 
20535
20536         * interface.cs: Implement `Define'. 
20537
20538         * modifiers.cs: Map Modifiers.constants to
20539         System.Reflection.TypeAttribute flags.
20540
20541         * class.cs: Keep track of types and user-defined types.
20542         (BuilderInit): New method for creating an assembly
20543         (ResolveType): New function to launch the resolution process, only
20544         used by interfaces for now.
20545
20546         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20547         that are inserted into the name space. 
20548
20549 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20550
20551         * ARGH.  I have screwed up my tree so many times due to the use of
20552         rsync rather than using CVS.  Going to fix this at once. 
20553
20554         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20555         load types.
20556
20557 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20558
20559         * Experiment successful: Use System.Type rather that our own
20560         version of Type.  
20561
20562 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20563
20564         * cs-parser.jay: Removed nsAliases from here.
20565
20566         Use new namespaces, handle `using XXX;' 
20567
20568         * namespace.cs: Reimplemented namespace handling, use a recursive
20569         definition of the class.  Now we can keep track of using clauses
20570         and catch invalid using clauses.
20571
20572 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20573
20574         * gen-treedump.cs: Adapted for all the renaming.
20575
20576         * expression.cs (Expression): this class now has a Type property
20577         which returns an expression Type.
20578
20579         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20580         `Type', as this has a different meaning now in the base
20581
20582 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20583
20584         * interface.cs, class.cs: Removed from all the sources the
20585         references to signature computation, as we can not do method
20586         signature computation during the parsing time, as we are not
20587         trying to solve at that point distinguishing:
20588
20589         class X {
20590                 void a (Blah x) {}
20591                 void a (NS.Blah x) {}
20592         }
20593
20594         Which depending on the context might be valid or not, as we do not
20595         know if Blah is the same thing as NS.Blah at that point.
20596
20597         * Redid everything so the code uses TypeRefs now instead of
20598         Types.  TypeRefs are just temporary type placeholders, that need
20599         to be resolved.  They initially have a pointer to a string and the
20600         current scope in which they are used.  This is used later by the
20601         compiler to resolve the reference to an actual Type. 
20602
20603         * DeclSpace is no longer a CIR.Type, and neither are
20604         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20605         are all DeclSpaces, but no Types. 
20606
20607         * type.cs (TypeRefManager): This implements the TypeRef manager,
20608         which keeps track of all the types that need to be resolved after
20609         the parsing has finished. 
20610
20611 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20612
20613         * ARGH.  We are going to have to store `foreach' as a class rather
20614         than resolving it, as we need to verify error 1579 after name
20615         resolution.   *OR* we could keep a flag that says `This request to
20616         IEnumerator comes from a foreach statement' which we can then use
20617         to generate the error.
20618
20619 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20620
20621         * class.cs (TypeContainer.AddMethod): we now add methods to the
20622         MethodGroup instead of the method hashtable.  
20623
20624         * expression.cs: Add MethodGroup abstraction, which gets us one
20625         step closer to the specification in the way we handle method
20626         declarations.  
20627
20628         * cs-parser.jay (primary_expression): qualified_identifier now
20629         tried to match up an identifier to a local variable reference or
20630         to a parameter reference.
20631
20632         current_local_parameters is now a parser global variable that
20633         points to the current parameters for the block, used during name
20634         lookup.
20635
20636         (property_declaration): Now creates an implicit `value' argument to
20637         the set accessor.
20638
20639 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20640
20641         * parameter.cs: Do not use `param' arguments as part of the
20642         signature, per the spec.
20643
20644 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20645
20646         * decl.cs: Base class for classes, structs and interfaces.  This
20647         is the "Declaration Space" 
20648
20649         * cs-parser.jay: Use CheckDef for checking declaration errors
20650         instead of having one on each function.
20651
20652         * class.cs: Factor out some code for handling error handling in
20653         accordance to the "Declarations" section in the "Basic Concepts"
20654         chapter in the ECMA C# spec.
20655
20656         * interface.cs: Make all interface member classes derive from
20657         InterfaceMemberBase.
20658
20659 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20660
20661         * Many things: all interfaces are parsed and generated in
20662         gen-treedump.  Support for member variables, constructors,
20663         destructors, properties, constants is there.
20664
20665         Beginning of the IL backend, but very little done, just there for
20666         testing purposes. 
20667
20668 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20669
20670         * cs-parser.jay: Fix labeled statement.
20671
20672         * cs-tokenizer.cs (escape): Escape " and ' always.
20673         ref_line, ref_name: keep track of the line/filename as instructed
20674         by #line by the compiler.
20675         Parse #line.
20676
20677 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20678
20679         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20680         to match the values in System.CodeDOM.
20681
20682         Divid renamed to Divide.
20683
20684         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20685         statements. 
20686         (Statements.set): remove.
20687
20688         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20689         statements. 
20690
20691         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20692         falseStatements always have valid values. 
20693
20694         * cs-parser.jay: Use System.CodeDOM now.
20695