2005-08-02 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / ChangeLog
1 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2
3         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4         New method, looking for lo-case imported cls type.
5
6         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7         here.
8
9         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10
11         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
12
13         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
14         all_imported_types.
15         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
16
17         Optimized to save 3.5 MB for SWF compilation.
18
19 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
20
21         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
22         (PartialContainer.Create): Moved logic AddToContainer.
23         (PartialContainer.MarkForDuplicationCheck): Shares name.
24         
25         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
26         place.
27         
28         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
29         initialization.
30         (Namespace.GetSignatureForError): New method.
31         
32         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
33         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
34
35 2005-08-01  Raja R Harinath  <rharinath@novell.com>
36
37         Fix #75669.
38         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
39         member lookup rather than qualifier_type, since qualifier_type can
40         be null.
41
42 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
43
44         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
45         enum member.
46
47 2005-07-31  Miguel de Icaza  <miguel@novell.com>
48
49         * statement.cs: Copy the local exception into the exception
50         captured local.  Fixes 75674
51
52 2005-07-31  Raja R Harinath  <harinath@gmail.com>
53
54         Fix #75658.
55         * expression.cs (Invocation.OverloadResolve): Don't report error
56         CS1501 if error CS1502 has been reported.
57         (New.DoResolve): Delegate CS1501 reporting to
58         Invocation.OverloadResolve.
59
60         Fix #75656.
61         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
62         invariant-meaning-in-block property in an enclosing block if
63         necessary.
64
65 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
66
67         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
68         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
69         (Switch.CheckSwitch): Just save 50kb for SWF.
70
71 2005-07-27  Martin Baulig  <martin@ximian.com>
72
73         * anonymous.cs (CaptureContext.AddField): Added
74         `AnonymousContainer am' argument; compute its toplevel scope if
75         it's not already computed.  Fixes #75649.
76
77 2005-07-26  Raja R Harinath  <rharinath@novell.com>
78
79         Fix #75628.
80         * class.cs (Constructor.Emit): Reset block to null if the block
81         resolve fails.
82
83 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
84
85         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
86
87 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
88
89         * class.cs (MethodData.Define): Check whether accessor implementing
90         interface is public.
91
92         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
93
94 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
95
96         Fix #57245
97         * namespace.cs (LookupType): Moved same type check to...
98         
99         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
100         with the same name.
101
102 2005-07-21  Raja R Harinath  <rharinath@novell.com>
103
104         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
105         already found a typebuilder.
106         * class.cs (MethodCore.IsDuplicateImplementation): Compare
107         MemberNames, not strings.
108
109         * const.cs (Error_ExpressionMustBeConst): 
110         Rename from Error_EpressionMustBeConst.
111         * const.cs, class.cs, statement.cd: Update.
112
113 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
114
115         Fix #65573
116
117         * const.cs (Const.LookupConstantValue): Report missing contant expression
118         everytime.
119         (Error_EpressionMustBeConstant): Only one error method.
120
121         * class.cs, statement.c: Updated.
122
123 2005-07-20  Raja R Harinath  <rharinath@novell.com>
124
125         * statement.cs (Block.Flags): Add back HasVarargs.
126         (Block.flags): Make protected.
127         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
128
129         * typemanager.cs (types, typecontainers, user_types): Remove.
130         (UserTypes, TypeContainers): Likewise.
131         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
132         (CleanUp, Reset): Update.
133         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
134         (GetNestedType): Use Type.GetNestedType.
135         (CoreLookupType): Take two arguments, the namespace and the
136         basename of the type.  Update to use the Namespace.Lookup
137         mechanism.
138         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
139         (RealMemberLookup): Use IsNestedChildOf instead of playing with
140         string concatenation and substring matches.
141         * class.cs, enum.cs, delegate.cs: Update to changes.
142
143 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
144
145         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
146         Expression and made virtual.
147
148         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
149         (ImplicitStandardConversionExists): Fixed `byte' typo ?
150
151         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
152
153         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
154         error message.
155
156         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
157         change.
158
159 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
160
161         Fix #57707
162         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
163         AssemblyCultureAttribute is not used on executable.
164
165         * rootcontext.cs,
166         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
167
168 2005-07-16  Raja R Harinath  <rharinath@novell.com>
169
170         Fix #60638.
171         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
172         New.  Reports CS0252/CS0253.
173         Mostly taken from preliminary patch by Duncak Mak.
174         (Binary.DoResolveOperator): Store results of operator lookup.
175         Use them to detect if we need to warn about unintended reference
176         comparisons.
177
178 2005-07-15  Raja R Harinath  <rharinath@novell.com>
179
180         Fix #72969.
181         * namespace.cs (Namespace.Lookup): Add back location parameter.
182         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
183         * delegate.cs, ecore.cs, expression.cs: Update to changes.
184
185         * codegen.cs (EmitContext.DeclSpace): Make readonly.
186         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
187         (Namespace.LookupType): ... this.
188         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
189         of namespaces.
190         * typemanager.cs (LookupTypeReflection): Remove buggy code that
191         purported to handle pointers.
192         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
193         CoreLookupType.
194
195 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
196
197         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
198         type as namespace.
199
200 2005-07-15  Raja R Harinath  <rharinath@novell.com>
201
202         * namespace.cs (Namespace.Lookup): Drop location parameter.
203         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
204         (NamespaceEntry.Lookup): ... this.
205         (NamespaceEntry.Error_AmbiguousTypeReference):
206         Move here from DeclSpace.
207         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
208         names ...
209         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
210         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
211         Move to NamespaceEntry.
212         * delegate.cs, expression.cs: Update to changes.
213
214 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
215
216         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
217         CheckAttributeType and refactored.
218         (Attribute.ResolvePossibleAttributeType): Changed to reuse
219         ResolveAsTypeTerminal error handling.
220         (ResolveAsTypeTerminal): Introduced because of global attributes extra
221         handling.
222         (GetSignatureForError): Print errors in same way.
223
224         * class.cs,
225         * codegen.cs: Reflect attribute GetSignatureForError change.
226
227         * ecore.cs,
228         * expression.cs: Add silent parameter to ResolveAsTypeStep.
229
230         * namespace.cs (UsingEntry): Refactored to make fields private.
231
232         * assign.cs,
233         statement.cs: Error_UnexpectedKind has extra parameter.
234
235 2005-07-14  Raja R Harinath  <rharinath@novell.com>
236
237         * ecore.cs (IAlias): Remove.
238         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
239         that implement the interface.
240         * namespace.cs (Namespace): Likewise.
241         (Namespace.declspaces): Renamed from 'defined_names'.
242         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
243         DeclSpace instead of an IAlias.
244         * tree.cs (Tree.AddDecl): Update.
245
246 2005-07-12  Raja R Harinath  <rharinath@novell.com>
247
248         * statement.cs (Block.Flags); Remove HasVarargs.
249         (Block.HasVarargs): Move to ToplevelBlock.
250         (Block.ThisVariable, Block.AddThisVariable): Likewise.
251         (Block.Variables): Make protected.  Initialize variable hashtable
252         if necessary.
253         (Block.AddVariable): Update.
254         (Block.Resolve): Update to changes.
255         (ToplevelBlock.HasVarargs): New boolean.
256         (ToplevelBlock.ThisVariable): Move here from Block.
257         (ToplevelBlock.AddThisVariable): Likewise.
258         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
259         * expression.cs (This.ResolveBase): Update to changes.
260         (ArglistAccess.DoResolve): Likewise.
261
262 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
263
264         Fix #75321
265         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
266
267         * class.cs (TypeContainer.VerifyMembers): Distinguish between
268         not used and not used & assigned.
269         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
270
271 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
272
273         Fix #75053
274         * expression.cs (Is.DoResolve): null is never provided type.
275
276 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
277
278         Fix #52496
279         * cs-parser.jay: Less strict event error rule to catch more errors.
280
281 2005-07-08  Martin Baulig  <martin@ximian.com>
282
283         Fix test-iter-10.cs - distinguish whether we `yield' in a property
284         gettter (allowed) or setter (not allowed).
285
286         * class.cs (Accessor): Implement IIteratorContainer.
287         (Accessor.Yields): New public field.
288         (PropertyBase.PropertyMethod.Define): Handle iterators on a
289         per-accessor basis.
290
291         * cs-parser.jay
292         (get_accessor_declaration, set_accessor_declaration): Set the
293         `yields' flag on the accessor, not the property.
294         (property_declaration): Do the iterators check on a per-accessor
295         basis and not for the whole property.
296
297 2005-07-08  Martin Baulig  <martin@ximian.com>
298
299         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
300         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
301
302 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
303
304         Fix #74975
305         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
306         (ExtractSecurityPermissionSet): Cope with self referencing security
307         attributes properly.
308
309         * driver.cs (SetOutputFile): Made public property OutputFile.
310
311 2005-07-07  Raja R Harinath  <rharinath@novell.com>
312
313         Fix #75486.
314         * class.cs (TypeContainer.first_nonstatic_field): Rename from
315         has_nonstatic_fields.  Make into a FieldBase pointer.
316         (TypeContainer.AddField): Add CS0282 check.
317         (TypeContainer.EmitType): Update.
318
319 2005-07-06  Miguel de Icaza  <miguel@novell.com>
320
321         * cs-tokenizer.cs (consume_identifier): Do not create strings to
322         compare if they start with __.
323
324 2005-07-06  Raja R Harinath  <rharinath@novell.com>
325
326         * statement.cs (Switch.SwitchGoverningType): Only look at
327         UserCasts that don't need implicit standard conversions to one of
328         the allowed switch types (Fixes test-322.cs).
329         (LocalInfo.Resolve): Re-enable sanity-test.
330
331 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
332
333         * cs-tokenizer.cs (consume_identifier): Detect double undescores
334         
335         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
336         
337         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
338
339 2005-07-06  Raja R Harinath  <rharinath@novell.com>
340
341         Fix #75472.
342         * ecore.cs (SimpleName.GetSignatureForError): Add.
343         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
344         (MemberAccess.GetSignatureForError): Add.
345
346 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
347  
348         The big error and warning messages review.
349         
350         * anonymous.cs,
351         * assign.cs,
352         * attribute.cs,
353         * class.cs,
354         * codegen.cs,
355         * convert.cs,
356         * cs-parser.jay,
357         * cs-tokenizer.cs,
358         * decl.cs,
359         * delegate.cs,
360         * doc.cs,
361         * driver.cs,
362         * ecore.cs,
363         * enum.cs,
364         * expression.cs,
365         * flowanalysis.cs,
366         * iterators.cs,
367         * literal.cs,
368         * location.cs,
369         * modifiers.cs,
370         * namespace.cs,
371         * parameter.cs,
372         * pending.cs,
373         * report.cs,
374         * rootcontext.cs,
375         * statement.cs,
376         * support.cs,
377         * tree.cs,
378         * typemanager.cs: Updated.
379         
380         * class.cs: (MethodCore.SetYields): Moved here to share.
381         (PropertyMethod.Define): Moved iterator setup here.
382         
383         * iterators.cs: Add orig_method to have full access to parent
384         container.
385
386 2005-07-05  Raja R Harinath  <rharinath@novell.com>
387
388         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
389         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
390         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
391         variable of struct type.
392         * expression.cs (Unary.ResolveOperator): Update to change.
393         (Indirection.VerifyFixed): Likewise.
394         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
395         (ParameterReference.VerifyFixed): Value parameters are fixed.
396         (This.VerifyFixed): Treat 'this' as a value parameter.
397         * statement.cs (LocalInfo.IsFixed): Remove.
398
399 2005-07-01  Martin Baulig  <martin@ximian.com>
400
401         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
402         `ec.EmitThis ()' to get the correct scope.
403
404 2005-07-01  Martin Baulig  <martin@ximian.com>
405
406         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
407         instance is a ParameterReference; fixes #75299.
408
409 2005-07-01  Martin Baulig  <martin@ximian.com>
410
411         Reverted Marek's latest patch (r46725):
412         - it contains structural changes which are neither mentioned in
413           the ChangeLog nor explained anywhere; for example the additional
414           argument of EmitContext's and Iterator's .ctor's and the
415           TypeContainer.DefineMembers() change.
416         - structural changes like this should go in in seperate patches
417           and not be hidden in a huge patch which just seems to affect
418           warnings and errors.
419           a big and hard to understand patch.
420         - it breaks iterators and causes regressions, for instance in
421           test-iter-03.cs.      
422
423 2005-06-30  Raja R Harinath  <rharinath@novell.com>
424
425         Fix #75412.
426         * expression.cs (Indexers.map): Remove.
427         (Indexers.Append): Filter out inaccessible setters and getters.
428         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
429
430         Fix #75283.
431         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
432         Refactored from ...
433         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
434         (FieldExpr.Emit, PropertyExpr.Emit): Update.
435         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
436         * expression.cs (Invocation.EmitCall): Add CS0120 check.
437
438 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
439
440         Fix #75322
441         * class.cs (FieldBase.GetInitializerExpression): One more field
442         for backup.
443
444 2005-06-28  Miguel de Icaza  <miguel@novell.com>
445
446         * pending.cs: Do not define a proxy if the base method is virtual,
447         it will be picked up by the runtime (bug 75270).
448
449 2005-06-08  Martin Baulig  <martin@ximian.com>
450
451         The big Iterators rewrite :-)
452
453         * iterators.cs: Rewrite this to use the anonymous methods framework.
454
455         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
456         before the TypeContainers; see 2test-21.cs.
457
458         * class.cs
459         (TypeContainer.DefineType): Don't create a new EmitContext if we
460         already have one (this only happens if we're an Iterator).
461         (TypeContainer.Define): Also call Define() on all our iterators.
462         (Method.CreateEmitContext): Added support for iterators.
463
464         * anonymous.cs
465         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
466         (AnonymousContainer.CreateMethodHost): Moved here from
467         AnonymousMethod and made abstract.
468         (AnonymousContainer.CreateScopeType): New abstract method.
469         (AnonymousContainer.IsIterator): New public property.
470         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
471         get the ScopeTypeBuilder rather than manually defining it here. 
472         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
473         iterators here.
474
475         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
476         before RootContext.DefineTypes().
477
478         * codegen.cs (EmitContext.RemapToProxy): Removed.
479         (EmitContext.CurrentAnonymousMethod): Changed type from
480         AnonymousMethod -> AnonymousContainer.
481         (EmitContext.ResolveTopBlock): Protect from being called twice.
482         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
483         (EmitContext.EmitThis): Removed the iterators hacks; use the
484         anonymous methods framework for that.
485
486         * statement.cs
487         (ToplevelBlock.Container): Make this a property, not a field.
488         (ToplevelBlock.ReParent): New public method; move the
489         ToplevelBlock into a new container.
490         (Foreach.TemporaryVariable): Simplify.
491
492 2005-06-05  Martin Baulig  <martin@ximian.com>
493
494         * statement.cs (LocalInfo.CompilerGenerated): New flag.
495         (Block.AddTemporaryVariable): New public method; creates a new
496         `LocalInfo' for a temporary variable.
497         (Block.EmitMeta): Create the LocalBuilders for all the temporary
498         variables here.
499         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
500         non-iterator variables.
501
502 2005-06-05  Martin Baulig  <martin@ximian.com>
503
504         * statement.cs (Foreach.TemporaryVariable): Create the
505         LocalBuilder in the Emit phase and not in Resolve since in some
506         situations, we don't have an ILGenerator during Resolve; see
507         2test-19.cs for an example.
508
509 2005-06-04  Martin Baulig  <martin@ximian.com>
510
511         **** Merged r45395 from GCS ****
512
513         The big Foreach rewrite - Part II.
514
515         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
516         with `PropertyInfo ienumerator_getcurrent'.
517
518         * codegen.cs (VariableStorage): Removed.
519
520         * statement.cs
521         (Foreach): Derive from Statement, not ExceptionStatement.
522         (Foreach.CollectionForeach): New nested class.  Moved all the code
523         dealing with collection foreach here.
524         (Foreach.ForeachHelperMethods): Removed.
525         (Foreach.TemporaryVariable): Implement IMemoryLocation.
526
527 2005-05-23  Martin Baulig  <martin@ximian.com>
528
529         * statement.cs (Try.DoResolve): Don't create a `finally' if we
530         don't need to.  Fix #75014.
531
532 2005-05-20  Martin Baulig  <martin@ximian.com>
533
534         Merged r44808 from GMCS.
535
536         * class.cs (TypeContainer.CircularDepException): Removed.
537         (TypeContainer.DefineType): Removed the `InTransit' stuff.
538         (TypeContainer.CheckRecursiveDefinition): Check for circular class
539         (CS0146) and interface (CS0529) dependencies here.
540
541 2005-06-21  Raja R Harinath  <rharinath@novell.com>
542
543         * expression.cs (Invocation.EmitCall): Fix initialization
544         'this_call' to reflect current behaviour.  Fix indentation.
545
546         * convert.cs (FindMostEncompassedType): Add two trivial special
547         cases (number_of_types == 0 || number_of_types == 1).
548         (FindMostEncompasingType): Likewise.
549
550 2005-06-17  Raja R Harinath  <rharinath@novell.com>
551
552         Some cleanups preparing for the fix of #75283.
553         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
554         error testing.
555         (EventExpr.InstanceResolve): Likewise.
556         (EventExpr.DoResolve): Remove redundant checks.
557
558 2005-06-10  Duncan Mak  <duncan@novell.com>
559
560         * cs-tokenizer.cs (process_directives): New flag for controlling
561         the processing of preprocessor directives.
562         (x_token): After seeing a '#', return Token.NONE instead of going
563         to handle_preprocessing_directive() when not processing
564         directives. This avoids unnecessary processing during the token peek in
565         is_punct().
566
567         This fixes #74939.
568
569         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
570         the existing error reporting methods instead of Report.Error.
571
572         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
573         after Raja's rewrite.
574
575 2005-06-08  Miguel de Icaza  <miguel@novell.com>
576
577         * class.cs: Small fix.
578
579 2005-06-08  Raja R Harinath  <rharinath@novell.com>
580
581         Fix #75160.
582         * class.cs (GetPartialBases): Fix return value check of
583         part.GetClassBases.
584
585 2005-06-07  Raja R Harinath  <rharinath@novell.com>
586
587         Ensure that partial classes are registered in their enclosing
588         namespace.  Initial part of fix of #75160.
589         * tree.cs (Tree.RecordDecl): Add new namespace argument.
590         Register declspace with namespace here, not in
591         DeclSpace.RecordDecl.
592         * cs-parser.jay: Pass namespace to RecordDecl.
593         * class.cs (PartialContainer.Create): Likewise.
594         (ClassPart.DefineType): New sanity-check.  Throws an exception if
595         called.
596         * decl.cs (Declspace.RecordDecl): Remove.
597         * namespace.cs (NamespaceEntry.DefineName): Remove.
598
599 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
600
601         * rootcontext.cs: Reset TargetExt as well.
602
603 2005-06-03  Raja R Harinath  <rharinath@novell.com>
604
605         * ecore.cs (Expression.Resolve): Emit CS0654 error when
606         -langversion:ISO-1.
607
608 2005-06-02  Raja R Harinath  <rharinath@novell.com>
609
610         Fix #75080, cs0119.cs.
611         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
612         of ...
613         (Expression.Resolve): ... this.  Use it.  Remove bogus code
614         allowing ExprClass.Type and ExprClass.Namespace for
615         ResolveFlags.VariableOrValue.
616         (Expression.Resolve) [1-argument variant]: Change default resolve
617         flags based on language version.
618         (Expression.Error_UnexpectedKind): Use a simple string array
619         rather than an ArrayList.
620         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
621         not ExprClass.Type.
622         (TypeOfVoid.DoResolve): Likewise.
623         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
624         flags argument -- it always has the same value.
625
626 2005-05-31  Raja R Harinath  <rharinath@novell.com>
627
628         Fix #75081.
629         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
630         Use it in the error message.
631         * assign.cs, expression.cs, statement.cs: Update.
632
633 2005-05-30  Raja R Harinath  <rharinath@novell.com>
634
635         Fix #75088.
636         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
637         the "almostMatchedMember" case too.
638         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
639         that failed the accessibility checks to 'almost_match'.
640
641 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
642
643         * attribute.cs: Use internal MethodBuilder methods to set
644         ExactSpelling and SetLastError on PInvoke methods, instead
645         of passing them via charset.  Fixes #75060.
646
647 2005-05-27  Raja R Harinath  <rharinath@novell.com>
648
649         * parameter.cs (Parameter): Remove TODO comment.
650         (Parameter.DefineParameter): Remove Location parameter.
651         (Parameters.LabelParameters): Likewise.
652         * class.cs (Constructor.Emit): Update to change.
653         (MethodData.Emit): Likewise.
654         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
655         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
656
657 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
658
659         * parameter.cs,
660           Removed Parameters.Location and added Parameter.Location instead.
661           Removed Location parameter from Emit() and GetSignature().
662         * anonymous.cs,
663           class.cs,
664           cs-parser.jay,
665           delegate.cs,
666           iterators.cs,
667           statement.cs :
668           Modified all related calls.
669
670 2005-05-26  Raja R Harinath  <rharinath@novell.com>
671
672         Improve user-defined conversion handling.
673         * convert.cs (GetConversionOperators): Rewrite.  Return only the
674         applicable operators.
675         (AddConversionOperators): New.  Helper for GetConversionOperators.
676         (FindMostEncompassedType, FindMostEncompassingType): Verify that
677         there is only one most encompassed/encompassing type.
678         (FindMostSpecificSource, FindMostSpecificTarget): Remove
679         "applicable operator" handling.
680         (UserConversion): Move cache here from GetConversionOperators.
681         Directly cache the chosen operator, rather than the whole
682         MethodGroup.
683         (ExplicitNumericConversion): Fix buggy implementation of Decimal
684         case.  Allow conversion of decimal to sbyte and byte too.
685         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
686         New static methods.  Used to avoid allocating EmptyExpressions in
687         convert.cs.
688
689 2005-05-24  Duncan Mak  <duncan@novell.com>
690
691         * ecore.cs (CastFromDecimal): New class for casting a decimal to
692         another class, used in Convert.ExplicitNumericConversion.
693         (CastToDecimal): New class, similar to above, but casts to
694         System.Decimal, used in Convert.ImplicitNumericConversion and also
695         in explicit convesion from double/float to decimal.
696
697         * convert.cs (ImplicitNumericConversion): Handle implicit
698         conversions to System.Decimal.
699         (ExplicitNumericConversion): handle explicit conversions to
700         System.Decimal.
701
702         This fixes #68711.
703         
704 2005-05-20  Miguel de Icaza  <miguel@novell.com>
705
706         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
707         know the type at this stage, just break through.   Fixes #75008 
708
709 2005-05-19  Martin Baulig  <martin@ximian.com>
710
711         * delegate.cs
712         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
713         to disable error reporting.
714
715         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
716         here since we don't want to report an error; see the new test-336.cs.
717
718 2005-05-19  Raja R Harinath  <rharinath@novell.com>
719
720         * statement.cs (ToplevelBlock.GetParameterReference)
721         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
722         Move here from class Block.
723         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
724         * expression.cs (ParameterReference.DoResolveBase): Likewise.
725
726 2005-05-18  Martin Baulig  <martin@ximian.com>
727
728         Fix #74978.
729
730         * flowanalysis.cs
731         (FlowBranching.Reachability): Add non-static public And() and Or()
732         methods.
733         (FlowBranchingSwitch): New class; do the `break_origins' thing
734         like in FlowBranchingLoop.
735         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
736         reachability, not just locals and parameters.
737         (FlowBranching.MergeChild): Remove some of the hacks for loop and
738         switch; MergeBreakOrigins() now takes care of that.
739
740 2005-05-18  Martin Baulig  <martin@ximian.com>
741
742         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
743         a loop and may leave it, reset the barrier; fixes #74974.
744
745 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
746         
747         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
748         is back.
749         
750         * cs-parser.jay: Catch more lexical errors.
751         
752         * report.cs: Add one more Error method.
753         
754         * rootcontext.cs,
755         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
756
757 2005-05-17  Martin Baulig  <martin@ximian.com>
758
759         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
760         #70970. 
761
762 2005-05-16  Raja R Harinath  <rharinath@novell.com>
763
764         Fix test-382.cs.  Emit values of decimal constants.
765         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
766         Carved out of ...
767         (TypeContainer.AddField): ... this.
768         (TypeContainer.EmitFieldInitializers): Allow the list of fields
769         with initializers to include 'Const's.
770         (ClassPart.RegisterFieldForInitialization): Forward to
771         PartialContainer.
772         * const.cs (Const.Const): Pass initializer to base class.
773         (Const.Define): In case of decimal constants, register them for
774         initialization in a static constructor.
775
776 2005-05-14  Martin Baulig  <martin@ximian.com>
777
778         * statement.cs (Block.Resolve): Correctly handle unreachable code;
779         do not call ResolveUnreachable() on unreachable statements in
780         here, see the comment in the source code.
781
782 2005-05-13  Raja R Harinath  <rharinath@novell.com>
783
784         Fix #74934.
785         * expression.cs (BinaryResolveOperator): If one of the operands of
786         an equality comparison is 'null' and the other is a pointer type,
787         convert the null to a NullPointer.
788         * convert.cs (ImplicitReferenceConversion): If the expression is a
789         NullLiteral and the target type is a pointer type, return a
790         NullPointer instead.
791         (ImplicitConversionStandard): Likewise.
792
793 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
794         
795         * cs-parser.jay: Set readonly context based on special constructs.
796         
797         * expression.cs (LocalVariableReference.DoResolveBase): Improved
798         readonly variable error handling.
799         
800         * rootcontext.cs (EmitCode): Don't verify members when error
801         occurred.
802         
803         * statement.cs (LocalInfo): Add reaodnly context information.
804         (SetReadOnlyContext, GetReadOnlyContext): New methods.
805
806 2005-05-13  Raja R Harinath  <rharinath@novell.com>
807
808         * statement.cs (Block.Resolve): Revert change below.  Modify fix
809         for #74041 to initialize 'resolved' to false only for explicit
810         blocks.  Fixes #74873.
811
812 2005-05-12  Raja R Harinath  <harinath@gmail.com>
813
814         Fix #74920.
815         * typemanager.cs (unmanaged_enclosing_types): New.
816         (IsUnmanagedType): Avoid infloops by using
817         'unmanaged_enclosing_types' to talk with recursive invocations.
818
819 2005-05-13  Martin Baulig  <martin@ximian.com>
820
821         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
822         instance variable, not a local.  Fix #74873.
823         (Block.ResolveUnreachable): Set it to true here.
824
825 2005-05-11  Duncan Mak  <duncan@novell.com>
826
827         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
828         continuing to process for 'arg'.
829         (handle_preprocessing_directive): Check the argument of the #endif
830         directive and report error CS1025 if there are any trailing
831         characters.
832
833         According to the C# spec, having even whitespace after the #endif
834         directive is illegal; however, because we call arg.TrimEnd ()
835         beforehand, we have the same behavior as csc, allowing whitespace
836         after the directive.
837
838         Fixes #74892.
839
840 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
841
842         Fix #74863.
843         
844         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
845         (Constructor.GetObsoleteAttribute): Implemented correctly.
846
847 2005-05-10  Martin Baulig  <martin@ximian.com>
848
849         * support.cs (ReflectionParameters.ParameterModifier): Use
850         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
851         and `ParameterAttributes.In'.  Fixes #74884.
852
853 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
854
855         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
856         
857         * expression.cs (Argument.GetParameterModifier): Turned to property.
858         (Invocation.Error_InvalidArguments): Add more descriptive errors.
859         
860         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
861         its C# equivalent.
862         
863 2005-05-09  Raja R Harinath  <rharinath@novell.com>
864
865         Fix #74852.
866         * decl.cs (MemberCache.AddMethods): Register override methods,
867         rather than non-override methods.
868         * typemanager.cs (RegisterOverride): New.
869         (IsOverride): Update.
870
871 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
872
873         Fix #73105.
874         
875         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
876         recursive declaration.
877         
878         * statement.cs (Block.ResolveMeta): Report any error in resolving.
879         
880 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
881
882         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
883         
884         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
885
886 2005-05-05  Raja R Harinath  <rharinath@novell.com>
887
888         Fix #74797.
889         * decl.cs (DeclSpace.FamilyAccessible): 
890         Use TypeManager.IsNestedFamilyAccessible.
891
892         Fix reopened #64812.
893         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
894         internal'.
895
896 2005-05-04  Raja R Harinath  <rharinath@novell.com>
897             Abin Thomas  <projectmonokochi@rediffmail.com>
898             Anoob V E  <projectmonokochi@rediffmail.com>
899             Harilal P R  <projectmonokochi@rediffmail.com>
900
901         Fix #64812.
902         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
903         allow access to all static members.
904
905 2005-05-04  Martin Baulig  <martin@ximian.com>
906
907         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
908
909 2005-05-04  Martin Baulig  <martin@ximian.com>
910
911         Fix #74655.
912
913         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
914         section at the end; make things work if `default' is not the last
915         section.        
916
917 2005-05-04  Martin Baulig  <martin@ximian.com>
918
919         Fix #70400.
920
921         * statement.cs (Switch): Replaced the `got_default' field with a
922         `default_section' one.
923         (Switch.CheckSwitch): Set `default_section' here.
924         (Switch.Resolve): If we're a constant switch and the constant is
925         not found, use the default section.
926
927 2005-05-03  Martin Baulig  <martin@ximian.com>
928
929         * expression.cs (ArrayAccess.EmitGetLength): New public method.
930
931         * statement.cs (Foreach.ArrayForeach): New nested class.
932         (Foreach.TemporaryVariable): New nested class.
933         (Foreach.EmitArrayForeach): Removed; this is now in the new
934         ArrayForeach class.
935
936 2005-05-03  Raja R Harinath  <rharinath@novell.com>
937
938         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
939         more conservative.
940         (VerifyPendingMethods): Revert change below.
941
942         * typemanager.cs (IsOverride, RegisterNonOverride): New.
943         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
944         that used to trigger warning -28.  Remove warning -28.
945         * expression.cs (Invocation.OverloadResolve): Use
946         TypeManager.IsOverride to distinguish override methods.
947
948         Fix #74773.
949         * pending.cs (VerifyPendingMethods): If a base type implements the
950         requested interface, don't bother checking individual methods of
951         the base type.  As a side-effect, this prevents the creation of
952         unnecessary proxies.
953
954 2005-05-02  Martin Baulig  <martin@ximian.com>
955
956         Fix #70182.
957
958         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
959         Also `And' the locals if the old vector is null.
960         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
961         null; in this case we basically reset all the variables.        
962
963 2005-05-02  Martin Baulig  <martin@ximian.com>
964
965         Fix #74529.
966
967         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
968         Added `FlowBranching branching' argument; always `and' the
969         variables instead of `or'ing them unless we're an infinite loop.
970
971         * statement.cs (While.Resolve): Create a new sibling unless we're
972         infinite.       
973
974 2005-05-02  Martin Baulig  <martin@ximian.com>
975
976         Fix #70140.
977
978         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
979         arguments; use it instead of creating a new TopLevelBlock.
980         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
981         our ConstructorInitializer.
982
983         * statement.cs
984         (TopLevelBlock.TopLevelBranching): New public property.
985         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
986         and create our `TopLevelBranching'.
987
988         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
989         anonymous method host, use `block.TopLevelBranching' rather than
990         creating a new branching.
991
992 2005-04-20  Miguel de Icaza  <miguel@novell.com>
993
994         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
995         a ScopeInfo, if any of the current children is a child of the new
996         entry, move those children there.
997
998 2005-04-30  Martin Baulig  <martin@ximian.com>
999
1000         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1001         at the beginning of a SwitchSection.  Fix #73335.
1002
1003 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1004
1005         Fix #74378
1006         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1007         
1008         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1009         (FieldExpr.DoResolve): Obsolete members are ignored for field
1010         initializers.
1011         
1012 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1013
1014         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1015         of arrays detection.
1016
1017         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1018         verification.
1019         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1020
1021         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1022         arrays report.
1023
1024 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1025
1026         * cs-parser.jay: Use the prefered version of -unsafe in error
1027         message.
1028
1029 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1030
1031         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1032         circumstances.
1033
1034 2005-04-20  John Luke  <john.luke@gmail.com>
1035
1036         * driver.cs: fix typo in error message, --outout to --output
1037
1038 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1039
1040         * codegen.cs (InRefOutArgumentResolving): New field.
1041         
1042         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1043         fields outside contructor.
1044         
1045         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1046         
1047 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1048
1049         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1050         parameter code was not completed ever, so it was not as up-to-date
1051         as local variables.  Must finish it.
1052
1053         The bug fix was to compare the Toplevel of the block, not the
1054         current block.  Thanks for Ben for pointing this out. 
1055
1056 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1057
1058         * decl.cs (AddMethods): Use the declaring type of the problem
1059         method to determine if we want to squash a warning.
1060
1061 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1062
1063         * attribute.cs: Removed debug output.
1064
1065         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1066         
1067         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1068         Report.Stderr.
1069         
1070 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1071
1072         Fix #74481.
1073         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1074         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1075         all null comparisons against reference types.
1076
1077 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1078
1079         Fix# 74565
1080         * class.cs (TypeContainer.CircularDepException) New nested
1081         exception class.
1082         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1083         (TypeContainer.DefineType): Removed error, reset InTransit before
1084         exit.
1085         (Class.DefineType): Throw exception when is in Transit.
1086         Catch exception and report error.
1087         (Struct.DefineType): Throw exception when is in Transit.
1088         Catch exception and report error.
1089         (Interface.DefineType): Throw exception when is in Transit.
1090         Catch exception and report error.
1091
1092         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1093         handle nested exception handlers.
1094
1095         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1096         a catch.
1097
1098         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1099         InFinally and InCatch storage.
1100
1101         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1102         (Catch.Resolve): Set and Restore ec.InCatch.
1103         (Try.Resolve): Set and Restore ec.InFinally.
1104         (Try.HasCatch): True when try has catch.
1105
1106 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1107
1108         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1109           for the same event member, so exclude such cases from warning 419.
1110           Fixed bug #74633.
1111
1112 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1113
1114         * expression.cs (Binary.ResolveOperator): Apply patch from John
1115         Luke to fix bug 59864: operators &, | and ^ on enumerations
1116         require that the same enum type on both sides.
1117
1118         * driver.cs: Add warnings to old flag usage, this is to assist
1119         people who produce Makefiles and hope that the Makefiles will be
1120         used on Windows.
1121
1122         * class.cs (TypeContainer.EmitType): Moved the definition of the
1123         special $PRIVATE$ field from the resolve phase to the Emit phase.
1124         During resolve we do not know if we are a struct with
1125         HasExplicitLayout, we know this only after the attributes for the
1126         type are emitted.
1127
1128         Set the FieldOffset to zero on the dummy field that we create for
1129         the class.   Fixes 74590.
1130
1131 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1132
1133         Fix #73834.
1134         * ecore.cs (PropertyExpr.resolved): New.
1135         (DoResolve): Use it to handle a case of double resolution here.
1136         Handle a case of identical-name-and-type-name.
1137         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1138         resolution by storing the results of expression resolution back
1139         into the "probes" array.
1140
1141 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1142
1143         Fix cs0208-7.cs and cs0208-8.cs.
1144         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1145         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1146         error reporting to point out the reason a struct is not unmanaged.
1147
1148 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1149
1150         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1151           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1152
1153 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1154
1155         Fix #74528.
1156         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1157         IdenticalNameAndTypeName here.
1158         (EventExpr.InstanceResolve): Likewise.
1159
1160 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1161
1162         C# 2.0 DefaultCharSetAttribute implementation
1163         
1164         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1165         which allows us to set GlobalNamespace for every resolve.
1166         (Attribute.ResolveArguments): Cut from Resolve.
1167         (Attribute.GetCharSetValue): Returns CharSet named argument.
1168         (Attribute.DefinePInvokeMethod): Gets default charset from
1169         module settings.
1170         (GlobalAttribute.ResolveAsTypeStep): Override.
1171         (GlobalAttribute.ResolveArguments): Override.
1172         
1173         * class.cs (TypeAttr): Is protected.
1174         
1175         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1176         (ModuleClass.DefaultCharSetType): New memeber.
1177         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1178         
1179         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1180         charset from module.
1181         
1182         * delegate.cs (TypeAttr): Override.
1183         (Delegate.DefineType): Use this TypeAttr.
1184         
1185         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1186         at very early stage (before types are defined) to resolve model
1187         module attributes. It will probably not work with corlib but it
1188         should be ok.
1189         
1190         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1191         charset from module.
1192         
1193         * typemanager.cs (default_charset_type): New type.
1194
1195 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1196
1197         * decl.cs (MemberCache.AddMethods): Don't warn if
1198         System.Object.Finalize has buggy MethodAttributes.
1199
1200         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1201         removed below.
1202
1203 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1204
1205         * doc.cs : detect ambiguous reference to overloaded members.
1206           Fixed bug #71603. MS 1.1 csc does not detect it.
1207
1208 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1209
1210         * doc.cs : delegates must not be referenced with parameters.
1211           Fixed bug #71605.
1212
1213 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1214
1215         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1216
1217 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1218
1219         * driver.cs (MainDriver): Stop processing if the CLS stage found
1220         errors. 
1221
1222         (CompilerCallableEntryPoint.InvokeCompiler): Always
1223         reset after execution;   Take a TextWriter argument for the
1224         output.
1225
1226         * report.cs: Use the error stream instead of hardcoding stderr. 
1227
1228 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1229
1230         * class.cs: Reduce code paths to test, too small of an
1231         optimization to make it worth the extra testing.  Always perform
1232         it. 
1233
1234 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1235
1236         Fix #74510.
1237         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1238         operators that had errors reported on them.
1239
1240 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1241
1242         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1243         argument types.
1244         (Attribute.Resolve): Add named argument type checking.
1245         
1246         * class.cs (FixedField.Define): Use IsPrimitiveType
1247         
1248         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1249         
1250         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1251         unsafe parameter types.
1252         
1253         * statement.cs (Using.ResolveExpression): Add better error description.
1254         
1255         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1256         
1257 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1258
1259         Fix #74484.
1260         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1261         AttributeUsageAttribute in the emitcontext of the attribute class,
1262         not in the emitcontext of the attributable entity it was attached to.
1263         * cs-parser.jay: Use 'current_class', not 'current_container',
1264         when creating a GlobalAttribute.
1265
1266 2005-04-08  Alp Toker  <alp@atoker.com>
1267
1268         * pending.cs: The fix to #58413 failed to compile methods implementing
1269         interfaces with/without params modifiers and vice versa, even though
1270         params modifiers aren't part of the signature. Make the modifier check
1271         less strict as in csc.
1272
1273 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1274             Anoob V E  <projectmonokochi@rediffmail.com>
1275             Harilal P R  <projectmonokochi@rediffmail.com>
1276
1277         Fix #58413.
1278         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1279         modifiers of pending methods.
1280         (PendingImplementation.PendingImplementation): Initialize it.
1281         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1282         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1283         with ParameterData.  Add check for modifiers.
1284         * class.cs (MethodData.Define): Update to changes.
1285
1286 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1287
1288         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1289
1290 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1291
1292         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1293         property.
1294         
1295         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1296         
1297         * rootcontext.cs,
1298         * typemanager.cs: Registered RequiredAttributeAttribute.
1299         
1300 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1301
1302         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1303         Warning CS0169 is back at level 3.
1304         (IMethodData.SetMemberIsUsed): New method.
1305         
1306         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1307         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1308         
1309         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1310
1311         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1312         contants.
1313         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1314         is used.
1315         
1316         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1317         is used.
1318         
1319         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1320         to avoid the problems with nested types.
1321
1322 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1323             Anoob V.E  <projectmonokochi@rediffmail.com>
1324             Harilal P.R  <projectmonokochi@rediffmail.com>
1325             Raja R Harinath  <rharinath@novell.com>
1326
1327         Fix #73820.
1328         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1329         attribute.
1330         * typemanager (GetConstructor): Make public.
1331
1332 2005-04-05  John Luke  <john.luke@gmail.com>
1333             Raja R Harinath  <rharinath@novell.com>
1334
1335         Fix #62232.
1336         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1337         struct too.  Return false quicker in a few cases.
1338         (VerifyUnManaged): Use it.
1339
1340 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1341
1342         Fix #74041.
1343         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1344         not 'unreachable_seen'.
1345
1346 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1347
1348         * attribute.cs (Attribute.GetValue): Removed unused.
1349         
1350         * codegen.cs (CodeGen.TrimExt): Removed unused.
1351         
1352         * cs-parser.jay (output): Removed unused.
1353         
1354         * cs-tokenizer.cs (hex_digits): Removed unused.
1355         
1356         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1357         
1358         * expression.cs (Indirection.LoadExprValue): Removed unused.
1359         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1360         
1361         * iterators.cs (Iterator.param_types): Removed unused.
1362         
1363         * statement.cs (Goto.block): Removed unused.
1364         (ToplevelBlock.did): Removed unused.
1365         (Switch.ResolveConstantSwitch): Removed unused.
1366
1367 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1368
1369         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1370         resetting thingy.
1371
1372 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1373
1374         Fix #74232 and cs0208-3.cs.
1375         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1376         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1377         unmanaged type.  Don't use FieldBuilders when 't' is a
1378         TypeBuilder.  Use ModFlags and MemberType fields.
1379         * class.cs (MemberBase.member_type): Rename from MemberType.
1380         (MemberBase.MemberType): New property.  Determines member_type on
1381         demand.
1382         (MemberBase.DoDefine): Don't initialize MemberType here.
1383         (FieldMember.Define): Likewise.
1384
1385 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1386
1387         Fix #74241
1388         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1389         Attributes are emitted there.
1390         
1391 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1392
1393         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1394         keyword in 'partial enum' too.
1395         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1396         is not allowed).
1397         Report from Kamil Skalski <nazgul@omega.pl>.
1398
1399         Fix #74309.
1400         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1401         have partial containers too.
1402
1403         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1404         in block' checks to Block.CheckInvariantMeaningInBlock.
1405         * statement.cs (Block.GetKnownVariableInfo): Make private.
1406         (Block.IsVariableUsedInChildBlock): Remove.
1407         (Block.IsVariableUsedInBlock): Likewise.
1408         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1409         conflicting declaration.
1410         (Block.AddVariable): Make error messages less long-winded and more
1411         specific.  Show location of conflicting declaration.
1412         * parameter.cs (Parameters.Location): New readonly property.
1413
1414 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1415
1416         Clean up semantics of invoking ResolveMemberAccess.
1417         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1418         can have an instance, ensure that we pass in a non-TypeExpression
1419         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1420         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1421         argument.  Update to changes and simplify.
1422         (FieldExpr.Emitinstance): Remove CS0120 check.
1423         (PropertyExpr.EmitInstance): Likewise.
1424         * expression.cs (Argument.Resolve): Likewise.
1425         (Invocation.DoResolve): Update to changes in semantics of
1426         InstanceExpression.
1427
1428 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1429
1430         Fix #74241
1431         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1432         customization.
1433         
1434         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1435
1436 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1437
1438         Fix difference in behaviour with commandline invocation.
1439         * driver.cs (Driver.Reset): New.
1440         (CompilerCallableEntryPoint): Call it.
1441
1442         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1443         variable" warnings if the boolean expression failed to resolve.
1444
1445 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1446
1447         * attribute.cs: Fix the union of several permissions when some of them
1448         are unrestricted (so the result isn't an unrestricted permission set).
1449         Fix #74036.
1450
1451 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1452
1453         * ecore.cs (MemberExpr): New class.  Convert from interface
1454         IMemberExpr.
1455         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1456         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1457         error checks.
1458         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1459         (MethodGroupExpr.IsExplicitImpl): Remove.
1460         (Expression.GetFieldFromEvent): Remove.
1461         (SimpleName.MemberStaticCheck): Remove.
1462         (SimpleName.DoSimpleNameResolve): Update to changes.
1463         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1464         (MemberAccess.IdenticalNameAndTypeName): Remove.
1465         (MemberAccess.error176): Move to MemberExpr.
1466         (MemberAccess.DoResolve): Update to changes.
1467         (BaseAccess.DoResolve): Likewise.
1468
1469 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1470
1471         C# 2.0 Conditional attribute class implementation
1472         
1473         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1474         Analyzes class whether it has attribute which has ConditionalAttribute
1475         and its condition is not defined.
1476         
1477         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1478         (Class.IsExcluded): New method. Search for at least one defined
1479         condition in ConditionalAttribute of attribute class.
1480
1481 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1482
1483         * ecore.cs (PropertyExpr): Derive from Expression, not
1484         ExpressionStatement.
1485         (PropertyExpr.EmitStatement): Remove.
1486
1487 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1488
1489         Fix #74060.
1490         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1491         internal field "value__" of an enum be private.  The examples for
1492         "value__" that I found on MSDN all used FieldAttributes.Private.
1493
1494         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1495         Don't mention IL method attribute names.
1496
1497         Fix #47991.  Remove a TODO.
1498         * statement.cs (Block.Toplevel): Make into a field.
1499         (Block.Parameters): Move into ToplevelBlock.
1500         (Block.known_variables): Rename from child_variable_names.
1501         (Block.Block): Remove variants that take Parameters.  Initialize
1502         'Toplevel' with the immediately surrounding toplevel block.
1503         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1504         LocalInfo parameter.
1505         (Block.GetKnownVariableInfo): New.
1506         (Block.IsVariableNameUsedInChildBlock): Update.
1507         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1508         the block, even though it may not be in scope.
1509         (Block.AddVariable): Remove Parameters parameter.  Use
1510         Toplevel.Parameters instead.
1511         (Block.AddConstant): Remove Parameters parameter.
1512         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1513         (Block.IsParamaterReference): Likewise.
1514         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1515         (ToplevelBlock.Parameters): New.  Moved from Block.
1516         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1517         initialize Parameters to a non-null value.
1518         * cs-parser.jay: Update to changes.
1519         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1520         simple names that mean different things in the same block.  Use
1521         Block.IsVariableNameUsedInBlock.
1522
1523 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1524
1525         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1526         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1527         GetTypeHandle.  It is possible for a reflected type to derive from
1528         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1529         System.Array during mscorlib compilation).
1530         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1531         contain a method_hash, don't create one either.  Don't create a
1532         deep copy of the base cache's method_hash.
1533         (MemberCache.SetupCache): Rename back from DeepCopy.
1534         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1535         already initialized.  If we see an override function, add its
1536         underlying base virtual function to the member_hash too.
1537
1538         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1539
1540 2005-03-26  Raja R Harinath  <harinath@acm.org>
1541
1542         Fix #73038.
1543         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1544         fails to resolve, ensure that the LHS is still resolved as an
1545         lvalue.
1546
1547 2005-03-25  Raja R Harinath  <harinath@acm.org>
1548
1549         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1550         ec.ContainerType.
1551         (Enum.current_ec): Remove.
1552         (Enum.LookupEnumValue): Remove EmitContext argument.
1553         Just uses the one created during DefineType.
1554         (Enum.FindMembers): Update.
1555         * expression.cs (MemberAccess.DoResolve): Update.
1556
1557 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1558
1559         * assign.cs (Assign.DoResolve): Check for CS1717 when
1560         source and target are same (uses Equals).
1561
1562         * expression.cs (LocalVariableReference, ParameterReference,
1563         This): Implemented Equals, GetHashCode.
1564
1565         * statement.cs (Block.GetParameterReference): Removed useless
1566         local variable.
1567
1568 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1569
1570         Fix cs0128.cs
1571         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1572         blocks before deciding whether the error is cs0136 or cs0128.
1573
1574         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1575         (using_alias_directive, using_namespace_directive): Pass
1576         MemberName, not an expression to Namespace.UsingAlias and
1577         Namespace.Using.
1578         (MakeName): Use the MemberName of the namespace.
1579         * namespace.cs (Namespace.MemberName): New.
1580         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1581         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1582         Likewise.
1583         * decl.cs (MemberName.Name): Make readonly.
1584         (MemberName.FromDotted): New "constructor".
1585         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1586         (MemberCore.Name): Compute from MemberName on demand.
1587         (MemberCore.SetMemberName): Provide a way to change the
1588         MemberName.
1589         (MemberCore.AddToContainer): Don't take a fullname parameter.
1590         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1591         fully qualified name of the container to the member name.
1592         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1593         only if the type is a member of the root container.
1594         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1595         MemberName.Left rather than searching for an embedded ".".
1596         (PartialContainer.CreatePart): Update to changes in RootContext.
1597         (MemberBase.ShortName): Turn into a property.  Use
1598         MemberCore.SetMemberName.
1599         (MemberBase.ExplicitInterfaceName): Remove.
1600         (MemberBase.UpdateMemberName): Remove.
1601         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1602         (PropertyBase.SetMemberName): New override.
1603         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1604         (Tree.GetDecl): New.
1605         (Tree.AllDecls): Rename from Decls.
1606         * attribute.cs, enum.cs, report.cs: Update to changes.
1607         * driver.cs (MainDriver): Use MemberName.FromDotted on
1608         RootContext.MainClass.
1609
1610 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1611
1612         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1613         checks.
1614
1615         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1616
1617 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1618
1619         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1620         property accessor modifiers.
1621
1622         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1623         fixed buffer attribute (CS1716).
1624         (PropertyMethod.HasCustomAccessModifier): When property accessor
1625         has custom modifier.
1626
1627         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1628         modifiers.
1629         (PropertyExpr.DoResolveLValue): Add CS0272.
1630
1631 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1632
1633         * convert.cs: When converting to a pointer, use the proper Conv.U
1634         or Conv.I depending on the source data type.
1635
1636         * cs-tokenizer.cs: Make the size for large decimal constants,
1637         fixes #72957.
1638
1639 2005-03-17  Martin Baulig  <martin@ximian.com>
1640
1641         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1642         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1643
1644 2005-03-17  Martin Baulig  <martin@ximian.com>
1645
1646         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1647         to bool so we can return an error condition.
1648         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1649         returned an error.
1650
1651 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1652
1653         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1654         attributes.
1655
1656 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1657
1658         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1659         Refactor to avoid traversing the list of assemblies, and to avoid
1660         string concatenation.
1661         * typemanager.cs (guid_attr_type): Remove.
1662         (negative_hits, pointers, references): Remove hashes.
1663         (type_hash): New.
1664         (GetConstructedType): New.  Uses type_hash to handle constructed
1665         types (arrays, references, pointers).
1666         (GetReferenceType, GetPointerType): Use it.
1667         (GetNestedType): New.  Uses type_hash to handle nested types of
1668         reflected types.
1669         (LookupType, LookupTypeDirect): Remove.
1670         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1671         'types' hash and LookupTypeReflection directly.
1672         (params_string, params_object): Use GetConstructedType.
1673         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1674         top-level types.
1675         (Namespace.Lookup): Use cached_types.
1676         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1677         provided by old TypeManager.LookupType.
1678         * rootcontext.cs (MakeFQN): Remove.
1679         * decl.cs (DeclSpace.MakeFQN): Likewise.
1680         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1681         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1682         TypeManager.GetConstructedType.
1683         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1684
1685 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1686
1687         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
1688         indexers.
1689
1690         * cs-parser.jay: Reports CS1527 for any namespace element.
1691
1692         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1693         Added CS0407.
1694
1695         * expression.cs (ParameterReference.IsAssigned): Changed error to
1696         CS0269.
1697         (Error_WrongNumArguments): Moved CS0245 detection here.
1698
1699         * statement.cs (Return.Resolve): Add CS1622 report.
1700
1701 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1702
1703         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1704
1705 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1706
1707         * attribute.cs expression.cs: Get rid of some allocations.
1708
1709 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1710
1711         * doc.cs : just eliminate the latest change.
1712
1713 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1714
1715         * doc.cs : commented out the latest change. It breaks xml-030.cs
1716
1717 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1718
1719         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1720           fail. So invoke CreateType() in FindDocumentedType().
1721
1722 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1723
1724         * cs-tokenizer.cs : added IsKeyword().
1725         * doc.cs : Detect keyword incorrectly used as identifier.
1726           Allow identifiers prefixed by @.
1727
1728 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1729
1730         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1731         It caused exception in namespace resolving (again!).
1732         
1733         * class.cs (Class.ctor): Removed exit.
1734         (PropertyMethod.ctor): ditto.
1735         
1736         * codegen.cs (Codegen.Reset): Reset static data.
1737         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1738         
1739         * cs-tokenizer.cs (Cleanup): Removed.
1740         
1741         * driver.cs (GetSystemDir): Rewrote to one line command.
1742         It caused problem with unloaded dynamic modules.
1743         (UnixParseOption): Removed Exit.
1744         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1745         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1746         Now can be mcs used as library.
1747         
1748         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1749         empty location.
1750         
1751         * location.cs (Reset): Reset static data.
1752         
1753         * namespace.cs (Reset): Reset static data.
1754         
1755         * report.cs (Report.Reset): Reset static data.
1756         
1757         * rootcontext.cs (RootContext.Reset): Reset static data.
1758         
1759         * tree.cs (RootTypes.ctor): Use Location.Null
1760         
1761         * typemanager.cs (TypeManager.Reset): Reset static data.
1762         (CoreLookupType): Removed Exit.
1763         (TypeHandle.Reset): Reset static data.
1764         
1765 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1766
1767         Fix #73516.
1768         * typemanager.cs (ComputeNamespaces): Import namespaces from
1769         referenced modules too.
1770
1771 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1772
1773         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1774         than '.'.
1775
1776 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1777
1778         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1779         enclosing DeclSpace.  This ensures that a name-lookup populates
1780         more caches and there are fewer 'TypeExpression's.  Carve out
1781         nested type lookup into ...
1782         (LookupNestedTypeInHierarchy): ... this.
1783
1784 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1785
1786         Clean up a few partial-class semantics.  
1787         Fixes test-357.cs and cs1618-2.cs.
1788         * cs-parser.jay (struct_declaration): Use 'current_class' as
1789         parent of newly-created struct.  Remove call to Register ().
1790         Use 'pop_current_class' to complete handing the current struct.
1791         (interface_declaration): Likewise.
1792         (class_declaration): Likewise.
1793         (enum_declaration): Use 'current_class' as parent of newly created
1794         enum.
1795         (delegate_declaration): Likewise.
1796         (pop_current_class): New function.  This is used to handle closing
1797         up the 'current_class' and 'current_container', and pointing them
1798         to the enclosing class/container.
1799         (CSharpParser): Initialize 'current_class' too.
1800         * decl.cs (MemberCore): Add check for invariant: a partial
1801         container is not a parsed entity, and thus does not enclose any
1802         parsed members.
1803         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1804         (DeclSpace.BaseTypeExpr): Use it.
1805         (DeclSpace.LookupType): Add check for invariant.
1806         * class.cs (TypeContainer): Add check for invariant: a nested
1807         class should have the same NamespaceEntry as its enclosing class.
1808         (TypeContainer.EmitFieldInitializers): Make virtual.
1809         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1810         MemberCore.
1811         (TypeContainer.Register): Remove.
1812         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1813         null.  Use TypeResolveEmitContext for resolving base types and
1814         interfaces.  Move initialization of Parts.TypeBuilder here from
1815         ...
1816         (TypeContainer.DefineNestedTypes): ... here.
1817         (PartialContainer): Take a Namespace not a NamespaceEntry.
1818         (PartialContainer.Create): Don't use Register.  Call the
1819         appropriate Add... function directly.
1820         (ClassPart): Take both the PartialContainer and the enclosing
1821         class as constructor arguments.
1822         (ClassPart.EmitFieldInitializers): Override.
1823         (ClassPart.PartFindNestedTypes): Remove.
1824         (FieldBase.GetInitializerExpression): Resolve the initializer
1825         expression in the emit context of the enclosing class.
1826         * tree.cs (RootTypes): Remove Register ().
1827         
1828 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1829
1830         * cs-parser.jay: Removed CS0134.
1831         
1832         * driver.cs: Removed CS1901.
1833         
1834         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1835         for predefined types.
1836
1837 2005-03-07  Duncan Mak  <duncan@novell.com>
1838
1839         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1840         well. Fixes bug #73454.
1841
1842 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1843
1844         * cs-tokenizer.cs (xtoken): Add CS1035.
1845         
1846         * class.cs (MethodData.Define): Add CS0683.
1847         (FieldMember.ctor): Add CS0681.
1848
1849 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1850
1851         * ecore.cs (SimpleName.DoResolve): Rename from
1852         SimpleName.DoResolveAllowStatic.
1853         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1854         Pass 'intermediate' flag to MemberStaticCheck.
1855         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1856         of "intermediate" lookups via MemberAccess.
1857         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1858         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1859
1860 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1861
1862         Fix #73394.
1863         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1864         slipped in because of variable names that are identical to a
1865         builtin type's BCL equivalent ('string String;', 'int Int32;').
1866         (PropertyExpr.EmitInstance): Likewise.
1867
1868 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1869
1870         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1871         
1872         * report.cs (warning_ignore_table): Made public.
1873
1874 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1875
1876         Fix #73282.
1877         * class.cs (MethodData.Emit): Pass 'container' to
1878         container.GetObsoleteAttribute instead of 'container.Parent'.
1879
1880 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1881
1882         * cs-parser.jay: Add 1534 error test.
1883
1884         * iterators.cs (Yield.CheckContext): Add error 1629.
1885         (Iterator.ctor): Save unsafe modifier.
1886         (MoveNextMethod.DoEmit): Restore unsafe context.
1887
1888         * namespace.cs (UsingAlias): Better error message.
1889
1890 2005-03-03  Dan Winship  <danw@novell.com>
1891
1892         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1893         the warning message [#73219]
1894
1895 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1896
1897         Fix compile with MCS 1.0.0.0.
1898         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1899         w_restore to not depend on string constant folding.
1900
1901 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1902
1903         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
1904         CS0246 check to users who passed 'silent = false'.
1905         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1906         check.
1907         (SimpleName.SimpleNameResolve): Update.
1908         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
1909         (MemberAccess.IdenticalNameAndTypeName): Update.
1910         * doc.cs (FindDocumentedTypeNonArray): Update.
1911
1912 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
1913
1914         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
1915         * parameters.cs (ComputeAndDefineParameters): Remove.
1916         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
1917         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
1918         Use GetParameterInfo.
1919
1920 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
1921
1922         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
1923
1924 2005-03-02  Raja R Harinath  <rharinath@novell.com>
1925
1926         Unify DeclSpace.LookupType and DeclSpace.FindType.
1927         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
1928         is in charge of defining nested types on demand.
1929         (DeclSpace.LookupType): Use it when the current_type is a
1930         TypeBuilder.  Use LookupTypeDirect for reflected types.
1931         (DeclSpace.FindType): Remove.
1932         (DeclSpace.LookupInterfaceOrClass): Likewise.
1933         (DeclSpace.DefineTypeAndParents): Likewise.
1934         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
1935         DeclSpace.LookupType.
1936         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
1937         * typemanager.cs (LookupType): Simplify.
1938         (AddUserType): Remove type from negative_hits.
1939         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
1940         * class.cs (TypeContainer.FindMembers): Move handling of nested
1941         types ...
1942         (TypeContainer.FindMembers_NestedTypes): ... here.
1943         (TypeContainer.FindNestedType): Implement override.
1944         (ClassPart.FindNestedType): Delegate to PartialContainer.
1945         (ClassPart.PartFindNestedType): Looks up the nested types of the
1946         part alone.
1947
1948 2005-03-02  Martin Baulig  <martin@ximian.com>
1949
1950         * class.cs (TypeContainer.DoDefineMembers): We also need a default
1951         static constructor in static classes.
1952
1953 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
1954
1955         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
1956         sizeParamIndex is not specified.
1957
1958 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
1959
1960         Fix #73117
1961         * report.cs (WarningMessage.IsEnabled): Missing null check.
1962
1963 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1964
1965         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
1966         in the fields and not in the properties.
1967
1968 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
1969
1970         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
1971         fields as well.
1972
1973 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1974
1975         * attribute.cs: Small refactoring (improved robustness).
1976         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
1977         (ValidateGuid): Removed.
1978         (Resolve): Removed referenced to above mentioned.
1979         (GetAttributeUsage): Made private and changed to work without
1980         class assistance.
1981         (GetIndexerAttributeValue): Don't crash.
1982         (GetConditionalAttributeValue): Ditto.
1983         (GetClsCompliantAttributeValue): Ditto.
1984         (ExtractSecurityPermissionSet): All attributes exceptions are
1985         error 648.
1986         (GetPropertyValue): New helper.
1987         (GetMethodImplOptions): New method.
1988         (DefinePInvokeMethod): Reuse common code. Implemented handling of
1989         some missing properties.
1990         
1991         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
1992         (Method.ApplyAttributeBuilder): Updated.
1993         
1994         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
1995         exception.
1996
1997 2005-02-28  Raja R Harinath  <rharinath@novell.com>
1998
1999         Fix #73052.
2000         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2001         non-simple types (array, pointer, reference).
2002
2003 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2004
2005         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2006
2007         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2008         for operators.
2009         (Method.CheckBase): Catch wrong destructor here.
2010         (MethodData.Define): Add errors 550, 668.
2011
2012         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2013
2014         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2015
2016         * pending.cs (VerifyPendingMethods): Add error 551.
2017
2018         * typemanager.cs (CSharpName): Next error report helper.
2019
2020 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2021
2022         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2023         attributes. Removed useless attribute double check.
2024         It saves almost 2MBs for corlib.
2025
2026 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2027
2028         Fix #72924.
2029         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2030         called twice in case of error.
2031
2032 2005-02-23  Chris Toshok  <toshok@ximian.com>
2033
2034         Fix compiler portions of #72827.
2035         * statement.cs (Block.Emit): call Begin/EndScope on the
2036         EmitContext instead of the ILGenerator.
2037
2038         * codegen.cs (EmitContext.BeginScope): new method, call
2039         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2040         we have one.)
2041         (EmitContext.BeginScope): same, but EndScope and CloseScope
2042
2043         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2044         offset and call the superclass's OpenScope(int) with it.
2045         (SymbolWriter.CloseScope): get the current il
2046         offset and call superclass's CloseScope(int) with it.
2047
2048 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2049
2050         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2051         CS1677 for out and ref as well.
2052
2053         * class.cs (Method.Define): Add error CS1599 detection.
2054         
2055         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2056         
2057         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2058         
2059         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2060         
2061         * support.cs.cs (ModifierDesc): New helper method.
2062
2063 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2064             Abin Thomas  <projectmonokochi@rediffmail.com>
2065             Anoob V E  <projectmonokochi@rediffmail.com>
2066             Harilal P R  <projectmonokochi@rediffmail.com>
2067
2068         Fix #57851, #72718.
2069         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2070         MemberLookup (used for error reporting) actually returns a result.
2071         Fix error report number (122, not 112).
2072
2073 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2074             Anoob V E  <projectmonokochi@rediffmail.com>
2075             Harilal P R  <projectmonokochi@rediffmail.com>
2076
2077         Fix #71134.
2078         * pending.cs (PendingImplementation.GetAbstractMethods):
2079         Find NonPublic members too.
2080
2081 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2082
2083         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2084         Fixed error 217.
2085         
2086         * class.cs (MethodCore.CheckMethodAgainstBase):
2087         Add error 239 report.
2088
2089 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2090
2091         Fix #68955.
2092         * expression.cs (Invocation.IsApplicable): Make public.
2093         (Invocation.IsParamsMethodApplicable): Likewise.
2094         * delegate.cs (Delegate.VerifyApplicability): Don't use
2095         Invocation.VerifyArgumentCompat for parameter applicability
2096         testing.  Use Invocation.IsApplicable and
2097         Invocation.IsParamsMethodApplicable.
2098
2099 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2100
2101         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2102         
2103         * class.cs (Operator.Define): Add error 217 report.
2104         
2105 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2106
2107         * namespace.cs (UsingEntry.Resolve): Undo change below.
2108
2109 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2110
2111         Fix #72756.
2112         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2113         disable the error message when the extended MemberLookup also
2114         fails.
2115         (Expression.MemberLookupFinal): Update.
2116         (SimpleName.DoSimpleNameResolve): Update.
2117         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2118         Don't use MemberLookupFinal.
2119         (New.DoResolve): Update.
2120         (BaseAccess.CommonResolve): Update.
2121
2122 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2123
2124         Fix #72732.
2125         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2126         occured previously, don't resolve again.
2127
2128 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2129
2130         Fix #69949
2131         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2132         argument. Call ResolveAttributeUsage for unresolved.
2133         when types doesn't match ctor arguments.
2134         
2135         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2136         for nested attribute classes.
2137         (Class.attribute_usage): Removed.
2138         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2139         for attribute class.
2140         
2141         * ecore.cs (IsAttribute): Removed.
2142         
2143         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2144         
2145         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2146         now normal types.
2147         (attribute_types): Removed.
2148         (EmitCode): Global attributes are emited as the latest.
2149
2150 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2151
2152         * class.cs (EmitFieldInitializers): Don't emit field initializer
2153         for default values when optimilization is on.
2154         
2155         * constant.cs (Constant.IsDefaultValue): New property.
2156         
2157         * driver.cs: Add /optimize handling.
2158         
2159         * constant.cs,
2160         * ecore.cs,
2161         * literal.cs: Implement new IsDefaultValue property.
2162         
2163         * rootcontext.cs (Optimize): New field, holds /optimize option.
2164
2165 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2166
2167         Fix crasher in re-opened #72347.
2168         * namespace.cs (Namespace.Lookup): Return null if
2169         DeclSpace.DefineType returns null.
2170
2171         Fix #72678.
2172         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2173
2174 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2175
2176         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2177         now returns null if it cannot resolve to an lvalue.
2178         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2179         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2180         returned null.  Remove check for SimpleName.
2181         (EventExpr.DoResolveLValue): New.
2182         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2183         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2184         error from ...
2185         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2186         avoid CS0131 error.
2187         (Unary.ResolveOperator): Move CS0211 check ...
2188         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2189         CS0131 error.
2190         (Unary.DoResolveLValue): Simplify.
2191         (AddressOf.DoResolveLValue): New.
2192         (ArrayAccess.DoResolveLValue): New.
2193
2194 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2195
2196         * attribute.cs (Attribute.Resolve): Add arguments casting for
2197         when types doesn't match ctor arguments.
2198
2199 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2200
2201         Fix parts of #63202.
2202         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2203         lookup of operator in base type.  Ensure that all checks happen
2204         when the operator resolves to an "op_..." method.
2205
2206 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2207
2208         Fix #71992.
2209         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2210         'ignore_cs0104' parameter.  Pass it to ...
2211         (NamespaceEntry.Lookup): ... this.
2212         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2213         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2214         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2215         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2216         Update.  Request that cs0104 errors be ignored.
2217         (ComposedCast.ResolveAsTypeStep): Update.
2218
2219 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2220
2221         Fix #59209.
2222         * expression.cs (Invocation.BetterFunction): Remove support for
2223         comparing virtual functions and their overrides.
2224         (Invocation.IsOverride): New.
2225         (Invocation.OverloadResolve): Don't consider 'override' functions
2226         during candidate selection.  Store them in a lookaside list.
2227         If the selected method is a 'virtual' function, use the list to
2228         find any overrides that are closer to the LHS type.
2229
2230 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2231
2232         * expression.cs (New.DoResolve): Add complex core type reduction.
2233         (New.Constantify): Converts complex core type syntax like 'new int ()'
2234         to simple constant.
2235         
2236 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2237
2238         * decl.cs (EntryType.EntryType): New constructor to create an
2239         updated copy of a cache entry.
2240         (MemberCache.AddMethods): Use it.
2241         (MemberCache.ClearDeclaredOnly): Remove.
2242         (MemberCache.MemberCache): Update.
2243
2244 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2245
2246         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2247         variable.  This one is represents the actual low-level declaration
2248         of the method, as opposed to the semantic level `IsStatic'.   
2249
2250         An anonymous method which is hosted into a static method might be
2251         actually an instance method.  IsStatic would reflect the
2252         container, while MethodIsStatic represents the actual code
2253         generated.
2254
2255         * expression.cs (ParameterReference): Use the new MethodIsStatic
2256         instead of IsStatic.
2257
2258         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2259         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2260         set on the current EmitContext. 
2261
2262         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2263         resolve our casted expression as an LValue.  This triggers the
2264         proper LValue processing that is later required by Assign.
2265
2266         This fixes 72347.
2267
2268         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2269
2270 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2271
2272         C# 2.0 Fixed buffer implementation
2273
2274         * anonymous.cs: Update after RegisterHelperClass renaming.
2275
2276         * attribute.cs (AttributeTester.fixed_buffer_cache):
2277         Cache of external fixed buffers.
2278         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2279         implementation if field is fixed buffer else null.
2280
2281         * class.cs
2282         (TypeContainer.AddField): Accept FieldMember instead of Field.
2283         (FieldBase.IsFieldClsCompliant): Extracted code from
2284         VerifyClsCompliance descendant customization.
2285         (FixedField): New class handles fixed buffer fields.
2286         (FixedFieldExternal): Keeps information about imported fixed
2287         buffer.
2288         (IFixedField): Make access to internal or external fixed buffer
2289         same.
2290
2291         * cs-parser.jay: Add fixed buffer parsing.
2292
2293         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2294         buffer.
2295
2296         * expression.cs (Indirection): Extended implementation to accept
2297         fixed buffer field.
2298         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2299         (ElementAccess.MakePointerAccess): Get type as parameter.
2300         (DoResolve): Add fixed buffer field expression conversion.
2301         (DoResolveLValue): Ditto.
2302         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2303         (ArrayPtr): Derives from FixedBufferPtr.
2304         (ArrayPtr.Emit): Add extra emit for array elements.
2305
2306         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2307
2308         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2309         for compiler generated types.
2310         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2311
2312         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2313         and consume less memory.
2314         (Fixed.Resolve): Add fixed buffer case.
2315
2316         * typemanager.cs (compiler_generated_attr_ctor,
2317         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2318         (HasElementType): Add our own implementation to work on every
2319         runtime.
2320
2321 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2322
2323         * anonymous.cs (CaptureContext): Track whether `this' has been
2324         referenced.   
2325
2326         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2327         only captured `this' if it was implicitly done (instance
2328         methods/variables were used). 
2329
2330         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2331         `this' must be captured.
2332
2333 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2334  
2335         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2336         is null it means that there has been no need to capture anything,
2337         so we just create a sibling.
2338
2339         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2340
2341         Just a partial fix.  The other half is fairly elusive.
2342         
2343 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2344
2345         Fix #52586, cs0121-4.cs.
2346         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2347         and return a hashtable.
2348         (MemberCache.ClearDeclaredOnly): New.
2349         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2350         the method_hash of a base type too.
2351         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2352         type methods.  Overwrite entries with the same MethodHandle so
2353         that the ReflectedType is correct.  The process leaves in base
2354         virtual functions and their overrides as distinct entries.
2355         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2356         matters since it was boxed in a ArrayList before.
2357         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2358         modifier.
2359         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2360         case of a virtual function and its override (choose the overload
2361         as better).
2362         (Invocation.OverloadResolve): Avoid 'override' members during
2363         'applicable_type' calculation.
2364
2365 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2366
2367         Combine two near-redundant caches.
2368         * typemanager.cs (method_params): Rename from method_internal_params.
2369         (TypeManager.GetParameterData): New.  Replace
2370         Invocation.GetParameterData.
2371         (TypeManager.LookupParametersByBuilder): Remove.
2372         * expression.cs (Invocation.method_parameter_cache): Remove.
2373         (Invocation.GetParameterData): Remove.
2374         Update to changes.
2375         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2376         Update to changes.
2377
2378 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2379
2380         Fix #72015.
2381         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2382         TypeManager.multicast_delegate_type is null, resolve it by looking
2383         up "System.MulticastDelegate".
2384         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2385
2386 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2387             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2388             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2389
2390         Fix cs0164.cs.
2391         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2392         (LabeledStatement.AddReference): New.  Set 'referenced'.
2393         (Goto.Resolve): Use it.
2394
2395 2005-02-05  John Luke  <john.luke@gmail.com>
2396
2397         * driver.cs: remove duplicate -doc line in Usage ()
2398
2399 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2400
2401         * location.cs (Location.AddFile): Fix CS2002 error report.
2402
2403 2005-02-02  Martin Baulig  <martin@ximian.com>
2404
2405         * delegate.cs (Delegate.DefineType): Report an internal error if
2406         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2407         details.        
2408
2409 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2410
2411         Fix a crasher in a variant of #31984.
2412         * const.cs (Constant.CheckBase): New override that defers the
2413         new-or-override check in case the base type hasn't been populated
2414         yet.
2415         (Constant.Define): Ensure the new-or-override check is performed.
2416
2417 2005-02-01  Duncan Mak  <duncan@ximian.com>
2418
2419         * const.cs (LookupConstantValue): Check that `ce' is not null
2420         before calling GetValue ().
2421
2422 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2423
2424         Fix test-334.cs (#69519).
2425         * cs-parser.jay (using_alias_directive): Pass in an expression to
2426         NamespaceEntry.UsingAlias.
2427         (using_namespace_directive): Pass in an expression to
2428         NamespaceEntry.Using.
2429         (namespace_name): Don't flatten to a string.
2430         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2431         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2432         ResolveAsTypeStep.
2433         (NamespaceEntry.UsingEntry): Likewise.
2434         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2435         changes.
2436         (NamespaceEntry.LookupForUsing): Remove.
2437         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2438         names.
2439         (NamespaceEntry.Lookup): Remove support for dotted names.
2440
2441 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2442
2443         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2444         split into two.
2445         (NamespaceEntry.ImplicitParent): Compute on demand.
2446         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2447         parallels the current.
2448         (NamespaceEntry.LookupForUsing): Use it.
2449         (NamespaceEntry.Lookup): If the current namespace-entry is
2450         implicit, don't search aliases and using tables.
2451
2452 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2453
2454         Fix #31984.
2455         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2456         BaseCache here.
2457         (TypeContainer.BaseCache): Compute on demand.
2458         (TypeContainer.FindMembers): Define constants and types if they're
2459         not already created.
2460         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2461         check.
2462         * const.cs (Constant.Define): Make idempotent.
2463
2464 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2465
2466         * pending.cs: Produce better code (no nops produced by using Ldarg
2467         + value).
2468         
2469         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2470         i - 1' it should be arg + 1.
2471
2472         Fixes bug #71819.
2473
2474 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2475
2476         * attribute.cs (Attribute.CheckAttributeType): Make private
2477         non-virtual.
2478         (Attribute.ResolveType): Make virtual.
2479         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2480         handling of RootContext.Tree.Types.
2481
2482 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2483
2484         Update attribute-handling to use the SimpleName/MemberAccess
2485         mechanisms.
2486         * cs-parser.jay (attribute): Pass in an expression to the
2487         constructors of Attribute and GlobalAttribute.
2488         * attribute.cs (Attribute): Take an expression for the name.
2489         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2490         passed in attribute name expression.
2491         (Attribute.CheckAttributeType): Use it.
2492         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2493         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2494         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2495         argument to prevent error messages if the lookup fails.
2496
2497 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2498
2499         * expression.cs (Indirection): Implemented IVariable interface
2500         to support indirection in AddressOf operator.
2501         (PointerArithmetic.Emit): Add optimalization for case where
2502         result can be precomputed.
2503
2504 2005-01-26  Martin Baulig  <martin@ximian.com>
2505
2506         * class.cs (TypeContainer.AttributeTargets): Return the correct
2507         AttributeTargets depending on our `Kind' instead of throwing an
2508         exception; fixes #71632.
2509
2510 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2511
2512         Fix #71257
2513         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2514         constant members.
2515
2516 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2517
2518         Fix #71602.
2519         * expression.cs (MemberAccess.DoResolve): Don't complain with
2520         cs0572 when the LHS of a member access has identical name and type
2521         name.
2522
2523 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2524
2525         Fix #71651, #71675
2526         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2527         CreatePermission.
2528         Create custom PermissionSet only for PermissionSetAttribute.
2529
2530 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2531
2532         Fix #71649
2533         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2534         delegates in static class.
2535
2536 2005-01-24  Martin Baulig  <martin@ximian.com>
2537
2538         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2539         merging an implicit block, just use its reachability.
2540
2541         * statement.cs (Block.Resolve): Make the unreachable code check
2542         work wrt. implicit blocks; see test-337 from #63842.
2543
2544 2005-01-21  Alp Toker  <alp@atoker.com>
2545  
2546         * cs-parser.jay: destructor_declaration's container is PartialContainer
2547         not Class when partial types are used, so use Kind prop instead of
2548         'is'.
2549         
2550 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2551
2552         * cs-parser.jay: Improve error reporting when an interface
2553         declares new types.
2554
2555 2005-01-20  Dick Porter  <dick@ximian.com>
2556
2557         * support.cs: SeekableStreamReader fix from Sandor Dobos
2558         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2559         chars are read.  Fixes bug 70369.
2560
2561 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2562
2563         * cs-parser.jay (catch_clause): Simplify current_block handling
2564         somewhat.
2565
2566 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2567
2568         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2569         code with ImplicitStandardConversion to handle the implicit
2570         conversion of method groups into valid delegate invocations. 
2571
2572         The problem is that in parameter handling we were using this code
2573         path.  Fixes bug #64698
2574
2575 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2576
2577         * cs-parser.jay: Fix several infelicities.
2578         - Avoid assigning to the parser value stack.  Code like 
2579           '$3 = null' is unclean.  Synthesize a value for the code block
2580           instead. 
2581         - Avoid using oob_stack for storing location information.  Use ...
2582         (_mark_): ... this.  New (empty) rule.  Saves the current location
2583         in $$.
2584         (foreach_statement): Avoid using oob_stack for current_block
2585         handling.  Use technique used in for_statement and
2586         using_statement.  Synthesize a value for the code block to store
2587         additional intermediate information.
2588
2589 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2590
2591         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2592         of a different type is only allowed to private fields of a
2593         containing type, not on fields of a base class.
2594
2595         See test-174.cs and error cs0122-9.cs
2596
2597 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2598
2599         Fix test-335.cs (bug #58126).
2600         * cs-parser.jay (argument): Split out non-expression parts of the
2601         rule into 'non_simple_argument'.
2602         (invocation_expression): Support parenthesized invocations with
2603         multiple arguments, and with single non-simple arguments.
2604
2605 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2606
2607         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2608         places.
2609
2610 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2611
2612         Fix cs0038-1.cs, cs1640-6.cs.
2613         * ecore.cs (Expression.Resolve): Remove special-case for
2614         SimpleName in error-handling.
2615         (Expression.almostMatchedMembers): Relax access permission to
2616         protected.
2617         (Expression.MemberLookupFailed): Handle duplicates in
2618         almostMatchedMembers list.
2619         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2620         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2621         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2622         overload if the passed in MemberInfo is a MethodBase.
2623
2624 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2625
2626         Fix #70749
2627         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2628         for non-CAS & merge permission sets properly.
2629
2630 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2631
2632         Improve standard-compliance of simple name and member access 
2633         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2634         * ecore.cs (FullNamedExpression): New abstract base class 
2635         for Namespaces and TypeExpressions.
2636         (ResolveFlags.SimpleName): Remove.
2637         (SimpleName): Remove support for dotted names.
2638         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2639         DeclSpace.FindType and DeclSpace.LookupType.
2640         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2641         (Expression.ExprClassName): Make member function.
2642         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2643         a namespace.  Remove creation of dotted "SimpleName"s.
2644         (MemberAccess.DoResolve): Likewise.
2645         * decl.cs (DeclSpace.Cache): Make private.
2646         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2647         (DeclSpace.FindType): Update.
2648         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2649         FullNamedExpression.
2650         * namespace.cs (Namespace): Derive from FullNamedExpression
2651         so that it can be part of expression resolution.
2652         (Namespace.Lookup): Return an FullNamedExpression.
2653         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2654         namespace.
2655         * rootcontext.cs (NamespaceLookup): Remove.
2656         (LookupType): Move to DeclSpace.
2657         * attribute.cs (CheckAttributeType): Update.
2658         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2659         (FindDocumentedTypeNonArray): Likewise.
2660
2661 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2662
2663         Fix cs0509.cs, cs1632.cs.
2664         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2665         is the same as IsInterface.
2666         (TypeContainer.GetClassBases): Likewise.
2667         * statement.cs (LabeledStatement.ig): New field.
2668         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2669         label.
2670         (LabeledStatement.DoEmit): Check that the label was created with
2671         the same ILGenerator.
2672
2673 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2674
2675         Fix #71058
2676         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2677         accessors to its properties.
2678
2679         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2680         from accessors to property.
2681         
2682 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2683
2684         Fix #70722
2685         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2686         only for overrides.
2687         
2688 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2689
2690         * attribute.cs: Check for null and empty strings.  
2691
2692         I have lost another battle to Paolo.
2693
2694 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
2695
2696         Fix #70942
2697         * class.cs (PropertyMethod): Set Parent field in ctors.
2698         (SetMethod.InternalParameters): Add unsafe switch hack.
2699         Override MarkForDuplicationCheck where it is appropriate.
2700
2701         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
2702         It says whether container allows members with the same name.
2703         Base default is no.
2704         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
2705         Removed is_method parameter.
2706
2707 2005-01-06  Duncan Mak  <duncan@ximian.com>
2708
2709         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
2710         because the previous change led to incorrect reporting of CS1032
2711         ("Cannot define/undefine preprocessor symbols after first token in
2712         file"). Instead of using `tokens_seen' as the only flag that
2713         triggers CS1040, introduce `comments_seen'. This new flag is used
2714         to signify having seen comments on the current line, so it is
2715         unset after a newline.
2716
2717 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2718
2719         * doc.cs : When searching for a type, find nested type too.
2720           This fixes bug #71040.
2721
2722 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2723
2724         * doc.cs :
2725           - Warn missing member comment on those classes which also does not
2726             have doc comments. Fixed bug #71041.
2727           - Don't warn missing doc comment on default constructor.
2728             Fixed bug #71042.
2729
2730 2005-01-06  Duncan Mak  <duncan@ximian.com>
2731
2732         * cs-tokenizer.cs (xtoken): After handling traditional C-style
2733         comments, set `tokens_seen' to true. This allows us to detect
2734         misplaced preprocessor directives (i.e. not at the beginning of
2735         the a line, nor after whitespaces). In that case, report error
2736         CS1040. This fixes bug #56460.
2737
2738         * cs-parser.jay (interface_member_declaration): Add checks for
2739         IsExplicitImpl, and report CS0541 error if an interface member is
2740         defined as an explicit interface declaration.
2741
2742 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
2743
2744         Fix #70817
2745         * class.cs (PropertyMethod): Set Parent field in ctors.
2746         (SetMethod.InternalParameters): Add unsafe switch hack.
2747         
2748         * decl.cs (MemberCore.Parent): Cannot be readonly.
2749
2750 2005-01-06  Raja R Harinath  <rharinath@novell.com>
2751
2752         * decl.cs (DeclSpace.ResolveType): Remove.
2753         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
2754         Merge in code from ...
2755         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
2756         * class.cs, enum.cs: Update to changes.
2757
2758 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
2759
2760         * anonymous.cs: Ensure that we init the scope of our parent if it
2761         has not been initialized yet.
2762
2763 2004-12-30  Duncan Mak  <duncan@ximian.com>
2764
2765         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
2766         if field.FieldBuilder is null. Fixes #70758.
2767
2768         * convert.cs: Fixed some typos and updated some of the comments.
2769         (ImplicitStandardConversionExists):
2770         (TryImplicitIntConversion): If `target_type' is an interface and
2771         the type of `ic' implements this interface, return true or a new
2772         BoxedCast instead of null. This fixes #70468.
2773
2774 2004-12-29  Duncan Mak  <duncan@ximian.com>
2775
2776         * expression.cs (Argument.Emit): Check that Expr is
2777         IMemoryLocation before casting to it, and report CS1510 otherwise.
2778
2779         This fixes #70402.
2780
2781 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
2782
2783         * statement.cs (Block.ThisVariable): remove the recursion here, to
2784         make the --profile more sane.
2785
2786 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
2787
2788         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
2789         assembly, by JB Evain.
2790
2791 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2792
2793         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
2794           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
2795         "parent" refers to enclosing type/class.  "base" refers to superclass.
2796
2797 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2798
2799         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2800         Ensure that we only have GlobalAttributes.
2801         * attribute.cs (Attribute.Emit): Make non-virtual.
2802         (GlobalAttribute.Emit): Remove.
2803         (Attribute.Resolve): Make virtual.
2804         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
2805         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
2806         the argument. Don't create one.
2807         (Attribute.GetObsoleteAttribute): Likewise.
2808         (Attribute.GetClsCompliantAttributeValue): Likewise.
2809         * class.cs, decl.cs: Update to changes.
2810
2811 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
2812
2813         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
2814         
2815         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
2816         
2817         * statement.cs (Foreach.Resolve): Add error 186 report.
2818
2819 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
2820
2821         * expression.cs (Conditional.DoResolve): Add warning 429.
2822         
2823         * statement.cs (If.Resolve): Add warning 665.
2824
2825 2004-12-16  Raja R Harinath  <rharinath@novell.com>
2826
2827         New invariant: RootContext.Tree.Types.NamespaceEntry == null
2828         except when in the parser, and in GlobalAttribute.
2829         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
2830         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
2831         RootContext.Tree.Types.NamespaceEntry once work is done.
2832         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
2833         and resets RootContext.Tree.Types.NamespaceEntry.
2834
2835 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
2836
2837         * cs-parser.jay: Don't create a block for every variable.
2838
2839 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
2840
2841         * location.cs: Provide extra information.
2842
2843         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
2844         variables from the captured environment, it is the ldarg_0.
2845
2846 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2847
2848         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
2849         find a conclusion.
2850         
2851         * class.cs: Changed warning level for 169 to avoid developer
2852         displeasure from warning flooding. It will be changed back when they
2853         fix most of current BCL warnings.
2854         
2855         * RootContext.cs: Pushed default WarningLevel to 3.
2856         
2857         * statement.cs: Removed unused variable.
2858
2859 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2860
2861         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
2862         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
2863         Add error 502 report.
2864         (StaticClass.DefineType): Add error 441 report.
2865         (Class.AllowedModifiersProp): New virtual property as temporary
2866         extension to AllowedModifiers.
2867         (Class.DefineType): Add error 418 report. Moved ModFlags check here
2868         to share implementation with StaticClass and don't call virtual
2869         methods from ctor.
2870         
2871         * driver.cs (MainDriver): Add error 1558 test.
2872
2873         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
2874         report. Moved error 36 test here.
2875
2876         * statement.cs (Throw.Resolve): Add error 724 report.
2877
2878         * typemanager.cs: Add out_attribute_type core type.
2879         
2880 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
2881
2882         * class.cs (TypeContainer.VerifyClsCompliance): Add error
2883         3018 report.
2884         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
2885
2886         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
2887         3017 report.
2888         
2889         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
2890
2891         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
2892         Add error 3023 report.
2893         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
2894
2895         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
2896         implementation.
2897
2898 2004-12-12  John Luke  <john.luke@gmail.com>
2899
2900         * driver.cs (AddArgs): take -- into account when
2901         adding arguments, fixes bug 65710 
2902
2903 2004-12-12  Martin Baulig  <martin@ximian.com>
2904
2905         * expression.cs (Unary.TryReduceNegative): Added support for
2906         SByteConstant and ByteConstant.
2907         (Unary.Reduce): Check error values from TryReduceNegative().
2908
2909 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
2910
2911         * attributes.cs (Attribute.Resolve): Avoid multiple error report
2912         and report exception as error 182.
2913
2914 2004-12-10  Raja R Harinath  <rharinath@novell.com>
2915
2916         * driver.cs (Main): Fix message when there are warnings.
2917
2918 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
2919
2920         * delegate.cs: Fixed my fix from yesterday, sorry about that.
2921
2922 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
2923
2924         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
2925         Reduced number of warnings.
2926         
2927         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
2928
2929 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
2930
2931         * driver.cs: Removed message.
2932
2933         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
2934
2935 2004-12-08    <vargaz@freemail.hu>
2936
2937         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
2938
2939 2004-12-08  Martin Baulig  <martin@ximian.com>
2940
2941         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
2942         instead of a CS3002 for properties and indexer.
2943
2944 2004-12-08  Martin Baulig  <martin@ximian.com>
2945
2946         * decl.cs (MemberName.ToString): Make this work again.
2947
2948 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
2949
2950         * attribute.cs (Resolve): Add error 591 detection.
2951
2952         * class.cs (FieldMember.Define): Add error 1547 detection.
2953         (Indexer.Define): Add error 620 detection.
2954         (Operator.Define): Add error 590 detection.
2955
2956         * ecore.cs: Missing argument for error 79.
2957
2958         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
2959         detection.
2960
2961 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
2962
2963         Fix #70106
2964         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
2965         only.
2966
2967 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
2968
2969         * cs-parser.jay : handle doc comments on implicit/explicit operators.
2970           Some operator comments were suppressed.
2971         * doc.cs : Implicit/explicit operator name in doc comments are like
2972           "op_Explicit(type)~returnType", so added suffix handling.
2973
2974 2004-12-07  Martin Baulig  <martin@ximian.com>
2975
2976         * decl.cs
2977         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2978         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2979         (DeclSpace.ec): New protected field; store the EmitContext here.
2980         (DeclSpace.EmitContext): New public property; moved here from
2981         `TypeContainer'.
2982         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2983         EmitContext.
2984
2985         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2986         (Enum.Emit): Don't create a new EmitContext.
2987
2988         * delegate.cs (Delegate.DefineType): Always create the
2989         EmitContext.
2990
2991         * iterators.cs (Iterators.DefineIterator): Create a new
2992         EmitContext and store it in `ec'.
2993
2994 2004-08-24  Martin Baulig  <martin@ximian.com>
2995
2996         * typemanager.cs
2997         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
2998         this for accessibility checks.
2999         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3000         IsNestedFamilyAccessible.
3001         (TypeManager.IsSubclassOf): New method, do what the name actually
3002         says.   
3003
3004 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3005
3006         Fix crash on cs0657-17.cs.
3007         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3008         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3009         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3010         the case where the NamespaceEntry gets overwritten.
3011
3012 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3013
3014         Fixed #69195, #56821
3015         * ecore.cs (ResolveBoolean): Tiny refactoring.
3016
3017         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3018         of right expression resolving when left is false constant and
3019         operator is LogicalAnd OR true constant and operator is LogicalOr.
3020
3021         * statement.cs (ResolveUnreachable): Always reports warning.
3022
3023 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3024
3025         * class.cs: Distinguish between 1721 and 1722 (just a little help
3026         for the programmer).
3027
3028 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3029
3030         * delegate.cs: Only allow this on new versions of the language. 
3031
3032 2004-12-02  Duncan Mak  <duncan@ximian.com>
3033
3034         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3035         Expression class.
3036         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3037         here as a static method. Take an additional bool out parameter
3038         `must_do_cs1540_check' for signaling to InstanceResolve.
3039         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3040         member field from PropertyExpr class and made it an argument of
3041         the method instead.
3042         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3043         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3044         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3045         and `remove_accessor' as well as InstanceResolve: report CS0122
3046         where applicable.
3047
3048         Fixes #70129.
3049
3050 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3051
3052         Fix test-327.cs, test-328.cs, and put in early infrastructure
3053         for eventually fixing #52697.
3054         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3055         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3056         from other methods.
3057         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3058         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3059         (VerifyUsing, error246): Update.
3060         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3061         'NamespaceEntry.LookupNamespaceOrType'.
3062
3063 2004-12-03  Martin Baulig  <martin@ximian.com>
3064
3065         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3066         method as our child, call AnonymousMethod.Compatible() on it.
3067
3068 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3069
3070         Disable XML documentation support in 'basic' profile.
3071         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3072         Redirect XmlElement to System.Object.
3073         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3074         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3075         * mcs.exe.sources: Add doc-bootstrap.cs.
3076         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3077         of doc.cs.
3078
3079 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3080
3081         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3082           comments are allowed.
3083
3084 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3085
3086         * delegate.cs: Add checks for subtypes in paramaters and return values
3087         in VerifyMethod () to add support for Covariance/Contravariance
3088         in delegates.
3089         
3090 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3091
3092         * report.cs: Remove extra closing parenthesis.
3093
3094         * convert.cs (Error_CannotImplicitConversion): If the name of the
3095         types are the same, provide some extra information.
3096
3097         * class.cs (FieldBase): Use an unused bit field from the field to
3098         encode the `has_offset' property from the FieldMember.  This saves
3099         a couple of Ks on bootstrap compilation.
3100
3101         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3102         method as our child, return the AnonymousMethod resolved
3103         expression.
3104
3105         * expression.cs (New.DoResolve): Allow return values from
3106         NewDelegate to also include AnonymousMethods.
3107
3108         Fixes #70150.
3109
3110 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3111
3112         Fix bug #70102
3113         * attribute.cs (Resolve): Improved implementation of params
3114         attribute arguments.
3115
3116         * support.cs (ParameterData): Add HasParams to be faster.
3117
3118 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3119
3120         all things are for /doc support:
3121
3122         * doc.cs: new file that supports XML documentation generation.
3123         * mcs.exe.sources: added doc.cs.
3124         * driver.cs:
3125           Handle /doc command line option.
3126           Report error 2006 instead of 5 for missing file name for /doc.
3127           Generate XML documentation when required, after type resolution.
3128         * cs-tokenizer.cs:
3129           Added support for picking up documentation (/// and /** ... */),
3130           including a new XmlCommentState enumeration.
3131         * cs-parser.jay:
3132           Added lines to fill Documentation element for field, constant,
3133           property, indexer, method, constructor, destructor, operator, event
3134           and class, struct, interface, delegate, enum.
3135           Added lines to warn incorrect comment.
3136         * rootcontext.cs :
3137           Added Documentation field (passed only when /doc was specified).
3138         * decl.cs:
3139           Added DocComment, DocCommentHeader, GenerateDocComment() and
3140           OnGenerateDocComment() and some supporting private members for
3141           /doc feature to MemberCore.
3142         * class.cs:
3143           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3144         * delegate.cs:
3145           Added overriden DocCommentHeader.
3146         * enum.cs:
3147           Added overriden DocCommentHeader and GenerateDocComment().
3148
3149 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3150
3151         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3152         unwrapping the enumeration values, chain to
3153         DoConstantNumericPromotions again, so we can promote things to the
3154         fundamental types (takes care of enums that are bytes, sbytes).
3155
3156         Fixes bug #62054.
3157
3158 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3159
3160         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3161         Fix long-standing bug in type-lookup.  Use FindType instead of
3162         LookupType when ec.ResolvingTypeTree.
3163         (Attribute.ResolveType, Attribute.Resolve)
3164         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3165         Update to changes.
3166         (Attributes.Search): Remove internal version.  Update.
3167         (Attributes.SearchMulti): Update.
3168         (Attributes.GetClsCompliantAttribute): Remove.
3169         (Attributes.GetIndexerNameAttribute): Remove.
3170         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3171         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3172         * class.cs (Indexer.Define): Likewise.
3173
3174 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3175
3176         Fix bug #68790
3177         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3178         MarshallByReference members access.
3179
3180         * expression.cs: Use CheckMarshallByRefAccess;
3181         Better error CS0197 message.
3182
3183         * report.cs: Print whole related error message.
3184
3185 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3186
3187         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3188         the current directory to help debugging.
3189
3190 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3191
3192         * class (GetClassBases): Better error 60 report.
3193         (EventProperty): Disabled warning 67 detection.
3194
3195 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3196
3197         Fix bug #60324
3198         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3199
3200         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3201         precise values.
3202
3203 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3204
3205         Fix bug #49488
3206         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3207
3208         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3209
3210 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3211
3212         * attribute.cs (Attribute.Resolve): Refine error reporting and
3213         report a cs0117 if the identifier does not exist, to distinguish
3214         from 0617 which is a miss-use of the actual identifier.
3215
3216         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3217         between cs0070 and cs0079.
3218
3219         * class.cs (MemberBase.DoDefine): When reporting a wrong
3220         accessibility level, we use MethodCore to compare instead of
3221         Method (this was a regression in some refactoring effort).
3222
3223         So now we correctly report cs0056 again.
3224
3225         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3226         testing the target_type (which was known to be object_type) and
3227         not the source type (which is anonymous_method).
3228
3229         Fixed reporting of error cs1660.
3230
3231         * expression.cs (UserCast.Source): Expose the underlying cast.
3232
3233         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3234         allowed types to find a match to int32 first (most common).
3235
3236         In addition, it ignores any ImplicitUserConversions that did an
3237         internal implicit conversion (as the switch statement allows only
3238         one integral conversion to exist).
3239
3240         * class.cs (PartialContainer.Create): rename `name' to
3241         `member_name' for clarity.  Then replace the string calls with a
3242         call to MemberName.GetPartialName, as now using
3243         MemberName.ToString is an error (this is due to the side effects
3244         it had, that were fixed in the past).
3245
3246         This will restore the error reporting on a number of partial class
3247         errors that were missusing this (and getting an exception as a
3248         results, which is now just a plain textual warning, because
3249         yyparse debug output would crash otherwise).
3250
3251 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3252
3253         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3254
3255 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3256
3257         * rootcontext.cs (LookupType): Make sure to cache lookups that
3258         don't give us a negative result. This saves about 5% of corlib
3259         compilation time.
3260
3261 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3262
3263         * report.cs (AbstractMessage.Print): messages are sent to stderr
3264
3265         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3266         non-interface in the list of interfaces (at this point, either
3267         parent was properly set, or a base class is being listed in the
3268         interfaces section).
3269
3270         This flags error 1722, and resolves the crash from bug 69259.
3271
3272 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3273
3274         * statement.cs (Using.EmitExpressionFinally): make this work right
3275         for valuetypes. Fixes 69926.
3276
3277 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3278
3279         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3280         converted to an enum" here, before we try to change the underlying
3281         type.  This code exists, but it is a different code path than the
3282         one used while encoding constants.
3283
3284         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3285         old bug: when converting from the null literal to a pointer,
3286         return an EmptyCast, not the NullLiteral.
3287
3288         This fixes #69921, the recent null_type changes probably made this
3289         bug more prominent.
3290
3291         (ImplicitReferenceConversionExists): In addition, resynchronized
3292         the code here, so it matches the same code in
3293         ImplicitReferenceConversionExists for the `from any class-type S
3294         to any interface-type T'.
3295         
3296
3297 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3298
3299         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3300
3301 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3302
3303         * cs-parser.jay: Use verbosity accordingly. 
3304
3305 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3306
3307         * expression.cs (Unary.ResolveOperator): Do not report warning;
3308         AddressOf reads from variable.
3309         
3310         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3311
3312 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3313
3314         Fix bug #69462
3315
3316         * attribute.cs (Attributable): Removed CheckTargets.
3317         (Attributes.Emit): Explicit attribute targets are tested here.
3318
3319         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3320         not enabled for interfaces.
3321
3322         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3323         (GetAssemblyName): Ouch next bug there.
3324
3325 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3326
3327         * expression.cs: Error 275 added.
3328         
3329 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3330
3331         Fix bug #69177 (Implemented decimal constant support)
3332
3333         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3334         (BinaryFold): Add DecimalConstant.
3335
3336         * const.cs (Define): Decimal constant 
3337         (is not constant.
3338         (ChangeType): Add decimal type handling.
3339         (LookupConstantValue): Don't set value for decimal type but
3340         emit DecimalConstantAttribute. Needed for constant optimization.
3341
3342         * constant.cs (ToDecimal): New method.
3343         (ConvertToDecimal): New method.
3344         (IntConstant): Implemented ConvertToDecimal.
3345         (DecimalConstant.Emit): Emit optimized version for decimals in
3346         int range.
3347
3348         * expression.cs (ResolveOperator): Changed order of constant
3349         reduction to work correctly with native types which have
3350         overloaded operators.
3351         (ResolveMemberAccess): Extract constant value from attribute
3352         for decimal type.
3353
3354         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3355
3356         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3357         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3358         (ChangeType): Decimal is special.
3359         (TypeToCoreType): Add decimal type.
3360
3361 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3362
3363         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3364         decimal types.
3365
3366 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3367
3368         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3369         test cs1667-5.cs.
3370
3371 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3372
3373         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3374
3375         * pending.cs (PendingImplementation): Grab only interfaces.
3376
3377 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3378
3379         * statement.cs (ForeachHelperMethods): Add location member and
3380         error 202 detection.
3381
3382 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3383
3384         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3385         automatically handled by executable.make.
3386         (PROGRAM): Make profile-specific.
3387
3388 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3389
3390         * expression.cs (DoResolveBase): Fixed wrong warning for out
3391         variables.
3392
3393 2004-11-18  Martin Baulig  <martin@ximian.com>
3394
3395         Merged latest changes into gmcs.  Please keep this comment in
3396         here, it makes it easier for me to see what changed in MCS since
3397         the last time I merged.
3398
3399 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3400
3401         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3402         (TypeHandle.GetMemberCache): New.
3403         (TypeHandle.TypeHandle): Update.
3404         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3405         (TypeManager.LookupParentInterfacesCache):
3406         Rename from LookupInterfaceCache.  Optimize slightly.
3407         (TypeManager.MemberLookup_FindMembers): Update.
3408         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3409         multi-type variant.
3410         (AddCacheContents): Rename from AddHashtable.
3411         * class.cs (TypeContainer.parent_container): Remove.
3412         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3413         (TypeContainer.DoDefineMembers): Don't initialize it.
3414         Update to name changes.
3415         
3416 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3417
3418         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3419         that factors the code to check access modifiers on override.  
3420
3421         (PropertyBase): Use the code here.
3422
3423         Patch from Lluis S'anchez, fixes bug #69361.
3424
3425 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3426
3427         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3428         routine that is used to report the use of a captured variable
3429         whose address has been taken.
3430
3431         There are two checks: one when variables are being captured and
3432         the other check is when the address of a variable is taken. 
3433         
3434         (because an anonymous methods might be resolved before *or* after
3435         the address has been taken) and 
3436
3437         * expression.cs (Conditional.DoResolve): Remove the special
3438         casing that Martin added to trueExpr and falseExpr being both
3439         NullLiteral.  We get the right behavior now just by introducing
3440         the null_type into the compiler. 
3441
3442         * convert.cs (ExplicitConversion): Change the code to use
3443         null_type instead of testing `expr is NullLiteral'.
3444         (ImplicitConversionStandard): use null_type too.
3445         (ImplicitReferenceConversionExists): use null_type too.
3446         (ImplicitReferenceConversion): use null_type too.
3447
3448         * literal.cs: The type of `NullLiteral' is now null_type instead
3449         of object_type. 
3450         (Resolve): Set the type here.
3451
3452         * typemanager.cs: Introduce null_type.
3453
3454 2004-11-17  Martin Baulig  <martin@ximian.com>
3455
3456         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3457         direction, like FindMembers() does.  Fixes #69546, testcase is in
3458         test-315.cs.    
3459
3460 2004-11-16  Martin Baulig  <martin@ximian.com>
3461
3462         This is based on a patch from Marek Safar, see bug #69082.
3463         Fixes bugs #63705 and #67130.
3464
3465         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3466         method; create a MemberCache for an interface type and cache the
3467         result.
3468
3469         * decl.cs (IMemberContainer.ParentContainer): Removed.
3470         (IMemberContainer.ParentCache): New property.
3471         (MemberCache.SetupCacheForInterface): Removed.
3472         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3473         to create a cache for an interface's "parent".
3474
3475         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3476         interfaces too.
3477
3478 2004-11-16  Martin Baulig  <martin@ximian.com>
3479
3480         Merged back from gmcs; these changes already went into gmcs a
3481         couple of weeks ago.
3482
3483         * typemanager.cs
3484         (TypeManager.AddUserType): Removed the `ifaces' argument.
3485         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
3486         `TypeExpr []'.
3487         (TypeManager.AddUserInterface): Removed.
3488         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
3489         `TypeExpr []'.
3490         (TypeManager.GetInterfaces): Likewise.
3491         (TypeManager.GetExplicitInterfaces): Likewise.
3492
3493         * ecore.cs (TypeExpr.GetInterfaces): Removed.
3494
3495         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
3496         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
3497
3498 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3499
3500         * statement.cs: Avoid adding bools to a hashtable.
3501
3502 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3503
3504         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3505         calling an unsafe method from a safe location.
3506
3507 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3508
3509         Fix #69167
3510         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3511
3512 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3513
3514         * namespace.cs (VerifyUsing): use GetPartialName instead of
3515         ToString. 
3516
3517 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3518
3519         * statement.cs (Return.Resolve): Fix regression in typo: if
3520         `in_exc', we have to request a NeedReturnLabel, this was a typo
3521         introduced in the anonymous method check-in.  Fixes #69131.
3522
3523         * Indexers were using the ShortName when defining themselves,
3524         causing a regression in the compiler bootstrap when applying the
3525         patch from 2004-11-02 (first part), now they use their full name
3526         and the bug is gone.
3527
3528 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3529
3530         * driver.cs: Strip the path from the names of embedded resources. Fixes
3531         #68519.
3532
3533 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3534
3535         Fix error message regression: cs0104-2.cs.
3536         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3537         (AliasEntry.Resolve): Update.
3538         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3539         'silent' flag.
3540         (RootContext.LookupType): Update.
3541
3542 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3543
3544         * cs-parser.jay: Add support for handling accessor modifiers
3545         * class: Add support port accessor modifiers and error checking,
3546         define PropertyMethod.Define as virtual (not abstract anymore)
3547         * ecore.cs: Add checking for proeprties access with access modifiers
3548         * iterators.cs: Modify Accessor constructor call based in the modified
3549         constructor
3550 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3551
3552         * expression.cs (StringConcat): Handle being called twice,
3553         as when we have a concat in a field init with more than two
3554         ctors in the class
3555
3556 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3557
3558         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3559         special case explicit implementations, we should always produce
3560         the .property or .event declaration.
3561         
3562         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3563         since it will not return correct data if people use this
3564         unresolved in the presence of using statements (see test-313).
3565
3566         * class.cs (MethodData.Define): If we are an explicit interface
3567         implementation, set the method name to the full name of the
3568         interface plus the name of the method.  
3569
3570         Notice that using the method.MethodName.GetFullName() does not
3571         work, as it will only contain the name as declared on the source
3572         file (it can be a shorthand in the presence of using statements)
3573         and not the fully qualifed type name, for example:
3574
3575         using System;
3576
3577         class D : ICloneable {
3578                 object ICloneable.Clone ()  {
3579                 }
3580         }
3581
3582         Would produce a method called `ICloneable.Clone' instead of
3583         `System.ICloneable.Clone'.
3584
3585         * namespace.cs (Alias.Resolve): Use GetPartialName.
3586         
3587 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3588
3589         * cs-parser.jay: Add error 1055 report.
3590
3591 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3592
3593         * assign.cs (Assign.DoResolve): Only do the transform of
3594         assignment into a New if the types are compatible, if not, fall
3595         through and let the implicit code deal with the errors and with
3596         the necessary conversions. 
3597
3598 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3599
3600         * cs-parser.jay: Add error 1031 report.
3601
3602         * cs-tokenizer.cs: Add location for error 1038.
3603
3604 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3605
3606         * cs-parser.jay: Add error 1016 report.
3607
3608 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3609
3610         * cs-parser.jay: Add errors 1575,1611 report.
3611
3612 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3613
3614         * cs-parser.jay: Add error 1001 report.
3615
3616 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3617
3618         Fix #68850
3619         * attribute.cs (GetMarshal): Add method argument for
3620         caller identification.
3621
3622         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
3623         agument for GetMarshal and RuntimeMissingSupport.
3624
3625 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3626
3627         * attribute.cs (ExtractSecurityPermissionSet): Removed
3628         TypeManager.code_access_permission_type.
3629
3630         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3631
3632 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3633
3634         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3635         for obsolete use of a variable here.   Fixes regression on errors
3636         cs0619-25 and cs0619-26.
3637
3638 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3639
3640         Fix #62358, implemented security attribute encoding.
3641
3642         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3643         Tests permitted SecurityAction for assembly or other types.
3644         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3645         data from SecurityPermissionAttribute to PermisionSet class.
3646
3647         * class.cs (ApplyAttributeBuilder): Added special handling
3648         for System.Security.Permissions.SecurityAttribute based types.
3649
3650         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
3651         special handling for System.Security.Permissions.SecurityAttribute
3652         based types.
3653
3654         * enum.cs (ApplyAttributeBuilder): Added special handling
3655         for System.Security.Permissions.SecurityAttribute based types.
3656
3657         * parameter.cs (ApplyAttributeBuilder): Added special handling
3658         for System.Security.Permissions.SecurityAttribute based types.
3659
3660         * rootcontext.cs: Next 2 core types.
3661
3662         * typemanager.cs (TypeManager.security_permission_attr_type):
3663         Built in type for the SecurityPermission Attribute.
3664         (code_access_permission_type): Build in type.
3665
3666 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
3667
3668         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
3669         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
3670         all of this information into
3671         EmitContext.EmitCapturedVariableInstance.
3672         
3673         * codegen.cs (EmitCapturedVariableInstance): move here the
3674         funcionality of emitting an ldarg.0 in the presence of a
3675         remapping.   This centralizes the instance emit code.
3676
3677         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
3678         then emit a load of this: it means that we have reached the
3679         topmost ScopeInfo: the one that contains the pointer to the
3680         instance of the class hosting the anonymous method.
3681
3682         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
3683         captures to the topmost CaptureContext.
3684
3685 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
3686
3687         * expression.cs (LocalVariableReference): Move the knowledge about
3688         the iterators into codegen's EmitCapturedVariableInstance.
3689
3690 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
3691
3692         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
3693         all code paths return a value from an anonymous method (it is the
3694         same as the 161 error, but for anonymous methods).
3695
3696 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
3697
3698         The introduction of anonymous methods in the compiler changed
3699         various ways of doing things in the compiler.  The most
3700         significant one is the hard split between the resolution phase
3701         and the emission phases of the compiler.
3702
3703         For instance, routines that referenced local variables no
3704         longer can safely create temporary variables during the
3705         resolution phase: they must do so from the emission phase,
3706         since the variable might have been "captured", hence access to
3707         it can not be done with the local-variable operations from the runtime.
3708         
3709         * statement.cs 
3710
3711         (Block.Flags): New flag `IsTopLevel' to indicate that this block
3712         is a toplevel block.
3713
3714         (ToplevelBlock): A new kind of Block, these are the blocks that
3715         are created by the parser for all toplevel method bodies.  These
3716         include methods, accessors and anonymous methods.
3717
3718         These contain some extra information not found in regular blocks:
3719         A pointer to an optional CaptureContext (for tracking captured
3720         local variables and parameters).  A pointer to the parent
3721         ToplevelBlock.
3722         
3723         (Return.Resolve): Catch missmatches when returning a value from an
3724         anonymous method (error 1662).
3725         Invoke NeedReturnLabel from the Resolve phase instead of the emit
3726         phase.
3727
3728         (Break.Resolve): ditto.
3729
3730         (SwitchLabel): instead of defining the labels during the
3731         resolution phase, we now turned the public ILLabel and ILLabelCode
3732         labels into methods called GetILLabelCode() and GetILLabel() that
3733         only define the label during the Emit phase.
3734
3735         (GotoCase): Track the SwitchLabel instead of the computed label
3736         (its contained therein).  Emit the code by using
3737         SwitchLabel.GetILLabelCode ().
3738
3739         (LocalInfo.Flags.Captured): A new flag has been introduce to track
3740         whether the Local has been captured or not.
3741
3742         (LocalInfo.IsCaptured): New property, used to tell whether the
3743         local has been captured.
3744         
3745         * anonymous.cs: Vastly updated to contain the anonymous method
3746         support.
3747
3748         The main classes here are: CaptureContext which tracks any
3749         captured information for a toplevel block and ScopeInfo used to
3750         track the activation frames for various local variables.   
3751
3752         Each toplevel block has an optional capture context associated
3753         with it.  When a method contains an anonymous method both the
3754         toplevel method and the anonymous method will create a capture
3755         context.   When variables or parameters are captured, they are
3756         recorded on the CaptureContext that owns them, for example:
3757
3758         void Demo () {
3759              int a;
3760              MyDelegate d = delegate {
3761                  a = 1;
3762              }
3763         }
3764
3765         Here `a' will be recorded as captured on the toplevel
3766         CapturedContext, the inner captured context will not have anything
3767         (it will only have data if local variables or parameters from it
3768         are captured in a nested anonymous method.
3769
3770         The ScopeInfo is used to track the activation frames for local
3771         variables, for example:
3772
3773         for (int i = 0; i < 10; i++)
3774                 for (int j = 0; j < 10; j++){
3775                    MyDelegate d = delegate {
3776                         call (i, j);
3777                    }
3778                 }
3779
3780         At runtime this captures a single captured variable `i', but it
3781         captures 10 different versions of the variable `j'.  The variable
3782         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
3783         recorded on a child.  
3784
3785         The toplevel ScopeInfo will also track information like the `this'
3786         pointer if instance variables were referenced (this is necessary
3787         as the anonymous method lives inside a nested class in the host
3788         type of the method). 
3789
3790         (AnonymousMethod): Expanded to track the Toplevel, implement
3791         `AnonymousMethod.Compatible' to tell whether an anonymous method
3792         can be converted to a target delegate type. 
3793
3794         The routine now also produces the anonymous method content
3795
3796         (AnonymousDelegate): A helper class that derives from
3797         DelegateCreation, this is used to generate the code necessary to
3798         produce the delegate for the anonymous method that was created. 
3799
3800         * assign.cs: API adjustments for new changes in
3801         Convert.ImplicitStandardConversionExists.
3802
3803         * class.cs: Adjustments to cope with the fact that now toplevel
3804         blocks are of type `ToplevelBlock'. 
3805
3806         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
3807         insteda of standard blocks.
3808
3809         Flag errors if params arguments are passed to anonymous methods.
3810
3811         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
3812         `CurrentAnonymousMethod' which points to the current Anonymous
3813         Method.  The variable points to the AnonymousMethod class that
3814         holds the code being compiled.  It is set in the new EmitContext
3815         created for the anonymous method.
3816
3817         (EmitContext.Phase): Introduce a variable and an enumeration to
3818         assist in enforcing some rules about when and where we are allowed
3819         to invoke certain methods (EmitContext.NeedsReturnLabel is the
3820         only one that enfonces this right now).
3821
3822         (EmitContext.HaveCaptureInfo): new helper method that returns
3823         whether we have a CapturedContext initialized.
3824
3825         (EmitContext.CaptureVariable): New method used to register that a
3826         LocalInfo must be flagged for capturing. 
3827
3828         (EmitContext.CapturedParameter): New method used to register that a
3829         parameters must be flagged for capturing. 
3830         
3831         (EmitContext.CapturedField): New method used to register that a
3832         field must be flagged for capturing. 
3833
3834         (EmitContext.HaveCapturedVariables,
3835         EmitContext.HaveCapturedFields): Return whether there are captured
3836         variables or fields. 
3837
3838         (EmitContext.EmitMethodHostInstance): This is used to emit the
3839         instance for the anonymous method.  The instance might be null
3840         (static methods), this (for anonymous methods that capture nothing
3841         and happen to live side-by-side with the current method body) or a
3842         more complicated expression if the method has a CaptureContext.
3843
3844         (EmitContext.EmitTopBlock): Routine that drives the emission of
3845         code: it will first resolve the top block, then emit any metadata
3846         and then emit the code.  The split is done so that we can extract
3847         any anonymous methods and flag any captured variables/parameters.
3848         
3849         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
3850         during this phase, the ILGenerator should not be used as labels
3851         and local variables declared here might not be accessible to any
3852         code that is part of an anonymous method.  
3853
3854         Exceptions to this include the temporary variables that are
3855         created by some statements internally for holding temporary
3856         variables. 
3857         
3858         (EmitContext.EmitMeta): New routine, in charge of emitting all the
3859         metadata for a cb
3860
3861         (EmitContext.TemporaryReturn): This method is typically called
3862         from the Emit phase, and its the only place where we allow the
3863         ReturnLabel to be defined other than the EmitMeta.  The reason is
3864         that otherwise we would have to duplicate a lot of logic in the
3865         Resolve phases of various methods that today is on the Emit
3866         phase. 
3867
3868         (EmitContext.NeedReturnLabel): This no longer creates the label,
3869         as the ILGenerator is not valid during the resolve phase.
3870
3871         (EmitContext.EmitThis): Extended the knowledge in this class to
3872         work in anonymous methods in addition to iterators. 
3873
3874         (EmitContext.EmitCapturedVariableInstance): This emits whatever
3875         code is necessary on the stack to access the instance to a local
3876         variable (the variable will be accessed as a field).
3877
3878         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
3879         EmitContext.EmitAddressOfParameter): Routines to support
3880         parameters (not completed at this point). 
3881         
3882         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
3883         will also remove the parameters.
3884
3885         * convert.cs (Convert): Define a `ConstantEC' which points to a
3886         null.  This is just to prefity some code that uses
3887         ImplicitStandardConversion code and do not have an EmitContext
3888         handy.
3889
3890         The idea is to flag explicitly that at that point in time, it is
3891         known that the conversion will not trigger the delegate checking
3892         code in implicit conversions (which requires a valid
3893         EmitContext). 
3894
3895         Everywhere: pass new EmitContext parameter since
3896         ImplicitStandardConversionExists now requires it to check for
3897         anonymous method conversions. 
3898
3899         (Convert.ImplicitStandardConversionExists): If the type of an
3900         expression is the anonymous_method_type, and the type is a
3901         delegate, we invoke the AnonymousMethod.Compatible method to check
3902         whether an implicit conversion is possible. 
3903
3904         (Convert.ImplicitConversionStandard): Only do implicit method
3905         group conversions if the language level is not ISO_1.
3906
3907         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
3908         MethodInfo for the Invoke method.  used by Delegate and
3909         AnonymousDelegate.
3910
3911         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
3912         method conversions if the target type is a delegate.
3913
3914         Removed extra debugging nops.
3915
3916         (LocalVariableReference): Turn the `local_info' into a public
3917         field. 
3918
3919         Add `prepared' field, the same hack used for FieldExprs to cope
3920         with composed assignments, as Local variables do not necessarily
3921         operate purely on the stack as they used to: they can be captured
3922         fields. 
3923
3924         Add `temp' for a temporary result, like fields.
3925
3926         Refactor DoResolve and DoResolveLValue into DoResolveBase.
3927
3928         It now copes with Local variables that are captured and emits the
3929         proper instance variable to load it from a field in the captured
3930         case. 
3931
3932         (ParameterReference.DoResolveBase): During the resolve phase,
3933         capture parameters if we are in an anonymous method.
3934
3935         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
3936         anonymous method, use the EmitContext helper routines to emit the
3937         parameter reference.
3938
3939         * iterators.cs: Set RemapToProxy to true/false during the
3940         EmitDispose class.
3941
3942         * parameters.cs (GetParameterByName): New helper method. 
3943
3944         * typemanager.cs (anonymous_method_type) a new type that
3945         represents an anonyous method.  This is always an internal type,
3946         used as a fencepost to test against the anonymous-methodness of an
3947         expression. 
3948         
3949 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
3950
3951         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
3952         561 report.
3953         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
3954
3955 2004-10-18  Martin Baulig  <martin@ximian.com>
3956
3957         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
3958         `Type' directly, but call ResolveType() on it.
3959         (Catch.Resolve): Likewise.
3960         (Foreach.Resolve): Likewise.
3961
3962 2004-10-18  Martin Baulig  <martin@ximian.com>
3963
3964         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
3965         `Type' directly, but call ResolveType() on it.
3966         (Probe.DoResolve): Likewise.
3967         (ArrayCreation.LookupType): Likewise.
3968         (TypeOf.DoResolve): Likewise.
3969         (SizeOf.DoResolve): Likewise.
3970
3971 2004-10-18  Martin Baulig  <martin@ximian.com>
3972
3973         * expression.cs (Invocation.BetterFunction): Put back
3974         TypeManager.TypeToCoreType().
3975
3976 2004-10-18  Raja R Harinath  <rharinath@novell.com>
3977
3978         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
3979         the ResolveType.
3980
3981 2004-10-18  Martin Baulig  <martin@ximian.com>
3982
3983         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
3984         `Type' directly, but call ResolveType() on it.
3985
3986 2004-10-18  Martin Baulig  <martin@ximian.com>
3987
3988         * class.cs (FieldMember.Define): Don't access the TypeExpr's
3989         `Type' directly, but call ResolveType() on it.
3990         (MemberBase.DoDefine): Likewise.
3991
3992         * expression.cs (New.DoResolve): Don't access the TypeExpr's
3993         `Type' directly, but call ResolveType() on it.
3994         (ComposedCast.DoResolveAsTypeStep): Likewise.
3995
3996         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
3997         `Type' directly, but call ResolveType() on it.
3998
3999 2004-10-17  John Luke  <john.luke@gmail.com>
4000
4001         * class.cs (Operator.GetSignatureForError): use CSharpName
4002
4003         * parameter.cs (Parameter.GetSignatureForError): Returns
4004         correct name even if was not defined.
4005
4006 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4007
4008         Fix #65816.
4009         * class.cs (TypeContainer.EmitContext): New property.
4010         (DefineNestedTypes): Create an emitcontext for each part.
4011         (MethodCore.DoDefineParameters): Use container's emitcontext.
4012         Pass type array to InternalParameters.
4013         (MemberBase.DoDefine): Use container's emitcontext.
4014         (FieldMember.Define): Likewise.
4015         (Event.Define): Likewise.
4016         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4017         Pass type array to InternalParameters.
4018         (SetIndexerMethod.GetParameterInfo): Likewise.
4019         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4020         * delegate.cs (Define): Pass emitcontext to
4021         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4022         array to InternalParameters.
4023         * expression.cs (ParameterReference.DoResolveBase): Pass
4024         emitcontext to GetParameterInfo.
4025         (ComposedCast.DoResolveAsTypeStep): Remove check on
4026         ec.ResolvingTypeTree.
4027         * parameter.cs (Parameter.Resolve): Change argument to
4028         EmitContext.  Use ResolveAsTypeTerminal.
4029         (Parameter.GetSignature): Change argument to EmitContext.
4030         (Parameters.ComputeSignature): Likewise.
4031         (Parameters.ComputeParameterTypes): Likewise.
4032         (Parameters.GetParameterInfo): Likewise.
4033         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4034         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4035         * support.cs (InternalParameters..ctor): Remove variant that takes
4036         a DeclSpace.
4037         * typemanager.cs (system_intptr_expr): New.
4038         (InitExpressionTypes): Initialize it.
4039
4040 2004-10-12  Chris Toshok  <toshok@ximian.com>
4041
4042         * cs-parser.jay: fix location for try_statement and catch_clause.
4043
4044 2004-10-11  Martin Baulig  <martin@ximian.com>
4045
4046         * report.cs: Don't make --fatal abort on warnings, we have
4047         -warnaserror for that.
4048
4049 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4050
4051         More DeclSpace.ResolveType avoidance.
4052         * decl.cs (MemberCore.InUnsafe): New property.
4053         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4054         with newly created EmitContext.
4055         (FieldMember.Define): Likewise.
4056         * delegate.cs (Delegate.Define): Likewise.
4057         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4058         only if normal name-lookup fails.
4059         (TypeExpr.DoResolve): Enable error-checking.
4060         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4061         (SizeOf.DoResolve): Likewise.
4062         (ComposedCast.DoResolveAsTypeStep): Likewise.
4063         (StackAlloc.DoResolve): Likewise.
4064         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4065         (Block.Unsafe): New property.
4066         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4067         (Unsafe): Set 'unsafe' flag of contained block.
4068         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4069         (Fixed.Resolve): Likewise.
4070         (Catch.Resolve): Likewise.
4071         (Using.ResolveLocalVariableDecls): Likewise.
4072         (Foreach.Resolve): Likewise.
4073
4074 2004-10-05  John Luke <john.luke@gmail.com>
4075
4076         * cs-parser.jay: add location to error CS0175
4077
4078 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4079
4080         * ecore.cs (Expression.Constantity): Add support for turning null
4081         into a constant.
4082
4083         * const.cs (Const.Define): Allow constants to be reference types
4084         as long as the value is Null.
4085
4086 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4087
4088         * namespace.cs (NamespaceEntry.Using): No matter which warning
4089         level is set, check if this namespace name has already been added.
4090
4091 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4092
4093         * expression.cs: reftype [!=]= null should always use br[true,false].
4094         # 67410
4095
4096 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4097
4098         Fix #67108
4099         * attribute.cs: Enum conversion moved to 
4100         GetAttributeArgumentExpression to be applied to the all
4101         expressions.
4102
4103 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4104
4105         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4106         * class.c (TypeContainer.DefineType): Flag error if
4107         base types aren't accessible due to access permissions.
4108         * decl.cs (DeclSpace.ResolveType): Move logic to
4109         Expression.ResolveAsTypeTerminal.
4110         (DeclSpace.ResolveTypeExpr): Thin layer over
4111         Expression.ResolveAsTypeTerminal.
4112         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4113         Refactor code into NestedAccess.  Use it.
4114         (DeclSpace.NestedAccess): New.
4115         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4116         argument to silence errors.  Check access permissions.
4117         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4118         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4119         (Cast.DoResolve): Likewise.
4120         (New.DoResolve): Likewise.
4121         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4122         (TypeOf.DoResolve): Likewise.
4123
4124         * expression.cs (Invocation.BetterConversion): Return the Type of
4125         the better conversion.  Implement section 14.4.2.3 more faithfully.
4126         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4127         section 14.4.2.2 explicit.
4128         (Invocation.OverloadResolve): Update.
4129         (Invocation): Remove is_base field.
4130         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4131         (Invocation.Emit): Likewise.
4132
4133 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4134
4135         * README: Update to changes.
4136
4137 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4138
4139         * cs-parser.jay: Reverted 642 warning fix.
4140
4141 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4142
4143         Fix bug #66615
4144         * decl.cs (FindMemberWithSameName): Indexer can have more than
4145         1 argument.
4146
4147 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4148
4149         * expression.cs (LocalVariableReference.DoResolveLValue):
4150         Do not report warning 219 for out values.
4151         (EmptyExpression.Null): New member to avoid extra allocations.
4152
4153 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4154
4155         * cs-parser.jay: Fix wrong warning 642 report.
4156
4157         * cs-tokenizer.cs (CheckNextToken): New helper;
4158         Inspect next character if is same as expected.
4159
4160 2004-09-23  Martin Baulig  <martin@ximian.com>
4161
4162         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4163         (Convert.ImplicitReferenceConversionExists): Likewise.
4164
4165 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4166
4167         * class.cs (Operator.Define): Add error 448 and 559 report.
4168
4169 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4170
4171         * class.cs (MemberBase.IsTypePermitted): New protected
4172         method for checking error CS0610.
4173
4174 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4175
4176         * class.cs (TypeContainer.HasExplicitLayout): New property
4177         Returns whether container has StructLayout attribute set Explicit.
4178         (FieldMember): New abstract class for consts and fields.
4179         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4180         (Field): Reuse FieldMember.
4181
4182         * const.cs (Const): Reuse FieldMember.
4183
4184         * rootcontext.cs: EmitConstants call moved to class.
4185
4186 2004-09-22  Martin Baulig  <martin@ximian.com>
4187
4188         Thanks to Peter Sestoft for this bug report.
4189
4190         * expression.cs (Conditional): If both the `trueExpr' and the
4191         `falseExpr' is a NullLiteral, return a NullLiteral.
4192
4193 2004-09-22  Martin Baulig  <martin@ximian.com>
4194
4195         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4196         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4197         for the "get_Current" call.
4198
4199 2004-09-22  Martin Baulig  <martin@ximian.com>
4200
4201         Marek and me just fixed one of our oldest bugs: #28562 :-)
4202
4203         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4204
4205         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4206         we're an EnumConstant, just return that.
4207         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4208         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4209         to get the value which'll actually be written into the attribute.
4210         However, we have to use GetValue() to access the attribute's value
4211         in the compiler.        
4212
4213 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4214
4215         * constant.cs (Constant.IsNegative): New abstract property
4216         IsNegative.
4217
4218         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4219         (StackAlloc.DoResolve): Reused IsNegative.
4220
4221 2004-09-21  Martin Baulig  <martin@ximian.com>
4222
4223         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4224         if we're used in an iterator, we may be called from different
4225         methods.
4226
4227         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4228         we actually have an exception block.
4229
4230 2004-09-20  John Luke <jluke@cfl.rr.com>
4231
4232         * class.cs, cs-parser.jay: Improve the error report for 1520:
4233         report the actual line where the error happens, not where the
4234         class was declared.
4235
4236         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4237         Pass location information that was available elsewhere.
4238
4239 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4240
4241         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4242         runtime to delay sign assemblies.
4243
4244 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4245
4246         * cs-parser.jay: Do not report the stack trace, this is barely
4247         used nowadays.
4248
4249 2004-08-22  John Luke  <john.luke@gmail.com>
4250  
4251         * driver.cs : check that a resource id is not already used
4252         before adding it, report CS1508 if it is, bug #63637
4253
4254 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4255
4256         * ecore.cs: Removed dead code.
4257
4258 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4259
4260         * class.cs: Do not report warning CS0067 on the interfaces.
4261
4262 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4263
4264         * cs-parser.jay: Add error 504 report.
4265
4266 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4267
4268         * rootcontext.cs: WarningLevel is 4 by default now.
4269
4270         * statement.cs (Fixed.Resolve): Do not null
4271         VariableInfo.
4272
4273 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4274
4275         Fixed bug #55780
4276         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4277         deep search when property is not virtual.
4278         (PropertyExpr.ResolveAccessors): Make one call for both
4279         accessors.
4280
4281 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4282
4283         Fixed bug #65766
4284         * statement.cs: Error 152 report constains also location.
4285
4286 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4287
4288         Fixed bug #65766
4289         * const.cs: Explicitly set constant as static.
4290
4291 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4292
4293         Fixed bug #64226
4294         * cs-parser.jay: Add error 1017 report.
4295
4296 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4297
4298         Fixed bug #59980, #64224
4299         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4300
4301         * typemanager.cs (IsSpecialMethod): Simplified
4302
4303 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4304
4305         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4306         condition with better params.
4307
4308 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4309
4310         Fixed bug #65238
4311         * attribute.cs (Resolve): Property has to have both
4312         accessors.
4313
4314 2004-09-14  Martin Baulig  <martin@ximian.com>
4315
4316         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4317
4318 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4319
4320         Fixed bug #61902
4321         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4322         called and is obsolete then this member suppress message
4323         when call is inside next [Obsolete] method or type.
4324
4325         * expression.cs: Use TestObsoleteMethodUsage member.
4326
4327 2004-09-14  Martin Baulig  <martin@ximian.com>
4328
4329         * cs-parser.jay: Sync a bit with the GMCS version.
4330
4331 2004-09-14  Martin Baulig  <martin@ximian.com>
4332
4333         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4334         (CSharpParser.yacc_verbose_flag): New public field.
4335
4336         * genericparser.cs: Removed.
4337
4338 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4339
4340         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4341
4342 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4343
4344         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4345
4346 2004-09-10  Martin Baulig  <martin@ximian.com>
4347
4348         Backported my MemberName changes from GMCS into MCS.
4349
4350         - we are now using a special `MemberName' class instead of using
4351         strings; in GMCS, the `MemberName' also contains the type
4352         arguments.
4353
4354         - changed the grammar rules a bit:
4355           * the old `member_name' is now a `namespace_or_type_name':
4356             The rule is that we use `namespace_or_type_name' everywhere
4357             where we expect either a "member name" (GetEnumerator) or a
4358             "member name" with an explicit interface name
4359             (IEnumerable.GetEnumerator).
4360             In GMCS, the explicit interface name may include type arguments
4361             (IEnumerable<T>.GetEnumerator).
4362           * we use `member_name' instead of just `IDENTIFIER' for
4363             "member names":
4364             The rule is that we use `member_name' wherever a member may
4365             have type parameters in GMCS.       
4366
4367         * decl.cs (MemberName): New public class.
4368         (MemberCore.MemberName): New public readonly field.
4369         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4370         (DeclSpace): Likewise.
4371
4372         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4373         * enum.cs (Enum.ctor): Likewise.
4374
4375         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4376         MemberName.     
4377         (AliasEntry.ctor): Take a MemberName, not an Expression.
4378         (AliasEntry.UsingAlias): Likewise.
4379
4380         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4381         (IMethodData.MemberName): Changed type from string to MemberName.
4382         (MemberBase.ExplicitInterfaceName): Likewise.
4383         (AbstractPropertyEventMethod.SetupName): Make this private.
4384         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4385         argument; compute the member name here.
4386         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4387         on the `member.MemberName' and the `prefix'.
4388
4389         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4390         not `type_name'.
4391         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4392         thus, we get a `MemberName' instead of a `string'.  These
4393         declarations may have type parameters in GMCS.
4394         (interface_method_declaration, delegate_declaration): Likewise.
4395         (class_declaration, interface_declaration): Likewise.
4396         (method_header): Use `namespace_or_type_name' instead of
4397         `member_name'.  We may be an explicit interface implementation.
4398         (property_declaration, event_declaration): Likewise.
4399         (member_name): This is now just an `IDENTIFIER', not a
4400         `namespace_or_type_name'.
4401         (type_name, interface_type): Removed.
4402         (namespace_or_type_name): Return a MemberName, not an Expression.
4403         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4404         call GetTypeExpression() on the MemberName to get an expression.
4405         (IndexerDeclaration.interface_type): Changed type from string to
4406         MemberName.
4407         (MakeName): Operate on MemberName's instead of string's.
4408
4409 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4410
4411         Fix bug #55770.
4412         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4413         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4414         lookup to avoid symbols introduced by 'using'.
4415         * rootcontext.cs (NamespaceLookup): Update.
4416
4417 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4418
4419         * class.cs (TypeContainer.DoDefineMembers): Do not call
4420         DefineDefaultConstructor for static classes.
4421
4422 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4423
4424         * attribute.cs (Attribute.Resolve): Add error 653 report.
4425
4426         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4427         report.
4428         (Method.ApplyAttributeBuilder): Add error 685 report.
4429         (Operator.Define): Add error 564 report.
4430
4431         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4432
4433         * expression.cs (Invocation.DoResolve): Add error
4434         245 and 250 report.
4435
4436         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4437         error 674 report.
4438
4439 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4440
4441         * class.cs (ConstructorInitializer.Resolve):
4442         Wrong error number (515->516).
4443
4444 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4445
4446         * class.cs (Indexer.Define): Add error 631 report.
4447
4448 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4449
4450         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4451
4452 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4453
4454         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4455
4456 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4457
4458         * cs-parser.jay: Added error CS0241 report.
4459
4460 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4461
4462         * cs-parser.jay (fixed_statement): Introduce a scope for the
4463         declaration in the 'fixed' statement.
4464
4465 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4466
4467         * cs-parser.jay: Added CS0230 error report.
4468
4469 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4470
4471         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4472
4473 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4474
4475         * expression.cs (Argument.Resolve): Added error CS0192 and
4476         CS0199 report.
4477
4478 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4479
4480         C# 2.0 #pragma warning feature
4481
4482         * cs-tokenizer.cs (PreProcessPragma): New method; 
4483         Handles #pragma directive.
4484
4485         * report.cs (WarningRegions): New class; Support
4486         class for #pragma warning directive. It tests whether
4487         warning is enabled for a given line.
4488
4489 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4490
4491         * const.cs: Add more descriptive error report, tahnks to
4492         Sebastien. 
4493
4494 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4495
4496         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4497
4498 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4499
4500         * expression.cs: Apply patch from Ben: Remove dead code from
4501         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4502         as that code just threw an exception anwyays.
4503
4504         * const.cs: Remove the call to the turnintoconstant, for details
4505         see bug: #63144
4506         
4507         * literal.cs: The type of the null-literal is the null type;  So
4508         we use a placeholder type (literal.cs:System.Null, defined here)
4509         for it.
4510
4511         * expression.cs (Conditional.DoResolve): Remove some old code that
4512         is no longer needed, conversions have been fixed.
4513
4514         (ArrayCreationExpression.DoResolve): Return false if we fail to
4515         resolve the inner expression.
4516
4517 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4518
4519         Fix test-290.cs.
4520         * cs-parser.jay (delegate_declaration): Record a delegate
4521         declaration as a type declaration.
4522         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4523
4524 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4525
4526         * parameter.cs: Do not crash if the type can not be resolved. 
4527
4528         * expression.cs: Report errors with unsafe pointers, fixes #64896
4529
4530 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4531
4532         * expression.cs: Pointer arith always needs to do a conv.i
4533         if the operand is a long. fix 65320
4534
4535 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4536
4537         Fixed cs0619-37.cs, cs0619-38.cs
4538
4539         * enum.cs (GetObsoleteAttribute): Removed.
4540
4541         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4542         on Enum member is double staged. The first is tested member
4543         and then enum.
4544
4545 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4546
4547         Fixed #56986, #63631, #65231
4548
4549         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4550         adds member to name container.
4551         (TypeContainer.AddToTypeContainer): New method, adds type to
4552         name container.
4553         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4554         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4555         AddOperator): Simplified by reusing AddToMemberContainer.
4556         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4557         instead of field.
4558         (Method.CheckForDuplications): Fixed implementation to test all
4559         possibilities.
4560         (MemberBase): Detection whether member is explicit interface
4561         implementation is now in constructor.
4562         (MemberBase.UpdateMemberName): Handles IndexerName.
4563         (Accessor): Changed to keep also location information.
4564         (AbstractPropertyEventMethod): Is derived from MemberCore.
4565         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4566         will be emited or not.
4567         (PropertyBase.AreAccessorsDuplicateImplementation):
4568         Tests whether accessors are not in collision with some method.
4569         (Operator): Is derived from MethodCore to simplify common
4570         operations.
4571
4572         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4573         must be performed.
4574         (DeclSpace.AddToContainer): Adds the member to defined_names
4575         table. It tests for duplications and enclosing name conflicts.
4576
4577         * enum.cs (EnumMember): Clean up to reuse the base structures
4578
4579 2004-09-03  Martin Baulig  <martin@ximian.com>
4580
4581         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4582         into TypeContainer, to make partial classes work again.
4583
4584 2004-09-03  Martin Baulig  <martin@ximian.com>
4585
4586         * rootcontext.cs (RootContext.V2): Removed.
4587
4588 2004-03-23  Martin Baulig  <martin@ximian.com>
4589
4590         * expression.cs (Invocation.OverloadResolve): Added `bool
4591         may_fail' argument and use it instead of the Location.IsNull() hack.
4592
4593 2004-09-03  Martin Baulig  <martin@ximian.com>
4594
4595         Merged latest changes into gmcs.  Please keep this comment in
4596         here, it makes it easier for me to see what changed in MCS since
4597         the last time I merged.
4598
4599 2004-09-03  Raja R Harinath  <rharinath@novell.com>
4600
4601         Fix #61128.
4602         * expression.cs (BetterConversion): Don't allow either conversion 
4603         to be null.  Remove redundant implicit conversion test when 'q ==
4604         null' -- when this function is invoked, we already know that the
4605         implicit conversion exists.
4606         (BetterFunction): Assume that 'best' is non-null.  Remove
4607         redundant reimplementation of IsApplicable when 'best' is null.
4608         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
4609         number of arguments.
4610         (IsAncestralType): Extract from OverloadResolve.
4611         (OverloadResolve): Make robust to the MethodGroupExpr being
4612         unsorted.  Implement all the logic of Section 14.5.5.1, and
4613         support overloading of methods from multiple applicable types.
4614         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
4615
4616         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
4617         (RealError, Warning): Append type of report to related symbol.
4618
4619 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
4620
4621         * enum.cs: Fixed CLS-Compliance checks for enum members.
4622         Error tests cs3008-8.cs, cs3014-8.cs
4623
4624 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4625
4626         Fixed bug #62342, #63102
4627         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4628         like ImplementMethod.
4629
4630 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4631
4632         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4633         Fixed bug #65170.
4634
4635 2004-09-02  Martin Baulig  <martin@ximian.com>
4636
4637         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4638         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4639         on the MethodBase.
4640
4641 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4642
4643         C# 2.0 Static classes implemented
4644
4645         * class.cs (TypeContainer): instance_constructors,
4646         initialized_fields, initialized_static_fields,
4647         default_constructor, base_inteface_types are protected to be
4648         accessible from StaticClass.
4649         (TypeContainer.DefineDefaultConstructor): New virtual method
4650         for custom default constructor generating
4651         (StaticClass): New class to handle "Static classes" feature.
4652
4653         * cs-parser.jay: Handle static keyword on class like instance
4654         of StaticClass.
4655
4656         * driver.cs: Added "/langversion" command line switch with two
4657         options (iso-1, default).
4658
4659 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
4660
4661         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
4662
4663 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
4664
4665         * delegate.cs: Style.
4666
4667 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4668
4669         * delegate.cs: Add seperate instance expr field for miguel.
4670
4671 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4672
4673         * PointerArithmetic (Resolve): make sure we are not doing
4674         pointer arith on void*. Also, make sure we are resolved
4675         by not setting eclass until resolve.
4676
4677         All callers: Make sure that PointerArithmetic gets resolved.
4678
4679 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4680
4681         * ArrayCreation (LookupType): If the type does not resolve 
4682         to an array, give an error.
4683
4684 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
4685
4686         * statement.cs (Try.Resolve): Fixed bug #64222
4687
4688 2004-08-27  Martin Baulig  <martin@ximian.com>
4689
4690         * class.cs
4691         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4692         crash here.     
4693
4694 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4695
4696         * ecore.cs (Constantify): Get underlying type via
4697         System.Enum.GetUnderlyingType to avoid StackOverflow on the
4698         Windows in special cases.
4699
4700 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4701
4702         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
4703         for obtaining also private methods.
4704         (GetRemoveMethod): Used GetRemoveMethod (true)
4705         for obtaining also private methods.
4706
4707 2004-08-24  Martin Baulig  <martin@ximian.com>
4708
4709         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
4710         MethodAttributes.HideBySig for operators.
4711
4712 2004-08-23  Martin Baulig  <martin@ximian.com>
4713
4714         Back to the old error reporting system :-)
4715
4716         * report.cs (Message): Removed.
4717         (Report.MessageData, ErrorData, WarningData): Removed.
4718         (Report.Error, Warning): Back to the old system.
4719
4720 2004-08-23  Martin Baulig  <martin@ximian.com>
4721
4722         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
4723
4724         * class.cs (TypeContainer.ParentContainer): New public virtual
4725         method; replaces the explicit interface implementation.
4726         (ClassPart.ParentContainer): Override.
4727
4728 2004-08-23  Martin Baulig  <martin@ximian.com>
4729
4730         * statement.cs (Switch): Added support for constant switches; see
4731         #59428 or test-285.cs.
4732
4733 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4734
4735         Fixed bug #62740.
4736         * statement.cs (GetEnumeratorFilter): Removed useless
4737         logic because C# specs is strict. GetEnumerator must be
4738         public.
4739
4740 2004-08-22  Martin Baulig  <martin@ximian.com>
4741
4742         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4743         a switch and may break, reset the barrier.  Fixes #59867.
4744
4745 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4746
4747         CLS-Compliance speed up (~5% for corlib)
4748
4749         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
4750         New method. Tests container for CLS-Compliant names
4751
4752         * class.cs (TypeContainer.VerifyClsName): New method.
4753         Checks whether container name is CLS Compliant.
4754         (Constructor): Implements IMethodData.
4755
4756         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
4757         low-case table for CLS Compliance test.
4758         (MemberCache.VerifyClsParameterConflict): New method.
4759         Checks method parameters for CS3006 error.
4760
4761         * enum.cs (EnumMember): Is derived from MemberCore.
4762         (Enum.VerifyClsName): Optimized for better performance.
4763
4764 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4765
4766         * report.cs: Renamed Error_T to Error and changed all
4767         references.
4768
4769 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4770
4771         * class.cs (TypeContainer.IndexerArrayList): New inner class
4772         container for indexers.
4773         (TypeContainer.DefaultIndexerName): New constant for default
4774         indexer name. Replaced all "Item" with this constant.
4775         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
4776
4777         * typemanager.cs (TypeManager.default_member_ctor): Cache here
4778         DefaultMemberAttribute constructor.
4779
4780 2004-08-05  Martin Baulig  <martin@ximian.com>
4781
4782         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4783         Fix bug #59429.
4784
4785 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
4786
4787         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
4788         multi platforms problem.
4789
4790         * compiler.csproj: Included shared files.
4791
4792 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4793
4794         Fix bug 60333, 55971 in the more general way
4795         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4796         Added arg_type argument for constant conversion.
4797         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
4798
4799 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4800
4801         Fix bug #59760
4802         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
4803         OperatorArrayList, MethodCoreArrayList for typecontainer
4804         containers. Changed class member types to these new types.
4805         (MethodArrayList.DefineMembers): Added test for CS0659.
4806
4807 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
4808
4809         * cfold.cs: Synchronize the folding with the code in expression.cs
4810         Binary.DoNumericPromotions for uint operands.
4811
4812         * attribute.cs: Revert patch from Raja, it introduced a regression
4813         while building Blam-1.2.1 (hard to isolate a test case).
4814
4815 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4816
4817         Fix for #55382
4818         * class.cs:
4819         (TypeContainer.Define): Renamed to DefineContainerMembers because of
4820         name collision.
4821         (MethodCore.parent_method): New member. The method we're overriding
4822         if this is an override method.
4823         (MethodCore.CheckBase): Moved from Method class and made common.
4824         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
4825         private.
4826         (MethodCore.CheckForDuplications): New abstract method. For custom
4827         member duplication search in a container
4828         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
4829         method and its return type.
4830         (Event.conflict_symbol): New member. Symbol with same name in the
4831         parent class.
4832
4833         * decl.cs:
4834         (MemberCache.FindMemberWithSameName): New method. The method
4835         is looking for conflict with inherited symbols.
4836
4837 2004-08-04  Martin Baulig  <martin@ximian.com>
4838
4839         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
4840
4841         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
4842
4843 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4844
4845         * report.cs (Message): New enum for better error, warning reference in
4846         the code.
4847         (MessageData): New inner abstract class. It generally handles printing of
4848         error and warning messages.
4849         Removed unused Error, Warning, Message methods.
4850
4851 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4852
4853         Fix for cs0592-8.cs test
4854         * attribute.cs
4855         (Attributable.ValidAttributeTargets): Made public.
4856         (Attribute.ExplicitTarget): New member for explicit target value.
4857         (Attribute.CheckTargets): Now we translate explicit attribute
4858         target to Target here.
4859
4860 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
4861
4862         * ecore.cs (MethodGroupExpr): new IsBase property.
4863
4864         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
4865
4866         * delegate.cs (DelegateCreation): store a MethodGroupExpr
4867         rather than an instance expr.
4868
4869         (DelegateCreation.Emit): Use the method group rather than
4870         the instance expression. Also, if you have base.Foo as the
4871         method for a delegate, make sure to emit ldftn, not ldftnvirt.
4872
4873         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
4874
4875         (NewDelegate.DoResolve): Only check for the existance of Invoke
4876         if the method is going to be needed. Use MethodGroupExpr.
4877
4878         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
4879
4880         * expression.cs: For pointer arith., make sure to use
4881         the size of the type, not the size of the pointer to
4882         the type.
4883
4884 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4885
4886         Fix for #60722
4887         * class.cs (Class): Added error CS0502 test.
4888
4889 2004-08-03  John Luke  <jluke@cfl.rr.com>
4890             Raja R Harinath  <rharinath@novell.com>
4891
4892         Fix for #60997.
4893         * attribute.cs (Attribute.complained_before): New flag.
4894         (Attribute.ResolveType, Attribute.Resolve),
4895         (Attribute.DefinePInvokeMethod): Set it.
4896         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
4897         
4898 2004-08-03  Martin Baulig  <martin@ximian.com>
4899
4900         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
4901         use a user-defined operator; we still need to do numeric
4902         promotions in case one argument is a builtin type and the other
4903         one has an implicit conversion to that type.  Fixes #62322.
4904
4905 2004-08-02  Martin Baulig  <martin@ximian.com>
4906
4907         * statement.cs (LocalInfo.Flags): Added `IsThis'.
4908         (LocalInfo.IsThis): New public property.
4909         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
4910
4911 2004-08-01  Martin Baulig  <martin@ximian.com>
4912
4913         * class.cs (TypeContainer.GetClassBases): Don't set the default
4914         here since we may get called from GetPartialBases().
4915         (TypeContainer.DefineType): If GetClassBases() didn't return a
4916         parent, use the default one.
4917
4918 2004-07-30  Duncan Mak  <duncan@ximian.com>
4919
4920         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
4921
4922 2004-07-30  Martin Baulig  <martin@ximian.com>
4923
4924         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
4925
4926         * class.cs (SourceMethod): New public class, derive from the
4927         symbol writer's ISourceMethod.
4928         (Method): Use the new symbol writer API.
4929
4930         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
4931         as argument and use the new symbol writer.
4932
4933         * location.cs
4934         (SourceFile): Implement the symbol writer's ISourceFile.
4935         (Location.SymbolDocument): Removed.
4936         (Location.SourceFile): New public property.
4937
4938         * symbolwriter.cs: Use the new symbol writer API.
4939
4940 2004-07-30  Raja R Harinath  <rharinath@novell.com>
4941
4942         * Makefile (install-local): Remove.  Functionality moved to
4943         executable.make.
4944
4945 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
4946
4947         * Makefile: Install mcs.exe.config file together with mcs.exe.
4948         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
4949         correct runtime version.
4950         
4951 2004-07-25  Martin Baulig  <martin@ximian.com>
4952
4953         * class.cs
4954         (TypeContainer.RegisterOrder): Removed, this was unused.
4955         (TypeContainer, interface_order): Removed.
4956         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
4957         TypeContainer as argument since we can also be called with a
4958         `PartialContainer' for a partial class/struct/interface.
4959         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
4960         of checking whether we're an `Interface' - we could be a
4961         `PartialContainer'.
4962         (PartialContainer.Register): Override; call
4963         AddClass()/AddStruct()/AddInterface() on our parent.
4964
4965         * cs-parser.jay (interface_member_declaration): Add things to the
4966         `current_container', not the `current_class'.
4967
4968         * rootcontext.cs (RegisterOrder): The overloaded version which
4969         takes an `Interface' was unused, removed.
4970
4971         * typemanager.cs (TypeManager.LookupInterface): Return a
4972         `TypeContainer', not an `Interface'.
4973         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
4974         contain a `PartialContainer' for an interface, so check it's
4975         `Kind' to figure out what it is.
4976
4977 2004-07-25  Martin Baulig  <martin@ximian.com>
4978
4979         * class.cs (Class.DefaultTypeAttributes): New public constant.
4980         (Struct.DefaultTypeAttributes): Likewise.
4981         (Interface.DefaultTypeAttributes): Likewise.
4982         (PartialContainer.TypeAttr): Override this and add the
4983         DefaultTypeAttributes.
4984
4985 2004-07-25  Martin Baulig  <martin@ximian.com>
4986
4987         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
4988         we can just use the `Parent' field instead.
4989
4990 2004-07-25  Martin Baulig  <martin@ximian.com>
4991
4992         * class.cs (TypeContainer.Emit): Renamed to EmitType().
4993
4994 2004-07-25  Martin Baulig  <martin@ximian.com>
4995
4996         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
4997         our parts before defining any methods.
4998         (TypeContainer.VerifyImplements): Make this virtual.
4999         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5000         on our PartialContainer.
5001
5002 2004-07-25  Martin Baulig  <martin@ximian.com>
5003
5004         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5005
5006         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5007         argument, we can just use the `Parent' field instead.
5008
5009         * class.cs
5010         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5011         (MemberBase.DoDefine): Likewise.
5012
5013 2004-07-24  Martin Baulig  <martin@ximian.com>
5014
5015         * decl.cs (MemberCore.Parent): New public field.
5016         (DeclSpace.Parent): Moved to MemberCore.
5017
5018         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5019         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5020         parent's .ctor.
5021         (FieldBase, Field, Operator): Likewise.
5022         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5023         (EventField, Event): Likewise.
5024
5025 2004-07-23  Martin Baulig  <martin@ximian.com>
5026
5027         * class.cs (PartialContainer): New public class.
5028         (ClassPart): New public class.
5029         (TypeContainer): Added support for partial classes.
5030         (TypeContainer.GetClassBases): Splitted some of the functionality
5031         out into GetNormalBases() and GetPartialBases().
5032
5033         * cs-tokenizer.cs (Token.PARTIAL): New token.
5034         (Tokenizer.consume_identifier): Added some hacks to recognize
5035         `partial', but only if it's immediately followed by `class',
5036         `struct' or `interface'.
5037
5038         * cs-parser.jay: Added support for partial clases.
5039
5040 2004-07-23  Martin Baulig  <martin@ximian.com>
5041
5042         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5043         a `DeclSpace' and also made it readonly.
5044         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5045         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5046         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5047
5048         * cs-parser.jay: Pass the `current_class', not the
5049         `current_container' (at the moment, this is still the same thing)
5050         to a new Method, Property, Event, Indexer or Constructor.
5051
5052 2004-07-23  Martin Baulig  <martin@ximian.com>
5053
5054         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5055         and removed the `current_interface' one.
5056         (struct_declaration, class_declaration, interface_declaration):
5057         Set `current_class' to the newly created class/struct/interface;
5058         set their `Bases' and call Register() before parsing their body.
5059
5060 2004-07-23  Martin Baulig  <martin@ximian.com>
5061
5062         * class.cs (Kind): New public enum.
5063         (TypeContainer): Made this class abstract.
5064         (TypeContainer.Kind): New public readonly field.
5065         (TypeContainer.CheckDef): New public method; moved here from
5066         cs-parser.jay.
5067         (TypeContainer.Register): New public abstract method.
5068         (TypeContainer.GetPendingImplementations): New public abstract
5069         method.
5070         (TypeContainer.GetClassBases): Removed the `is_class' and
5071         `is_iface' parameters.
5072         (TypeContainer.DefineNestedTypes): Formerly known as
5073         DoDefineType().
5074         (ClassOrStruct): Made this class abstract.
5075
5076         * tree.cs (RootTypes): New public type. 
5077
5078 2004-07-20  Martin Baulig  <martin@ximian.com>
5079
5080         * tree.cs (Tree.RecordNamespace): Removed.
5081         (Tree.Namespaces): Removed.
5082
5083         * rootcontext.cs (RootContext.IsNamespace): Removed.
5084
5085         * cs-parser.jay (namespace_declaration): Just create a new
5086         NamespaceEntry here.
5087
5088 2004-07-20  Martin Baulig  <martin@ximian.com>
5089
5090         * statement.cs (ExceptionStatement): New abstract class.  This is
5091         now used as a base class for everyone who's using `finally'.
5092         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5093         our local variables before using them.
5094
5095         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5096         virtual method.  This is used by Yield.Resolve() to "steal" an
5097         outer block's `finally' clauses.
5098         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5099         argument.
5100
5101         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5102         version which takes an ExceptionStatement.  This version must be
5103         used to create exception branchings.
5104
5105         * iterator.cs
5106         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5107         (Iterator.EmitMoveNext): Added exception support; protect the
5108         block with a `fault' clause, properly handle 'finally' clauses.
5109         (Iterator.EmitDispose): Run all the `finally' clauses here.
5110
5111 2004-07-20  Martin Baulig  <martin@ximian.com>
5112
5113         * iterator.cs: This is the first of a set of changes in the
5114         iterator code.  Match the spec more closely: if we're an
5115         IEnumerable, then GetEnumerator() must be called.  The first time
5116         GetEnumerator() is called, it returns the current instance; all
5117         subsequent invocations (if any) must create a copy.
5118
5119 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5120
5121         * expression.cs: Resolve the constant expression before returning
5122         it. 
5123
5124 2004-07-19  Martin Baulig  <martin@ximian.com>
5125
5126         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5127         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5128         the return type of the new EmitContext.
5129
5130 2004-07-18  Martin Baulig  <martin@ximian.com>
5131
5132         * class.cs (Property.Define): Fix iterators.
5133
5134         * iterators.cs (Iterator.Define): Moved the
5135         `container.AddInterator (this)' call here from the .ctor; only do
5136         it if we resolved successfully.
5137
5138 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5139
5140         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5141         `true' for preprocessing directives that we parse.  The return
5142         value indicates whether we should return to regular tokenizing or
5143         not, not whether it was parsed successfully.
5144
5145         In the past if we were in: #if false ... #line #endif, we would
5146         resume parsing after `#line'.  See bug 61604.
5147
5148         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5149         building: IsEnumType should return true only for enums, not for
5150         enums or System.Enum itself.  This fixes #61593.
5151
5152         Likely what happened is that corlib was wrong: mcs depended on
5153         this bug in some places.  The bug got fixed, we had to add the
5154         hack, which caused bug 61593.
5155
5156         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5157         that was a workaround for the older conditions.
5158
5159 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5160
5161         * assign.cs: IAssignMethod has a new interface, as documented
5162         inline. All assignment code now uses this new api.
5163
5164         * ecore.cs, expression.cs: All classes which implement
5165         IAssignMethod now use the new interface.
5166
5167         * expression.cs (Invocation): add a hack to EmitCall so that
5168         IndexerAccess can be the target of a compound assignment without
5169         evaluating its arguments twice.
5170
5171         * statement.cs: Handle changes in Invocation api.
5172
5173 2004-07-16  Martin Baulig  <martin@ximian.com>
5174
5175         * iterators.cs: Rewrote this.  We're now using one single Proxy
5176         class for both the IEnumerable and the IEnumerator interface and
5177         `Iterator' derives from Class so we can use the high-level API.
5178
5179         * class.cs (TypeContainer.AddIterator): New method.
5180         (TypeContainer.DoDefineType): New protected virtual method, which
5181         is called from DefineType().
5182         (TypeContainer.DoDefineMembers): Call DefineType() and
5183         DefineMembers() on all our iterators.
5184         (TypeContainer.Emit): Call Emit() on all our iterators.
5185         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5186
5187         * codegen.cs (EmitContext.CurrentIterator): New public field.
5188
5189 2004-07-15  Martin Baulig  <martin@ximian.com>
5190
5191         * typemanager.cs
5192         (TypeManager.not_supported_exception_type): New type.   
5193
5194 2004-07-14  Martin Baulig  <martin@ximian.com>
5195
5196         * iterators.cs: Use real error numbers.
5197
5198 2004-07-14  Martin Baulig  <martin@ximian.com>
5199
5200         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5201         requires this to be a System.Collection.IEnumerable and not a
5202         class implementing that interface.
5203         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5204
5205 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5206
5207         * class.cs: Fixed previous fix, it broke some error tests.
5208
5209 2004-07-12  Martin Baulig  <martin@ximian.com>
5210
5211         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5212         Fixes #61293.
5213
5214 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5215
5216         * assign.cs (LocalTemporary): Add new argument: is_address,If
5217         `is_address' is true, then the value that we store is the address
5218         to the real value, and not the value itself.
5219         
5220         * ecore.cs (PropertyExpr): use the new local temporary
5221         stuff to allow us to handle X.Y += z (where X is a struct)
5222
5223 2004-07-08  Martin Baulig  <martin@ximian.com>
5224
5225         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5226         not always return, just like we're doing in Using.Resolve().
5227
5228 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5229
5230         * cs-parser.jay (fixed_statement): flag this as Pinned.
5231
5232 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5233
5234         * typemanager.cs (TypeManager): Removed MakePinned method, this
5235         mechanism is replaced with the .NET 2.x compatible mechanism of
5236         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5237
5238         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5239         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5240         `IsFixed' property which has a different meaning.
5241
5242 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5243
5244         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5245         visible from inside a nested class, not just the names of the
5246         immediately enclosing class.
5247         Fix for bug #60730.
5248
5249 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5250
5251         * expression.cs (BetterConversion): Remove buggy special-case
5252         handling of "implicit constant expression conversions".  At this
5253         point, we already know that the conversion is possible -- we're
5254         only checking to see which is better.
5255
5256 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5257
5258         * cs-parser.jay: Added error CS0210 test.
5259
5260 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5261
5262         * cs-parser.jay: Added error CS0134 test.
5263
5264 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5265
5266         Fix bug #52507
5267         * cs-parser.jay: Added error CS0145 test.
5268
5269 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5270
5271         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5272
5273 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5274         
5275         * expression.cs (StackAlloc.Resolve): The argument may not
5276         be a constant; deal with this case.
5277         
5278 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5279
5280         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5281         GetIndexerAttributeValue.
5282         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5283
5284         * class.cs (Indexer.Define): Added error tests for CS0415,
5285         CS0609.
5286
5287 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5288
5289         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5290         property code.
5291
5292 2004-06-23  Martin Baulig  <martin@ximian.com>
5293
5294         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5295         neither return nor throw, reset the barrier as well.  Fixes #60457.
5296
5297 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5298
5299         * class.cs : EventAttributes is now set to None by default.
5300           This fixes bug #60459.
5301
5302 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5303
5304         Fix bug #60219
5305         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5306         Don't throw exception but return null (it's sufficient now).
5307
5308 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5309
5310         * typemanager.cs (GetArgumentTypes): Faster implementation.
5311
5312 2004-06-18  Martin Baulig  <martin@ximian.com>
5313
5314         * attribute.cs (Attribute.Resolve): Check whether we're an
5315         EmptyCast which a Constant child.  Fixes #60333.
5316
5317 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5318
5319         * statement.cs (EmitCollectionForeach): Account for the fact that
5320         not all valuetypes are in areas which we can take the address of.
5321         For these variables, we store to a temporary variable. Also, make
5322         sure that we dont emit a `callvirt' on a valuetype method.
5323
5324 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5325
5326         * expression.cs (StackAlloc.DoReSolve): Added test for
5327         negative parameter (CS0247).
5328
5329 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5330
5331         Fix bug #59792
5332         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5333
5334 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5335
5336         Fix bug #59781
5337         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5338         ulong.
5339
5340 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5341
5342         Fix bug #58254 & cs1555.cs, cs1556.cs
5343         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5344
5345 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5346
5347         * cs-parser.jay: Added error CS1669 test for indexers.
5348
5349 2004-06-11  Martin Baulig  <martin@ximian.com>
5350
5351         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5352         call this twice: for params and varargs methods.
5353
5354 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5355
5356         * class.cs:
5357         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5358
5359 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5360
5361         * attribute.cs (Attribute.GetValidTargets): Made public.
5362
5363         * class.cs: 
5364         (AbstractPropertyEventMethod): New class for better code sharing.
5365         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5366         CS1667 report.
5367         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5368
5369 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5370
5371         Fix bug #59477.
5372         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5373         that the call to Resolve is part of a MemberAccess.
5374         (Expression.Resolve): Use it for SimpleName resolution.
5375         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5376         Add 'intermediate' boolean argument.
5377         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5378         error message when the SimpleName can be resolved ambiguously
5379         between an expression and a type.
5380         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5381         public.
5382         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5383         call on the left-side.
5384
5385 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5386
5387         * class.cs:
5388         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5389
5390 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5391
5392         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5393
5394 2004-06-11  Martin Baulig  <martin@ximian.com>
5395
5396         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5397         varargs methods if applicable.
5398
5399 2004-06-11  Martin Baulig  <martin@ximian.com>
5400
5401         * expression.cs (Invocation.EmitCall): Don't use
5402         `method.CallingConvention == CallingConventions.VarArgs' since the
5403         method could also have `CallingConventions.HasThis'.
5404
5405 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5406
5407         * class.cs (Event.GetSignatureForError): Implemented.
5408         Fixed crash in error test cs3010.cs
5409
5410 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5411
5412         * cs-tokenizer.cs: Change the way we track __arglist to be
5413         consistent with the other keywords.
5414
5415 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5416
5417         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5418         tomorrow.
5419
5420 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5421
5422         * codegen.cs: Check that all referenced assemblies have a strongname
5423         before strongnaming the compiled assembly. If not report error CS1577.
5424         Fix bug #56563. Patch by Jackson Harper.
5425         * typemanager.cs: Added a method to return all referenced assemblies.
5426         Fix bug #56563. Patch by Jackson Harper.
5427
5428 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5429
5430         * class.cs:
5431         (Method.ApplyAttributeBuilder): Moved and added conditional
5432         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5433
5434         * delegate.cs:
5435         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5436
5437 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5438
5439         Fixed #59640
5440         * class.cs: (EventField.attribute_targets): Changed default target.
5441
5442 2004-06-08  Martin Baulig  <martin@ximian.com>
5443
5444         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5445
5446 2004-06-08  Martin Baulig  <martin@ximian.com>
5447
5448         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5449
5450 2004-06-07  Martin Baulig  <martin@ximian.com>
5451
5452         Added support for varargs methods.
5453
5454         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5455         keyword.
5456
5457         * cs-parser.jay: Added support for `__arglist'.
5458
5459         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5460
5461         * expression.cs (Argument.AType): Added `ArgList'.
5462         (Invocation): Added support for varargs methods.
5463         (ArglistAccess): New public class.
5464         (Arglist): New public class.
5465
5466         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5467
5468         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5469         a method's top-level block if the method has varargs.
5470
5471         * support.cs (ReflectionParameters, InternalParameters): Added
5472         support for varargs methods.    
5473
5474 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
5475
5476         * class.cs: Provide location in indexer error report.
5477
5478         * driver.cs: Use standard names.
5479
5480         * namespace.cs: Catch the use of using after a namespace has been
5481         declared also on using aliases.
5482
5483 2004-06-03  Raja R Harinath  <rharinath@novell.com>
5484
5485         Bug #50820.
5486         * typemanager.cs (closure_private_ok, closure_invocation_type)
5487         (closure_qualifier_type, closure_invocation_assembly)
5488         (FilterWithClosure): Move to ...
5489         (Closure): New internal nested class.
5490         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
5491         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
5492         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
5493         (MemberLookup, MemberLookupFailed): Use it.
5494         * expression.cs (New.DoResolve): Treat the lookup for the
5495         constructor as being qualified by the 'new'ed type.
5496         (Indexers.GetIndexersForTypeOrInterface): Update.
5497
5498 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
5499
5500         * attribute.cs
5501         (GetConditionalAttributeValue): New method. Returns
5502         condition of ConditionalAttribute.
5503         (SearchMulti): New method.  Returns all attributes of type 't'.
5504         Use it when attribute is AllowMultiple = true.
5505         (IsConditionalMethodExcluded): New method.
5506
5507         * class.cs
5508         (Method.IsExcluded): Implemented. Returns true if method has conditional
5509         attribute and the conditions is not defined (method is excluded).
5510         (IMethodData): Extended interface for ConditionalAttribute support.
5511         (PropertyMethod.IsExcluded): Implemented.
5512
5513         * decl.cs
5514         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
5515
5516         * expression.cs
5517         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
5518         on the method.
5519
5520 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5521
5522         * expression.cs (ArrayCreationExpression): Make this just an
5523         `expression'. It can't be a statement, so the code here was
5524         dead.
5525
5526 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5527
5528         Fixed #59072
5529         * typemanager.cs (GetFullNameSignature): New method for
5530         MethodBase types.
5531
5532 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5533
5534         Fixed #56452
5535         * class.cs (MemberBase.GetSignatureForError): New virtual method.
5536         Use this method when MethodBuilder is null.
5537         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
5538         Added test for error CS0626 (MONO reports error for this situation).
5539         (IMethodData.GetSignatureForError): Extended interface.
5540
5541 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5542
5543         * attribute.cs
5544         (AttributeTester.GetObsoleteAttribute): Returns instance of
5545         ObsoleteAttribute when type is obsolete.
5546
5547         * class.cs
5548         (TypeContainer.VerifyObsoleteAttribute): Override.
5549         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5550         (MethodCode.VerifyObsoleteAttribute): Override.
5551         (MemberBase.VerifyObsoleteAttribute): Override.
5552
5553         * decl.cs
5554         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5555         and report proper error.
5556
5557         *delegate.cs
5558         Delegate.VerifyObsoleteAttribute): Override.
5559
5560         * ecore.cs
5561         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5562         and report proper error.
5563         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5564
5565         * enum.cs
5566         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5567         and enum member.
5568
5569         * expression.cs
5570         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5571         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5572         Added test for ObsoleteAttribute.
5573
5574         * statement.cs
5575         (Catch): Derived from Statement.
5576
5577 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5578  
5579         Fixed bug #59071 & cs0160.cs
5580  
5581         * statement.cs (Try.Resolve): Check here whether order of catch
5582         clauses matches their dependencies.
5583
5584 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
5585
5586         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
5587         caused a regression: #59343.  Referencing nested classes from an
5588         assembly stopped working.
5589
5590 2004-05-31  Martin Baulig  <martin@ximian.com>
5591
5592         MCS is now frozen for beta 2.
5593
5594 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5595
5596         * convert.cs: add a trivial cache for overload operator resolution.
5597
5598 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5599
5600         * decl.cs: If possible, use lookuptypedirect here. We can only do
5601         this if there is no `.' after the namespace. Avoids using
5602         LookupType, which does lots of slow processing.
5603         (FindNestedType) New method, does what it says :-).
5604         * namespace.cs: use LookupTypeDirect.
5605         * rootcontext.cs: use membercache, if possible.
5606         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5607
5608 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5609
5610         * expression.cs:
5611         According to the spec, 
5612
5613         In a member access of the form E.I, if E is a single identifier,
5614         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5615         field, property, localvariable, or parameter with the same type as
5616         the meaning of E as a type-name (§3.8), then both possible
5617         meanings of E are permitted.
5618
5619         We did not check that E as a simple-name had the same type as E as
5620         a type name.
5621
5622         This trivial check gives us 5-7% on bootstrap time.
5623
5624 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5625
5626         * expression.cs (Invocation.OverloadResolve): Avoid the
5627         use of hashtables and boxing here by allocating on demand.
5628
5629 2004-05-30  Martin Baulig  <martin@ximian.com>
5630
5631         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5632         we're doing a silent lookup.  Don't try to lookup nested types in
5633         TypeManager.object_type (thanks to Ben Maurer).
5634
5635 2004-05-30  Martin Baulig  <martin@ximian.com>
5636
5637         Committing a patch from Ben Maurer.
5638
5639         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5640
5641 2004-05-29  Martin Baulig  <martin@ximian.com>
5642
5643         * class.cs (IMethodData.ShouldIgnore): New method.
5644
5645         * typemanager.cs (TypeManager.MethodFlags): Don't take a
5646         `Location' argument, we don't need it anywhere.  Use
5647         `IMethodData.ShouldIgnore ()' instead of
5648         `MethodData.GetMethodFlags ()'.
5649         (TypeManager.AddMethod): Removed.
5650         (TypeManager.AddMethod2): Renamed to AddMethod.
5651
5652 2004-05-29  Martin Baulig  <martin@ximian.com>
5653
5654         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
5655
5656         * convert.cs (Convert.ImplicitReferenceConversion): If we're
5657         converting from a class type S to an interface type and we already
5658         have an object on the stack, don't box it again.  Fixes #52578.
5659
5660 2004-05-29  Martin Baulig  <martin@ximian.com>
5661
5662         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5663         Added support for `params' parameters.  Fixes #59267.
5664
5665 2004-05-29  Martin Baulig  <martin@ximian.com>
5666
5667         * literal.cs (NullPointer): Provide a private .ctor which sets
5668         `type' to TypeManager.object_type.  Fixes #59048.
5669
5670 2004-05-29  Martin Baulig  <martin@ximian.com>
5671
5672         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
5673         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
5674
5675         * ecore.cs (EventExpr.instance_expr): Make the field private.
5676
5677 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
5678
5679         Fixed bug #50080 & cs0214-2.cs
5680         * expression.cs (Cast.DoResolve): Check unsafe context here.
5681         
5682         * statement.cs (Resolve.DoResolve): Likewise.
5683
5684 2004-05-26  Martin Baulig  <martin@ximian.com>
5685
5686         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
5687
5688         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
5689         (RootContext.LookupType): Pass down the `silent' flag.
5690
5691 2004-05-25  Martin Baulig  <martin@ximian.com>
5692
5693         * expression.cs
5694         (MethodGroupExpr.IdenticalTypeName): New public property.
5695         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
5696         expression actually refers to a type.
5697
5698 2004-05-25  Martin Baulig  <martin@ximian.com>
5699
5700         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
5701         for #56176 and made it actually work.
5702
5703 2004-05-25  Martin Baulig  <martin@ximian.com>
5704
5705         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
5706         (FieldExpr, PropertyExpr): Override and implement
5707         CacheTemporaries.  Fixes #52279.
5708
5709 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
5710
5711         * location.cs: In the new compiler listing a file twice is a
5712         warning, not an error.
5713
5714 2004-05-24  Martin Baulig  <martin@ximian.com>
5715
5716         * enum.cs (Enum.DefineType): For the `BaseType' to be a
5717         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
5718
5719 2004-05-24  Martin Baulig  <martin@ximian.com>
5720
5721         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
5722         walking the `using' list.  Fixes #53921.
5723
5724 2004-05-24  Martin Baulig  <martin@ximian.com>
5725
5726         * const.cs (Const.LookupConstantValue): Added support for
5727         EmptyCast's; fixes #55251.
5728
5729 2004-05-24  Martin Baulig  <martin@ximian.com>
5730
5731         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
5732         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
5733         which does the CS0135 check.  The reason is that we first need to
5734         check whether the variable actually exists.
5735
5736 2004-05-24  Martin Baulig  <martin@ximian.com>
5737
5738         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
5739         than RootContext.LookupType() to find the explicit interface
5740         type.  Fixes #58584.
5741
5742 2004-05-24  Raja R Harinath  <rharinath@novell.com>
5743
5744         * Makefile: Simplify.  Use executable.make.
5745         * mcs.exe.sources: New file.  List of sources of mcs.exe.
5746
5747 2004-05-24  Anders Carlsson  <andersca@gnome.org>
5748
5749         * decl.cs:
5750         * enum.cs:
5751         Use the invariant culture when doing String.Compare for CLS case
5752         sensitivity.
5753         
5754 2004-05-23  Martin Baulig  <martin@ximian.com>
5755
5756         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
5757         don't have any dots.  Fixes #52622, added cs0246-8.cs.
5758
5759         * namespace.cs (NamespaceEntry.Lookup): Likewise.
5760         
5761 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5762
5763         * class.cs (MemberBase.Define): Reuse MemberType member for 
5764         resolved type. Other methods can use it too.
5765
5766 2004-05-23  Martin Baulig  <martin@ximian.com>
5767
5768         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
5769         the variable also exists in the current block (otherwise, we need
5770         to report a CS0103).  Fixes #58670.
5771
5772 2004-05-23  Martin Baulig  <martin@ximian.com>
5773
5774         * flowanalysis.cs (Reachability.Reachable): Compute this
5775         on-the-fly rather than storing it as a field.
5776
5777 2004-05-23  Martin Baulig  <martin@ximian.com>
5778
5779         * flowanalysis.cs (Reachability.And): Manually compute the
5780         resulting `barrier' from the reachability.      
5781        
5782 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5783
5784         Fix bug #57835
5785         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
5786         instance of ObsoleteAttribute when symbol is obsolete.
5787
5788         * class.cs
5789         (IMethodData): Extended interface for ObsoleteAttribute support.
5790
5791 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5792
5793         * attribute.cs: Fix bug #55970
5794
5795 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5796
5797         Fix bug #52705
5798         * attribute.cs
5799         (GetObsoleteAttribute): New method. Creates the instance of
5800         ObsoleteAttribute.
5801         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
5802         ObsoleteAttribute when member is obsolete.
5803         (AttributeTester.Report_ObsoleteMessage): Common method for
5804         Obsolete error/warning reporting.
5805
5806         * class.cs
5807         (TypeContainer.base_classs_type): New member for storing parent type.
5808
5809         * decl.cs
5810         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
5811         for this MemberCore.
5812
5813 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5814
5815         * attribute.cs, const.cs: Fix bug #58590
5816
5817 2004-05-21  Martin Baulig  <martin@ximian.com>
5818
5819         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
5820         out parameters if the end of the method is unreachable.  Fixes
5821         #58098. 
5822
5823 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5824
5825         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
5826         Hari was right, why extra method.
5827
5828 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5829
5830         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
5831
5832 2004-05-20  Martin Baulig  <martin@ximian.com>
5833
5834         Merged this back from gmcs to keep the differences to a minumum.
5835
5836         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
5837         instead of a Declspace.
5838         (Attribute.ResolveType): Likewise.
5839         (Attributes.Search): Likewise.
5840         (Attributes.Contains): Likewise.
5841         (Attributes.GetClsCompliantAttribute): Likewise.
5842
5843         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
5844         argument.
5845         (MethodData.ApplyAttributes): Take an EmitContext instead of a
5846         DeclSpace.
5847
5848 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
5849
5850         Fix bug #58688 (MCS does not report error when the same attribute
5851         is assigned twice)
5852
5853         * attribute.cs (Attribute.Emit): Distinction between null and default.
5854
5855 2004-05-19  Raja R Harinath  <rharinath@novell.com>
5856
5857         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
5858         of a top-level attribute without an attribute target.
5859         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
5860         Make non-static.
5861         (Attribute.Conditional_GetConditionName), 
5862         (Attribute.Obsolete_GetObsoleteMessage): Update.
5863         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
5864         part of ScanForIndexerName.
5865         (Attribute.CanIgnoreInvalidAttribute): New function.
5866         (Attribute.ScanForIndexerName): Move to ...
5867         (Attributes.ScanForIndexerName): ... here.
5868         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
5869         (Attributes.Search): New internal variant that can choose not to
5870         complain if types aren't resolved.  The original signature now
5871         complains.
5872         (Attributes.GetClsCompliantAttribute): Use internal variant, with
5873         complaints suppressed.
5874         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
5875         only if it not useful.
5876         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
5877         top-level for attributes that are shared between the assembly
5878         and a top-level class.
5879         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
5880         * class.cs: Update to reflect changes.
5881         (DefineIndexers): Fuse loops.
5882         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
5883         a couple more variants of attribute names.
5884
5885 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
5886
5887         Fix bug #52585 (Implemented explicit attribute declaration)
5888
5889         * attribute.cs:
5890         (Attributable.ValidAttributeTargets): New abstract method. It gets
5891         list of valid attribute targets for explicit target declaration.
5892         (Attribute.Target): It holds target itself.
5893         (AttributeSection): Removed.
5894         (Attribute.CheckTargets): New method. It checks whether attribute
5895         target is valid for the current element.
5896
5897         * class.cs:
5898         (EventProperty): New class. For events that are declared like
5899         property (with add and remove accessors).
5900         (EventField): New class. For events that are declared like field.
5901         class.cs
5902
5903         * cs-parser.jay: Implemented explicit attribute target declaration.
5904
5905         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
5906         Override ValidAttributeTargets.
5907
5908         * parameter.cs:
5909         (ReturnParameter): Class for applying custom attributes on 
5910         the return type.
5911         (ParameterAtribute): New class. Class for applying custom
5912         attributes on the parameter type.
5913
5914 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
5915
5916         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
5917         definitions. 
5918
5919         (Method): Allow UNSAFE here.
5920
5921         * modifiers.cs: Support unsafe reporting.
5922
5923 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
5924
5925         * decl.cs: Fix bug #58478.
5926
5927 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5928
5929         * statement.cs: When checking for unreachable code on an EmptyStatement,
5930         set the location. Fixes bug #58488.
5931
5932 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
5933
5934         * driver.cs: Add -pkg handling.
5935
5936         From Gonzalo: UseShelLExecute=false
5937
5938 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
5939
5940         * attribute.cs:
5941         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
5942         for attribute.
5943         (Attribute.IsClsCompliaceRequired): Moved to base for better
5944         accesibility.
5945         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
5946         when attribute is AttributeUsageAttribute.
5947         (Attribute.GetValidTargets): Simplified.
5948         (Attribute.GetAttributeUsage): New method returns AttributeUsage
5949         attribute for this type.
5950         (Attribute.ApplyAttributes): Method renamed to Emit and make
5951         non-static.
5952         (GlobalAttributeSection): New class for special handling of global
5953         attributes (assembly, module).
5954         (AttributeSection.Emit): New method.
5955
5956         * class.cs: Implemented Attributable abstract methods.
5957         (MethodCore.LabelParameters): Moved to Parameter class.
5958         (Accessor): Is back simple class.
5959         (PropertyMethod): Implemented Attributable abstract class.
5960         (DelegateMethod): Implemented Attributable abstract class.
5961         (Event): New constructor for disctintion between normal Event
5962         and Event with accessors.
5963
5964         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
5965
5966         * codegen.cs, const.cs, decl.cs, delegate.cs:
5967         (CommonAssemblyModulClass): Implemented Attributable abstract class
5968         and simplified.
5969
5970         * enum.cs: Implement IAttributeSupport interface.
5971         (EnumMember): New class for emum members. Implemented Attributable
5972         abstract class
5973
5974         * parameter.cs:
5975         (ParameterBase): Is abstract.
5976         (ReturnParameter): New class for easier [return:] attribute handling.
5977
5978         * typemanager.cs: Removed builder_to_attr.
5979
5980 2004-05-11  Raja R Harinath  <rharinath@novell.com>
5981
5982         Fix bug #57151.
5983         * attribute.cs (Attribute.GetPositionalValue): New function.
5984         * class.cs (TypeContainer.VerifyMembers): New function.
5985         (TypeContainer.Emit): Use it.
5986         (ClassOrStruct): New base class for Class and Struct.
5987         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
5988         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
5989         class.
5990         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
5991         then each non-static field should have a FieldOffset attribute.
5992         Otherwise, none of the fields should have a FieldOffset attribute.
5993         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
5994         and FieldOffset attributes.
5995         * typemanager.cs (TypeManager.struct_layout_attribute_type)
5996         (TypeManager.field_offset_attribute_type): New core types.
5997         (TypeManager.InitCoreTypes): Initialize them.
5998
5999 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6000
6001         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6002         Return correct type.
6003         From bug #58270.
6004
6005 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6006
6007         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6008         be implicitly converted to ulong.
6009         
6010         * expression.cs: The logic for allowing operator &, | and ^ worked
6011         was wrong, it worked before because we did not report an error in
6012         an else branch.  Fixes 57895.
6013
6014         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6015         allow volatile fields to be reference types.
6016
6017 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6018
6019         * driver.cs: Add support for /debug-
6020
6021 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6022
6023         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6024         Add a 'complain' parameter to silence errors.
6025         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6026         silently overlooked type-resolutions.
6027         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6028         to reflect changes.
6029         (Attributes.Search): New function.
6030         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6031         (Attributes.GetAttributeFullName): Remove hack.
6032         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6033         Update to reflect changes.
6034         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6035         Use Attributes.Search instead of nested loops.
6036
6037 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6038
6039         * decl.cs:
6040         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6041         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6042         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6043
6044         * report.cs: (Report.Warning): Renamed to Warning_T because of
6045         parameter collision.
6046
6047 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6048
6049         * expression.cs (MemberAccess.ResolveMemberAccess):
6050         Exit with non-zero status after Report.Error.
6051         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6052         Likewise.
6053         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6054
6055 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6056
6057         * support.cs: Don't hang when the file is empty.
6058
6059 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6060
6061         * support.cs: In SeekableStreamReader, compute the preamble size of the
6062           underlying stream. Position changes should take into account that initial
6063           count of bytes.
6064
6065 2004-05-03  Todd Berman  <tberman@sevenl.net>
6066
6067         * driver.cs: remove unused GetSysVersion function.
6068
6069 2004-05-03  Todd Berman  <tberman@sevenl.net>
6070
6071         * driver.cs: Remove the hack from saturday, as well as the hack
6072         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6073         link_paths to get that bit proper.
6074
6075 2004-05-01  Todd Berman  <tberman@sevenl.net>
6076
6077         * driver.cs: Try a LoadFrom before a Load, this checks the current
6078         path. This is currently a bug in mono that is be fixed, however, this
6079         provides a workaround for now. This will be removed when the bug
6080         is fixed.
6081
6082 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6083
6084         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6085         incomplete key pairs (#57941).
6086
6087 2004-05-01  Todd Berman  <tberman@sevenl.net>
6088
6089         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6090         from the GAC
6091
6092 2004-04-30  Jackson Harper  <jackson@ximian.com>
6093
6094         * codegen.cs: Open keys readonly.
6095         
6096 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6097
6098         * typemanager.cs: don't report cyclic struct layout when a struct
6099         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6100         which has 2 Pango.Rectangle fields.
6101
6102 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6103
6104         * expression.cs: Handle IntPtr comparisons with IL code
6105         rather than a method call.
6106
6107 2004-04-29  Martin Baulig  <martin@ximian.com>
6108
6109         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6110         the list of PropertyInfo's in class hierarchy and find the
6111         accessor.  Fixes #56013.
6112
6113 2004-04-29  Martin Baulig  <martin@ximian.com>
6114
6115         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6116
6117 2004-04-29  Martin Baulig  <martin@ximian.com>
6118
6119         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6120
6121         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6122
6123 2004-04-29  Martin Baulig  <martin@ximian.com>
6124
6125         * class.cs (ConstructorInitializer.Resolve): Check whether the
6126         parent .ctor is accessible.  Fixes #52146.
6127
6128 2004-04-29  Martin Baulig  <martin@ximian.com>
6129
6130         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6131
6132         * statement.cs (Using.EmitLocalVariableDecls): Use
6133         TypeManager.idisposable_type, not typeof (IDisposable).
6134         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6135
6136 2004-04-29  Martin Baulig  <martin@ximian.com>
6137
6138         * class.cs (Event.Define): Don't emit the field and don't set
6139         RTSpecialName and SpecialName for events on interfaces.  Fixes
6140         #57703. 
6141
6142 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6143
6144         Refactor Attribute.ApplyAttributes.
6145         * attribute.cs (Attributable): New base class for objects that can
6146         have Attributes applied on them.
6147         (Attribute): Make AttributeUsage fields public.
6148         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6149         (Attribute.IsInternalCall): New property.
6150         (Attribute.UsageAttr): Convert to a public read-only property.
6151         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6152         (Attribute.ResolveType, Attribute.Resolve)
6153         (Attribute.ScanForIndexerName): Update to reflect changes.
6154         (Attribute.CheckAttributeTarget): Re-format.
6155         (Attribute.ApplyAttributes): Refactor, to various
6156         Attributable.ApplyAttributeBuilder methods.
6157         * decl.cs (MemberCore): Make Attributable.
6158         * class.cs (Accessor): Make Attributable.
6159         (MethodData.ApplyAttributes): Use proper attribute types, not
6160         attribute names.
6161         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6162         (TypeContainer.ApplyAttributeBuilder)
6163         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6164         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6165         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6166         (Operator.ApplyAttributeBuilder): New factored-out methods.
6167         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6168         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6169         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6170         * parameter.cs (ParameterBase): New Attributable base class
6171         that can also represent Return types.
6172         (Parameter): Update to the changes.
6173
6174 2004-04-29  Jackson Harper  <jackson@ximian.com>
6175
6176         * driver.cs: Prefer the corlib system version when looking for
6177         assemblies in the GAC. This is still a hack, but its a better hack
6178         now.
6179         
6180 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6181
6182         * decl.cs, enum.cs: Improved error 3005 reporting.
6183   
6184         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6185         (related_symbols): New private member for list of symbols
6186         related to reported error/warning.
6187         
6188         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6189
6190 2004-04-29  Martin Baulig  <martin@ximian.com>
6191
6192         * ecore.cs (Expression.Constantify): If we're an enum and
6193         TypeManager.TypeToCoreType() doesn't give us another type, use
6194         t.UnderlyingSystemType.  Fixes #56178.  
6195
6196 2004-04-29  Martin Baulig  <martin@ximian.com>
6197
6198         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6199         interfaces and for each interface, only add members directly
6200         declared in that interface.  Fixes #53255.
6201
6202 2004-04-28  Martin Baulig  <martin@ximian.com>
6203
6204         * expression.cs (ConditionalLogicalOperator): Use a temporary
6205         variable for `left' to avoid that we evaluate it more than once;
6206         bug #52588.
6207
6208 2004-04-28  Martin Baulig  <martin@ximian.com>
6209
6210         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6211         `void[]' (CS1547).
6212
6213 2004-04-28  Martin Baulig  <martin@ximian.com>
6214
6215         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6216         void (CS1547).
6217
6218         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6219         whether the type is not void (CS1547).
6220
6221 2004-04-28  Martin Baulig  <martin@ximian.com>
6222
6223         * expression.cs (Unary.DoResolveLValue): Override this and report
6224         CS0131 for anything but Operator.Indirection.
6225
6226 2004-04-28  Martin Baulig  <martin@ximian.com>
6227
6228         Committing a patch from Ben Maurer; see bug #50820.
6229
6230         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6231         check for classes.
6232
6233         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6234         classes.        
6235
6236 2004-04-28  Martin Baulig  <martin@ximian.com>
6237
6238         Committing a patch from Ben Maurer; see bug #50820.
6239
6240         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6241         check for classes.
6242
6243         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6244         classes.        
6245
6246 2004-04-28  Martin Baulig  <martin@ximian.com>
6247
6248         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6249         (Block.AddLabel): Call DoLookupLabel() to only search in the
6250         current block.
6251
6252 2004-04-28  Martin Baulig  <martin@ximian.com>
6253
6254         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6255         comparing StringConstants and NullLiterals in Equality and Inequality.
6256
6257 2004-04-28  Jackson Harper  <jackson@ximian.com>
6258
6259         * driver.cs: Attempt to load referenced assemblies from the
6260         GAC. This is the quick and dirty version of this method that
6261         doesnt take into account versions and just takes the first
6262         canidate found. Will be good enough for now as we will not have more
6263         then one version installed into the GAC until I update this method.
6264
6265 2004-04-28  Martin Baulig  <martin@ximian.com>
6266
6267         * typemanager.cs (TypeManager.CheckStructCycles): New public
6268         static method to check for cycles in the struct layout.
6269
6270         * rootcontext.cs (RootContext.PopulateTypes): Call
6271         TypeManager.CheckStructCycles() for each TypeContainer.
6272         [Note: We only need to visit each type once.]
6273
6274 2004-04-28  Martin Baulig  <martin@ximian.com>
6275
6276         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6277
6278         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6279         success and added `out object value'.  Use a `bool resolved' field
6280         to check whether we've already been called rather than
6281         `ConstantValue != null' since this breaks for NullLiterals.
6282
6283 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6284
6285         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6286         setting of this flag, since the 'set' method may be non-public.
6287
6288 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6289
6290         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6291         check on current_vector.Block.
6292
6293 2004-04-27  Martin Baulig  <martin@ximian.com>
6294
6295         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6296         a field initializer.  Fixes #56459.
6297
6298 2004-04-27  Martin Baulig  <martin@ximian.com>
6299
6300         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6301         we're not attempting to use an indexer.  Fixes #52154.
6302
6303 2004-04-27  Martin Baulig  <martin@ximian.com>
6304
6305         * statement.cs (Return): Don't create a return label if we don't
6306         need it; reverts my change from January 20th.  Thanks to Ben
6307         Maurer for this.
6308
6309 2004-04-27  Martin Baulig  <martin@ximian.com>
6310
6311         According to the spec, `goto' can only leave a nested scope, but
6312         never enter it.
6313
6314         * statement.cs (Block.LookupLabel): Only lookup in the current
6315         block, don't recurse into parent or child blocks.
6316         (Block.AddLabel): Check in parent and child blocks, report
6317         CS0140/CS0158 if we find a duplicate.
6318         (Block): Removed this indexer for label lookups.
6319         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6320         this already does the error reporting for us.
6321
6322         * flowanalysis.cs
6323         (FlowBranching.UsageVector.Block): New public variable; may be null.
6324         (FlowBranching.CreateSibling): Added `Block' argument.
6325         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6326         label for the target of a `goto' and check whether we're not
6327         leaving a `finally'.
6328
6329 2004-04-27  Martin Baulig  <martin@ximian.com>
6330
6331         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6332         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6333         just for returns).
6334
6335 2004-04-27  Martin Baulig  <martin@ximian.com>
6336
6337         * statement.cs (Block.AddLabel): Also check for implicit blocks
6338         and added a CS0158 check.
6339
6340 2004-04-27  Martin Baulig  <martin@ximian.com>
6341
6342         * flowanalysis.cs (FlowBranchingLoop): New class.
6343         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6344         UsageVector's instead of an ArrayList.
6345         (FlowBranching.Label): Likewise.
6346         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6347         (FlowBranching.AddBreakVector): New method.
6348
6349 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6350
6351         * attribute.cs: Small regression fix: only convert the type if we
6352         the type is different, fixes System.Drawing build.
6353
6354 2004-04-27  Martin Baulig  <martin@ximian.com>
6355
6356         * attribute.cs (Attribute.Resolve): If we have a constant value
6357         for a named field or property, implicity convert it to the correct
6358         type.
6359
6360 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6361
6362         * statement.cs (Block.Block): Implicit blocks share
6363         'child_variable_names' fields with parent blocks.
6364         (Block.AddChildVariableNames): Remove.
6365         (Block.AddVariable): Mark variable as "used by a child block" in
6366         every surrounding block.
6367         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6368         been used in a child block, complain about violation of "Invariant
6369         meaning in blocks" rule.
6370         * cs-parser.jay (declare_local_variables): Don't use
6371         AddChildVariableNames.
6372         (foreach_statement): Don't create an implicit block: 'foreach'
6373         introduces a scope.
6374
6375 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6376
6377         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6378         converting from 0L to ulong.  Fixes 57522.
6379
6380 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6381
6382         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6383         derived class hides via 'new' keyword field from base class (test-242.cs).
6384         TODO: Handle this in the more general way.
6385         
6386         * class.cs (CheckBase): Ditto.
6387
6388 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6389
6390         * decl.cs (caching_flags): New member for storing cached values
6391         as bit flags.
6392         (MemberCore.Flags): New enum where bit flags for caching_flags
6393         are defined.
6394         (MemberCore.cls_compliance): Moved to caching_flags.
6395         (DeclSpace.Created): Moved to caching_flags.
6396
6397         * class.cs: Use caching_flags instead of DeclSpace.Created
6398         
6399 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6400
6401         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6402         if we are only a derived class, not a nested class.
6403
6404         * typemanager.cs: Same as above, but do this at the MemberLookup
6405         level (used by field and methods, properties are handled in
6406         PropertyExpr).   Allow for the qualified access if we are a nested
6407         method. 
6408
6409 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6410
6411         * class.cs: Refactoring.
6412         (IMethodData): New inteface; Holds links to parent members
6413         to avoid member duplication (reduced memory allocation).
6414         (Method): Implemented IMethodData interface.
6415         (PropertyBase): New inner classes for get/set methods.
6416         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6417         (Event): New inner classes for add/remove methods.
6418         (Event.DelegateMethod): Implemented IMethodData interface.
6419
6420         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6421         EmitContext (related to class.cs refactoring).
6422
6423 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6424
6425         * delegate.cs (Delegate.VerifyApplicability): If the number of
6426         arguments are the same as the number of parameters, first try to
6427         verify applicability ignoring  any 'params' modifier on the last
6428         parameter.
6429         Fixes #56442.
6430
6431 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6432
6433         * class.cs (TypeContainer.AddIndexer): Use
6434         'ExplicitInterfaceName' to determine if interface name was
6435         explicitly specified.  'InterfaceType' is not initialized at this time.
6436         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6437         Indexers array is already in the required order.  Initialize
6438         'IndexerName' only if there are normal indexers.
6439         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6440         (TypeContainer.Emit): Emit DefaultMember attribute only if
6441         IndexerName is initialized.
6442         Fixes #56300.
6443
6444 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6445
6446         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6447         Fixes #57007
6448
6449 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6450
6451         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6452         attributes.
6453         Fix for #56456.
6454
6455         * attribute.cs (Attribute.Resolve): Check for duplicate named
6456         attributes.
6457         Fix for #56463.
6458
6459 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6460
6461         * iterators.cs (MarkYield): track whether we are in an exception,
6462         and generate code accordingly.  Use a temporary value to store the
6463         result for our state.
6464
6465         I had ignored a bit the interaction of try/catch with iterators
6466         since their behavior was not entirely obvious, but now it is
6467         possible to verify that our behavior is the same as MS .NET 2.0
6468
6469         Fixes 54814
6470
6471 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6472
6473         * iterators.cs: Avoid creating temporaries if there is no work to
6474         do. 
6475
6476         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6477         Enumerations, use TypeManager.EnumToUnderlying and call
6478         recursively. 
6479
6480         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6481         bug #57013
6482
6483         (This.Emit): Use EmitContext.EmitThis to emit our
6484         instance variable.
6485
6486         (This.EmitAssign): Ditto.
6487
6488         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6489         codepaths, we will move all the functionality into
6490         Mono.CSharp.This 
6491
6492         (FieldExpr.EmitAssign): Ditto.
6493
6494         This fixes several hidden bugs that I uncovered while doing a code
6495         review of this today.
6496
6497         * codegen.cs (EmitThis): reworked so the semantics are more clear
6498         and also support value types "this" instances.
6499
6500         * iterators.cs: Changed so that for iterators in value types, we
6501         do not pass the value type as a parameter.  
6502
6503         Initialization of the enumerator helpers is now done in the caller
6504         instead of passing the parameters to the constructors and having
6505         the constructor set the fields.
6506
6507         The fields have now `assembly' visibility instead of private.
6508
6509 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6510
6511         * expression.cs (Argument.Resolve): Check if fields passed as ref
6512         or out are contained in a MarshalByRefObject.
6513
6514         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6515         another compiler type.
6516
6517 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6518
6519         * class.cs (Indexer.Define): use the new name checking method.
6520         Also, return false on an error.
6521         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6522         (is_identifier_[start/part]_character): make static.
6523
6524 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6525
6526         * expression.cs (Binary.ResolveOperator): Do no append strings
6527         twice: since we can be invoked more than once (array evaluation)
6528         on the same concatenation, take care of this here.  Based on a fix
6529         from Ben (bug #56454)
6530
6531 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6532
6533         * codegen.cs: Fix another case where CS1548 must be reported (when 
6534         delay-sign isn't specified and no private is available #56564). Fix
6535         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6536         error when MCS is used on the MS runtime and we need to delay-sign 
6537         (which seems unsupported by AssemblyBuilder - see #56621).
6538
6539 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6540
6541         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6542         (TypeManager.ComputeNamespaces): Faster implementation for
6543         Microsoft runtime.
6544
6545         * compiler.csproj: Updated AssemblyName to mcs.
6546
6547 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6548
6549         * rootcontext.cs: Add new types to the boot resolution.
6550
6551         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
6552         MulticastDelegate is not allowed.
6553
6554         * typemanager.cs: Add new types to lookup: System.TypedReference
6555         and ArgIterator.
6556
6557         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
6558         check for TypedReference or ArgIterator, they are not allowed. 
6559
6560         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
6561         makes us properly catch 1510 in some conditions (see bug 56016 for
6562         details). 
6563
6564 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
6565
6566         * CryptoConvert.cs: update from corlib version
6567         with endian fixes.
6568
6569 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
6570
6571         * class.cs (Indexer.Define): Check indexername declaration
6572
6573 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
6574
6575         * attribute.cs (IsClsCompliant): Fixed problem with handling
6576         all three states (compliant, not-compliant, undetected).
6577
6578 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
6579
6580         * attribute.cs (Attribute): Location is now public.
6581         (Resolve): Store resolved arguments (pos_values) in attribute class.
6582         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
6583         (GetClsCompliantAttributeValue): New method that gets
6584         CLSCompliantAttribute value.
6585         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
6586         if exists else null.
6587         (AttributeTester): New class for CLS-Compliant verification routines.
6588
6589         * class.cs (Emit): Add CLS-Compliant verification.
6590         (Method.GetSignatureForError): Implemented.
6591         (Constructor.GetSignatureForError): Implemented
6592         (Constructor.HasCompliantArgs): Returns if constructor has
6593         CLS-Compliant arguments.
6594         (Constructor.Emit): Override.
6595         (Construcor.IsIdentifierClsCompliant): New method; For constructors
6596         is needed to test only parameters.
6597         (FieldBase.GetSignatureForError): Implemented.
6598         (TypeContainer): New member for storing base interfaces.
6599         (TypeContainer.FindMembers): Search in base interfaces too.
6600
6601         * codegen.cs (GetClsComplianceAttribute): New method that gets
6602         assembly or module CLSCompliantAttribute value.
6603         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
6604         for assembly.
6605         (ModuleClass.Emit): Add error 3012 test.
6606
6607         * const.cs (Emit): Override and call base for CLS-Compliant tests.
6608
6609         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
6610         state for all decl types.
6611         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
6612         if CLS-Compliant tests are required.
6613         (IsClsCompliaceRequired): New method. Analyze whether code
6614         must be CLS-Compliant.
6615         (IsExposedFromAssembly): New method. Returns true when MemberCore
6616         is exposed from assembly.
6617         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
6618         value or gets cached value.
6619         (HasClsCompliantAttribute): New method. Returns true if MemberCore
6620         is explicitly marked with CLSCompliantAttribute.
6621         (IsIdentifierClsCompliant): New abstract method. This method is
6622         used to testing error 3005.
6623         (IsIdentifierAndParamClsCompliant): New method. Common helper method
6624         for identifier and parameters CLS-Compliant testing.
6625         (VerifyClsCompliance): New method. The main virtual method for
6626         CLS-Compliant verifications.
6627         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
6628         null. I don't know why is null (too many public members !).
6629         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
6630         and get value of first CLSCompliantAttribute that found.
6631
6632         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
6633         (VerifyClsCompliance): Override and add extra tests.
6634
6635         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
6636         clscheck- disable CLS-Compliant verification event if assembly is has
6637         CLSCompliantAttribute(true).
6638
6639         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
6640         ApllyAttribute is now called in emit section as in the other cases.
6641         Possible future Emit integration.
6642         (IsIdentifierClsCompliant): New override.
6643         (VerifyClsCompliance): New override.
6644         (GetEnumeratorName): Returns full enum name.
6645
6646         * parameter.cs (GetSignatureForError): Implemented.
6647
6648         * report.cs (WarningData): New struct for Warning message information.
6649         (LocationOfPreviousError): New method.
6650         (Warning): New method. Reports warning based on the warning table.
6651         (Error_T): New method. Reports error based on the error table.
6652
6653         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
6654         verifications are done here.
6655
6656         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
6657
6658         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
6659         CLSCompliantAttribute.
6660         (all_imported_types): New member holds all imported types from other
6661         assemblies.
6662         (LoadAllImportedTypes): New method fills static table with exported types
6663         from all referenced assemblies.
6664         (Modules): New property returns all assembly modules.
6665
6666 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
6667
6668         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
6669         throwing a parser error.
6670
6671         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
6672         which removes the hardcoded get_/set_ prefixes for properties, as
6673         IL allows for the properties to be named something else.  
6674
6675         Bug #56013
6676
6677         * expression.cs: Do not override operand before we know if it is
6678         non-null.  Fix 56207
6679
6680 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6681
6682         * typemanager.cs: support for pinned variables.
6683
6684 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6685
6686         * decl.cs, typemanager.cs: Avoid using an arraylist
6687         as a buffer if there is only one result set.
6688
6689 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6690
6691         * expression.cs: Make sure you cant call a static method
6692         with an instance expression, bug #56174.
6693
6694 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
6695
6696         * class.cs (IsDuplicateImplementation): Improve error reporting to
6697         flag 663 (method only differs in parameter modifier).
6698
6699         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
6700         in preprocessor directives.
6701
6702         * location.cs (LookupFile): Allow for the empty path.
6703
6704         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
6705         better approach for some of that patch, but its failing with the
6706         CharSet enumeration.  For now try/catch will do.
6707
6708         * typemanager.cs: Do not crash if a struct does not have fields.
6709         Fixes 56150.
6710
6711 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6712
6713         * expression.cs: cs0213, cant fix a fixed expression.
6714         fixes 50231.
6715
6716 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6717
6718         * cs-parser.jay: detect invalid embeded statements gracefully.
6719         bug #51113.
6720
6721 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6722
6723         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
6724         As a regex:
6725         s/
6726         the invocation type may not be a subclass of the tye of the item/
6727         The type of the item must be a subclass of the invocation item.
6728         /g
6729
6730         Fixes bug #50820.
6731
6732 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
6733
6734         * attribute.cs: Added methods to get a string and a bool from an
6735         attribute. Required to information from AssemblyKeyFileAttribute,
6736         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
6737         * codegen.cs: Modified AssemblyName creation to include support for
6738         strongnames. Catch additional exceptions to report them as CS1548.
6739         * compiler.csproj: Updated include CryptoConvert.cs.
6740         * compiler.csproj.user: Removed file - user specific configuration.
6741         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
6742         Mono.Security assembly. The original class is maintained and tested in
6743         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
6744         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
6745         like CSC 8.0 (C# v2) supports.
6746         * Makefile: Added CryptoConvert.cs to mcs sources.
6747         * rootcontext.cs: Added new options for strongnames.
6748
6749 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
6750
6751         * driver.cs: For --expect-error, report error code `2'
6752         if the program compiled with no errors, error code `1' if
6753         it compiled with an error other than the one expected.
6754
6755 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
6756
6757         * compiler.csproj: Updated for Visual Studio .NET 2003.
6758         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
6759         * compiler.sln: Updated for Visual Studio .NET 2003.
6760
6761 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
6762
6763         * expression.cs: Fix bug #47234. We basically need to apply the
6764         rule that we prefer the conversion of null to a reference type
6765         when faced with a conversion to 'object' (csc behaviour).
6766
6767 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6768
6769         * statement.cs: Shorter form for foreach, eliminates
6770         a local variable. r=Martin.
6771
6772 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6773
6774         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
6775         checks if we can use brtrue/brfalse to test for 0.
6776         * expression.cs: use the above in the test for using brtrue/brfalse.
6777         cleanup code a bit.
6778
6779 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6780
6781         * expression.cs: Rewrite string concat stuff. Benefits:
6782
6783         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
6784         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
6785         rather than a concat chain.
6786
6787         * typemanager.cs: Add lookups for more concat overloads.
6788
6789 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6790
6791         * expression.cs: Emit shorter il code for array init.
6792
6793         newarr
6794         dup
6795         // set 1
6796
6797         // set 2
6798
6799         newarr
6800         stloc.x
6801
6802         ldloc.x
6803         // set 1
6804
6805         ldloc.x
6806         // set 2
6807
6808 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
6809
6810         * statement.cs: Before, two switch blocks would be merged if the
6811         total size of the blocks (end_item - begin_item + 1) was less than
6812         two times the combined sizes of the blocks.
6813
6814         Now, it will only merge if after the merge at least half of the
6815         slots are filled.
6816
6817         fixes 55885.
6818
6819 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
6820
6821         * class.cs : csc build fix for GetMethods(). See bug #52503.
6822
6823 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
6824
6825         * expression.cs: Make sure fp comparisons work with NaN.
6826         This fixes bug #54303. Mig approved this patch a long
6827         time ago, but we were not able to test b/c the runtime
6828         had a related bug.
6829
6830 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
6831
6832         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
6833
6834 2004-03-19  Martin Baulig  <martin@ximian.com>
6835
6836         * class.cs (MemberCore.IsDuplicateImplementation): Report the
6837         error here and not in our caller.
6838
6839 2004-03-19  Martin Baulig  <martin@ximian.com>
6840
6841         * interface.cs: Completely killed this file.
6842         (Interface): We're now a TypeContainer and live in class.cs.
6843
6844         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
6845         argument; we're now also called for interfaces.
6846         (TypeContainer.DefineMembers): Allow this method being called
6847         multiple times.
6848         (TypeContainer.GetMethods): New public method; formerly known as
6849         Interface.GetMethod().  This is used by PendingImplementation.
6850         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
6851         it's now private and non-static.
6852         (Interface): Moved this here; it's now implemented similar to
6853         Class and Struct.
6854         (Method, Property, Event, Indexer): Added `bool is_interface'
6855         argument to their .ctor's.
6856         (MemberBase.IsInterface): New public field.
6857
6858         * cs-parser.jay: Create normal Method, Property, Event, Indexer
6859         instances instead of InterfaceMethod, InterfaceProperty, etc.
6860         (opt_interface_base): Removed; we now use `opt_class_base' instead.
6861         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
6862
6863 2004-03-19  Martin Baulig  <martin@ximian.com>
6864
6865         * class.cs (MethodCore.IsDuplicateImplementation): New private
6866         method which does the CS0111 checking.
6867         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
6868         Use IsDuplicateImplementation().
6869
6870 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
6871
6872         * decl.cs (FindMemberToOverride): New method to find the correct
6873         method or property to override in the base class.
6874         * class.cs
6875             - Make Method/Property use the above method to find the
6876               version in the base class.
6877             - Remove the InheritableMemberSignatureCompare as it is now
6878               dead code.
6879
6880         This patch makes large code bases much faster to compile, as it is
6881         O(n) rather than O(n^2) to do this validation.
6882
6883         Also, it fixes bug 52458 which is that nested classes are not
6884         taken into account when finding the base class member.
6885
6886         Reviewed/Approved by Martin.
6887
6888 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
6889
6890         * interface.cs: In all interface classes removed redundant
6891         member initialization.
6892
6893 2004-03-16  Martin Baulig  <martin@ximian.com>
6894
6895         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
6896
6897 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
6898
6899         * decl.cs (DefineTypeAndParents): New helper method to define a
6900         type's containers before the type itself is defined;  This is a
6901         bug exposed by the recent changes to Windows.Forms when an
6902         implemented interface was defined inside a class that had not been
6903         built yet.   
6904
6905         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
6906
6907         (Check): Loop correctly to report errors modifiers
6908         (UNSAFE was not in the loop, since it was the same as TOP).
6909
6910         * interface.cs: Every interface member now takes a ModFlags,
6911         instead of a "is_new" bool, which we set on the base MemberCore. 
6912
6913         Every place where we called "UnsafeOk" in the interface, now we
6914         call the proper member (InterfaceMethod.UnsafeOK) instead to get
6915         the unsafe settings from the member declaration instead of the
6916         container interface. 
6917
6918         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
6919
6920         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
6921         `set_indexer_name' to the pending bits (one per type).
6922
6923         We fixed a bug today that was picking the wrong method to
6924         override, since for properties the existing InterfaceMethod code
6925         basically ignored the method name.  Now we make sure that the
6926         method name is one of the valid indexer names.
6927
6928 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
6929  
6930         * support.cs (SeekableStreamReader): Keep track of stream byte
6931         positions and don't mix them with character offsets to the buffer.
6932
6933         Patch from Gustavo Giráldez
6934
6935 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
6936
6937         * interface.cs (InterfaceSetGetBase): Removed double member
6938         initialization, base class does it as well.
6939
6940 2004-03-13  Martin Baulig  <martin@ximian.com>
6941
6942         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
6943         when compiling corlib.
6944
6945 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
6946
6947         * convert.cs (ExplicitConversion): We were reporting an error on
6948         certain conversions (object_type source to a value type, when the
6949         expression was `null') before we had a chance to pass it through
6950         the user defined conversions.
6951
6952         * driver.cs: Replace / and \ in resource specifications to dots.
6953         Fixes 50752
6954
6955         * class.cs: Add check for duplicate operators.  Fixes 52477
6956
6957 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
6958
6959         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
6960         that are in the middle of the statements, not only at the end.
6961         Fixes #54987
6962
6963         * class.cs (TypeContainer.AddField): No longer set the
6964         `HaveStaticConstructor' flag, now we call it
6965         `UserDefineStaticConstructor' to diferentiate the slightly
6966         semantic difference.
6967
6968         The situation is that we were not adding BeforeFieldInit (from
6969         Modifiers.TypeAttr) to classes that could have it.
6970         BeforeFieldInit should be set to classes that have no static
6971         constructor. 
6972
6973         See:
6974
6975         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
6976
6977         And most importantly Zoltan's comment:
6978
6979         http://bugzilla.ximian.com/show_bug.cgi?id=44229
6980
6981         "I think beforefieldinit means 'it's ok to initialize the type sometime 
6982          before its static fields are used', i.e. initialization does not need
6983          to be triggered by the first access to the type. Setting this flag
6984          helps the JIT to compile better code, since it can run the static
6985          constructor at JIT time, and does not need to generate code to call it
6986          (possibly lots of times) at runtime. Unfortunately, mcs does not set
6987          this flag for lots of classes like String. 
6988          
6989          csc sets this flag if the type does not have an explicit static 
6990          constructor. The reasoning seems to be that if there are only static
6991          initalizers for a type, and no static constructor, then the programmer
6992          does not care when this initialization happens, so beforefieldinit
6993          can be used.
6994          
6995          This bug prevents the AOT compiler from being usable, since it 
6996          generates so many calls to mono_runtime_class_init that the AOT code
6997          is much slower than the JITted code. The JITted code is faster, 
6998          because it does not generate these calls if the vtable is type is
6999          already initialized, which is true in the majority of cases. But the
7000          AOT compiler can't do this."
7001
7002 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7003
7004         * class.cs (MethodData.Emit): Refactor the code so symbolic
7005         information is generated for destructors;  For some reasons we
7006         were taking a code path that did not generate symbolic information
7007         before. 
7008
7009 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7010
7011         * class.cs: Create a Constructor.CheckBase method that
7012         takes care of all validation type code. The method
7013         contains some code that was moved from Define.
7014
7015         It also includes new code that checks for duplicate ctors.
7016         This fixes bug #55148.
7017
7018 2004-03-09  Joshua Tauberer <tauberer@for.net>
7019
7020         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7021         a { ... }-style array creation invokes EmitStaticInitializers
7022         which is not good for reference-type arrays.  String, decimal
7023         and now null constants (NullCast) are not counted toward
7024         static initializers.
7025
7026 2004-03-05  Martin Baulig  <martin@ximian.com>
7027
7028         * location.cs (SourceFile.HasLineDirective): New public field;
7029         specifies whether the file contains or is referenced by a "#line"
7030         directive.
7031         (Location.DefineSymbolDocuments): Ignore source files which
7032         either contain or are referenced by a "#line" directive.        
7033
7034 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7035
7036         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7037         direct access to our parent, so check the method inline there.
7038
7039 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7040
7041         * expression.cs (Invocation.EmitCall): Miguel's last commit
7042         caused a regression. If you had:
7043
7044             T t = null;
7045             t.Foo ();
7046
7047         In Foo the implict this would be null.
7048
7049 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7050
7051         * expression.cs (Invocation.EmitCall): If the method is not
7052         virtual, do not emit a CallVirt to it, use Call.
7053
7054         * typemanager.cs (GetFullNameSignature): Improve the method to
7055         cope with ".ctor" and replace it with the type name.
7056
7057         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7058         as an argument the ConstructorBuilder where it is being defined,
7059         to catch the recursive constructor invocations.
7060
7061 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7062
7063         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7064         routines to check if a type is an enumerable/enumerator allow
7065         classes that implement the IEnumerable or IEnumerator interfaces.
7066
7067         * class.cs (Property, Operator): Implement IIteratorContainer, and
7068         implement SetYields.
7069
7070         (Property.Define): Do the block swapping for get_methods in the
7071         context of iterators.   We need to check if Properties also
7072         include indexers or not.
7073
7074         (Operator): Assign the Block before invoking the
7075         OperatorMethod.Define, so we can trigger the Iterator code
7076         replacement. 
7077
7078         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7079         Property and Operator classes are not created when we parse the
7080         declarator but until we have the block completed, so we use a
7081         singleton SimpleIteratorContainer.Simple to flag whether the
7082         SetYields has been invoked.
7083
7084         We propagate this setting then to the Property or the Operator to
7085         allow the `yield' to function.
7086
7087 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7088
7089         * codegen.cs: Implemented attribute support for modules.
7090         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7091         Assembly/Module functionality.
7092
7093         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7094         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7095         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7096
7097 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7098
7099         * interface.cs (FindMembers): The operation is performed on all base
7100         interfaces and not only on the first. It is required for future CLS Compliance patch.
7101
7102 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7103
7104         * statement.cs, codegen.cs:
7105         This patch deals with patterns such as:
7106
7107         public class List : IEnumerable {
7108
7109                 public MyEnumerator GetEnumerator () {
7110                         return new MyEnumerator(this);
7111                 }
7112
7113                 IEnumerator IEnumerable.GetEnumerator () {
7114                         ...
7115                 }
7116                 
7117                 public struct MyEnumerator : IEnumerator {
7118                         ...
7119                 }
7120         }
7121
7122         Before, there were a few things we did wrong:
7123         1) we would emit callvirt on a struct, which is illegal
7124         2) we emited ldarg when we needed to emit ldarga
7125         3) we would mistakenly call the interface methods on an enumerator
7126         type that derived from IEnumerator and was in another assembly. For example:
7127
7128         public class MyEnumerator : IEnumerator
7129
7130         Would have the interface methods called, even if there were public impls of the
7131         method. In a struct, this lead to invalid IL code.
7132
7133 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7134
7135         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7136           renamed to Emit.
7137
7138         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7139
7140 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7141
7142         * cs-parser.jay: Fix small regression: we were not testing V2
7143         compiler features correctly.
7144
7145         * interface.cs: If the emit context is null, then create one
7146
7147 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7148
7149         * decl.cs (GetSignatureForError): New virtual method to get full name
7150           for error messages.
7151
7152         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7153           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7154
7155         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7156           Duplicated members and code in these classes has been removed.
7157           Better encapsulation in these classes.
7158
7159 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7160
7161         * assign.cs (Assign.DoResolve): When dealing with compound
7162         assignments, there is a new rule in ECMA C# 2.4 (might have been
7163         there before, but it is documented here) that states that in:
7164
7165         a op= b;
7166
7167         If b is of type int, and the `op' is a shift-operator, then the
7168         above is evaluated as:
7169
7170         a = (int) a op b 
7171
7172         * expression.cs (Binary.ResolveOperator): Instead of testing for
7173         int/uint/long/ulong, try to implicitly convert to any of those
7174         types and use that in pointer arithmetic.
7175
7176         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7177         method to print information for from the type, not from the
7178         null-method we were given.
7179
7180 2004-02-01  Duncan Mak  <duncan@ximian.com>
7181
7182         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7183         parsing for cmd, fixes bug #53694.
7184
7185 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7186
7187         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7188         in the member name duplication tests. Property and operator name duplication
7189         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7190
7191 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7192
7193         * interface.cs (PopulateMethod): Fixed crash when interface method
7194         returns not existing type (error test cs0246-3.cs).
7195
7196 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7197
7198         * cs-parser.jay (interface_accessors): Re-write actions to also
7199         store attributes attached to get and set methods. Fix spelling
7200         while at it.
7201
7202         (inteface_property_declaration): Modify accordingly.
7203
7204         (InterfaceAccessorInfo): New helper class to store information to pass
7205         around between rules that use interface_accessors.
7206
7207         * interface.cs (Emit): Apply attributes on the get and set
7208         accessors of properties and indexers too.
7209
7210         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7211         right MethodBuilder when applying attributes to the get and set accessors.
7212
7213 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7214
7215         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7216
7217 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7218
7219         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7220
7221 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7222
7223         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7224         changes that treat `yield' specially when present before `break'
7225         or `return' tokens.
7226
7227         * cs-tokenizer.cs: yield is no longer a keyword.
7228
7229 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7230
7231         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7232         setting for default constructors.
7233         For default constructors are almost every time set wrong Modifier. The
7234         generated IL code has been alright. But inside mcs this values was
7235         wrong and this was reason why several of my CLS Compliance tests
7236         failed.
7237
7238 2004-01-22  Martin Baulig  <martin@ximian.com>
7239
7240         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7241         not a QualifiedIdentifier.  This is what `type_name_expression'
7242         was previously doing.
7243         (type_name_expression): Removed; the code is now in
7244         `namespace_or_type_name'.
7245         (qualified_identifier): Removed, use `namespace_or_type_name'
7246         instead.
7247         (QualifiedIdentifier): Removed this class.      
7248
7249 2004-01-22  Martin Baulig  <martin@ximian.com>
7250
7251         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7252         not a string as alias name.
7253
7254 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7255
7256         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7257         #52730 bug, and instead compute correctly the need to use a
7258         temporary variable when requesting an address based on the
7259         static/instace modified of the field and the constructor.
7260  
7261 2004-01-21  Martin Baulig  <martin@ximian.com>
7262
7263         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7264         class and namespace before looking up aliases.  Fixes #52517.
7265
7266 2004-01-21  Martin Baulig  <martin@ximian.com>
7267
7268         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7269         assinged in a 'try'; fixes exception4.cs.
7270
7271 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7272         * class.cs : Implemented parameter-less constructor for TypeContainer
7273
7274         * decl.cs: Attributes are now stored here. New property OptAttributes
7275
7276         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7277
7278         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7279
7280 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7281
7282         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7283           (CSharpSignature): New method for indexer and property signature.
7284
7285 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7286
7287         * pending.cs (IsVirtualFilter): Faster implementation.
7288
7289 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7290
7291         * typemanager.cs: Avoid inclusion of same assembly more than once.
7292
7293 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7294
7295         * cs-parser.jay: Fixed problem where the last assembly attribute
7296           has been applied also to following declaration (class, struct, etc.)
7297           
7298 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7299
7300         * class.cs: Added error CS0538, CS0539 reporting.
7301         Fixed crash on Microsoft runtime when field type is void.
7302
7303         * cs-parser.jay: Added error CS0537 reporting.
7304
7305         * pending.cs: Added error CS0535 reporting.
7306         Improved error report for errors CS0536, CS0534.
7307
7308 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7309
7310         Merge a few bits from the Anonymous Method MCS tree.
7311
7312         * statement.cs (ToplevelBlock): New class for toplevel methods,
7313         will hold anonymous methods, lifted variables.
7314
7315         * cs-parser.jay: Create toplevel blocks for delegates and for
7316         regular blocks of code. 
7317
7318 2004-01-20  Martin Baulig  <martin@ximian.com>
7319
7320         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7321         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7322         and `NeedExplicitReturn'; added `IsLastStatement'.
7323         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7324         have a `ReturnLabel' or we're not unreachable.
7325
7326         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7327         child's reachability; don't just override ours with it.  Fixes
7328         #58058 (lluis's example).
7329         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7330         InFinally(), InLoop(), InSwitch() and
7331         BreakCrossesTryCatchBoundary() methods.
7332
7333         * statement.cs (Return): Do all error checking in Resolve().
7334         Unless we are the last statement in a top-level block, always
7335         create a return label and jump to it.
7336         (Break, Continue): Do all error checking in Resolve(); also make
7337         sure we aren't leaving a `finally'.
7338         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7339         statement in a top-level block.
7340         (Block.Flags): Added `IsDestructor'.
7341         (Block.IsDestructor): New public property.
7342
7343 2004-01-20  Martin Baulig  <martin@ximian.com>
7344
7345         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7346
7347 2004-01-20  Martin Baulig  <martin@ximian.com>
7348
7349         * statement.cs (Statement.ResolveUnreachable): New public method.
7350         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7351         (Block.Resolve): Resolve unreachable statements.
7352
7353 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7354
7355         * expression.cs: We need to fix the case where we do
7356         not have a temp variable here.
7357
7358         * assign.cs: Only expression compound assignments need
7359         temporary variables.
7360
7361 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7362
7363         * flowanalysis.cs: Reduce memory allocation in a few ways:
7364           - A block with no variables should not allocate a bit
7365             vector for itself.
7366           - A method with no out parameters does not need any tracking
7367             for assignment of the parameters, so we need not allocate
7368             any data for it.
7369           - The arrays:
7370                 public readonly Type[] VariableTypes;
7371                 public readonly string[] VariableNames;
7372             Are redundant. The data is already stored in the variable
7373             map, so we need not allocate another array for it.
7374           - We need to add alot of checks for if (params | locals) == null
7375             due to the first two changes.
7376
7377 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7378
7379         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7380         implement IMemoryLocation, we store a copy on a local variable and
7381         take the address of it.  Patch from Benjamin Jemlich
7382
7383         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7384         to use a special "type_name_expression" rule which reduces the
7385         number of "QualifiedIdentifier" classes created, and instead
7386         directly creates MemberAccess expressions.
7387
7388 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7389
7390         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7391         that fixes #52853.  Null literal assignment to ValueType
7392
7393         * class.cs (MethodData.Emit): Instead of checking the name of the
7394         method to determine if its a destructor, create a new derived
7395         class from Method called Destructor, and test for that.  
7396
7397         * cs-parser.jay: Create a Destructor object instead of a Method.  
7398
7399         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7400
7401         Fixes: 52933
7402
7403 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7404
7405         * expression.cs (Binary.ResolveOperator): Perform an implicit
7406         conversion from MethodGroups to their delegate types on the
7407         Addition operation.
7408
7409         * delegate.cs: Introduce a new class DelegateCreation that is the
7410         base class for `NewDelegate' and `ImplicitDelegateCreation',
7411         factor some code in here.
7412
7413         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7414         conversion from MethodGroups to compatible delegate types. 
7415
7416         * ecore.cs (Expression.Resolve): Do not flag error 654
7417         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7418         we allow conversions from MethodGroups to delegate types now.
7419
7420         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7421         assignments in v2 either.
7422
7423 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7424
7425         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7426         static read-only fields in ctors.
7427
7428         Applied patch from Benjamin Jemlich 
7429
7430         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7431
7432 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7433
7434         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7435         here to return true, as they can be used like this:
7436
7437                 (XXX) int.MEMBER ()
7438
7439         Fixed 49836 and all the other dups
7440
7441 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7442
7443         * driver.cs: Implement /win32res and /win32icon.
7444
7445 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7446
7447         * cs-parser.jay: Add a rule to improve error handling for the
7448         common mistake of placing modifiers after the type.
7449
7450 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7451
7452         * cs-parser.jay (interface_event_declaration): Catch
7453         initialization of events on interfaces, and report cs0068
7454
7455         * cs-parser.jay (interface_event_declaration): Catch
7456         initialization of events. 
7457
7458         * ecore.cs: Better report missing constructors.
7459
7460         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7461         the error reporting done in the wrong place.  Fix.
7462
7463         * expression.cs (Binary.ResolveOperator): Catch the 
7464         operator + (E x, E y) error earlier, and later allow for implicit
7465         conversions in operator +/- (E e, U x) from U to the underlying
7466         type of E.
7467
7468         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7469         52596, if the container class is abstract, the default constructor
7470         is protected otherwise its public (before, we were always public).
7471
7472         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7473         fixed statement.
7474
7475         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7476         Jemlich that fixes bug #52597, MCS was generating invalid code for
7477         idisposable structs.   Thanks to Ben for following up with this
7478         bug as well.
7479
7480 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7481
7482         * driver.cs: Allow assemblies without code to be generated, fixes
7483         52230.
7484
7485 2004-01-07  Nick Drochak <ndrochak@gol.com>
7486
7487         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7488
7489 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7490
7491         * cs-parser.jay: Add rules to improve error reporting if fields or
7492         methods are declared at the namespace level (error 116)
7493
7494         * Add rules to catch event add/remove
7495
7496 2004-01-04  David Sheldon <dave-mono@earth.li>
7497
7498   * expression.cs: Added matching ")" to error message for 
7499   CS0077
7500
7501 2004-01-03 Todd Berman <tberman@gentoo.org>
7502
7503         * ecore.cs, attribute.cs:
7504         Applying fix from #52429.
7505
7506 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7507
7508         * ecore.cs, expression.cs, statement.cs:
7509         Total rewrite of how we handle branching. We
7510         now handle complex boolean expressions with fewer
7511         jumps. As well if (x == 0) no longer emits a ceq.
7512
7513         if (x is Foo) is much faster now, because we generate
7514         better code.
7515
7516         Overall, we get a pretty big improvement on our benchmark
7517         tests. The code we generate is smaller and more readable.
7518
7519         I did a full two-stage bootstrap. The patch was reviewed
7520         by Martin and Miguel.
7521
7522 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7523
7524         * cs-parser.jay: Make primary_expression not take a QI.
7525         we dont need this because the member_access rule covers
7526         us here. So we replace the rule with just IDENTIFIER.
7527
7528         This has two good effects. First, we remove a s/r conflict.
7529         Second, we allocate many fewer QualifiedIdentifier objects.
7530
7531 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7532
7533         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7534         set the correct information via SRE. This prevents
7535         hanging on the MS runtime. Fixes #29374.
7536
7537 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7538
7539         * convert.cs: correctly handle conversions to value types
7540         from Enum and ValueType as unboxing conversions.
7541
7542         Fixes bug #52569. Patch by Benjamin Jemlich.
7543
7544 2004-01-02  Ravi Pratap  <ravi@ximian.com>
7545
7546         * expression.cs (BetterConversion): Prefer int -> uint
7547         over int -> ulong (csc's behaviour). This fixed bug #52046.
7548
7549 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7550
7551         * decl.cs (MemberCache.FindMembers): now returns a
7552         MemberInfo [].
7553
7554         * typemanager.cs: In general, go with with ^^.
7555         (CopyNewMethods): take an IList.
7556         (RealMemberLookup): Only allocate an arraylist
7557         if we copy from two sets of methods.
7558
7559         This change basically does two things:
7560         1) Fewer array lists allocated due to CopyNewMethods.
7561         2) the explicit cast in MemberList costed ALOT.
7562
7563 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
7564
7565         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
7566         a hashtable to avoid needless string allocations when an identifier is
7567         used more than once (the common case).
7568
7569 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7570
7571         * pending.cs: MS's TypeBuilder.GetInterfaces ()
7572         is broken, it will not return anything. So, we
7573         have to use the information we have in mcs to
7574         do the task.
7575
7576         * typemanager.cs: Add a cache for GetInterfaces,
7577         since this will now be used more often (due to ^^)
7578
7579         (GetExplicitInterfaces) New method that gets the
7580         declared, not effective, interfaces on a type
7581         builder (eg, if you have interface IFoo, interface
7582         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
7583         { IBar }.
7584
7585         This patch makes MCS able to bootstrap itself on
7586         Windows again.
7587
7588 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7589
7590         * expression.cs: Remove the Nop's that Miguel put
7591         in by mistake.
7592
7593 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7594
7595         * report.cs, codegen.cs: Give the real stack trace to
7596         the error when an exception is thrown.
7597
7598 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7599
7600         * decl.cs: only allocate hashtables for ifaces if 
7601         it is an iface!
7602
7603 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7604
7605         * expression.cs: fix the error from cs0121-2.cs
7606         (a parent interface has two child interfaces that
7607         have a function with the same name and 0 params
7608         and the function is called through the parent).
7609
7610 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7611
7612         * class.cs, rootcontext.cs, typmanager.cs: do not
7613         leak pointers.
7614
7615 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7616
7617         * codegen.cs: remove stack for the ec flow branching.
7618         It is already a linked list, so no need.
7619
7620 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7621
7622         * Makefile: Allow custom profiler here.
7623
7624 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7625
7626         * typemanager.cs (LookupType):
7627           - Use a static char [], because split takes
7628             a param array for args, so it was allocating
7629             every time.
7630           - Do not store true in a hashtable, it boxes.
7631
7632 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7633
7634         * flowanalysis.cs: bytify common enums.
7635
7636 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7637
7638         * modifiers.cs: Add a new set of flags for the
7639         flags allowed on explicit interface impls.
7640         * cs-parser.jay: catch the use of modifiers in
7641         interfaces correctly.
7642         * class.cs: catch private void IFoo.Blah ().
7643
7644         All related to bug #50572.
7645
7646 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7647
7648         * decl.cs: Rewrite the consistant accessability checking.
7649         Accessability is not linear, it must be implemented in
7650         a tableish way. Fixes #49704.
7651
7652 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7653
7654         * expression.cs: Handle negation in a checked context.
7655         We must use subtraction from zero. Fixes #38674.
7656
7657 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7658
7659         * class.cs: Ignore static void main in DLLs.
7660         * rootcontext.cs: Handle the target type here,
7661         since we are have to access it from class.cs
7662         * driver.cs: account for the above.
7663
7664 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7665
7666         * report.cs: Give line numbers and files if available.
7667
7668 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
7669
7670         * driver.cs: Implement /addmodule.
7671
7672         * typemanager.cs:  Change 'modules' field so it now contains Modules not
7673         ModuleBuilders.
7674
7675 2003-12-20  Martin Baulig  <martin@ximian.com>
7676
7677         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
7678         (FieldBase.IsAssigned): Removed this field.
7679         (FieldBase.SetAssigned): New public method.
7680         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
7681
7682 2003-12-20  Martin Baulig  <martin@ximian.com>
7683
7684         * expression.cs (LocalVariableReference.DoResolve): Don't set
7685         `vi.Used' if we're called from DoResolveLValue().
7686
7687         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
7688         returns the usage vector it just merged into the current one -
7689         pass this one to UsageWarning().
7690         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
7691         of the `EmitContext', don't call this recursively on our children.
7692
7693 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
7694
7695         * driver.cs: Implement /target:module.
7696
7697 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
7698
7699         * support.cs (CharArrayHashtable): New helper class.
7700
7701         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
7702         char arrays, not strings, so we can avoid creating a string in
7703         consume_identifier if the identifier is a keyword.
7704
7705 2003-12-16  Martin Baulig  <martin@ximian.com>
7706
7707         * statement.cs (LocalInfo.Assigned): Removed this property.
7708         (LocalInfo.Flags): Removed `Assigned'.
7709         (LocalInfo.IsAssigned): New public method; takes the EmitContext
7710         and uses flow analysis.
7711         (Block.UsageWarning): Made this method private.
7712         (Block.Resolve): Call UsageWarning() if appropriate.
7713
7714         * expression.cs (LocalVariableReference.DoResolve): Always set
7715         LocalInfo.Used here.
7716
7717 2003-12-13  Martin Baulig  <martin@ximian.com>
7718
7719         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
7720         any value here; we're now using flow analysis to figure out
7721         whether a statement/block returns a value.
7722
7723 2003-12-13  Martin Baulig  <martin@ximian.com>
7724
7725         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
7726         working again.
7727         (FlowBranching.MergeFinally): Don't call
7728         `branching.CheckOutParameters()' here, this is called in
7729         MergeTopBlock().
7730         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
7731         when adding the `finally' vector.       
7732
7733 2003-12-13  Martin Baulig  <martin@ximian.com>
7734
7735         * flowanalysis.cs
7736         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
7737         actually work and also fix #48962.
7738
7739 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7740
7741         * decl.cs: Do not check System.Object for nested types,
7742         since we know it does not have any. Big bang for buck:
7743
7744         BEFORE:
7745            Run 1:   8.35 seconds
7746            Run 2:   8.32 seconds
7747            corlib:  17.99 seconds
7748         AFTER:
7749            Run 1:   8.17 seconds
7750            Run 2:   8.17 seconds
7751            corlib:  17.39 seconds
7752
7753 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7754
7755         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
7756         time we are returning 0 members, so we save alot here.
7757
7758 2003-12-11  Martin Baulig  <martin@ximian.com>
7759
7760         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
7761         `MergeChild()', also just take the `FlowBranching' as argument;
7762         call Merge() on it and return the result.
7763         (FlowBranching.Merge): We don't need to do anything if we just
7764         have one sibling.
7765
7766 2003-12-11  Martin Baulig  <martin@ximian.com>
7767
7768         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
7769         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
7770         Maurer for this idea.
7771
7772 2003-12-11  Martin Baulig  <martin@ximian.com>
7773
7774         * flowanalysis.cs (MergeResult): This class is now gone; we now
7775         use the `UsageVector' for this.  The reason for this is that if a
7776         branching just has one sibling, we don't need to "merge" them at
7777         all - that's the next step to do.
7778         (FlowBranching.Merge): We now return a `UsageVector' instead of a
7779         `MergeResult'.
7780
7781 2003-12-11  Martin Baulig  <martin@ximian.com>
7782
7783         Reworked flow analyis and made it more precise and bug-free.  The
7784         most important change is that we're now using a special `Reachability'
7785         class instead of having "magic" meanings of `FlowReturns'.  I'll
7786         do some more cleanups and optimizations and also add some more
7787         documentation this week.
7788
7789         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
7790         largely reworked this class.
7791         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
7792         the new `Reachability' class instead of having "magic" values here.
7793         (FlowBranching): We're now using an instance of `Reachability'
7794         instead of having separate `Returns', `Breaks' etc. fields.
7795
7796         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
7797         based on flow analysis; ignore the return value of block.Emit ().
7798
7799 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
7800
7801         * driver.cs typemanager.cs: Find the mono extensions to corlib even
7802         if they are private.
7803
7804 2003-12-09  Martin Baulig  <martin@ximian.com>
7805
7806         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
7807         call them directly on the UsageVector.
7808
7809 2003-12-09  Martin Baulig  <martin@ximian.com>
7810
7811         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
7812         Changed return type from `FlowReturns' to `Reachability'.
7813
7814 2003-12-09  Martin Baulig  <martin@ximian.com>
7815
7816         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
7817         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
7818         `Reachable' fields with a single `Reachability' one.
7819
7820 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7821
7822         * class.cs (FindMembers): Remove foreach's.
7823
7824         Bootstrap times:
7825
7826         BEFORE
7827                 Run 1:   8.74 seconds
7828                 Run 2:   8.71 seconds
7829
7830         AFTER
7831                 Run 1:   8.64 seconds
7832                 Run 2:   8.58 seconds
7833
7834
7835 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7836
7837         * cs-parser.jay:
7838         * gen-treedump.cs:
7839         * statement.cs:
7840         This patch does a few things:
7841                 1. EmptyStatement is now a singleton, so it is never reallocated.
7842                 2. All blah is EmptyStatement constructs have been changed to
7843                    blah == EmptyStatement.Value, which is much faster and valid
7844                    now that EmptyStatement is a singleton.
7845                 3. When resolving a block, rather than allocating a new array for
7846                    the non-empty statements, empty statements are replaced with
7847                    EmptyStatement.Value
7848                 4. Some recursive functions have been made non-recursive.
7849         Mainly the performance impact is from (3), however (1) and (2) are needed for
7850         this to work. (4) does not make a big difference in normal situations, however
7851         it makes the profile look saner.
7852
7853         Bootstrap times:
7854
7855         BEFORE
7856         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
7857         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
7858         Total memory allocated: 56397 KB
7859
7860         AFTER
7861         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
7862         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
7863         Total memory allocated: 55666 KB
7864
7865 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7866
7867         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
7868         than the hashtable in a hashtable version
7869
7870         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
7871         we always end up concating a string. This results in a huge perf
7872         loss, because many strings have to be tracked by the GC. In this
7873         patch, we first use a hashtable that works with two keys, so that
7874         the strings do not need to be concat'ed.
7875
7876         Bootstrap times:
7877         BEFORE
7878                 Run 1:   8.74 seconds
7879                 Run 2:   8.71 seconds
7880
7881         AFTER
7882                 Run 1:   8.65 seconds
7883                 Run 2:   8.56 seconds
7884
7885 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7886
7887         * Makefile: Add a new target `do-time' that does a quick and simple
7888         profile, leaving easy to parse output.
7889
7890 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
7891
7892         * codegen.cs (Init): Create the dynamic assembly with 
7893         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
7894
7895 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7896
7897         * support.cs: Make the PtrHashtable use only one
7898         instance of its comparer.
7899
7900 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
7901
7902         * typemanager.cs: Fix lookup of GetNamespaces.
7903
7904 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
7905
7906         * expression.cs: Removed redundant line.
7907
7908         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
7909         ArrayLists, use for loops with bounds.  
7910
7911         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
7912         arraylist.
7913
7914         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
7915         arraylists, use for loop with bounds.
7916
7917         The above three changes give us a 0.071 second performance
7918         improvement out of 3.294 seconds down to 3.223.  On my machine
7919         the above changes reduced the memory usage by 1,387 KB during
7920         compiler bootstrap.
7921
7922         * cs-parser.jay (QualifiedIdentifier): New class used to represent
7923         QualifiedIdentifiers.  Before we created a new string through
7924         concatenation, and mostly later on, the result would be
7925         manipulated by DecomposeQI through string manipulation.
7926
7927         This reduced the compiler memory usage for bootstrapping from
7928         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
7929         compile times in 0.05 seconds.
7930
7931 2003-11-28  Dick Porter  <dick@ximian.com>
7932
7933         * support.cs: Do string compares with the Invariant culture.
7934
7935         * rootcontext.cs: 
7936         * gen-treedump.cs: 
7937         * expression.cs: 
7938         * driver.cs: 
7939         * decl.cs: 
7940         * codegen.cs: 
7941         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
7942         the comparison is done with the Invariant culture.
7943
7944 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
7945
7946         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7947         GetEnumerator method.
7948
7949         (ProbeCollectionType): Iterate starting at the most specific type
7950         upwards looking for a GetEnumerator
7951
7952         * expression.cs: Shift count can be up to 31 for int/uint and 63
7953         for long/ulong.
7954
7955 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
7956
7957         * statement.cs (Block.LookupLabel): Also look for the label on the
7958         children blocks.  Use a hash table to keep track of visited
7959         nodes. 
7960
7961         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7962         we actually did transform the other operand, otherwise fall back
7963         to the common codepath that casts to long.
7964
7965         * cs-tokenizer.cs: Use the same code pattern as the int case.
7966         Maybe I should do the parsing myself, and avoid depending on the
7967         Parse routines to get this done.
7968
7969 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
7970
7971         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7972         which fixes bug 51347.  This time test it.
7973
7974         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7975         attributes for example can not tell the difference between these.
7976         The difference was only a syntax feature of the language. 
7977
7978         * attribute.cs: Apply attributes to delegates.
7979
7980         * delegate.cs: Call the apply attributes method.
7981
7982 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
7983
7984         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7985         comparing 0 vs Byte.MinValue, not the value
7986
7987         (ImplicitConversionRequired): When reporting a conversion error,
7988         use error 31 to print out the constant error instead of the
7989         simpler 29.
7990
7991         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7992         which fixes bug 51347.
7993
7994 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
7995
7996         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
7997         which fixes the -warnaserror command line option.
7998
7999 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8000
8001         * cfold.cs (DoNumericPromotions): During constant folding of
8002         additions on UIntConstant, special case intconstants with
8003         IntConstants like we do on the expression binary operator. 
8004
8005 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8006
8007         * convert.cs (ImplicitReferenceConversion): We were missing a case
8008         (System.Enum are not value types or class types, so we need to
8009         classify them separatedly).
8010
8011         * driver.cs: We do not support error 2007.
8012
8013 2003-11-12 Jackson Harper <jackson@ximian.com>
8014
8015         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8016         system directory. Also use the full file name so users can
8017         libraries names mscorlib-o-tron.dll in a non system dir.
8018
8019 2003-11-10  Martin Baulig  <martin@ximian.com>
8020
8021         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8022         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8023         calling `ResolveType()' on them, directly assign their `Type'.
8024
8025 2003-11-08  Martin Baulig  <martin@ximian.com>
8026
8027         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8028         return value and the `out parent' parameter.
8029         (TypeContainer.DefineType): Moved the CS0644 check into
8030         GetClassBases().  Don't pass the interface types to the
8031         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8032         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8033
8034         * ecore.cs (TypeExpr.IsAttribute): New property.
8035         (TypeExpr.GetInterfaces): New method.
8036
8037         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8038         TypeExpr instead of a Type.
8039         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8040         (Interface.DefineType): Don't pass the interface types to the
8041         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8042         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8043
8044         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8045         instead of a `Type[]'.
8046         (TypeManager.RegisterBuilder): Likewise.
8047         (TypeManager.AddUserInterface): Likewise.
8048         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8049         `Type[]' and also return a `TypeExpr[]'.
8050         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8051
8052 2003-11-08  Martin Baulig  <martin@ximian.com>
8053
8054         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8055         Expression.     
8056
8057 2003-11-08  Martin Baulig  <martin@ximian.com>
8058
8059         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8060         TypeManager.ResolveExpressionTypes().
8061
8062         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8063         instead of an Expression.
8064         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8065         (TypeExpression): New public class; formerly known as `TypeExpr'.
8066
8067         * expression.cs (ComposedCast): Derive from TypeExpr.
8068
8069         * typemanager.cs (TypeManager.system_*_expr): These are now
8070         TypExpr's instead of Expression's.
8071         (TypeManager.ResolveExpressionTypes): New public static function;
8072         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8073         of them.        
8074
8075 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8076
8077         * expression.cs (New.DoResolve): Do not dereference value that
8078         might be a null return.
8079
8080         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8081         sure that the constant value has the right type.  Fixes an
8082         unreported bug, similar to 50425.
8083
8084         * const.cs (Const.LookupConstantValue): Call
8085         ImplicitStandardConversionExists before doing a conversion to
8086         avoid havng the TypeManager.ChangeType do conversions.
8087
8088         Reduced the number of casts used
8089
8090         (Const.ChangeType): New routine to enable reuse of the constant
8091         type changing code from statement.
8092
8093         * typemanager.cs (ChangeType): Move common initialization to
8094         static global variables.
8095
8096         Fixes #50425.
8097
8098         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8099         every value type to go through, even if it was void.  Fix that. 
8100
8101         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8102         character of the define, and the is_identifier_part_character for
8103         the rest of the string.
8104
8105 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8106
8107         * expression.cs (UnaryMutator.EmitCode): When I updated
8108         LocalVariableReference.DoResolve, I overdid it, and dropped an
8109         optimization done on local variable references.
8110
8111 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8112
8113         * ecore.cs: Convert the return from Ldlen into an int.
8114
8115 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8116
8117         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8118         the accessibility, this is a special case for toplevel non-public
8119         classes (internal for instance).
8120
8121 2003-10-20  Nick Drochak <ndrochak@gol.com>
8122
8123         * ecore.cs: Fix typo and build.  Needed another right paren.
8124
8125 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8126
8127         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8128         `internal' case regular and protected, but not allowing protected
8129         to be evaluated later.  Bug 49840
8130
8131 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8132
8133         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8134         to kb.Nlast, and not the kb.nFirst to isolate the switch
8135         statement.
8136
8137         Extract the underlying type, so enumerations of long/ulong are
8138         treated like long/ulong.
8139
8140 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8141
8142         * expression.cs (New): Overload the meaning of RequestedType to
8143         track the possible creation of the NewDelegate type, since
8144         DoResolve is invoked more than once for new constructors on field
8145         initialization.
8146
8147         See bugs: #48800 and #37014
8148
8149         * cs-parser.jay (declare_local_constants): Take an arraylist
8150         instead of a single constant.
8151
8152         (local_constant_declaration): It should take a
8153         constant_declarators, not a constant_declarator.  Fixes 49487
8154
8155         * convert.cs: Fix error report.
8156
8157 2003-10-13 Jackson Harper <jackson@ximian.com>
8158
8159         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8160         bug #49611
8161
8162 2003-10-09  Martin Baulig  <martin@ximian.com>
8163
8164         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8165         to the .ctor.
8166         (MethodCore.DoDefineParameters): Removed the TypeContainer
8167         argument; use the DeclSpace which was passed to the .ctor instead.
8168         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8169         TypeContainer; we only need a DeclSpace here.
8170
8171 2003-10-09  Martin Baulig  <martin@ximian.com>
8172
8173         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8174         to the .ctor.
8175         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8176         EmitContext's .ctor.    
8177
8178 2003-10-09  Martin Baulig  <martin@ximian.com>
8179
8180         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8181         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8182         AsAccessible(), moved them as well.
8183
8184         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8185
8186 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8187
8188         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8189
8190 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8191
8192         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8193         generation for >=, as spotted by Paolo, bug 48679.  
8194         Patch from David Waite.
8195
8196         * cs-tokenizer.cs: Add handling for #pragma.
8197
8198         * cs-parser.jay: Allow for both yield and yield return in the
8199         syntax.  The anti-cobolization of C# fight will go on!
8200
8201         * class.cs (TypeBuilder.DefineType): Catch error condition here
8202         (Parent.DefineType erroring out and returning null).
8203
8204         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8205         coping with enumerations variables, we were mistakenly processing
8206         them as a regular value type instead of built-in types.  Fixes the
8207         bug #48063
8208
8209         * typemanager.cs (IsBuiltinOrEnum): New method.
8210
8211 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8212
8213         * cs-parser.jay: Upgrade: yield now needs the return clause.
8214
8215 2003-09-19  Martin Baulig  <martin@ximian.com>
8216
8217         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8218         `MemberCache parent' argument.  Normally, an interface doesn't
8219         have a parent type except System.Object, but we use this in gmcs
8220         for generic type parameters.
8221
8222 2003-09-18  Martin Baulig  <martin@ximian.com>
8223
8224         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8225         on `type.IsInterface'; don't check whether the type has a parent
8226         to determine whether it's an interface.
8227
8228 2003-09-15  Martin Baulig  <martin@ximian.com>
8229
8230         * class.cs (TypeContainer.DefineType): Added an error flag to
8231         avoid reporting duplicate CS0146's ("class definition is
8232         circular.").
8233
8234         * driver.cs (Driver.MainDriver): Abort if
8235         RootContext.ResolveTree() reported any errors.
8236
8237 2003-09-07  Martin Baulig  <martin@ximian.com>
8238
8239         * report.cs (Error, Warning): Added overloaded versions which take
8240         a `params object[] args' and call String.Format().
8241
8242 2003-09-07  Martin Baulig  <martin@ximian.com>
8243
8244         * decl.cs (DeclSpace..ctor): Don't call
8245         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8246         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8247         (DeclSpace.RecordDecl): New method.
8248
8249         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8250
8251 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8252
8253         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8254         value attributes to be applied to ParameterBuilders.
8255
8256         * class.cs (MethodCore.LabelParameters): Make static and more
8257         generic so that it can be used from other places - like interface
8258         methods, for instance.
8259
8260         * interface.cs (Interface.Emit): Call LabelParameters before
8261         emitting attributes on the InterfaceMethod.
8262
8263 2003-08-26  Martin Baulig  <martin@ximian.com>
8264
8265         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8266         resolving aliases; fixes #47927.
8267
8268 2003-08-26  Martin Baulig  <martin@ximian.com>
8269
8270         * statement.cs (Using.DoResolve): This is internally emitting a
8271         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8272         do not always return.  Fixes #47681.
8273
8274 2003-08-26  Martin Baulig  <martin@ximian.com>
8275
8276         * decl.cs (MemberCore): Moved WarningNotHiding(),
8277         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8278         into MemberBase.
8279         (AdditionResult): Make this nested in DeclSpace.
8280         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8281         argument; call NamespaceEntry.Define() unless we're nested in a
8282         class or struct.
8283
8284         * namespace.cs (Namespace.DefineName): New public function.  This
8285         is called from DeclSpace's .ctor to add 
8286         (Namespace.Lookup): Include DeclSpaces in the lookup.
8287
8288         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8289
8290         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8291
8292 2003-08-25  Martin Baulig  <martin@ximian.com>
8293
8294         * convert.cs (Convert.ExplicitReferenceConversion): When
8295         converting from an interface type to a class, unbox if the target
8296         type is a struct type.  Fixes #47822.
8297
8298 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8299
8300         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8301         #47854.
8302
8303 2003-08-22  Martin Baulig  <martin@ximian.com>
8304
8305         * class.cs (TypeManager.DefineType): When defining a nested type,
8306         call DefineType() on our parent; fixes #47801.
8307
8308 2003-08-22  Martin Baulig  <martin@ximian.com>
8309
8310         * class.cs (MethodData.Define): While checking if a method is an
8311         interface implementation, improve the test a bit more to fix #47654.
8312
8313 2003-08-22  Martin Baulig  <martin@ximian.com>
8314
8315         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8316         correctly; fixes #47722.
8317
8318 2003-08-22  Martin Baulig  <martin@ximian.com>
8319
8320         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8321         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8322
8323         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8324
8325 2003-08-22  Martin Baulig  <martin@ximian.com>
8326
8327         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8328         can only be assigned in static constructors.  Fixes #47161.
8329
8330 2003-08-22  Martin Baulig  <martin@ximian.com>
8331
8332         Rewrote and improved the flow analysis code.
8333
8334         * flowbranching.cs (FlowBranching): Make this class abstract.
8335         (FlowBranching.CreateBranching): New static function to create a
8336         new flow branching.
8337         (FlowBranchingBlock, FlowBranchingException): New classes.
8338         (FlowBranching.UsageVector.Type): New public readonly field.
8339         (FlowBranching.UsageVector.Breaks): Removed the setter.
8340         (FlowBranching.UsageVector.Returns): Removed the setter.
8341         (FlowBranching.UsageVector): Added Break(), Return(),
8342         NeverReachable() and Throw() methods to modify the reachability.
8343         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8344         done by FlowBranching.Merge().
8345         (FlowBranching.UsageVector.MergeChild): New method; merges the
8346         merge result into the current vector.
8347         (FlowBranching.Merge): New abstract method to merge a branching.
8348
8349 2003-08-12  Martin Baulig  <martin@ximian.com>
8350
8351         * expression.cs (Indirection.CacheTemporaries): Create the
8352         LocalTemporary with the pointer type, not its element type.
8353
8354 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8355
8356         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8357         token was a keyword or not.
8358
8359         Add `error' options where an IDENTIFIER was expected;  Provide
8360         CheckToken and CheckIdentifierToken convenience error reporting
8361         functions. 
8362
8363         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8364
8365         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8366         NameSpaceEntry NameSpaceEntry.
8367
8368         (LookupInterfaceOrClass): Avoid creating a full qualified name
8369         from namespace and name: avoid doing lookups when we know the
8370         namespace is non-existant.   Use new Tree.LookupByNamespace which
8371         looks up DeclSpaces based on their namespace, name pair.
8372
8373         * driver.cs: Provide a new `parser verbose' to display the
8374         exception thrown during parsing.  This is turned off by default
8375         now, so the output of a failure from mcs is more graceful.
8376
8377         * namespace.cs: Track all the namespaces defined in a hashtable
8378         for quick lookup.
8379
8380         (IsNamespace): New method
8381
8382 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8383
8384         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8385         we know that we need to concatenate (full typename can never be
8386         null). 
8387
8388         * class.cs: ditto.
8389
8390         * statement.cs: Use a bitfield;  Do not initialize to null things
8391         which are done by the constructor by default.
8392
8393         * cs-parser.jay: bug fix, parameter was 4, not 3.
8394
8395         * expression.cs: Just use the property;
8396
8397         * statement.cs: No need for GetVariableInfo method.
8398
8399 2003-08-08  Martin Baulig  <martin@ximian.com>
8400
8401         * flowanalysis.cs (FlowReturns): This is now nested in the
8402         `FlowBranching' class.
8403         (MyBitVector): Moved this here from statement.cs.
8404         (FlowBranching.SiblingType): New enum type.
8405         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8406
8407 2003-08-07  Martin Baulig  <martin@ximian.com>
8408
8409         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8410         `FlowBranching' class and called `BranchingType'.
8411
8412 2003-08-07  Martin Baulig  <martin@ximian.com>
8413
8414         * flowanalysis.cs: Moved all the control flow analysis code into
8415         its own file.
8416
8417 2003-08-07  Martin Baulig  <martin@ximian.com>
8418
8419         * assign.cs (Assign.DoResolve): `target' must either be an
8420         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8421         #37319.
8422
8423 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8424
8425         * expression.cs (BinaryMethod): This kind of expression is created by the
8426         Binary class if it determines that the operator has to be handled
8427         by a method.
8428
8429         (BinaryDelegate): This kind of expression is created if we are
8430         dealing with a + or - operator on delegates.
8431
8432         (Binary): remove method, argumetns, and DelegateOperator: when
8433         dealing with methods, 
8434
8435         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8436
8437         * statement.cs (Block): use bitfields for the three extra booleans
8438         we had in use.   Remove unused topblock parameter.
8439
8440         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8441
8442         * assign.cs: Drop extra unneeded tests.
8443
8444 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8445
8446         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8447
8448         * statement.cs (Foreach): Use VariableStorage instead of
8449         LocalBuilders.   
8450
8451         * codegen.cs (VariableStorage): New class used by clients that
8452         require a variable stored: locals or fields for variables that
8453         need to live across yield.
8454
8455         Maybe provide a convenience api for EmitThis+EmitLoad?
8456
8457         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8458         these bad boys.
8459
8460 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8461
8462         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8463         RemapParameterLValue): New methods that are used to turn a
8464         precomputed FieldInfo into an expression like this:
8465
8466                 instance.FieldInfo
8467
8468         The idea is to use this instead of making LocalVariableReference
8469         have more than one meaning.
8470
8471         * cs-parser.jay: Add error production to BASE.
8472
8473         * ecore.cs: Deal with TypeManager.GetField returning null, which
8474         is now a valid return value.
8475
8476         (FieldExprNoAddress): New expression for Fields whose address can
8477         not be taken.
8478
8479         * expression.cs (LocalVariableReference): During the resolve
8480         phases, create new expressions if we are in a remapping context.
8481         Remove code that dealt with remapping here.
8482
8483         (ParameterReference): same.
8484
8485         (ProxyInstance): New expression, like the `This' expression, but
8486         it is born fully resolved.  We know what we are doing, so remove
8487         the errors that are targeted to user-provided uses of `this'.
8488
8489         * statement.cs (Foreach): our variable is now stored as an
8490         Expression;  During resolution, follow the protocol, dont just
8491         assume it will return this.
8492
8493 2003-08-06  Martin Baulig  <martin@ximian.com>
8494
8495         * support.cs (SeekableStreamReader.cs): New public class.
8496
8497         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8498         SeekableStreamReader instead of the normal StreamReader.
8499
8500 2003-08-04  Martin Baulig  <martin@ximian.com>
8501
8502         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8503         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8504         deambiguate casts and delegate invocations.
8505         (parenthesized_expression): Use the new tokens to ensure this is
8506         not a cast of method invocation.
8507
8508         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8509         when reading a `)' and Deambiguate_CloseParens () was previously
8510         called.
8511
8512         * expression.cs (ParenthesizedExpression): New class.  This is
8513         just used for the CS0075 test.
8514         (Binary.DoResolve): Check for CS0075.   
8515
8516 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8517
8518         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8519         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8520         reference comparison.
8521
8522         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8523         examine the ReturnType for equality - this is necessary in the
8524         cases of implicit and explicit operators whose signature also
8525         includes the return type.
8526
8527 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8528
8529         * namespace.cs: Cache the result of the namespace computation,
8530         instead of computing it every time.
8531
8532 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8533
8534         * decl.cs: Use a global arraylist that we reuse over invocations
8535         to avoid excesive memory consumption.  Reduces memory usage on an
8536         mcs compile by one meg (45 average).
8537
8538         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8539         private, work around that.
8540
8541 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8542
8543         * literal.cs (IntLiteral): Define Zero and One static literals. 
8544
8545         * cs-parser.jay (integer_literal): use static literals to reduce
8546         memory usage for the most used literals (0, 1 and -1).  211kb
8547         reduced in memory usage.
8548
8549         Replace all calls to `new ArrayList' with `new
8550         ArrayList(4)' which is a good average number for most allocations,
8551         and also requires only 16 bytes of memory for its buffer by
8552         default. 
8553
8554         This reduced MCS memory usage in seven megabytes for the RSS after
8555         bootstrapping.
8556
8557 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8558
8559         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8560         handle params methods the correct way by forming only one
8561         applicable set with params and normal methods in them. Earlier we
8562         were looking at params methods only if we found no normal methods
8563         which was not the correct thing to do.
8564
8565         (Invocation.BetterFunction): Take separate arguments indicating
8566         when candidate and the best method are params methods in their
8567         expanded form.
8568
8569         This fixes bugs #43367 and #46199.
8570
8571         * attribute.cs: Documentation updates.
8572
8573         (CheckAttribute): Rename to CheckAttributeTarget.
8574         (GetValidPlaces): Rename to GetValidTargets.
8575
8576         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8577         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8578
8579         Fixes bug #44468.
8580
8581 2003-07-28  Martin Baulig  <martin@ximian.com>
8582
8583         * class.cs (TypeContainer.DefineMembers): Use the base type's full
8584         name when looking up the base class of a nested class.  Fixes #46977.
8585
8586 2003-07-26  Martin Baulig  <martin@ximian.com>
8587
8588         * expression.cs (Indexers.Indexer): New nested struct; contains
8589         getter, setter and the indexer's type.
8590         (Indexers.Properties): This is now an ArrayList of
8591         Indexers.Indexer's.
8592         (IndexerAccess.DoResolveLValue): Correctly set the type if the
8593         indexer doesn't have any getters.
8594
8595         * assign.cs (Assign.DoResolve): Also do the implicit conversions
8596         for embedded property and indexer assignments.
8597
8598 2003-07-26  Martin Baulig  <martin@ximian.com>
8599
8600         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
8601         preprocessor directive is not the first non-whitespace character
8602         on a line.
8603
8604 2003-07-26  Martin Baulig  <martin@ximian.com>
8605
8606         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
8607         namespace parsing, follow the spec more closely.
8608
8609         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
8610         NamespaceEntry.Lookup().
8611
8612 2003-07-25  Martin Baulig  <martin@ximian.com>
8613
8614         * MethodCore.cs (OverridesSomething): New public field; it's set
8615         from TypeContainer.DefineMembers if this method overrides
8616         something (which doesn't need to be a method).  Fix #39462.
8617
8618 2003-07-25  Ravi Pratap  <ravi@ximian.com>
8619
8620         * typemanager.cs (GetMembers): Ensure that the list of members is
8621         reversed. This keeps things in sync.
8622
8623         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
8624         find an AttributeUsage attribute.
8625
8626         * expression.cs (Invocation.OverloadResolve): Perform the check
8627         which disallows Invoke to be directly called on a Delegate.
8628
8629         (Error_InvokeOnDelegate): Report error cs1533.
8630
8631 2003-07-25  Martin Baulig  <martin@ximian.com>
8632
8633         * expression.cs (Indexers.GetIndexersForType): Only look in the
8634         interface hierarchy if the requested type is already an
8635         interface.  Fixes #46788 while keeping #46502 fixed.
8636
8637 2003-07-25  Martin Baulig  <martin@ximian.com>
8638
8639         * class.cs (TypeContainer.DefineMembers): Check whether all
8640         readonly fields have been assigned and report warning CS0649 if
8641         not.
8642
8643         * statement.cs (LocalInfo.IsFixed): Always return true if this is
8644         a valuetype.
8645
8646 2003-07-24  Ravi Pratap  <ravi@ximian.com>
8647
8648         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
8649         returned from GetMethods to make things consistent with the
8650         assumptions MCS makes about ordering of methods.
8651
8652         This should comprehensively fix bug #45127 and it does :-)
8653
8654         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
8655         ordering is actually reverse.
8656
8657         * Clean up some debug messages I left lying around.
8658
8659         * interface.cs (Populate*): Get rid of code which emits attributes
8660         since the stage in which we emit attributes is the 'Emit' stage,
8661         not the define stage.
8662
8663         (Emit): Move attribute emission for interface members here.
8664
8665 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8666
8667         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8668         closely: we eliminate methods in base types when we have an
8669         applicable method in a top-level type.
8670
8671         Please see section 14.5.5.1 for an exact description of what goes
8672         on. 
8673
8674         This fixes bug #45127 and a host of other related to corlib compilation.
8675
8676         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8677         array is the method corresponding to the top-level type (this is
8678         because of the changes made to icall.c) so we change this
8679         accordingly.
8680
8681         (MethodGroupExpr.Name): This too.
8682
8683         * typemanager.cs (GetElementType): New method which does the right
8684         thing when compiling corlib. 
8685
8686         * everywhere: Make use of the above in the relevant places.
8687
8688 2003-07-22  Martin Baulig  <martin@ximian.com>
8689
8690         * cs-parser.jay (invocation_expression): Moved
8691         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8692         `cast_expression', but create a InvocationOrCast which later
8693         resolves to either an Invocation or a Cast.
8694
8695         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8696         method; call this before EmitStatement() to make sure that this
8697         expression can be used as a statement.
8698
8699         * expression.cs (InvocationOrCast): New class; resolves to either
8700         an Invocation or a Cast.
8701
8702         * statement.cs (StatementExpression): Call ResolveStatement() on
8703         the ExpressionStatement before emitting it.
8704
8705 2003-07-21  Martin Baulig  <martin@ximian.com>
8706
8707         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8708         `ref' and `out' attributes match; fixes #46220.
8709         (MemberAccess.ResolveMemberAccess): You can't reference a type
8710         through an expression; fixes #33180.
8711         (Indexers.GetIndexersForType): Don't return the indexers from
8712         interfaces the class implements; fixes #46502.
8713
8714 2003-07-21  Martin Baulig  <martin@ximian.com>
8715
8716         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8717         CS0661 checks; fixes bug #30442.
8718
8719 2003-07-21  Martin Baulig  <martin@ximian.com>
8720
8721         * decl.cs (AdditionResult): Added `Error'.
8722
8723         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8724
8725         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
8726         makes cs0031.cs actually work.
8727
8728 2003-07-20  Martin Baulig  <martin@ximian.com>
8729
8730         * namespace.cs: Fixed that bug which caused a crash when compiling
8731         the debugger's GUI.
8732
8733 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8734
8735         * typemanager.cs (LookupTypeReflection): Never expose types which
8736         are NotPublic, NestedPrivate, NestedAssembly, or
8737         NestedFamANDAssem.  We used to return these, and later do a check
8738         that would report a meaningful error, but the problem is that we
8739         would not get the real match, if there was a name override.
8740
8741 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8742
8743         * namespace.cs (Namespace, Name): Do not compute the namespace
8744         name dynamically, compute it in the constructor.  This reduced
8745         memory usage by 1697 KB.
8746
8747         * driver.cs: Use --pause to pause at the end.
8748
8749 2003-07-17  Peter Williams  <peter@newton.cx>
8750
8751         * Makefile: Change the name of the test target so that it doesn't
8752         conflict with the recursive test target.
8753
8754 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8755
8756         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8757         AddressOf): Do not use EmitThis, that was wrong, use the actual
8758         this pointer.
8759
8760 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8761
8762         * class.cs (MethodData.Define): While checking if a method is an
8763         interface implementation, improve the test: If we are not public
8764         (use new test here: use the computed MethodAttributes directly,
8765         instead of the parsed modifier flags) check if the `implementing'
8766         method comes from an interface or not.
8767
8768         * pending.cs (VerifyPendingMethods): Slightly better error
8769         message.
8770
8771         * makefile: add test target that does the mcs bootstrap.
8772
8773 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8774
8775         * interface.cs (Define): Do nothing here since there are no
8776         members to populate etc. Move the attribute emission out of here
8777         since this was just totally the wrong place to put it. Attribute
8778         application happens during the 'Emit' phase, not in the 'Define'
8779         phase.
8780
8781         (Emit): Add this method and move the attribute emission here
8782
8783         * rootcontext.cs (EmitCode): Call the Emit method on interface
8784         types too.
8785
8786 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8787
8788         * expression.cs (OverloadResolve): Report error only if Location
8789         is not 'Null' which means that there was a probe going on.
8790
8791 2003-07-14  Martin Baulig  <martin@ximian.com>
8792
8793         * expression.cs (ConditionalLogicalOperator): New public class to
8794         implement user defined conditional logical operators.
8795         This is section 14.11.2 in the spec and bug #40505.
8796
8797 2003-07-14  Martin Baulig  <martin@ximian.com>
8798
8799         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8800
8801 2003-07-14  Martin Baulig  <martin@ximian.com>
8802
8803         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8804
8805         * ecore.cs (IVariable.VerifyFixed): New interface method.
8806
8807         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8808         operator, check whether the variable is actually fixed.  Fixes bug
8809         #36055.  Set a variable definitely assigned when taking its
8810         address as required by the spec.
8811
8812         * statement.cs (LocalInfo.IsFixed): New field.
8813         (LocalInfo.MakePinned): Set `IsFixed' to true.
8814
8815 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8816
8817         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8818         for .ctors, ensure that we only ask for members declared in the
8819         attribute type (BindingFlags.DeclaredOnly).
8820
8821         Fixes bug #43632.
8822
8823         * expression.cs (Error_WrongNumArguments): Report error 1501
8824         correctly the way CSC does.
8825
8826 2003-07-13  Martin Baulig  <martin@ximian.com>
8827
8828         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8829         lookup on the fully qualified name, to make things like "X.X" work
8830         where "X.X" is a fully qualified type name, but we also have a
8831         namespace "X" in the using list.  Fixes #41975.
8832
8833 2003-07-13  Martin Baulig  <martin@ximian.com>
8834
8835         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8836         function. If we're a CompoundAssign, we need to create an embedded
8837         CompoundAssign, not an embedded Assign.
8838         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8839         Fixes #45854.
8840
8841 2003-07-13  Martin Baulig  <martin@ximian.com>
8842
8843         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8844         work to fix bug #46088.
8845
8846 2003-07-13  Ravi Pratap <ravi@ximian.com>
8847
8848         * class.cs (Operator.Emit): Do not emit attributes here - it is
8849         taken care of by the Method class that we delegate too. This takes
8850         care of bug #45876.
8851
8852 2003-07-10  Martin Baulig  <martin@ximian.com>
8853
8854         * expression.cs (TypeOfVoid): New class.
8855         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8856
8857 2003-07-10  Martin Baulig  <martin@ximian.com>
8858
8859         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8860         bug #35957.
8861
8862 2003-07-10  Martin Baulig  <martin@ximian.com>
8863
8864         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8865         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8866
8867         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8868
8869         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8870
8871 2003-07-10  Martin Baulig  <martin@ximian.com>
8872
8873         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8874         of decimal.  Fixes #42850.
8875
8876         NOTE: I also fixed the created byte blob, but this doesn't work on
8877         the MS runtime and csc never produces any byte blobs for decimal
8878         arrays.
8879
8880 2003-07-10  Martin Baulig  <martin@ximian.com>
8881
8882         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8883         structs; fixes #32068.
8884         (Block.AddChildVariableNames): Fixed #44302.
8885
8886 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8887
8888         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8889
8890 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8891
8892         * attribute.cs: And this test is onger needed.
8893
8894 2003-07-08  Martin Baulig  <martin@ximian.com>
8895
8896         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8897         inaccessible types.  Fixes #36313.
8898
8899         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8900
8901         * namespace.cs (NamespaceEntry): Create implicit entries for all
8902         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8903         implicit entries for N1.N2 and N1.
8904
8905 2003-07-08  Martin Baulig  <martin@ximian.com>
8906
8907         Rewrote the handling of namespaces to fix a lot of the issues
8908         wrt. `using' aliases etc.
8909
8910         * namespace.cs (Namespace): Splitted this class into a
8911         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8912
8913         * typemanager.cs (TypeManager.IsNamespace): Removed.
8914         (TypeManager.ComputeNamespaces): Only compute namespaces from
8915         loaded assemblies here, not the namespaces from the assembly we're
8916         currently compiling.
8917
8918 2003-07-08  Martin Baulig  <martin@ximian.com>
8919
8920         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8921
8922 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8923
8924         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8925         already fixed it.  
8926
8927         I thought about the memory savings here, but LookupTypeReflection
8928         is used under already very constrained scenarios.  Compiling
8929         corlib or mcs only exposes one hit, so it would not really reduce
8930         any memory consumption.
8931
8932 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8933
8934         * typemanager.cs: fixes bug #45889 by only adding public types from
8935         other assemblies to the list of known types.
8936
8937 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8938
8939         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8940         on the type we resolved.
8941
8942 2003-07-05  Martin Baulig  <martin@ximian.com>
8943
8944         * pending.cs (PendingImplementation.ParentImplements): Don't
8945         create the proxy if the parent is abstract.
8946
8947         * class.cs (TypeContainer.DefineIndexers): Process explicit
8948         interface implementations first.  Fixes #37714.
8949
8950 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8951
8952         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8953         defined recursively;  but since we modify the input parameters
8954         (left is set to `this' temporarily), we reset this value if the
8955         left_is_explicit is false, which gives the original semantics to
8956         the code.  
8957
8958         * literal.cs (NullPointer): new class used to represent a null
8959         literal in a pointer context.
8960
8961         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8962         type is a pointer, use a NullPointer object instead of a
8963         NullLiteral.   Closes 43687
8964
8965         (ExplicitConversion): Convert pointer values using
8966         the conv opcode to the proper type.
8967
8968         * ecore.cs (New): change ValueTypeVariable property into a method,
8969         that returns whether the valuetype is suitable for being used.
8970
8971         * expression.cs (Binary.DoNumericPromotions): Only return if we
8972         the int constant was a valid uint, and we can return both left and
8973         right as uints.  If not, we continue processing, to trigger the
8974         type conversion.  This fixes 39018.
8975
8976         * statement.cs (Block.EmitMeta): During constant resolution, set
8977         the CurrentBlock property on the emitcontext, so that we resolve
8978         constants propertly.
8979
8980 2003-07-02  Martin Baulig  <martin@ximian.com>
8981
8982         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8983         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8984
8985         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8986         than emitting it here.
8987
8988         * statement.cs: Fixed some more flow analysis bugs.
8989
8990 2003-07-02  Martin Baulig  <martin@ximian.com>
8991
8992         * class.cs (MethodData.Define): When implementing interface
8993         methods, set Final unless we're Virtual.
8994
8995         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8996         check work for interface methods.
8997
8998 2003-07-01  Martin Baulig  <martin@ximian.com>
8999
9000         * ecore.cs (EmitContext.This): Replaced this property with a
9001         GetThis() method which takes a Location argument.  This ensures
9002         that we get the correct error location for a CS0188.
9003
9004 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9005
9006         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9007         ImplicitStandardConversion.
9008
9009         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9010
9011 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9012
9013         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9014         optimization.
9015
9016 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9017
9018         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9019         constructors.
9020
9021         (MethodData.Define): Turn off initlocals for unsafe methods.
9022
9023 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9024
9025         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9026         complete;  Fixes #37521.
9027
9028         * delegate.cs: Use Modifiers.TypeAttr to compute the
9029         TypeAttributes, instead of rolling our own.  This makes the flags
9030         correct for the delegates.
9031
9032 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9033
9034         * class.cs (Constructor.Define): Set the private flag for static
9035         constructors as well.
9036
9037         * cs-parser.jay (statement_expression): Set the return value to
9038         null, to avoid a crash when we catch an error.
9039
9040 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9041
9042         * cs-parser.jay: Applied patch from Jackson that adds support for
9043         extern and unsafe modifiers to destructor declarations.
9044
9045         * expression.cs: Report error 21 if the user is trying to index a
9046         System.Array.
9047
9048         * driver.cs: Add an error message, suggested by the bug report.
9049
9050         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9051         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9052
9053 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9054
9055         * namespace.cs: Add some information to reduce FAQs.
9056
9057 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9058
9059         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9060         underlying enumeration types.  Fixes #43915.
9061
9062         * expression.cs: Treat ushort/short as legal values to be used in
9063         bitwise operations.
9064
9065 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9066
9067         * delegate.cs: transfer custom attributes for paramenters from
9068         the delegate declaration to Invoke and BeginInvoke.
9069
9070 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9071
9072         * attribute.cs: handle custom marshalers and emit marshal info
9073         for fields, too.
9074
9075 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9076
9077         * makefile.gnu: Added anonymous.cs to the compiler sources.
9078
9079 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9080
9081         * iterators.cs: Change the name of the proxy class to include two
9082         underscores.
9083
9084         * cs-parser.jay: Update grammar to include anonymous methods.
9085
9086         * anonymous.cs: new file.
9087
9088 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9089
9090         * class.cs (Field.Define): Add missing test for pointers and
9091         safety. 
9092
9093 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9094
9095         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9096         we use the stobj opcode.
9097
9098         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9099         since it wasn't the correct fix. 
9100
9101         It still is puzzling that we are required to use stobj for IntPtr
9102         which seems to be a ValueType.
9103
9104 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9105
9106         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9107         during regular simple name resolution.   Now, the trick is that
9108         instead of returning for processing the simplename, we do a
9109         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9110         contextual lookup type).   If a match is found, return that, if
9111         not, return for further composition.
9112
9113         This fixes long-standing 30485.
9114
9115         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9116         using the address to initialize an object, do an Stobj instead of
9117         using the regular Stelem.
9118
9119         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9120         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9121         Because if we are a BaseIndexerAccess that value will be true.
9122         Fixes 43643.
9123
9124         * statement.cs (GotoCase.Resolve): Return after reporting an
9125         error, do not attempt to continue. 
9126
9127         * expression.cs (PointerArithmetic.Emit): If our operand is a
9128         long, convert our constants to match the operand before
9129         multiplying.  Convert to I type before adding.   Fixes 43670.
9130
9131 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9132
9133         * enum.cs (ImplicitConversionExists) : Rename to
9134         ImplicitEnumConversionExists to remove ambiguity. 
9135
9136         * ecore.cs (NullCast): New type of cast expression class which
9137         basically is very similar to EmptyCast with the difference being
9138         it still is a constant since it is used only to cast a null to
9139         something else
9140         (eg. (string) null)
9141
9142         * convert.cs (ImplicitReferenceConversion): When casting a null
9143         literal, we return a NullCast.
9144
9145         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9146         should be around anymore.
9147
9148         The renaming (reported was slightly wrong). Corrections:
9149
9150         ConvertImplicitStandard -> ImplicitConversionStandard
9151         ConvertExplicitStandard -> ExplicitConversionStandard
9152
9153         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9154         before passing them in !
9155
9156         * convert.cs (ImplicitConversionStandard): When comparing for
9157         equal expr and target types, ensure that expr is not a
9158         NullLiteral.
9159
9160         In general, we must not be checking (expr_type ==
9161         target_type) in the top level conversion methods
9162         (ImplicitConversion, ExplicitConversion etc). This checking is
9163         done in the methods that they delegate to.
9164
9165 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9166
9167         * convert.cs: Move Error_CannotConvertType,
9168         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9169         ImplicitNumericConversion, ImplicitConversionExists,
9170         ImplicitUserConversionExists, StandardConversionExists,
9171         FindMostEncompassedType, FindMostSpecificSource,
9172         FindMostSpecificTarget, ImplicitUserConversion,
9173         ExplicitUserConversion, GetConversionOperators,
9174         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9175         TryImplicitIntConversion, Error_CannotConvertImplicit,
9176         ConvertImplicitRequired, ConvertNumericExplicit,
9177         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9178         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9179         its own file.
9180
9181         Perform the following renames:
9182
9183         StandardConversionExists -> ImplicitStandardConversionExists
9184         ConvertImplicit -> ImplicitConversion
9185         ConvertImplicitStandard -> ImplicitStandardConversion
9186         TryImplicitIntConversion -> ImplicitIntConversion
9187         ConvertImplicitRequired -> ImplicitConversionRequired
9188         ConvertNumericExplicit -> ExplicitNumericConversion
9189         ConvertReferenceExplicit -> ExplicitReferenceConversion
9190         ConvertExplicit -> ExplicitConversion
9191         ConvertExplicitStandard -> ExplicitStandardConversion
9192
9193 2003-05-19  Martin Baulig  <martin@ximian.com>
9194
9195         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9196         (TypeInfo): Added support for structs having structs as fields.
9197
9198         * ecore.cs (FieldExpr): Implement IVariable.
9199         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9200         VariableInfo for the field.
9201
9202 2003-05-18  Martin Baulig  <martin@ximian.com>
9203
9204         * expression.cs (This.DoResolve): Report a CS0027 if we're
9205         emitting a field initializer.
9206
9207 2003-05-18  Martin Baulig  <martin@ximian.com>
9208
9209         * expression.cs (This.ResolveBase): New public function.
9210         (This.DoResolve): Check for CS0188.
9211
9212         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9213         This.Resolve().
9214
9215         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9216         `instance_expression' to null if we don't have any non-static
9217         methods.
9218
9219 2003-05-18  Martin Baulig  <martin@ximian.com>
9220
9221         Reworked the way how local variables and parameters are handled by
9222         the flow analysis code.
9223
9224         * statement.cs (TypeInfo, VariableMap): New public classes.
9225         (VariableInfo): New public class.  This is now responsible for
9226         checking whether a variable has been assigned.  It is used for
9227         parameters and local variables.
9228         (Block.EmitMeta): Take the InternalParameters as argument; compute
9229         the layout of the flow vectors here.
9230         (Block.LocalMap, Block.ParameterMap): New public properties.
9231         (FlowBranching): The .ctor doesn't get the InternalParameters
9232         anymore since Block.EmitMeta() now computes the layout of the flow
9233         vector.
9234         (MyStructInfo): This class is now known as `StructInfo' and nested
9235         in `TypeInfo'; we don't access this directly anymore.
9236
9237         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9238         property and removed IsAssigned(), IsFieldAssigned(),
9239         SetAssigned() and SetFieldAssigned(); we now call them on the
9240         VariableInfo so we don't need to duplicate this code everywhere.
9241
9242         * expression.cs (ParameterReference): Added `Block block' argument
9243         to the .ctor.
9244         (LocalVariableReference, ParameterReference, This): The new
9245         VariableInfo class is now responsible for all the definite
9246         assignment stuff.
9247
9248         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9249         IsParameterAssigned, SetParameterAssigned): Removed.
9250
9251 2003-05-18  Martin Baulig  <martin@ximian.com>
9252
9253         * typemanager.cs (InitCoreTypes): Try calling
9254         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9255         the 3-args-version.  Corlib now also needs our `void_type'.
9256         (GetMethod): Added overloaded version which takes an optional
9257         `bool report_errors' to allow lookups of optional methods.
9258
9259 2003-05-12  Martin Baulig  <martin@ximian.com>
9260
9261         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9262         only used for locals and not for parameters.
9263
9264 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9265
9266         * support.cs (InternalParameters.ParameterType): Return the
9267         ExternalType of the parameter.
9268
9269         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9270         they were unused.
9271
9272 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9273
9274         * class.cs (MethodData.Define): Do not set the `newslot' on
9275         interface members, if they are also flagged as "override".
9276
9277         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9278         better code for ++i and i++.  This only works for static fields
9279         and local variables.
9280
9281         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9282         want to pull the DeclSpace out of the builder_to_declspace instead
9283         of the TypeBuilder (like in TypeContainer.FindMembers).
9284
9285         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9286         instead of LookupTypeContainer.  Fixes the crash on .NET for
9287         looking up interface members.
9288
9289         * const.cs: Create our own emit context during the Definition
9290         stage, so that constants are evaluated in the proper context, when
9291         a recursive definition happens.
9292
9293 2003-05-11  Martin Baulig  <martin@ximian.com>
9294
9295         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9296         new block for a switch section.
9297         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9298         the adding/lookup in the switch block.  Fixes #39828.
9299
9300 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9301
9302         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9303         functionality: I needed to convert the data after I had performed
9304         the add/sub operation into the operands type size.
9305
9306         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9307         pass the type for the box operation, otherwise the resulting
9308         object would have been of type object.
9309
9310         (BoxedCast): Add constructor to specify the type to box as.
9311
9312 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9313
9314         * iterators.cs: I was reusing the `count' variable inadvertently,
9315         take steps to not allow this to happen.
9316
9317 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9318
9319         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9320         by creating an array at the point where the params starts and
9321         putting all those arguments there, then adjusting the size of the
9322         array.
9323
9324 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9325
9326         * expression.cs (New.AddressOf): Implement interface
9327         IMemoryLocation.  This is used when the `new' operator is used in
9328         the context of an invocation to a method on a value type.
9329
9330         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9331         example. 
9332
9333         * namespace.cs: Also check the using aliases here.
9334
9335         * driver.cs: Move the test for using validity after the types have
9336         been entered, so we do a single pass that also includes the using
9337         aliases. 
9338
9339         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9340         in the regular case.   CreateSiblingForFinally is doing extra
9341         error checking.
9342
9343         * attribute.cs (GetAttributeArgumentExpression): Store the result
9344         on an out value, and use the return value to indicate failure
9345         instead of using null (which is a valid return for Constant.GetValue).
9346
9347         * statement.cs: Perform the analysis flow for the increment
9348         portion after the statement, because this will be the real flow of
9349         execution.  Fixes #42385
9350
9351         * codegen.cs (EmitContext.EmitArgument,
9352         EmitContext.EmitStoreArgument): New helper functions when the
9353         RemapToProxy flag is set.
9354
9355         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9356         function.
9357
9358         Add support for remapping parameters. 
9359
9360         * iterators.cs: Propagate parameter values;  Store parameter
9361         values in the proxy classes.
9362
9363 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9364
9365         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9366         need a proxy reference;  I do not know what I was thinking
9367
9368         * cs-parser.jay (constructor_initializer): catch another error,
9369         and display nice message.
9370
9371         (field_declaration): catch void field declaration
9372         to flag a better error. 
9373
9374         * class.cs (MemberBase.CheckBase): Report an error instead of a
9375         warning if a new protected member is declared in a struct. 
9376         (Field.Define): catch the error of readonly/volatile.
9377
9378         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9379
9380         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9381         volatile variable is taken
9382
9383 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9384
9385         * statement.cs (Fixed.Resolve): Report an error if we are not in
9386         an unsafe context.
9387
9388 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9389
9390         * typemanager.cs: reuse the code that handles type clashes for
9391         delegates and enumerations.
9392
9393         * class.cs (Report28): Always report.
9394
9395         * expression.cs (EncodeAsAttribute): Allow nulls here.
9396
9397 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9398
9399         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9400         the functionality for testing whether an expression is valid for
9401         an attribute here.  Also handle the case of arrays of elements
9402         being stored. 
9403
9404         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9405         encoding a linear array into an array of objects that are suitable
9406         to be passed to an CustomAttributeBuilder.
9407
9408         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9409
9410         * ecore.cs: (FieldExpr): Handle field remapping here.
9411
9412         * iteratators.cs: Pass the instance variable (if the method is an
9413         instance method) to the constructors, so we can access the field
9414         variables on the class.
9415
9416         TODO: Test this with structs.  I think the THIS variable on
9417         structs might have to be a pointer, and not a refenrece
9418
9419 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9420
9421         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9422         local variables to fields in a proxy class.
9423
9424         * iterators.cs (PopulateProxy): Rename our internal fields to
9425         <XXX>.  
9426         Create a <THIS> field if we are an instance method, so we can
9427         reference our parent container variables.
9428         (MapVariable): Called back from the EmitContext code to enter a
9429         new variable to field mapping into the proxy class (we just create
9430         a FieldBuilder).
9431
9432         * expression.cs
9433         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9434         for using the remapped locals to fields.
9435
9436         I placed the code here, because that gives the same semantics to
9437         local variables, and only changes the Emit code.
9438
9439         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9440         statements inside iterators.
9441         (VariableInfo): Add a FieldBuilder for the cases when we are
9442         remapping local variables to fields in a proxy class
9443
9444         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9445         current_block != null.
9446
9447         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9448         not cope with strings, as it has been moved to the
9449         TableSwitchEmit.  Fixed bug in switch generation.
9450
9451         * expression.cs (New.DoResolve): Provide more context for the user
9452         when reporting an error.
9453
9454         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9455         pointers. 
9456
9457         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9458         check the permissions for it.  Note than in a type-resolution
9459         context the check was already present in DeclSpace.ResolveType,
9460         but was missing from the MemberAccess.
9461
9462         (ArrayCreation.CheckIndices): warn if the user has
9463         more nested levels of expressions, but there are no more
9464         dimensions specified.  Avoids crash on bug 41906.
9465
9466 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9467
9468         * statement.cs (Block): replace Implicit bool, for a generic
9469         flags.   
9470         New flag: `Unchecked'.  This is used during the EmitMeta phase
9471         (which is out-of-line with the regular Resolve/Emit process for a
9472         statement, as this is done ahead of time, but still gets a chance
9473         to call constant resolve).
9474
9475         (Block.Flags): new enum for adding a new flag.
9476
9477         (Block.EmitMeta): track the state of unchecked.
9478
9479         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9480         to enable constant resolution to work there as well.
9481
9482 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9483
9484         * typemanager.cs (ienumerable_type): Also look up
9485         System.Collections.IEnumerable. 
9486
9487 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9488
9489         TODO: Test more than one conditional per method.
9490
9491         * class.cs (Indexer.Define): Report the location where the user is
9492         referencing the unsupported feature.
9493
9494         (MethodData): Overload the use of `conditionals' to
9495         minimize the creation of needless ArrayLists.   This saves roughly
9496         212kb on my machine.
9497
9498         (Method): Implement the new IIteratorContainer interface.
9499         (Method.SetYields): Implement the method by setting the ModFlags
9500         to contain METHOD_YIELDS.
9501
9502         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9503         which just got set to null.
9504
9505         * iterators.cs: New file.
9506
9507         (Yield, YieldBreak): New statements.
9508
9509         * statement.cs (Return.Resolve): Flag an error if we are used in
9510         an iterator method.
9511
9512         * codegen.cs (InIterator): New flag set if the code is being
9513         compiled in an iterator method.
9514
9515         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9516         internal modifier, and we just use it to avoid adding extra
9517         fields, as this is seldom used.  
9518
9519         * cs-parser.jay: Add yield_statement (yield and yield break).
9520
9521         * driver.cs: New flag -v2 to turn on version 2 features. 
9522
9523         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9524         hashtable when v2 is enabled.
9525
9526 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9527
9528         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9529         there is already a namespace defined with this name.
9530
9531         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9532         people upgraded their corlibs.
9533
9534         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9535         always use fully qualified types, no need to use the compiler
9536         front end.
9537
9538         (TypeManager.IsNamespace): Use binarysearch.
9539
9540         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9541         AddDelegate): I did not quite use the new IsValid API properly: I
9542         have to pass the short-name and the fullname.  I was passing only
9543         the basename instead of the fullname sometimes. 
9544
9545         (TypeContainer.DefineType): call NamespaceClash.
9546
9547         * interface.cs (Interface.DefineType): use NamespaceClash before
9548         defining the type.
9549
9550         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9551         defining the type.
9552
9553         * enum.cs: (Enum.DefineType): use NamespaceClash before
9554         defining the type.
9555
9556         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9557         speed increase.  First, use the negative_hits cache when we get a
9558         negative.  Second, add the type with its full original name
9559         instead of the new . and + encoded name (reflection uses + to
9560         separate type from a nested type).  Use LookupTypeReflection
9561         directly which bypasses the type->name hashtable (that we already
9562         know does not contain the type.
9563
9564         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9565         location/container type. 
9566
9567         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9568
9569 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9570
9571         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9572
9573         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9574         method is being referenced in the method group from a static
9575         context, and report error 120 if so.
9576
9577         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9578         Error118. 
9579
9580         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9581         is created, we create the A namespace).
9582
9583         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9584         Fixes #41591
9585
9586 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9587
9588         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9589         invocation to ModuleBuilder.GetType with the same values will
9590         return a new type instance, so we need to cache its return
9591         values. 
9592
9593         * expression.cs (Binary.ResolveOperator): Only allow the compare
9594         operators on enums if they are of the same type.
9595
9596         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9597         types of ValueType on their own case.  Before we were giving them
9598         the same treatment as objects.
9599
9600         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9601         fullname.  Short name is used to compare against container name.
9602         Fullname is used to check against defined namespace names.
9603
9604         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9605         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9606
9607         (Method.CheckBase): Call parent.
9608         (MemberBase.CheckBase): Check for protected members on sealed
9609         classes.
9610         (PropertyBase.CheckBase): Call parent.
9611         (Field.Define): Call parent.
9612
9613         * report.cs: Negative error codes are now mapped to 8000 - code,
9614         so that the display is render more nicely.
9615
9616         * typemanager.cs: Do not use try/catch, instead report a regular
9617         error. 
9618
9619         (GetPointerType, GetReferenceType): These methods provide
9620         mechanisms to obtain the T* and T& from a T.  We had the code
9621         previously scattered around the code base, and it also used
9622         TypeManager.LookupType that would go through plenty of caches.
9623         This one goes directly to the type source.
9624
9625         In some places we did the Type.GetType followed by
9626         ModuleBuilder.GetType, but not in others, so this unifies the
9627         processing as well.
9628
9629         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9630         statements now that we have namespace information.
9631
9632         * typemanager.cs (IsNamespace): New method, returns whether the
9633         string presented is a namespace or not.
9634
9635         (ComputeNamespaces): New public entry point, computes the list of
9636         available namespaces, using the GetNamespaces API call in Mono, or
9637         the slower version in MS.NET.   
9638
9639         Now before we start the semantic analysis phase, we have a
9640         complete list of namespaces including everything that the user has
9641         provided.
9642
9643         Deleted old code to cache namespaces in .nsc files.
9644
9645 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9646
9647         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9648         class/struct location definition Location for the implicit
9649         constructor location.
9650
9651         (Operator.Define): Use the location of the operator for the
9652         implicit Method definition.
9653
9654         (Constructor.Emit): use the constructor location for the implicit
9655         base initializer constructor.
9656
9657         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9658         and the Expression class now contains two new methods:
9659
9660         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9661         isolate type lookup from the rest of the resolution process.
9662
9663         Since we use Expressions to hold type definitions due to the way
9664         we parse the input we have historically overloaded Resolve to
9665         perform the Type lookups if a special flag is passed.  Now this is
9666         eliminated and two methods take their place. 
9667
9668         The differences in the two methods between xStep and xTerminal is
9669         that xStep is involved in our current lookup system that uses
9670         SimpleNames to compose a name, while xTerminal is used just to
9671         catch the case where the simplename lookup failed.
9672
9673 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9674
9675         * expression.cs (ResolveMemberAccess): Remove redundant code.
9676         TypeExpr expressions are always born fully resolved.
9677
9678         * interface.cs (PopulateMethod): Do not lookup the types twice.
9679         We were doing it once during SemanticAnalysis and once during
9680         PopulateMethod.
9681
9682         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9683         in local variable type definitions, were being returned as a
9684         SimpleName (we decomposed everything into a string), that is
9685         because primary_expression was being used instead of a type in the
9686         grammar (reduce/reduce conflicts).
9687
9688         The part that was wrong is that we converted the expression into a
9689         string (an oversimplification in one hand, compounded with primary
9690         expressions doing string concatenation).
9691
9692         So things like:
9693
9694         A.B.C [] x;
9695
9696         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9697         using clauses from working on this particular context.  And a type
9698         was being matched directly against "A.B.C[]".
9699
9700         We now use the correct approach, and allow for ComposedCast to be
9701         part of the unary expression.  So the "A.B.C []" become a composed
9702         cast of "A.B.C" (as a nested group of MemberAccess with a
9703         SimpleName at the end) plus the rank composition "[]". 
9704
9705         Also fixes 35567
9706
9707 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9708
9709         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9710         for the access level checking.
9711
9712         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9713         `TypeContainer container', because I kept getting confused when I
9714         was debugging this code.
9715
9716         * expression.cs (Indexers): Instead of tracking getters/setters,
9717         we now track them in parallel.  We create one arraylist less, but
9718         most importantly it is possible now for the LValue code to find a
9719         matching get for a set.
9720
9721         (IndexerAccess.DoResolveLValue): Update the code.
9722         GetIndexersForType has been modified already to extract all the
9723         indexers from a type.  The code assumed it did not.
9724
9725         Also make the code set the correct return type for the indexer.
9726         This was fixed a long time ago for properties, but was missing for
9727         indexers.  It used to be void_type.
9728
9729         (Binary.Emit): Test first for doubles instead of
9730         floats, as they are more common.
9731
9732         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9733         when dealing with floats and the <=, >= operators.  This fixes bug
9734         #39314 
9735
9736         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9737         to load the array value by emitting a load on the foreach variable
9738         type.  This was incorrect.  
9739
9740         We now emit the code to load an element using the the array
9741         variable type, and then we emit the conversion operator.
9742
9743         Fixed #40176
9744
9745 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9746
9747         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9748
9749 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9750
9751         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9752         test for protection before we test for signatures. 
9753
9754         (MethodSignature.ToString): implement.
9755
9756         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9757         to the case where we reduced into a LongConstant.
9758
9759         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9760         depend on whether the information is acurrate, because the
9761         Microsoft runtime will always claim that the array type is public,
9762         regardless of the real state.
9763
9764         If the type is a pointer, another problem happens: the type is
9765         reported as non-public in Microsoft.  
9766
9767         In both cases we have to call CheckAccessLevel recursively with
9768         the underlying type as the argument to be tested.
9769
9770 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9771
9772         * assign.cs (Assign.Emit): If we are dealing with a compound
9773         assignment expression, we should use the code path that stores the
9774         intermediate result in a temporary value.  This fixes #40903.
9775
9776         *expression.cs (Indirection.ToString): Provide ToString method for
9777         debugging. 
9778
9779 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9780
9781         * class.cs: Null out fields holding references to Block objects so
9782         they can be garbage collected.
9783
9784         * expression.cs (OverloadResolve): Remove unused local.
9785
9786 2003-04-07  Martin Baulig  <martin@ximian.com>
9787
9788         * codegen.cs (EmitContext.CurrentFile): New public field.
9789         (EmitContext.Mark): Use the CurrentFile to check whether the
9790         location is in the correct file.
9791         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9792
9793 2003-04-07  Martin Baulig  <martin@ximian.com>
9794
9795         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9796
9797         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9798         location.  [FIXME: The location argument which gets passed to this
9799         method is sometimes wrong!]
9800
9801 2003-04-07  Nick Drochak <ndrochak@gol.com>
9802
9803         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9804
9805 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9806
9807         * expression.cs (Indirection.EmitAssign): We were using the
9808         temporary, but returning immediately instead of continuing the
9809         EmitAssing flow.
9810
9811 2003-04-06  Martin Baulig  <martin@ximian.com>
9812
9813         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9814         if it's a nested child, but also deriving from the outer class.
9815         See test 190.cs.
9816
9817         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9818         nested child, but also deriving from the outer class.  See
9819         test-190.cs.
9820         (FilterWithClosure): We may access private members of the outer
9821         class if we're a nested child and deriving from the outer class.
9822         (RealMemberLookup): Only set `closure_private_ok' if the
9823         `original_bf' contained BindingFlags.NonPublic.
9824
9825 2003-04-05  Martin Baulig  <martin@ximian.com>
9826
9827         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
9828
9829 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9830
9831         * class.cs (Event.Define): Do not allow abstract events to have
9832         initializers. 
9833
9834 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9835
9836         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9837         block in event declarations.
9838
9839         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9840         value type, get its address.
9841
9842         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9843         leaving a class on the stack instead of a boolean value (int
9844         0/1).  Change the code so we compare against null, and then the
9845         result against zero.
9846
9847         * class.cs (TypeContainer.GetClassBases): We were checking for the
9848         parent class being sealed too late.
9849
9850         * expression.cs (Binary.Emit): For <= and >= when dealing with
9851         floating point values, use cgt.un and clt.un instead of cgt and
9852         clt alone.
9853
9854 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9855
9856         * statement.cs: Apply the same optimization as MS: skip the 
9857         GetEnumerator returning an IEnumerator, and use the one returning a 
9858         CharEnumerator instead. This allows us to avoid the try-finally block 
9859         and the boxing.
9860
9861 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9862
9863         * cs-parser.jay: Attributes cannot be applied to
9864                          namespaces. Fixes #40473
9865
9866 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9867
9868         * class.cs:
9869         (Add*): check if the name is valid using the full name for constants,
9870         fields, properties and events.
9871
9872 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9873
9874         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9875         char constants to be part of the enumeration.
9876
9877         * expression.cs (Conditional.DoResolve): Add support for operator
9878         true. Implements the missing functionality from 14.12
9879
9880         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9881         operator true/false as required by the spec.
9882
9883         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9884         implicit conversion to boolean.
9885
9886         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9887         also one where the type implements `operator true'. 
9888
9889         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9890         get an expression that will invoke operator true based on an
9891         expression.  
9892
9893         (GetConversionOperators): Removed the hack that called op_True
9894         here.  
9895
9896         (Expression.ResolveBoolean): Move this from Statement.
9897
9898 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9899
9900         * ecore.cs (FieldExpr): do not allow initialization of initonly
9901         fields on derived classes
9902
9903 2003-03-13  Martin Baulig  <martin@ximian.com>
9904
9905         * statement.cs (Block.Emit): Call ig.BeginScope() and
9906         ig.EndScope() when compiling with debugging info; call
9907         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9908
9909 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9910
9911         * expression.cs (Indexers): Do not construct immediately, allow
9912         for new members to be appended as we go.  Fixes 38143
9913
9914 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9915
9916         * expression.cs: save/restore context when resolving an unchecked
9917         expression.
9918
9919 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9920
9921         * cfold.cs: Catch division by zero in modulus operator during
9922         constant folding.
9923
9924 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9925
9926         * interface.cs (Interface.DefineMembers): Avoid defining members
9927         twice. 
9928
9929 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9930
9931         * driver.cs: handle the +/- options for -noconfig
9932
9933         * statement.cs (Unckeched.Resolve): Also track the state of
9934         unchecked in the Resolve phase.
9935
9936 2003-02-27  Martin Baulig  <martin@ximian.com>
9937
9938         * ecore.cs (Expression.MemberLookup): Don't create a
9939         MethodGroupExpr for something which is not a method.  Fixes #38291.
9940
9941 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9942
9943         * class.cs (MemberBase.CheckParameters): Also check that the type
9944         is unmanaged if it is a pointer.
9945
9946         * expression.cs (SizeOf.Resolve): Add location information.
9947
9948         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9949         a managed type is declared.
9950
9951         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9952         parameter modifiers as well.  Fixes bug 38606
9953
9954         * class.cs: Very sad.  Am backing out the speed up changes
9955         introduced by the ArrayList -> Array in the TypeContainer, as they
9956         were not actually that much faster, and introduced a bug (no error
9957         reports on duplicated methods).
9958
9959         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9960         source first, this will guarantee that we have a valid expression
9961         before calling in lower levels functions that will require a
9962         resolved object.  Then use this original_source in the
9963         target.ResolveLValue instead of the original source that was
9964         passed to us.
9965
9966         Another change.  Use target.Resolve instead of LValueResolve.
9967         Although we are resolving for LValues, we will let the Assign code
9968         take care of that (it will be called again from Resolve).  This
9969         basically allows code like this:
9970
9971         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9972         class Y { void A (X x) { x [0] += o; }
9973
9974         The problem was that the indexer was trying to resolve for
9975         set_Item (idx, object o) and never finding one.  The real set_Item
9976         was set_Item (idx, X).  By delaying the process we get the right
9977         semantics. 
9978
9979         Fixes bug 36505
9980
9981 2003-02-23  Martin Baulig  <martin@ximian.com>
9982
9983         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9984         while calling DoEmit ().
9985
9986         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9987         source files; if you use the #line directive inside a method, the
9988         compiler stops emitting line numbers for the debugger until it
9989         reaches the end of the method or another #line directive which
9990         restores the original file.
9991
9992 2003-02-23  Martin Baulig  <martin@ximian.com>
9993
9994         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9995
9996 2003-02-23  Martin Baulig  <martin@ximian.com>
9997
9998         * statement.cs (Block.AddChildVariableNames): We need to call this
9999         recursively, not just for our immediate children.
10000
10001 2003-02-23  Martin Baulig  <martin@ximian.com>
10002
10003         * class.cs (Event.Define): Always make the field private, like csc does.
10004
10005         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10006         actually work, fixes bug #37521.
10007
10008 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10009
10010         * delegate.cs: When creating the various temporary "Parameters"
10011         classes, make sure that we call the ComputeAndDefineParameterTypes
10012         on those new parameters (just like we do with the formal ones), to
10013         allow them to be resolved in the context of the DeclSpace.
10014
10015         This fixes the bug that Dick observed in Bugzilla #38530.
10016
10017 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10018
10019         * expression.cs (ResolveMemberAccess): When resolving a constant,
10020         do not attempt to pull a constant if the value was not able to
10021         generate a valid constant.
10022
10023         * const.cs (LookupConstantValue): Do not report more errors than required.
10024
10025 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10026
10027         * expression.cs: fixes bug #38328.
10028
10029 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10030
10031         * class.cs: Changed all the various members that can be part of a
10032         class from being an ArrayList to be an Array of the right type.
10033         During the DefineType type_list, interface_list, delegate_list and
10034         enum_list are turned into types, interfaces, delegates and enums
10035         arrays.  
10036
10037         And during the member population, indexer_list, event_list,
10038         constant_list, field_list, instance_constructor_list, method_list,
10039         operator_list and property_list are turned into their real arrays.
10040
10041         Although we could probably perform this operation earlier, for
10042         good error reporting we need to keep the lists and remove the
10043         lists for longer than required.
10044
10045         This optimization was triggered by Paolo profiling the compiler
10046         speed on the output of `gen-sample-program.pl' perl script. 
10047
10048         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10049         not crash in methods like MemberLookupFailed that use this field.  
10050
10051         This problem arises when the compiler fails to resolve a type
10052         during interface type definition for example.
10053
10054 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10055
10056         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10057         inherit from System.Object, so we have to stop at null, not only
10058         when reaching System.Object.
10059
10060 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10061
10062         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10063         DeclaredOnly because the parent indexer might have had a different
10064         name, but did not loop until the top of the hierarchy was reached.
10065
10066         The problem this one fixes is 35492: when a class implemented an
10067         indexer from an interface, we were getting the interface method
10068         (which was abstract) and we were flagging an error (can not invoke
10069         abstract method).
10070
10071         This also keeps bug 33089 functioning, and test-148 functioning.
10072
10073         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10074         out if a method is special is to see if it is declared in a
10075         property or event, or whether it is one of the predefined operator
10076         names.   This should fix correctly #36804.
10077
10078 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10079
10080         The goal here is to remove the dependency on EmptyCast.Peel ().
10081         Killing it completely.
10082
10083         The problem is that currently in a number of places where
10084         constants are expected, we have to "probe" for an EmptyCast, and
10085         Peel, which is not the correct thing to do, as this will be
10086         repetitive and will likely lead to errors. 
10087
10088         The idea is to remove any EmptyCasts that are used in casts that
10089         can be reduced to constants, so we only have to cope with
10090         constants. 
10091
10092         This bug hunt was triggered by Bug 37363 and the desire to remove
10093         the duplicate pattern where we were "peeling" emptycasts to check
10094         whether they were constants.  Now constants will always be
10095         constants.
10096
10097         * ecore.cs: Use an enumconstant here instead of wrapping with
10098         EmptyCast.  
10099
10100         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10101         throwing me off.  By handling this we can get rid of a few hacks.
10102
10103         * statement.cs (Switch): Removed Peel() code.
10104
10105 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10106
10107         * class.cs: Location information for error 508
10108
10109         * expression.cs (New.DoResolve): Add a guard against double
10110         resolution of an expression.  
10111
10112         The New DoResolve might be called twice when initializing field
10113         expressions (see EmitFieldInitializers, the call to
10114         GetInitializerExpression will perform a resolve on the expression,
10115         and later the assign will trigger another resolution
10116
10117         This leads to bugs (#37014)
10118
10119         * delegate.cs: The signature for EndInvoke should contain any ref
10120         or out parameters as well.  We were not doing this in the past. 
10121
10122         * class.cs (Field.Define): Do not overwrite the type definition
10123         inside the `volatile' group.  Turns out that volatile enumerations
10124         were changing the type here to perform a validity test, which
10125         broke conversions. 
10126
10127 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10128
10129         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10130         and structs, we do not want to load the instance variable
10131
10132         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10133         enum_type has to be handled like an object reference (implicit
10134         conversions exists from this to object), but the regular IsClass
10135         and IsValueType tests will never return true for this one.
10136
10137         Also we use TypeManager.IsValueType instead of type.IsValueType,
10138         just for consistency with the rest of the code (this is only
10139         needed if we ever use the construct exposed by test-180.cs inside
10140         corlib, which we dont today).
10141
10142 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10143
10144         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10145         just InternalCall.
10146
10147 2003-02-09  Martin Baulig  <martin@ximian.com>
10148
10149         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10150         (Namespace.DefineNamespaces): New static public method; this is
10151         called when we're compiling with debugging to add all namespaces
10152         to the symbol file.
10153
10154         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10155         pass it to the Namespace's .ctor.
10156
10157         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10158         and MethodBase arguments; pass the namespace ID to the symwriter;
10159         pass the MethodBase instead of the token to the symwriter.
10160         (SymbolWriter.DefineNamespace): New method to add a namespace to
10161         the symbol file.
10162
10163 2003-02-09  Martin Baulig  <martin@ximian.com>
10164
10165         * symbolwriter.cs: New file.  This is a wrapper around
10166         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10167         methods here in near future.
10168
10169 2003-02-09  Martin Baulig  <martin@ximian.com>
10170
10171         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10172         ILGenerator.MarkSequencePoint() which are actually used by the
10173         symbol writer.
10174
10175 2003-02-09  Martin Baulig  <martin@ximian.com>
10176
10177         * location.cs (SourceFile): New public sealed class.  This
10178         contains the name and an index which is used in the location's token.
10179         (Location): Reserve an appropriate number of bits in the token for
10180         the source file instead of walking over that list, this gives us a
10181         really huge performance improvement when compiling with debugging.
10182
10183         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10184         `SourceFile' argument instead of a string.
10185         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10186         but don't parse/tokenize here, we need to generate the list of all
10187         source files before we do that.
10188         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10189         the files.
10190
10191         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10192         instead of a string.
10193
10194         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10195         of a string.
10196
10197 2003-02-09  Martin Baulig  <martin@ximian.com>
10198
10199         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10200         filename on `#line default'.
10201
10202 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10203
10204         * statement.cs: don't clear the pinned var when the fixed statement
10205         returns from the method (fixes bug#37752).
10206
10207 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10208
10209         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10210         to IsValueType.
10211
10212 2003-02-07  Martin Baulig  <martin@ximian.com>
10213
10214         * driver.cs: Removed the `--debug-args' command line argument.
10215
10216         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10217         automatically by the AsssemblyBuilder.
10218         (CodeGen.InitializeSymbolWriter): We don't need to call any
10219         initialization function on the symbol writer anymore.  This method
10220         doesn't take any arguments.
10221
10222 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10223
10224         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10225         from referenced assemblies as well.
10226
10227 2003-02-02  Martin Baulig  <martin@ximian.com>
10228
10229         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10230
10231 2003-02-02  Martin Baulig  <martin@ximian.com>
10232
10233         * class.cs (Constructor.Emit): Open the symbol writer before
10234         emitting the constructor initializer.
10235         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10236         single-stepping through constructor initializers.
10237
10238 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10239
10240         * class.cs: Handle error 549: do not allow virtual methods in
10241         sealed classes. 
10242
10243 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10244
10245         * decl.cs: Check access levels when resolving types
10246
10247 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10248
10249         * statement.cs: Add parameters and locals set in catch blocks that might 
10250         return to set vector
10251
10252 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10253
10254         * class.cs (Operator): Set the SpecialName flags for operators.
10255
10256         * expression.cs (Invocation.DoResolve): Only block calls to
10257         accessors and operators on SpecialName methods.
10258
10259         (Cast.TryReduce): Handle conversions from char constants.
10260
10261
10262 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10263
10264         * statement.cs: small memory and time optimization in FlowBranching.
10265
10266 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10267
10268         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10269         problem that the last fix but in the other sid (Set).
10270
10271         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10272         access when there is no indexer in the hierarchy.
10273
10274 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10275
10276         * class.cs: Combine some if statements.
10277
10278 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10279
10280         * driver.cs: fixed bug #37187.
10281
10282 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10283
10284         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10285         any indexer, it's needed to build a list with all the indexers in the
10286         hierarchy (AllGetters), else we have problems. Fixes #35653.
10287
10288 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10289
10290         * class.cs (MethodData.Define): It is wrong for an interface
10291         implementation to be static in both cases: explicit and implicit.
10292         We were only handling this in one case.
10293
10294         Improve the if situation there to not have negations.
10295
10296         * class.cs (Field.Define): Turns out that we do not need to check
10297         the unsafe bit on field definition, only on usage.  Remove the test.
10298
10299 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10300
10301         * driver.cs: use assembly.Location instead of Codebase (the latest
10302         patch made mcs fail when using MS assemblies).
10303
10304 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10305
10306         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10307         get the path to *corlib.dll.
10308
10309 2003-01-21  Nick Drochak <ndrochak@gol.com>
10310
10311         * cs-tokenizer.cs:
10312         * pending.cs:
10313         * typemanager.cs: Remove compiler warnings
10314
10315 2003-01-20  Duncan Mak  <duncan@ximian.com>
10316
10317         * AssemblyInfo.cs: Bump the version number to 0.19.
10318
10319 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10320
10321         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10322
10323 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10324
10325         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10326
10327 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10328
10329         * cs-parser.jay: Small fix: we were not comparing the constructor
10330         name correctly.   Thanks to Zoltan for the initial pointer.
10331
10332 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10333
10334         * cs-tokenizer.cs: Set file name when specified with #line
10335
10336 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10337
10338         * cs-parser.jay: Only perform the constructor checks here if we
10339         are named like the class;  This will help provider a better
10340         error.  The constructor path is taken when a type definition is
10341         not found, but most likely the user forgot to add the type, so
10342         report that rather than the constructor error.
10343
10344 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10345
10346         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10347         allocations.
10348
10349 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10350
10351         * cs-parser.jay: Add cleanup call.
10352
10353 2003-01-13  Duncan Mak  <duncan@ximian.com>
10354
10355         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10356         consistent with other methods.
10357
10358 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10359
10360         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10361
10362 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10363
10364         * attribute.cs: only set GuidAttr to true when we have a
10365         GuidAttribute.
10366
10367 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10368
10369         * ecore.cs:
10370         * expression.cs:
10371         * typemanager.cs: fixes to allow mcs compile corlib with the new
10372         Type.IsSubclassOf fix.
10373
10374 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10375
10376         * expression.cs (LocalVariableReference.DoResolve): Classify a
10377         constant as a value, not as a variable.   Also, set the type for
10378         the variable.
10379
10380         * cs-parser.jay (fixed_statement): take a type instead of a
10381         pointer_type, so we can produce a better error message later.
10382
10383         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10384         as an error.  
10385
10386         (For.DoEmit): Make inifinite loops have a
10387         non-conditional branch back.
10388
10389         (Fixed.DoEmit): First populate the pinned variables, then emit the
10390         statement, then clear the variables.  Before I was emitting the
10391         code once for each fixed piece.
10392
10393
10394 2003-01-08  Martin Baulig  <martin@ximian.com>
10395
10396         * statement.cs (FlowBranching.MergeChild): A break in a
10397         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10398
10399 2003-01-08  Martin Baulig  <martin@ximian.com>
10400
10401         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10402         lives in the same number space than `param_map'.  Fixes #36154.
10403
10404 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10405
10406         * cs-parser.jay (constructor_declaration): Set the
10407         Constructor.ModFlags before probing for it.  This makes the
10408         compiler report 514, 515 and 132 (the code was there, but got
10409         broken). 
10410
10411         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10412         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10413         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10414
10415 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10416
10417         * enum.cs: create the enum static fields using the enum type.
10418
10419 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10420
10421         * class.cs: don't try to create the ParamBuilder for the return
10422         type if it's not needed (and handle it breaking for the ms runtime
10423         anyway).
10424
10425 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10426
10427         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10428
10429 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10430
10431         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10432         the command.   This showed up while compiling the JANET source
10433         code, which used \r as its only newline separator.
10434
10435 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10436
10437         * class.cs (Method.Define): If we are an operator (because it
10438         reuses our code), then set the SpecialName and HideBySig.  #36128
10439
10440 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10441
10442         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10443         exception, report error 120 `object reference required'.
10444
10445         * driver.cs: Add --pause option, used during to measure the size
10446         of the process as it goes with --timestamp.
10447
10448         * expression.cs (Invocation.DoResolve): Do not allow methods with
10449         SpecialName to be invoked.
10450
10451 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10452
10453         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10454         number before adding it.
10455
10456 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10457
10458         * ecore.cs (StandardImplicitConversion): When in an unsafe
10459         context, we allow conversion between void * to any other pointer
10460         type. This fixes bug #35973.
10461
10462 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10463
10464         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10465         is not thrown when extensionless outputs are used 
10466
10467 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10468
10469         * rootcontext.cs: fixed compilation of corlib.
10470
10471 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10472
10473         * attribute.cs (Attributes.Contains): Add new method.
10474
10475         * class.cs (MethodCore.LabelParameters): if the parameter is an
10476         `out' parameter, check that no attribute `[In]' has been passed.
10477
10478         * enum.cs: Handle the `value__' name in an enumeration.
10479
10480 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10481
10482         * decl.cs: Added special case to allow overrides on "protected
10483         internal" methods
10484
10485 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10486
10487         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10488         since it makes much more sense.
10489
10490         (Attributes.ctor): Don't require a Location parameter.
10491
10492         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10493
10494         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10495         since we already have that information per attribute.
10496
10497         * everywhere : make appropriate changes.
10498
10499         * class.cs (LabelParameters): Write the code which actually
10500         applies attributes to the return type. We can't do this on the MS
10501         .NET runtime so we flag a warning in the case an exception is
10502         thrown.
10503
10504 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10505
10506         * const.cs: Handle implicit null conversions here too.
10507
10508 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10509
10510         * class.cs (MethodCore.LabelParameters): Remove the extra
10511         Type [] parameter since it is completely unnecessary. Instead
10512         pass in the method's attributes so that we can extract
10513         the "return" attribute.
10514
10515 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10516
10517         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10518         of ignoring it and letting the compile continue.
10519
10520         * typemanager.cs (ChangeType): use an extra argument to return an
10521         error condition instead of throwing an exception.
10522
10523 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10524
10525         * expression.cs (Unary.TryReduce): mimic the code for the regular
10526         code path.  Perform an implicit cast in the cases where we can
10527         implicitly convert to one of the integral types, and then reduce
10528         based on that constant.   This fixes bug #35483.
10529
10530 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10531
10532         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10533
10534 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10535
10536         * namespace.cs: fixed bug #35489.
10537
10538 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10539
10540         * class.cs: Remove some dead code.
10541
10542         * cs-parser.jay: Estimate the number of methods needed
10543         (RootContext.MethodCount);
10544
10545         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10546         numbers instead of StringBuilders.
10547
10548         * support.cs (PtrHashtable): Add constructor with initial size;
10549         We can now reduce reallocations of the method table.
10550
10551 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10552
10553         * attribute.cs (ApplyAttributes): Keep track of the emitted
10554         attributes on a per-target basis. This fixes bug #35413.
10555
10556 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10557
10558         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10559         default to the Windows 1252 encoding.
10560
10561         (UnixParseOption): Support version, thanks to Alp for the missing
10562         pointer. 
10563
10564         * AssemblyInfo.cs: Add nice assembly information.
10565
10566         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10567         (bug 35169).
10568
10569         * cs-parser.jay: Allow a trailing comma before the close bracked
10570         in the attribute_section production.
10571
10572         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10573         address of the instance was being taken, I will take this out,
10574         because we take the address of the object immediately here.
10575
10576 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10577
10578         * typemanager.cs (AreMultipleAllowed): Take care of the most
10579         obvious case where attribute type is not in the current assembly -
10580         stupid me ;-)
10581
10582 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10583
10584         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10585         definitions, instead of doing that afterwards.  
10586
10587         Also we use a nice little hack, depending on the constructor, we
10588         know if we are a "composed" name or a simple name.  Hence, we
10589         avoid the IndexOf test, and we avoid 
10590
10591         * codegen.cs: Add code to assist in a bug reporter to track down
10592         the source of a compiler crash. 
10593
10594 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10595
10596         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10597         types have been emitted for a given element and flag an error
10598         if something which does not have AllowMultiple set is used more
10599         than once.
10600
10601         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10602         attribute types and their corresponding AllowMultiple properties
10603
10604         (AreMultipleAllowed): Check the property for a given type.
10605
10606         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10607         property in the case we have a TypeContainer.
10608
10609         (Attributes.AddAttribute): Detect duplicates and just skip on
10610         adding them. This trivial fix catches a pretty gross error in our
10611         attribute emission - global attributes were being emitted twice!
10612
10613         Bugzilla bug #33187 is now fixed.
10614
10615 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10616
10617         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10618         instead of pp_and).
10619
10620         * expression.cs (Binary.ResolveOperator): I can only use the
10621         Concat (string, string, string) and Concat (string, string,
10622         string, string) if the child is actually a concatenation of
10623         strings. 
10624
10625 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10626
10627         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10628         context where we need a 2-character lookahead.
10629
10630         * pending.cs (PendingImplementation): Rework so we can keep track
10631         of interface types all the time, and flag those which were
10632         implemented by parents as optional.
10633
10634 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10635
10636         * expression.cs (Binary.ResolveOperator): Use
10637         String.Concat(string,string,string) or
10638         String.Concat(string,string,string,string) when possible. 
10639
10640         * typemanager: More helper methods.
10641
10642
10643 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10644
10645         * pending.cs: remove the bogus return from GetMissingInterfaces()
10646         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10647
10648 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10649
10650         * namespace.cs: avoid duplicated 'using xxx' being added to
10651         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10652         when we get more than one 'using' statement for the same namespace.
10653         Report a CS0105 warning for it.
10654
10655 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10656
10657         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10658         of calling getChar/putback, uses internal knowledge of it.    
10659
10660         (xtoken): Reorder tokenizer so most common patterns are checked
10661         first.  This reduces the compilation time in another 5% (from 8.11s
10662         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10663
10664         The parsing time is 22% of the compilation in mcs, and from that
10665         64% is spent on the tokenization process.  
10666
10667         I tried using a binary search for keywords, but this is slower
10668         than the hashtable.  Another option would be to do a couple of
10669         things:
10670
10671                 * Not use a StringBuilder, instead use an array of chars,
10672                   with a set value.  Notice that this way we could catch
10673                   the 645 error without having to do it *afterwards*.
10674
10675                 * We could write a hand-parser to avoid the hashtable
10676                   compares altogether.
10677
10678         The identifier consumption process takes 37% of the tokenization
10679         time.  Another 15% is spent on is_number.  56% of the time spent
10680         on is_number is spent on Int64.Parse:
10681
10682                 * We could probably choose based on the string length to
10683                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10684                   computations. 
10685
10686         Another 3% is spend on wrapping `xtoken' in the `token' function.
10687
10688         Handle 0xa0 as whitespace (#34752)
10689
10690 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10691
10692         * typemanager.cs (IsCLRType): New routine to tell whether a type
10693         is one of the builtin types.  
10694
10695         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10696         typecode in more places instead of doing pointer comparissions.
10697         We could leverage some knowledge about the way the typecodes are
10698         laid out.
10699
10700         New code to cache namespaces in assemblies, it is currently not
10701         invoked, to be used soon.
10702
10703         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10704
10705         * expression.cs (Binary.ResolveOperator): specially handle
10706         strings, and do not perform user-defined operator overloading for
10707         built-in types.
10708
10709 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10710
10711         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10712         internalcall as it is a pretty simple operation;  Avoid whenever
10713         possible to call Char.IsLetter.
10714
10715         (consume_identifier): Cut by half the number of
10716         hashtable calls by merging the is_keyword and GetKeyword behavior.
10717
10718         Do not short-circuit, because if we do, we
10719         report errors (ie, #if false && true would produce an invalid
10720         directive error);
10721
10722
10723 2002-11-24  Martin Baulig  <martin@ximian.com>
10724
10725         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10726         check constant ranges and report a CS0221.  Fixes #33186.
10727
10728 2002-11-24  Martin Baulig  <martin@ximian.com>
10729
10730         * cs-parser.jay: Make this work for uninitialized variable
10731         declarations in the `for' initializer.  Fixes #32416.
10732
10733 2002-11-24  Martin Baulig  <martin@ximian.com>
10734
10735         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10736         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10737
10738 2002-11-24  Martin Baulig  <martin@ximian.com>
10739
10740         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10741         argument; if true, we also check for user-defined conversions.
10742         This is only needed if both arguments are of a user-defined type.
10743         Fixes #30443, added test-175.cs.
10744         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10745
10746         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10747
10748 2002-11-24  Martin Baulig  <martin@ximian.com>
10749
10750         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10751         function to get the store opcode.
10752         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10753         only emit the Ldelema if the store opcode is Stobj.  You must run
10754         both test-34 and test-167 to test this.  Fixes #34529.
10755
10756 2002-11-23  Martin Baulig  <martin@ximian.com>
10757
10758         * ecore.cs (Expression.MemberLookup): Added additional
10759         `qualifier_type' argument which is used when we're being called
10760         from MemberAccess.DoResolve() and null if we're called from a
10761         SimpleName lookup.
10762         (Expression.MemberLookupFailed): New method to report errors; this
10763         does the CS1540 check and reports the correct error message.
10764
10765         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10766         argument for the CS1540 check and redone the way how we're dealing
10767         with private members.  See the comment in the source code for details.
10768         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10769         `closure_start_type' to `closure_qualifier_type' and check whether
10770         it's not null.  It was not this filter being broken, it was just
10771         being called with the wrong arguments.
10772
10773         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10774         and pass it the correct `qualifier_type'; this also does the error
10775         handling for us.
10776
10777 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10778
10779         * expression.cs (Invocation.EmitParams): If the we are dealing
10780         with a non-built-in value type, load its address as well.
10781
10782         (ArrayCreation): Use a a pretty constant instead
10783         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10784         static initializers.  
10785
10786         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10787         because they are not really value types, just glorified integers. 
10788
10789         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10790
10791         * ecore.cs: Remove redundant code for enumerations, make them use
10792         the same code path as everything else, fixes the casting issue
10793         with enumerations in Windows.Forms.
10794
10795         * attribute.cs: Do only cast to string if it is a string, the
10796         validation happens later.
10797
10798         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10799         people upgrade their corlibs.
10800
10801         * ecore.cs: Oops, enumerations were not following the entire code path
10802
10803 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10804
10805         * typemanager.cs (FilterWithClosure): Commented out the test for
10806         1540 in typemanager.cs, as it has problems when accessing
10807         protected methods from a parent class (see test-174.cs). 
10808
10809         * attribute.cs (Attribute.ValidateGuid): new method.
10810         (Attribute.Resolve): Use above.
10811
10812 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10813
10814         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10815
10816         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10817         handling for enumerations, as we only needed the TypeContainer
10818         functionality to begin with (this is required for the fix below to
10819         work for enums that reference constants in a container class for
10820         example). 
10821
10822         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10823
10824         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10825         a valid TypeBuilder to perform lookups on.o
10826
10827         * class.cs (InheritableMemberSignatureCompare): Use true in the
10828         call to GetGetMethod and GetSetMethod, because we are comparing
10829         the signature, and we need to get the methods *even* if they are
10830         private. 
10831
10832         (PropertyBase.CheckBase): ditto.
10833
10834         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10835         GotoCase.Resolve): Use Peel on EmpytCasts.
10836
10837         * ecore.cs (EmptyCast): drop child, add Peel method.
10838
10839 2002-11-17  Martin Baulig  <martin@ximian.com>
10840
10841         * ecore.cs (EmptyCast.Child): New public property.
10842
10843         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10844         label resolved to an EmptyCast.  Fixes #34162.
10845         (GotoCase.Resolve): Likewise.
10846         (Block.EmitMeta): Likewise.
10847
10848 2002-11-17  Martin Baulig  <martin@ximian.com>
10849
10850         * expression.cs (Invocation.BetterConversion): Prefer int over
10851         uint; short over ushort; long over ulong for integer literals.
10852         Use ImplicitConversionExists instead of StandardConversionExists
10853         since we also need to check for user-defined implicit conversions.
10854         Fixes #34165.  Added test-173.cs.
10855
10856 2002-11-16  Martin Baulig  <martin@ximian.com>
10857
10858         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10859         with the `true' and `false' literals.  Fixes #33151.
10860
10861 2002-11-16  Martin Baulig  <martin@ximian.com>
10862
10863         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10864         October 22nd; don't do the cs1540 check for static members.
10865
10866         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10867         now using our own filter here and doing the cs1540 check again.
10868
10869 2002-11-16  Martin Baulig  <martin@ximian.com>
10870
10871         * support.cs (InternalParameters): Don't crash if we don't have
10872         any fixed parameters.  Fixes #33532.
10873
10874 2002-11-16  Martin Baulig  <martin@ximian.com>
10875
10876         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10877         when looking up static methods to make this work on Windows.
10878         Fixes #33773.
10879
10880 2002-11-16  Martin Baulig  <martin@ximian.com>
10881
10882         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10883         a setter rather than using PropertyInfo.CanWrite.
10884
10885 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10886
10887         * class.cs: Allow acces to block member by subclasses. Fixes build
10888         breaker.
10889
10890 2002-11-14  Martin Baulig  <martin@ximian.com>
10891
10892         * class.cs (Constructor.Emit): Added the extern/block check.
10893         Fixes bug #33678.
10894
10895 2002-11-14  Martin Baulig  <martin@ximian.com>
10896
10897         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10898         iteration while looking for indexers, this is needed because the
10899         indexer may have a different name in our base classes.  Fixed the
10900         error reporting (no indexers at all, not get accessor, no
10901         overloaded match).  Fixes bug #33089.
10902         (IndexerAccess.DoResolveLValue): Likewise.
10903
10904 2002-11-14  Martin Baulig  <martin@ximian.com>
10905
10906         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10907         indexers.  Fixes the first part of bug #33089.
10908         (MethodSignature.InheritableMemberSignatureCompare): Added support
10909         for properties.
10910
10911 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10912
10913         * attribute.cs (Attribute.Resolve): Catch the
10914         NullReferenceException and report it since it isn't supposed to
10915         happen. 
10916
10917 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10918
10919         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10920         LogicalOr and LogicalAnd that can benefit from recursively
10921         handling EmitBranchable.  The code now should be nice for Paolo.
10922
10923 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10924
10925         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10926         the Type lookups, as we perform quite a number of lookups on
10927         non-Types.  This can be removed once we can deterministically tell
10928         whether we have a type or a namespace in advance.
10929
10930         But this might require special hacks from our corlib.
10931
10932         * TODO: updated.
10933
10934         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10935         and double which avoids a conversion from an integer to a double.
10936
10937         * expression.cs: tiny optimization, avoid calling IsConstant,
10938         because it effectively performs the lookup twice.
10939
10940 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10941
10942         But a bogus return here to keep the semantics of the old code
10943         until the Mono runtime is fixed.
10944
10945         * pending.cs (GetMissingInterfaces): New method used to remove all
10946         the interfaces that are already implemented by our parent
10947         classes from the list of pending methods. 
10948
10949         * interface.cs: Add checks for calls after ResolveTypeExpr.
10950
10951 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10952
10953         * class.cs (Class.Emit): Report warning 67: event not used if the
10954         warning level is beyond 3.
10955
10956         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10957         being a NullLiteral.
10958
10959         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10960         specifiers. 
10961
10962         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10963         path that might fail if a type can not be resolved.
10964
10965         * expression.cs (Binary.Emit): Emit unsigned versions of the
10966         operators. 
10967
10968         * driver.cs: use error 5.
10969
10970 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10971
10972         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10973
10974 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10975
10976         * cs-parser.jay (switch_section): A beautiful patch from Martin
10977         Baulig that fixed 33094.
10978
10979 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10980
10981         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10982         Check whether the base is abstract and report an error if so.
10983
10984         * expression.cs (IndexerAccess.DoResolveLValue,
10985         IndexerAccess.DoResolve): ditto. 
10986
10987         (Invocation.DoResolve): ditto.
10988
10989         (Invocation.FullMethodDesc): Improve the report string.
10990
10991         * statement.cs (Block): Eliminate IsVariableDefined as it is
10992         basically just a wrapper for GetVariableInfo.
10993
10994         * ecore.cs (SimpleName): Use new 
10995
10996         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10997         type, as we return the actual parameter ref/unref state on a
10998         different call.
10999
11000 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11001
11002         * support.cs: Return proper flags REF/OUT fixing the previous
11003         commit.  
11004
11005         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11006         not used to mean `ref' but `ref or out' in ParameterReference
11007
11008         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11009         full type signature instead of calling TypeManger.CSharpName
11010         ourselves. 
11011
11012         * support.cs (InternalParameters.ParameterDesc): Do not compare
11013         directly to the modflags, because REF/OUT will actually be bitsets
11014         if set. 
11015
11016         * delegate.cs (VerifyMethod): Check also the modifiers.
11017
11018         * cs-tokenizer.cs: Fix bug where floating point values with an
11019         exponent where a sign was missing was ignored.
11020
11021         * driver.cs: Allow multiple assemblies to be specified in a single
11022         /r: argument
11023
11024 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11025
11026         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11027         because identifiers after a parenthesis would end up in this kind
11028         of production, and we needed to desamiguate it for having casts
11029         like:
11030
11031                 (UserDefinedType *) xxx
11032
11033 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11034
11035         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11036         we should set on the Bindingflags.NonPublic, but not turn on
11037         private_ok.  private_ok controls whether a Private member is
11038         returned (this is chekced on the filter routine), while the
11039         BindingFlags.NonPublic just controls whether private/protected
11040         will be allowed.   This fixes the problem part of the problem of
11041         private properties being allowed to be used in derived classes.
11042
11043         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11044         so we can call the children DoResolveLValue method (this will
11045         properly signal errors on lvalue assignments to base properties)
11046
11047         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11048         getter are null, and we have a property info, we know that this
11049         happened because the lookup failed, so we report an error 122 for
11050         protection level violation.
11051
11052         We also silently return if setter and getter are null in the
11053         resolve functions, this condition only happens if we have flagged
11054         the error before.  This is the other half of the problem. 
11055
11056         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11057         not have accessibility information, that is why we were returning
11058         true in the filter function in typemanager.cs.
11059
11060         To properly report 122 (property is inaccessible because of its
11061         protection level) correctly, we report this error in ResolveAccess
11062         by failing if both the setter and the getter are lacking (ie, the
11063         lookup failed). 
11064
11065         DoResolve and DoLResolve have been modified to check for both
11066         setter/getter being null and returning silently, the reason being
11067         that I did not want to put the knowledge about this error in upper
11068         layers, like:
11069
11070         int old = Report.Errors;
11071         x = new PropertyExpr (...);
11072         if (old != Report.Errors)
11073                 return null;
11074         else
11075                 return x;
11076
11077         So the property expr is returned, but it is invalid, so the error
11078         will be flagged during the resolve process. 
11079
11080         * class.cs: Remove InheritablePropertySignatureCompare from the
11081         class, as we no longer depend on the property signature to compute
11082         whether it is possible to implement a method or not.
11083
11084         The reason is that calling PropertyInfo.GetGetMethod will return
11085         null (in .NET, in Mono it works, and we should change this), in
11086         cases where the Get Method does not exist in that particular
11087         class.
11088
11089         So this code:
11090
11091         class X { public virtual int A { get { return 1; } } }
11092         class Y : X { }
11093         class Z : Y { public override int A { get { return 2; } } }
11094
11095         Would fail in Z because the parent (Y) would not have the property
11096         defined.  So we avoid this completely now (because the alternative
11097         fix was ugly and slow), and we now depend exclusively on the
11098         method names.
11099
11100         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11101         reference method, instead of using the property.
11102
11103         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11104         routines are gone now.
11105
11106         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11107         names, they were incorrectly named.
11108
11109         * cs-tokenizer.cs: Return are more gentle token on failure. 
11110
11111         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11112         had an out-of-sync index variable, which caused it to remove from
11113         the list of pending methods the wrong method sometimes.
11114
11115 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11116
11117         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11118         CanWrite, because those refer to this particular instance of the
11119         property, and do not take into account the fact that we can
11120         override single members of a property.
11121
11122         Constructor requires an EmitContext.  The resolution process does
11123         not happen here, but we need to compute the accessors before,
11124         because the resolution does not always happen for properties.
11125
11126         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11127         subclass, before we did not update this flag, but we did update
11128         bindingflags. 
11129
11130         (GetAccessors): Drop this routine, as it did not work in the
11131         presence of partially overwritten set/get methods. 
11132
11133         Notice that this broke the cs1540 detection, but that will require
11134         more thinking. 
11135
11136 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11137
11138         * class.cs:
11139         * codegen.cs:
11140         * driver.cs: issue a warning instead of an error if we don't support
11141         debugging for the platform. Also ignore a couple of errors that may
11142         arise when trying to write the symbols. Undo my previous patch.
11143
11144 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11145
11146         * driver.cs: ignore /debug switch except for Unix platforms.
11147
11148 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11149
11150         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11151
11152 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11153
11154         * driver.cs: Do not make mcs-debug conditional, so we do not break
11155         builds that use it.
11156
11157         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11158         review this patch.  But basically after all the children variables
11159         have been merged, the value of "Breaks" was not being set to
11160         new_breaks for Switch blocks.  I think that it should be set after
11161         it has executed.  Currently I set this to the value of new_breaks,
11162         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11163         conservative, but I do not understand this code very well.
11164
11165         I did not break anything in the build, so that is good ;-)
11166
11167         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11168
11169 2002-10-20  Mark Crichton  <crichton@gimp.org>
11170
11171         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11172
11173 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11174
11175         * cfold.cs: Fixed compile blocker.
11176
11177 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11178
11179         * driver.cs: I was chekcing the key, not the file.
11180
11181 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11182
11183         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11184         message that we were generating - we just need to silently return
11185         a null.
11186
11187 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11188
11189         * class.cs (Event.Define): Change my previous commit, as this
11190         breaks the debugger.  This is a temporary hack, as it seems like
11191         the compiler is generating events incorrectly to begin with.
11192
11193         * expression.cs (Binary.ResolveOperator): Added support for 
11194         "U operator - (E x, E y)"
11195
11196         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11197         y)".
11198
11199         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11200         init-only variables, but this path did not take into account that
11201         there might be also instance readonly variables.  Correct this
11202         problem. 
11203
11204         This fixes bug 32253
11205
11206         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11207         delegates as well.
11208
11209         * driver.cs: Change the extension for modules to `netmodule'
11210
11211         * cs-parser.jay: Improved slightly the location tracking for
11212         the debugger symbols.
11213
11214         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11215         modifiers that were specified instead of the hardcoded value
11216         (FamAndAssem).  This was basically ignoring the static modifier,
11217         and others.  Fixes 32429.
11218
11219         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11220         fixed a bug in the process (32476)
11221
11222         * expression.cs (ArrayAccess.EmitAssign): Patch from
11223         hwang_rob@yahoo.ca that fixes bug 31834.3
11224
11225 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11226
11227         * driver.cs: Make the module extension .netmodule.
11228
11229 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11230
11231         * driver.cs: Report an error if the resource file is not found
11232         instead of crashing.
11233
11234         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11235         false, like Emit does.
11236
11237 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11238
11239         * typemanager.cs: Remove unused private member.  Also reported mcs
11240         bug to report this as a warning like csc.
11241
11242 2002-10-15  Martin Baulig  <martin@gnome.org>
11243
11244         * statement.cs (Statement.Emit): Made this a virtual method; emits
11245         the line number info and calls DoEmit().
11246         (Statement.DoEmit): New protected abstract method, formerly knows
11247         as Statement.Emit().
11248
11249         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11250
11251 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11252
11253         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11254         have fixed a remaining problem: not every AddXXXX was adding a
11255         fully qualified name.  
11256
11257         Now everyone registers a fully qualified name in the DeclSpace as
11258         being defined instead of the partial name.  
11259
11260         Downsides: we are slower than we need to be due to the excess
11261         copies and the names being registered this way.  
11262
11263         The reason for this is that we currently depend (on the corlib
11264         bootstrap for instance) that types are fully qualified, because
11265         we dump all the types in the namespace, and we should really have
11266         types inserted into the proper namespace, so we can only store the
11267         basenames in the defined_names array.
11268
11269 2002-10-10  Martin Baulig  <martin@gnome.org>
11270
11271         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11272         from bug #31834, see the bug report for a testcase which is
11273         miscompiled.
11274
11275 2002-10-10  Martin Baulig  <martin@gnome.org>
11276
11277         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11278         flow analysis code for this.
11279
11280         * statement.cs (Do, While, For): Tell the flow analysis code about
11281         infinite loops.
11282         (FlowBranching.UsageVector): Added support for infinite loops.
11283         (Block.Resolve): Moved the dead code elimination here and use flow
11284         analysis to do it.
11285
11286 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11287
11288         * class.cs (Field.Define): Catch cycles on struct type
11289         definitions. 
11290
11291         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11292         fields if the fields are static.  We only need to check instance
11293         fields. 
11294
11295         * expression.cs (As.DoResolve): Test for reference type.
11296
11297         * statement.cs (Using.ResolveExpression): Use
11298         ConvertImplicitRequired, not ConvertImplicit which reports an
11299         error on failture
11300         (Using.ResolveLocalVariableDecls): ditto.
11301
11302         * expression.cs (Binary.ResolveOperator): Report errors in a few
11303         places where we had to.
11304
11305         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11306
11307 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11308
11309         * expression.cs: Use StoreFromPtr instead of extracting the type
11310         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11311
11312         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11313         an enumeration value to a System.Enum, but System.Enum is not a
11314         value type, but an class type, so we need to box.
11315
11316         (Expression.ConvertExplicit): One codepath could return
11317         errors but not flag them.  Fix this.  Fixes #31853
11318
11319         * parameter.cs (Resolve): Do not allow void as a parameter type.
11320
11321 2002-10-06  Martin Baulig  <martin@gnome.org>
11322
11323         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11324         if it's a class type and not a struct.  Fixes #31815.
11325
11326 2002-10-06  Martin Baulig  <martin@gnome.org>
11327
11328         * statement.cs: Reworked the flow analysis code a bit to make it
11329         usable for dead code elimination.
11330
11331 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11332
11333         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11334
11335 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11336
11337         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11338         to fix the test 165, will investigate deeper.
11339
11340 2002-10-04  Martin Baulig  <martin@gnome.org>
11341
11342         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11343         finally blocks actually work.
11344         (Try.Resolve): We don't need to create a sibling for `finally' if
11345         there is no finally block.
11346
11347 2002-10-04  Martin Baulig  <martin@gnome.org>
11348
11349         * class.cs (Constructor.Define): The default accessibility for a
11350         non-default constructor is private, not public.
11351
11352 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11353
11354         * class.cs (Constructor): Make AllowedModifiers public, add
11355         EXTERN.
11356
11357         * cs-parser.jay: Perform the modifiers test here, as the
11358         constructor for the Constructor class usually receives a zero
11359         because of the way we create it (first we create, later we
11360         customize, and we were never checking the modifiers).
11361
11362         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11363         is a version of LookupTypeReflection that includes the type-name
11364         cache.  This can be used as a fast path for functions that know
11365         the fully qualified name and are only calling into *.GetType() to
11366         obtain a composed type.
11367
11368         This is also used by TypeManager.LookupType during its type
11369         composition.
11370
11371         (LookupType): We now also track the real type name, as sometimes
11372         we can get a quey for the real type name from things like
11373         ComposedCast.  This fixes bug 31422.
11374
11375         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11376         complete type fullname, it does not have to go through the type
11377         resolution system to obtain the composed version of the type (for
11378         obtaining arrays or pointers).
11379
11380         (Conditional.Emit): Use the EmitBoolExpression to
11381         generate nicer code, as requested by Paolo.
11382
11383         (ArrayCreation.CheckIndices): Use the patch from
11384         hwang_rob@yahoo.ca to validate the array initializers. 
11385
11386 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11387
11388         * class.cs (ConstructorInitializer.Emit): simplify code by using
11389         Invocation.EmitCall, and at the same time, fix the bugs in calling
11390         parent constructors that took variable arguments. 
11391
11392         * ecore.cs (Expression.ConvertNumericExplicit,
11393         Expression.ImplicitNumericConversion): Remove the code that
11394         manually wrapped decimal (InternalTypeConstructor call is now gone
11395         as well).
11396
11397         * expression.cs (Cast.TryReduce): Also handle decimal types when
11398         trying to perform a constant fold on the type.
11399
11400         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11401
11402         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11403         that only turned off an error report, and did nothing else. 
11404
11405 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11406
11407         * driver.cs: Handle and ignore /fullpaths
11408
11409 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11410
11411         * expression.cs (Binary.ResolveOperator): Catch the case where
11412         DoNumericPromotions returns true, 
11413
11414         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11415
11416 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11417
11418         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11419         report error 70.
11420
11421 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11422
11423         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11424         conversion exists, but it is also required that the conversion be
11425         performed.  This manifested in "(Type64Enum) 2".  
11426
11427         * class.cs (TypeManager.AddMethod): The fix is not to change
11428         AddEnum, because that one was using a fully qualified name (every
11429         DeclSpace derivative does), but to change the AddMethod routine
11430         that was using an un-namespaced name.  This now correctly reports
11431         the duplicated name.
11432
11433         Revert patch until I can properly fix it.  The issue
11434         is that we have a shared Type space across all namespaces
11435         currently, which is wrong.
11436
11437         Options include making the Namespace a DeclSpace, and merge
11438         current_namespace/current_container in the parser.
11439
11440 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11441
11442         * cs-parser.jay: Improve error reporting when we get a different
11443         kind of expression in local_variable_type and
11444         local_variable_pointer_type. 
11445
11446         Propagate this to avoid missleading errors being reported.
11447
11448         * ecore.cs (ImplicitReferenceConversion): treat
11449         TypeManager.value_type as a target just like object_type.   As
11450         code like this:
11451
11452         ValueType v = 1;
11453
11454         Is valid, and needs to result in the int 1 being boxed before it
11455         is assigned to the value type v.
11456
11457         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11458         to validate the enumeration name.
11459
11460         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11461         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11462         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11463
11464         * ecore.cs (TryImplicitIntConversion): When doing an
11465         implicit-enumeration-conversion, check if the type is 64-bits and
11466         perform a conversion before passing to EnumConstant.
11467
11468 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11469
11470         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11471         report ambiguous type references.  Unlike the MS version, we
11472         report what the ambiguity is.   Innovation at work ;-)
11473
11474         (DeclSpace.FindType): Require a location argument to
11475         display when we display an ambiguous error.
11476
11477         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11478
11479         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11480
11481         * expression.cs (EmitDynamicInitializers): Apply patch from
11482         hwang_rob@yahoo.ca that fixes the order in which we emit our
11483         initializers. 
11484
11485 2002-09-21  Martin Baulig  <martin@gnome.org>
11486
11487         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11488         delegate takes no arguments.
11489
11490 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11491
11492         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11493         from integers.
11494
11495         * expression.cs: Extract the underlying type.
11496
11497         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11498
11499         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11500
11501 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11502
11503         * class.cs (TypeContainer.DefineType): We can not use the nice
11504         PackingSize with the size set to 1 DefineType method, because it
11505         will not allow us to define the interfaces that the struct
11506         implements.
11507
11508         This completes the fixing of bug 27287
11509
11510         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11511         means also structs.  This fixes part of the problem. 
11512         (Expresion.ImplicitReferenceConversionExists): ditto.
11513
11514         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11515         error if there were no errors reported during the type lookup
11516         process, to avoid duplicates or redundant errors.  Without this
11517         you would get an ambiguous errors plus a type not found.  We have
11518         beaten the user enough with the first error.  
11519
11520         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11521         reference. 
11522
11523         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11524         during the resolution process, stop the lookup, this avoids
11525         repeated error reports (same error twice).
11526
11527         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11528
11529         * typemanager.cs (LookupType): Redo the type lookup code to match
11530         the needs of System.Reflection.  
11531
11532         The issue is that System.Reflection requires references to nested
11533         types to begin with a "+" sign instead of a dot.  So toplevel
11534         types look like: "NameSpace.TopLevelClass", and nested ones look
11535         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11536         levels. 
11537
11538 2002-09-19  Martin Baulig  <martin@gnome.org>
11539
11540         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11541         says that a method always returns or always throws an exception,
11542         don't report the CS0161.
11543
11544         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11545         set `Returns = new_returns'.
11546
11547 2002-09-19  Martin Baulig  <martin@gnome.org>
11548
11549         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11550         to an enum constant, check for a CS0176.
11551
11552 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11553
11554         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11555         for operators that must be in pairs and report errors.
11556
11557         * ecore.cs (SimpleName.DoResolveType): During the initial type
11558         resolution process, when we define types recursively, we must
11559         check first for types in our current scope before we perform
11560         lookups in the enclosing scopes.
11561
11562         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11563
11564         (Invocation.VerifyArgumentsCompat): Call
11565         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11566         I thought we were supposed to always call this, but there are a
11567         few places in the code where we dont do it.
11568
11569 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11570
11571         * driver.cs: Add support in -linkres and -resource to specify the
11572         name of the identifier.
11573
11574 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11575
11576         * ecore.cs (StandardConversionExists): Sync with the conversion
11577         code: allow anything-* to void* conversions.
11578
11579         (FindMostSpecificSource): Use an Expression argument
11580         instead of a Type, because we might be handed over a Literal which
11581         gets a few more implicit conversions that plain types do not.  So
11582         this information was being lost.
11583
11584         Also, we drop the temporary type-holder expression when not
11585         required.
11586
11587 2002-09-17  Martin Baulig  <martin@gnome.org>
11588
11589         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11590         this is an explicit interface implementation.
11591
11592 2002-09-17  Martin Baulig  <martin@gnome.org>
11593
11594         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11595         different `IndexerName' attributes.
11596
11597         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11598         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11599         virtual CommonResolve().
11600
11601 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11602
11603         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11604         and convert that to the UnderlyingType.
11605
11606         * statement.cs (Foreach.Resolve): Indexers are just like variables
11607         or PropertyAccesses.
11608
11609         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11610         inside quoted strings, we were not doing this before.
11611
11612 2002-09-16  Martin Baulig  <martin@gnome.org>
11613
11614         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11615         resolve it.  This is needed for the definite assignment check of the
11616         instance expression, fixes bug #29846.
11617         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11618
11619 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11620
11621         * parameter.cs: Fix compile error.  Cannot reference static member
11622         from an instance object.  Is this an mcs bug?
11623
11624 2002-09-14  Martin Baulig  <martin@gnome.org>
11625
11626         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11627         multiple times.  Fixes bug #30295, added test-166.cs.
11628
11629 2002-09-14  Martin Baulig  <martin@gnome.org>
11630
11631         * statement.cs (Block.Emit): Don't emit unreachable code.
11632         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11633         `break' statements.
11634         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11635
11636 2002-09-14  Martin Baulig  <martin@gnome.org>
11637
11638         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11639         is set.
11640
11641 2002-09-14  Martin Baulig  <martin@gnome.org>
11642
11643         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11644         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11645         be false on the ms runtime.
11646
11647 2002-09-13  Martin Baulig  <martin@gnome.org>
11648
11649         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11650         the CS0038 error message.
11651
11652 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11653
11654         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11655         constant inside, return it.
11656
11657 2002-09-12  Martin Baulig  <martin@gnome.org>
11658
11659         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11660         implicit conversion can be done between enum types.
11661
11662         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11663         check whether an implicit conversion to the current enum's UnderlyingType
11664         exists and report an error if not.
11665
11666         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11667         without debugging support.
11668
11669         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11670         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11671
11672 2002-09-12  Martin Baulig  <martin@gnome.org>
11673
11674         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11675
11676         * ecore.cs (IMemberExpr.DeclaringType): New property.
11677         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11678         nonstatic member of an outer type (CS0038).
11679
11680 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11681
11682         * driver.cs: Activate the using-error detector at warning level
11683         4 (at least for MS-compatible APIs).
11684
11685         * namespace.cs (VerifyUsing): Small buglett fix.
11686
11687         * pending.cs (PendingImplementation): pass the container pointer. 
11688
11689         * interface.cs (GetMethods): Allow for recursive definition.  Long
11690         term, I would like to move every type to support recursive
11691         definitions, not the current ordering mechanism that we have right
11692         now.
11693
11694         The situation is this: Attributes are handled before interfaces,
11695         so we can apply attributes to interfaces.  But some attributes
11696         implement interfaces, we will now handle the simple cases
11697         (recursive definitions will just get an error).  
11698
11699         * parameter.cs: Only invalidate types at the end if we fail to
11700         lookup all types.  
11701
11702 2002-09-09  Martin Baulig  <martin@gnome.org>
11703
11704         * ecore.cs (PropertyExpr.Emit): Also check for
11705         TypeManager.system_int_array_get_length so this'll also work when
11706         compiling corlib.  Fixes #30003.
11707
11708 2002-09-09  Martin Baulig  <martin@gnome.org>
11709
11710         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11711         and throw an exception if we can't get the type's size.  Fixed #30040,
11712         added test-165.cs.
11713
11714 2002-09-09  Martin Baulig  <martin@gnome.org>
11715
11716         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11717
11718         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11719         context.  Fixes bug #30027.
11720
11721         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11722         virtual functions.  Fixes bug #30043, added test-164.cs.
11723
11724 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11725
11726         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11727
11728 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11729
11730         * driver.cs: Use an object to get the windows codepage since it's not a
11731         static property.
11732
11733 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11734
11735         * statement.cs (For.Emit): for infinite loops (test == null)
11736         return whether there is a break inside, not always "true".
11737
11738         * namespace.cs (UsingEntry): New struct to hold the name of the
11739         using definition, the location where it is defined, and whether it
11740         has been used in a successful type lookup.
11741
11742         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11743         strings.
11744
11745         * decl.cs: ditto.
11746
11747 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11748
11749         * attribute.cs : Fix incorrect code which relied on catching
11750         a NullReferenceException to detect a null being passed in
11751         where an object was expected.
11752
11753 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11754
11755         * statement.cs (Try): flag the catch variable as assigned
11756
11757         * expression.cs (Cast): Simplified by using ResolveType instead of
11758         manually resolving.
11759
11760         * statement.cs (Catch): Fix bug by using ResolveType.
11761
11762 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11763
11764         * expression.cs (BetterConversion): Special case for when we have
11765         a NullLiteral as the argument and we have to choose between string
11766         and object types - we choose string the way csc does.
11767
11768         * attribute.cs (Attribute.Resolve): Catch the
11769         NullReferenceException and report error #182 since the Mono
11770         runtime no more has the bug and having this exception raised means
11771         we tried to select a constructor which takes an object and is
11772         passed a null.
11773
11774 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11775
11776         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11777         message (1502, 1503) when we can't locate a method after overload
11778         resolution. This is much more informative and closes the bug
11779         Miguel reported.
11780
11781         * interface.cs (PopulateMethod): Return if there are no argument
11782         types. Fixes a NullReferenceException bug.
11783
11784         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11785         expressions too. Previously we were checking only in one place for
11786         positional arguments leaving out named arguments.
11787
11788         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11789         type to the enum type is not allowed. Remove code corresponding to
11790         that.
11791
11792         (ConvertNumericExplicit): Allow explicit conversions from
11793         the underlying type to enum type. This precisely follows the spec
11794         and closes a bug filed by Gonzalo.
11795
11796 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11797
11798         * compiler.csproj:
11799         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11800
11801 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11802
11803         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11804         it was important that we stored the right value after the
11805         reduction in `converted'.
11806
11807 2002-09-04  Martin Baulig  <martin@gnome.org>
11808
11809         * location.cs (Location.SymbolDocument): Use full pathnames for the
11810         source files.
11811
11812 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11813
11814         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11815         of the expression resolve mechanism, because that will catch the
11816         SimpleName error failures.
11817
11818         (Conditional): If we can not resolve the
11819         expression, return, do not crash.
11820
11821 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11822
11823         * cs-tokenizer.cs:
11824         (location): display token name instead of its number.
11825
11826 2002-08-28  Martin Baulig  <martin@gnome.org>
11827
11828         * expression.cs (Binary.ResolveOperator): Don't silently return
11829         but return an error if an operator cannot be applied between two
11830         enum types.
11831
11832 2002-08-28  Martin Baulig  <martin@gnome.org>
11833
11834         * class.cs (Constructor.Define): Set the permission attributes
11835         correctly instead of making all constructors public.
11836
11837 2002-08-28  Martin Baulig  <martin@gnome.org>
11838
11839         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11840         for private members before reporting a CS0103; if we find anything,
11841         it's a CS0122.
11842
11843 2002-08-28  Martin Baulig  <martin@gnome.org>
11844
11845         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11846         to check whether `closure_start_type == closure_invocation_type',
11847         we also need to check whether `m.DeclaringType == closure_invocation_type'
11848         before bypassing the permission checks.  We might be accessing
11849         protected/private members from the base class.
11850         (TypeManager.RealMemberLookup): Only set private_ok if private
11851         members were requested via BindingFlags.NonPublic.
11852
11853         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11854
11855         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11856         MethodGroupExpr.IsExplicitImpl if appropriate.
11857         (Invocation.DoResolve): Don't report the CS0120 for explicit
11858         interface implementations.
11859
11860 2002-08-27  Martin Baulig  <martin@gnome.org>
11861
11862         * expression.cs (Invocation.DoResolve): If this is a static
11863         method and we don't have an InstanceExpression, we must report
11864         a CS0120.
11865
11866 2002-08-25  Martin Baulig  <martin@gnome.org>
11867
11868         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11869         `==' between a valuetype and an object.
11870
11871 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11872
11873         * ecore.cs (TypeExpr): Provide a ToString method.
11874
11875 2002-08-24  Martin Baulig  <martin@gnome.org>
11876
11877         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11878         now called proggie.dbg and it's a binary file.
11879
11880 2002-08-23  Martin Baulig  <martin@gnome.org>
11881
11882         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11883
11884 2002-08-23  Martin Baulig  <martin@gnome.org>
11885
11886         * struct.cs (MyStructInfo.ctor): Make this work with empty
11887         structs; it's not allowed to use foreach() on null.
11888
11889 2002-08-23  Martin Baulig  <martin@gnome.org>
11890
11891         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11892         writer the full pathname of the generated assembly.
11893
11894 2002-08-23  Martin Baulig  <martin@gnome.org>
11895
11896         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11897         A `finally' block never returns or breaks; improved handling of
11898         unreachable code.
11899
11900 2002-08-23  Martin Baulig  <martin@gnome.org>
11901
11902         * statement.cs (Throw.Resolve): Allow `throw null'.
11903
11904 2002-08-23  Martin Baulig  <martin@gnome.org>
11905
11906         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11907         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11908         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11909         MemberLookup would return a wrong event if this is an explicit
11910         interface implementation and the class has an event with the same
11911         name.
11912
11913 2002-08-23  Martin Baulig  <martin@gnome.org>
11914
11915         * statement.cs (Block.AddChildVariableNames): New public method.
11916         (Block.AddChildVariableName): Likewise.
11917         (Block.IsVariableNameUsedInChildBlock): Likewise.
11918         (Block.AddVariable): Check whether a variable name has already
11919         been used in a child block.
11920
11921         * cs-parser.jay (declare_local_variables): Mark all variable names
11922         from the current block as being used in a child block in the
11923         implicit block.
11924
11925 2002-08-23  Martin Baulig  <martin@gnome.org>
11926
11927         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11928         find the symbol writer.
11929
11930         * driver.cs: csc also allows the arguments to /define being
11931         separated by commas, not only by semicolons.
11932
11933 2002-08-23  Martin Baulig  <martin@gnome.org>
11934
11935         * interface.cs (Interface.GetMembers): Added static check for events.
11936
11937 2002-08-15  Martin Baulig  <martin@gnome.org>
11938
11939         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11940         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11941
11942         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11943         why the MethodData.EmitDestructor() change was necessary.
11944
11945 2002-08-20  Martin Baulig  <martin@gnome.org>
11946
11947         * class.cs (TypeContainer.FindMembers): Added static check for events.
11948
11949         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11950
11951         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11952         use Type.GetEvents(), not Type.FindMembers().
11953
11954 2002-08-20  Martin Baulig  <martin@gnome.org>
11955
11956         * decl.cs (MemberCache): Added a special method cache which will
11957         be used for method-only searched.  This ensures that a method
11958         search will return a MethodInfo with the correct ReflectedType for
11959         inherited methods.      
11960
11961 2002-08-20  Martin Baulig  <martin@gnome.org>
11962
11963         * decl.cs (DeclSpace.FindMembers): Made this public.
11964
11965 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11966
11967         * delegate.cs: fixed build on windows.
11968         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11969
11970 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11971
11972         * ecore.cs (StandardConversionExists): Return a false
11973         if we are trying to convert the void type to anything else
11974         since that is not allowed.
11975
11976         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11977         we flag error 70 in the event an event is trying to be accessed
11978         directly from outside the declaring type.
11979
11980 2002-08-20  Martin Baulig  <martin@gnome.org>
11981
11982         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11983         MemberCache from typemanager.cs to decl.cs.
11984
11985 2002-08-19  Martin Baulig  <martin@gnome.org>
11986
11987         * class.cs (TypeContainer): Implement IMemberContainer.
11988         (TypeContainer.DefineMembers): Create the MemberCache.
11989         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11990         return public members if BindingFlags.Public was given, check
11991         whether members are static.
11992
11993 2002-08-16  Martin Baulig  <martin@gnome.org>
11994
11995         * decl.cs (DeclSpace.Define): Splitted this in Define and
11996         DefineMembers.  DefineMembers is called first and initializes the
11997         MemberCache.
11998
11999         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12000         DefineMembers() on all our DeclSpaces.
12001
12002         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12003         but call DefineMembers() on all nested interfaces.  We call their
12004         Define() in our new Define() function.
12005
12006         * interface.cs (Interface): Implement IMemberContainer.
12007         (Interface.Define): Moved all code except the attribute stuf to
12008         DefineMembers().
12009         (Interface.DefineMembers): Initialize the member cache.
12010
12011         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12012         need this anymore since we can use MemberCache.FindMembers directly.
12013
12014 2002-08-19  Martin Baulig  <martin@gnome.org>
12015
12016         * typemanager.cs (MemberCache): When creating the cache for an
12017         interface type, add all inherited members.
12018         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12019         to `out bool used_cache' and documented it.
12020         (TypeManager.MemberLookup): If we already used the cache in the first
12021         iteration, we don't need to do the interfaces check.
12022
12023 2002-08-19  Martin Baulig  <martin@gnome.org>
12024
12025         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12026         here from IMemberFinder and don't implement this interface anymore.
12027         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12028
12029         * typemanager.cs (IMemberFinder): This interface is now only used by
12030         classes which actually support the member cache.
12031         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12032         since we only put DeclSpaces into this Hashtable.
12033         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12034         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12035
12036 2002-08-16  Martin Baulig  <martin@gnome.org>
12037
12038         * typemanager.cs (ICachingMemberFinder): Removed.
12039         (IMemberFinder.MemberCache): New property.
12040         (TypeManager.FindMembers): Merged this with RealFindMembers().
12041         This function will never be called from TypeManager.MemberLookup()
12042         so we can't use the cache here, just the IMemberFinder.
12043         (TypeManager.MemberLookup_FindMembers): Check whether the
12044         IMemberFinder has a MemberCache and call the cache's FindMembers
12045         function.
12046         (MemberCache): Rewrote larger parts of this yet another time and
12047         cleaned it up a bit.
12048
12049 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * driver.cs (LoadArgs): Support quoting.
12052
12053         (Usage): Show the CSC-like command line arguments.
12054
12055         Improved a few error messages.
12056
12057 2002-08-15  Martin Baulig  <martin@gnome.org>
12058
12059         * typemanager.cs (IMemberContainer.Type): New property.
12060         (IMemberContainer.IsInterface): New property.
12061
12062         The following changes are conditional to BROKEN_RUNTIME, which is
12063         defined at the top of the file.
12064
12065         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12066         class'es members, but add all members from TypeHandle.ObjectType
12067         if we're an interface.
12068         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12069         is the current type.
12070         (MemberCache.CacheEntry.Container): Removed this field.
12071         (TypeHandle.GetMembers): Include inherited members.
12072
12073 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12074
12075         * typemanager.cs: fixed compilation and added a comment on a field that
12076         is never used.
12077
12078 2002-08-15  Martin Baulig  <martin@gnome.org>
12079
12080         * class.cs (ConstructorInitializer.Resolve): In the
12081         Expression.MemberLookup call, use the queried_type as
12082         invocation_type.
12083
12084         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12085         declared' attribute, it's always true.
12086         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12087         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12088         temporary wrapper for FindMembers which tells MemberLookup whether
12089         members from the base classes are included in the return value.
12090         This will go away soon.
12091         (TypeManager.MemberLookup): Use this temporary hack here; once the
12092         new MemberCache is completed, we don't need to do the DeclaredOnly
12093         looping here anymore since the MemberCache will take care of this.
12094         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12095         (MemberCache): When creating the MemberCache for a class, get
12096         members from the current class and all its base classes.
12097         (MemberCache.CacheEntry.Container): New field.  This is a
12098         temporary hack until the Mono runtime is fixed to distinguish
12099         between ReflectedType and DeclaringType.  It allows us to use MCS
12100         with both the MS runtime and the unfixed Mono runtime without
12101         problems and without accecting performance.
12102         (MemberCache.SearchMembers): The DeclaredOnly looping from
12103         TypeManager.MemberLookup is now done here.      
12104
12105 2002-08-14  Martin Baulig  <martin@gnome.org>
12106
12107         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12108         Type.GetFields on dynamic types but get the fields from the
12109         corresponding TypeContainer.
12110         (MyStructInfo.GetStructInfo): Added check for enum types.
12111
12112         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12113         (MemberList.SyncRoot): Implemented.
12114         (TypeManager.FilterWithClosure): No need to check permissions if
12115         closure_start_type == closure_invocation_type, don't crash if
12116         closure_invocation_type is null.
12117
12118 2002-08-13  Martin Baulig  <martin@gnome.org>
12119
12120         Rewrote TypeContainer.FindMembers to use a member cache.  This
12121         gives us a speed increase of about 35% for the self-hosting MCS
12122         build and of about 15-20% for the class libs (both on GNU/Linux).
12123
12124         * report.cs (Timer): New class to get enhanced profiling.  This
12125         whole class is "TIMER" conditional since it remarkably slows down
12126         compilation speed.
12127
12128         * class.cs (MemberList): New class.  This is an IList wrapper
12129         which we're now using instead of passing MemberInfo[]'s around to
12130         avoid copying this array unnecessarily.
12131         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12132         (ICachingMemberFinder, IMemberContainer): New interface.
12133         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12134         has already been checked, otherwise use it for the name comparision.
12135         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12136         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12137         if possible.  Returns a MemberList, not a MemberInfo [].
12138         (TypeHandle): New class, implements IMemberContainer.  We create
12139         one instance of this class per type, it contains a MemberCache
12140         which is used to do the member lookups.
12141         (MemberCache): New class.  Each instance of this class contains
12142         all members of a type and a name-based hash table.
12143         (MemberCache.FindMembers): This is our new member lookup
12144         function.  First, it looks up all members of the requested name in
12145         the hash table.  Then, it walks this list and sorts out all
12146         applicable members and returns them.
12147
12148 2002-08-13  Martin Baulig  <martin@gnome.org>
12149
12150         In addition to a nice code cleanup, this gives us a performance
12151         increase of about 1.4% on GNU/Linux - not much, but it's already
12152         half a second for the self-hosting MCS compilation.
12153
12154         * typemanager.cs (IMemberFinder): New interface.  It is used by
12155         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12156         Enum, Delegate or Interface.
12157         (TypeManager.finder_to_member_finder): New PtrHashtable.
12158         (TypeManager.finder_to_container): Removed.
12159         (TypeManager.finder_to_delegate): Removed.
12160         (TypeManager.finder_to_interface): Removed.
12161         (TypeManager.finder_to_enum): Removed.
12162
12163         * interface.cs (Interface): Implement IMemberFinder.
12164
12165         * delegate.cs (Delegate): Implement IMemberFinder.
12166
12167         * enum.cs (Enum): Implement IMemberFinder.
12168
12169         * class.cs (TypeContainer): Implement IMemberFinder.
12170
12171 2002-08-12  Martin Baulig  <martin@gnome.org>
12172
12173         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12174
12175 2002-08-12  Martin Baulig  <martin@gnome.org>
12176
12177         * ecore.cs (ITypeExpression): New interface for expressions which
12178         resolve to a type.
12179         (TypeExpression): Renamed to TypeLookupExpression.
12180         (Expression.DoResolve): If we're doing a types-only lookup, the
12181         expression must implement the ITypeExpression interface and we
12182         call DoResolveType() on it.
12183         (SimpleName): Implement the new ITypeExpression interface.
12184         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12185         hack, the situation that we're only looking up types can't happen
12186         anymore when this method is called.  Moved the type lookup code to
12187         DoResolveType() and call it.
12188         (SimpleName.DoResolveType): This ITypeExpression interface method
12189         is now doing the types-only lookup.
12190         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12191         (ResolveFlags): Added MaskExprClass.
12192
12193         * expression.cs (MemberAccess): Implement the ITypeExpression
12194         interface.
12195         (MemberAccess.DoResolve): Added support for a types-only lookup
12196         when we're called via ITypeExpression.DoResolveType().
12197         (ComposedCast): Implement the ITypeExpression interface.
12198
12199         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12200         Expression.Resolve() with ResolveFlags.Type instead.
12201
12202 2002-08-12  Martin Baulig  <martin@gnome.org>
12203
12204         * interface.cs (Interface.Define): Apply attributes.
12205
12206         * attribute.cs (Attribute.ApplyAttributes): Added support for
12207         interface attributes.
12208
12209 2002-08-11  Martin Baulig  <martin@gnome.org>
12210
12211         * statement.cs (Block.Emit): Only check the "this" variable if we
12212         do not always throw an exception.
12213
12214         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12215         whether the property has a set accessor.
12216
12217 2002-08-11  Martin Baulig  <martin@gnome.org>
12218
12219         Added control flow analysis support for structs.
12220
12221         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12222         with control flow analysis turned off.
12223         (IVariable): New interface.
12224         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12225         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12226         (FieldExpr.DoResolve): Resolve the instance expression with flow
12227         analysis turned off and do the definite assignment check after the
12228         resolving when we know what the expression will resolve to.
12229
12230         * expression.cs (LocalVariableReference, ParameterReference):
12231         Implement the new IVariable interface, only call the flow analysis
12232         code if ec.DoFlowAnalysis is true.
12233         (This): Added constructor which takes a Block argument.  Implement
12234         the new IVariable interface.
12235         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12236         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12237         This does the definite assignment checks for struct members.
12238
12239         * class.cs (Constructor.Emit): If this is a non-static `struct'
12240         constructor which doesn't have any initializer, call
12241         Block.AddThisVariable() to tell the flow analysis code that all
12242         struct elements must be initialized before control returns from
12243         the constructor.
12244
12245         * statement.cs (MyStructInfo): New public class.
12246         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12247         argument to this indexer.  If non-zero, check an individual struct
12248         member, not the whole struct.
12249         (FlowBranching.CheckOutParameters): Check struct members.
12250         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12251         overloaded versions of these methods which take an additional
12252         `int field_idx' argument to check struct members.
12253         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12254         overloaded versions of these methods which take an additional
12255         `string field_name' argument to check struct member.s
12256         (VariableInfo): Implement the IVariable interface.
12257         (VariableInfo.StructInfo): New public property.  Returns the
12258         MyStructInfo instance of the variable if it's a struct or null.
12259         (Block.AddThisVariable): New public method.  This is called from
12260         Constructor.Emit() for non-static `struct' constructor which do
12261         not have any initializer.  It creates a special variable for the
12262         "this" instance variable which will be checked by the flow
12263         analysis code to ensure that all of the struct's fields are
12264         initialized before control returns from the constructor.
12265         (UsageVector): Added support for struct members.  If a
12266         variable/parameter is a struct with N members, we reserve a slot
12267         in the usage vector for each member.  A struct is considered fully
12268         initialized if either the struct itself (slot 0) or all its
12269         members are initialized.
12270
12271 2002-08-08  Martin Baulig  <martin@gnome.org>
12272
12273         * driver.cs (Driver.MainDriver): Only report an error CS5001
12274         if there were no compilation errors.
12275
12276         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12277         `UnsafeContext' property to determine whether the parent is in
12278         unsafe context rather than checking the parent's ModFlags:
12279         classes nested in an unsafe class are unsafe as well.
12280
12281 2002-08-08  Martin Baulig  <martin@gnome.org>
12282
12283         * statement.cs (UsageVector.MergeChildren): Distinguish between
12284         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12285         we return.  Added test17() and test18() to test-154.cs.
12286
12287 2002-08-08  Martin Baulig  <martin@gnome.org>
12288
12289         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12290         Family access, make sure the invoking type isn't a subclass of the
12291         queried type (that'd be a CS1540).
12292
12293         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12294         this method which takes an additional `Type invocation_type'.
12295
12296         * expression.cs (BaseAccess.DoResolve): Use the base type as
12297         invocation and query type.
12298         (MemberAccess.DoResolve): If the lookup failed and we're about to
12299         report a CS0122, try a lookup with the ec.ContainerType - if this
12300         succeeds, we must report a CS1540.
12301
12302 2002-08-08  Martin Baulig  <martin@gnome.org>
12303
12304         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12305         (MethodGroupExpr): Implement the IMemberExpr interface.
12306
12307         * expression (MemberAccess.ResolveMemberAccess): No need to have
12308         any special code for MethodGroupExprs anymore, they're now
12309         IMemberExprs.   
12310
12311 2002-08-08  Martin Baulig  <martin@gnome.org>
12312
12313         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12314         Family, FamANDAssem and FamORAssem permissions.
12315         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12316
12317 2002-08-08  Martin Baulig  <martin@gnome.org>
12318
12319         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12320         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12321         or loop block.
12322
12323 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12324
12325         * driver.cs: implemented /resource option to embed managed resources.
12326
12327 2002-08-07  Martin Baulig  <martin@gnome.org>
12328
12329         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12330         (FieldBase.HasFieldInitializer): New public property.
12331         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12332         returns the field initializer and makes sure it is only resolved once.
12333         (TypeContainer.EmitFieldInitializers): Call
12334         FieldBase.GetInitializerExpression to get the initializer, this ensures
12335         that it isn't resolved multiple times.
12336
12337         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12338         the resolving process (SimpleName/MemberLookup) that we're currently
12339         emitting a field initializer (which must not access any instance members,
12340         this is an error CS0236).
12341
12342         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12343         argument, if the `IsFieldInitializer' flag is set, we must report and
12344         error CS0236 and not an error CS0120.   
12345
12346 2002-08-07  Martin Baulig  <martin@gnome.org>
12347
12348         * ecore.cs (IMemberExpr): New public interface.
12349         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12350         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12351         if the expression is an IMemberExpr.
12352
12353         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12354         to be null, implicitly default to `this' if we're non-static in
12355         this case.  Simplified the code a lot by using the new IMemberExpr
12356         interface.  Also fixed bug #28176 here.
12357
12358 2002-08-06  Martin Baulig  <martin@gnome.org>
12359
12360         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12361         ParameterReferences during semantic analysis so that we can do a
12362         type-only search when resolving Cast, TypeOf and SizeOf.
12363         (block): Pass the `current_local_parameters' to the Block's
12364         constructor.
12365
12366         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12367         argument to the constructor.
12368         (ConstructorInitializer.Resolve): Create a temporary implicit
12369         block with the parameters.
12370
12371         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12372         references here if we aren't doing a type-only search.
12373
12374         * statement.cs (Block): Added constructor which takes a
12375         `Parameters parameters' argument.
12376         (Block.Parameters): New public property.
12377
12378         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12379         to `Parameters' and made it public readonly.
12380
12381 2002-08-06  Martin Baulig  <martin@gnome.org>
12382
12383         * ecore.cs (Expression.Warning): Made this public as well.
12384
12385         * report.cs (Report.Debug): Print the contents of collections.
12386
12387 2002-08-06  Martin Baulig  <martin@gnome.org>
12388
12389         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12390         used to tell Resolve() which kinds of expressions it may return.
12391         (Expression.Resolve): Added overloaded version of this method which
12392         takes a `ResolveFlags flags' argument.  This can be used to tell
12393         Resolve() which kinds of expressions it may return.  Reports a
12394         CS0118 on error.
12395         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12396         ResolveFlags.SimpleName.
12397         (Expression.Error118): Added overloaded version of this method which
12398         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12399         which kinds of expressions are allowed.
12400
12401         * expression.cs (Argument.ResolveMethodGroup): New public method.
12402         Resolves an argument, but allows a MethodGroup to be returned.
12403         This is used when invoking a delegate.
12404
12405         * TODO: Updated a bit.
12406
12407 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12408
12409         Fixed compilation with csc.
12410
12411         * ecore.cs: Expression.Error made public. Is this correct? Should
12412         Warning be made public too?
12413
12414         * expression.cs: use ea.Location instead of ea.loc.
12415         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12416
12417 2002-08-06  Martin Baulig  <martin@gnome.org>
12418
12419         * ecore.cs (Expression.loc): Moved the location here instead of
12420         duplicating it in all derived classes.
12421         (Expression.Location): New public property.
12422         (Expression.Error, Expression.Warning): Made them non-static and
12423         removed the location argument.
12424         (Expression.Warning): Added overloaded version which takes an
12425         `int level' argument.
12426         (Expression.Error118): Make this non-static and removed the
12427         expression and location arguments.
12428         (TypeExpr): Added location argument to the constructor.
12429
12430         * expression.cs (StaticCallExpr): Added location argument to
12431         the constructor.
12432         (Indirection, PointerArithmetic): Likewise.
12433         (CheckedExpr, UnCheckedExpr): Likewise.
12434         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12435         (StringPtr): Likewise.
12436
12437
12438 2002-08-05  Martin Baulig  <martin@gnome.org>
12439
12440         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12441
12442         * assign.cs (Assign.DoResolve): Check whether the source
12443         expression is a value or variable.
12444
12445         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12446         while resolving the corresponding blocks.
12447
12448         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12449         an error, don't silently return null.
12450
12451         * statement.cs (Block.AddVariable): Do the error reporting here
12452         and distinguish between CS0128 and CS0136.
12453         (Block.DoResolve): Report all unused labels (warning CS0164).
12454         (LabeledStatement): Pass the location to the constructor.
12455         (LabeledStatement.HasBeenReferenced): New property.
12456         (LabeledStatement.Resolve): Set it to true here.
12457
12458         * statement.cs (Return.Emit): Return success even after reporting
12459         a type mismatch error (CS0126 or CS0127), this is what csc does and
12460         it avoids confusing the users with any consecutive errors.
12461
12462 2002-08-05  Martin Baulig  <martin@gnome.org>
12463
12464         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12465
12466         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12467
12468         * expression.cs (MemberAccess.DoResolve): Silently return if an
12469         error has already been reported.
12470
12471         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12472         error has already been reported.
12473
12474 2002-08-05  Martin Baulig  <martin@gnome.org>
12475
12476         * statement.cs (UsageVector): Only initialize the `parameters'
12477         vector if we actually have any "out" parameters.
12478
12479 2002-08-05  Martin Baulig  <martin@gnome.org>
12480
12481         * expression.cs (Binary.ResolveOperator): When combining delegates,
12482         they must have the same type.
12483
12484 2002-08-05  Martin Baulig  <martin@gnome.org>
12485
12486         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12487         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12488         work with the ms runtime and we also don't need it: if we're a
12489         PropertyBuilder and not in the `indexer_arguments' hash, then we
12490         are a property and not an indexer.
12491
12492         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12493         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12494         since the latter one doesn't work with the ms runtime.
12495
12496 2002-08-03  Martin Baulig  <martin@gnome.org>
12497
12498         Fixed bugs #27998 and #22735.
12499
12500         * class.cs (Method.IsOperator): New public field.
12501         (Method.CheckBase): Report CS0111 if there's already a method
12502         with the same parameters in the current class.  Report CS0508 when
12503         attempting to change the return type of an inherited method.
12504         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12505         and it's not marked abstract or extern.
12506         (PropertyBase): New abstract base class for Property and Indexer.
12507         (PropertyBase.CheckBase): Moved here from Property and made it work
12508         for indexers.
12509         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12510         the same so we can reuse it there.
12511         (Property, Indexer): Derive from PropertyBase.
12512         (MethodSignature.inheritable_property_signature_filter): New delegate
12513         to find properties and indexers.
12514
12515         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12516         argument and improved error reporting.
12517
12518         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12519         EmptyReadOnlyParameters and made it a property.
12520
12521         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12522         version of this method which takes a `PropertyInfo indexer'.
12523         (TypeManager.RegisterIndexer): New method.
12524
12525         * class.cs: Added myself as author of this file :-)
12526
12527 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12528
12529         * class.cs: fixed compilation on windoze.
12530
12531 2002-08-03  Martin Baulig  <martin@gnome.org>
12532
12533         * interface.cs (Interface.GetInterfaceBases): Check whether all
12534         base interfaces are at least as accessible than the current one.
12535
12536         * class.cs (TypeContainer.GetClassBases): Check whether base types
12537         are at least as accessible than the current type.
12538         (TypeContainer.AsAccessible): Implemented and made non-static.
12539         (MemberBase.CheckParameters): Report errors if the accessibility
12540         checks fail.
12541
12542         * delegate.cs (Delegate.Delegate): The default visibility is
12543         internal for top-level types and private for nested types.
12544         (Delegate.Define): Report errors if the accessibility checks fail.
12545
12546         * enum.cs (Enum.Enum): The default visibility is internal for
12547         top-level types and private for nested types.
12548         (Enum.DefineType): Compute the correct visibility.
12549
12550         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12551         function which takes a `bool is_toplevel' instead of a TypeContainer.
12552
12553         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12554         builtin type.
12555
12556 2002-08-02  Martin Baulig  <martin@gnome.org>
12557
12558         * expression.cs (LocalVariableReferenc): Added constructor which
12559         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12560         (LocalVariableReference.IsReadOnly): New property.
12561         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12562         variable is readonly, use our own readonly flag to do this; you can
12563         use the new constructor to get a writable reference to a read-only
12564         variable.
12565
12566         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12567         reference to the local variable.
12568
12569 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12570
12571         * rootcontext.cs (ResolveCore): Also include System.Exception
12572
12573         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12574         we reach an EmptyStatement.
12575
12576         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12577         is also fine.
12578
12579         * expression.cs (Binary.ResolveOperator): Check error result in
12580         two places.
12581
12582         use brtrue/brfalse directly and avoid compares to null.
12583
12584 2002-08-02  Martin Baulig  <martin@gnome.org>
12585
12586         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12587         Fixes bug #28407, added test-155.cs.
12588
12589 2002-08-01  Martin Baulig  <martin@gnome.org>
12590
12591         * class.cs (Event.EmitDefaultMethod): Make this work with static
12592         events.  Fixes #28311, added verify-3.cs.
12593
12594 2002-08-01  Martin Baulig  <martin@gnome.org>
12595
12596         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12597         `is_disposable' fields.
12598         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12599         `hm.is_disposable' if we're using the collection pattern.
12600         (Foreach.EmitCollectionForeach): Use the correct type for the
12601         enumerator's local variable, only emit the try/finally block if
12602         necessary (fixes #27713).
12603
12604 2002-08-01  Martin Baulig  <martin@gnome.org>
12605
12606         * ecore.cs (Expression.report118): Renamed to Error118 and made
12607         it public static.
12608
12609         * statement.cs (Throw.Resolve): Check whether the expression is of
12610         the correct type (CS0118) and whether the type derives from
12611         System.Exception (CS0155).
12612         (Catch.Resolve): New method.  Do the type lookup here and check
12613         whether it derives from System.Exception (CS0155).
12614         (Catch.CatchType, Catch.IsGeneral): New public properties.
12615
12616         * typemanager.cs (TypeManager.exception_type): Added.
12617
12618 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12619
12620         * driver.cs: Updated About function.
12621
12622 2002-07-31  Martin Baulig  <martin@gnome.org>
12623
12624         Implemented Control Flow Analysis.
12625
12626         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12627         (EmitContext.CurrentBranching): Added.
12628         (EmitContext.StartFlowBranching): Added.
12629         (EmitContext.EndFlowBranching): Added.
12630         (EmitContext.KillFlowBranching): Added.
12631         (EmitContext.IsVariableAssigned): Added.
12632         (EmitContext.SetVariableAssigned): Added.
12633         (EmitContext.IsParameterAssigned): Added.
12634         (EmitContext.SetParameterAssigned): Added.
12635         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12636         Added control flow analysis stuff here.
12637
12638         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12639         resolve the expression as lvalue.
12640         (LocalVariableReference.DoResolve): Check whether the variable has
12641         already been assigned.
12642         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12643         the parameter as assigned here.
12644         (ParameterReference.DoResolve): Check whether the parameter has already
12645         been assigned.
12646         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12647         expression as lvalue.
12648
12649         * statement.cs (FlowBranching): New class for the flow analysis code.
12650         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12651         (LabeledStatement.IsDefined): New public property.
12652         (LabeledStatement.AddUsageVector): New public method to tell flow
12653         analyis that the label may be reached via a forward jump.
12654         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12655         flow analysis.
12656         (VariableInfo.Number): New public field.  This is used by flow analysis
12657         to number all locals of a block.
12658         (Block.CountVariables): New public property.  This is the number of
12659         local variables in this block (including the locals from all parent
12660         blocks).
12661         (Block.EmitMeta): Number all the variables.
12662
12663         * statement.cs: Added flow analysis support to all classes.
12664
12665 2002-07-31  Martin Baulig  <martin@gnome.org>
12666
12667         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12668         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12669         then use this argument.
12670
12671         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12672
12673         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12674         use this to specify /define options.
12675
12676 2002-07-29  Martin Baulig  <martin@gnome.org>
12677
12678         * statement.cs (Fixed): Moved all code that does variable lookups
12679         and resolvings from Emit to Resolve.
12680
12681         * statement.cs (For): Moved all code that does variable lookups
12682         and resolvings from Emit to Resolve.
12683
12684         * statement.cs (Using): Moved all code that does variable lookups
12685         and resolvings from Emit to Resolve.
12686
12687 2002-07-29  Martin Baulig  <martin@gnome.org>
12688
12689         * attribute.cs (Attribute.Resolve): Explicitly catch a
12690         System.NullReferenceException when creating the
12691         CustromAttributeBuilder and report a different warning message.
12692
12693 2002-07-29  Martin Baulig  <martin@gnome.org>
12694
12695         * support.cs (ParameterData.ParameterName): Added method to
12696         get the name of a parameter.
12697
12698         * typemanager.cs (TypeManager.IsValueType): New public method.
12699
12700 2002-07-29  Martin Baulig  <martin@gnome.org>
12701
12702         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12703         is a flag which specifies that it's either ref or out.
12704         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12705         the out parameter to `out Parameter.Modifier mod', also set the
12706         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12707
12708         * support.cs (InternalParameters.ParameterModifier): Distinguish
12709         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12710         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12711
12712         * expression.cs (Argument.GetParameterModifier): Distinguish
12713         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12714         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12715
12716 2002-07-29  Martin Baulig  <martin@gnome.org>
12717
12718         * expression.cs (ParameterReference.ParameterReference): Added
12719         `Location loc' argument to the constructor.
12720
12721         * cs-parser.jay: Pass location to ParameterReference.
12722
12723 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12724
12725         * statement.cs (Try): Initialize the location.
12726
12727         * cs-parser.jay: pass location to Try.
12728
12729         * expression.cs (Unary.Reduce): Change the prototype to return
12730         whether a constant fold could be performed or not.  The result is
12731         returned in an out parameters.  In the case of Indirection and
12732         AddressOf, we want to perform the full tests.
12733
12734 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12735
12736         * statement.cs (Statement.Emit): Flag dead code.
12737
12738 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12739
12740         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12741
12742 2002-07-27  Martin Baulig  <martin@gnome.org>
12743
12744         * class.cs (MethodData.Define): Put back call to
12745         TypeManager.AddMethod(), accidentally commented this out.
12746
12747         * report.cs (Debug): New public method to print debugging information,
12748         this is `[Conditional ("DEBUG")]'.
12749
12750 2002-07-26  Martin Baulig  <martin@gnome.org>
12751
12752         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12753         (switch_statement): Push the current_block to the switch_stack and
12754         pop it again when we're done with the switch.
12755         (switch_section): The new block is a child of the current_block.
12756         Fixes bug #24007, added test-152.cs.
12757
12758 2002-07-27  Martin Baulig  <martin@gnome.org>
12759
12760         * expression.cs (Invocation.EmitArguments): When calling a varargs
12761         function with only its fixed arguments, we need to pass an empty
12762         array.
12763
12764 2002-07-27  Martin Baulig  <martin@gnome.org>
12765
12766         Mono 0.13 has been released.
12767
12768 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12769
12770         * driver.cs: Rename --resource to --linkres, because that is what
12771         we do currently, we dont support --resource yet.
12772
12773         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12774
12775 2002-07-25  Martin Baulig  <martin@gnome.org>
12776
12777         * class.cs (MethodData): New public class.  This is a `method builder'
12778         class for a method or one accessor of a Property/Indexer/Event.
12779         (MethodData.GetMethodFlags): Moved here from MemberBase.
12780         (MethodData.ApplyAttributes): Likewise.
12781         (MethodData.ApplyObsoleteAttribute): Likewise.
12782         (MethodData.ApplyConditionalAttribute): Likewise.
12783         (MethodData.ApplyDllImportAttribute): Likewise.
12784         (MethodData.CheckAbstractAndExternal): Likewise.
12785         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12786         (MethodData.Emit): Formerly known as Method.Emit().
12787         (MemberBase): Moved everything which was specific to a single
12788         accessor/method to MethodData.
12789         (Method): Create a new MethodData and call Define() and Emit() on it.
12790         (Property, Indexer, Event): Create a new MethodData objects for each
12791         accessor and call Define() and Emit() on them.
12792
12793 2002-07-25  Martin Baulig  <martin@gnome.org>
12794
12795         Made MethodCore derive from MemberBase to reuse the code from there.
12796         MemberBase now also checks for attributes.
12797
12798         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12799         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12800         as virtual.
12801         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12802         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12803         (MemberBase.ApplyAttributes): New virtual method; applies the
12804         attributes to a method or accessor.
12805         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12806         (MemberBase.ApplyConditionalAttribute): Likewise.
12807         (MemberBase.ApplyDllImportAttribute): Likewise.
12808         (MemberBase.CheckAbstractAndExternal): Likewise.
12809         (MethodCore.ParameterTypes): This is now a property instead of a
12810         method, it's initialized from DoDefineParameters().
12811         (MethodCore.ParameterInfo): Removed the set accessor.
12812         (MethodCore.DoDefineParameters): New protected virtual method to
12813         initialize ParameterTypes and ParameterInfo.
12814         (Method.GetReturnType): We can now simply return the MemberType.
12815         (Method.GetMethodFlags): Override the MemberBase version and add
12816         the conditional flags.
12817         (Method.CheckBase): Moved some code from Define() here, call
12818         DoDefineParameters() here.
12819         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12820         here to avoid some larger code duplication.
12821         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12822         ensure that abstract and external accessors don't declare a body.
12823
12824         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12825         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12826         lookup in the attribute's parent classes, so we need to abort as soon
12827         as we found the first match.
12828         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12829         the attribute has no arguments.
12830
12831         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12832         of a Method.
12833
12834 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12835
12836         * cs-parser.jay: reverted previous patch.
12837
12838 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12839
12840         * cs-parser.jay: fixed bug #22119.
12841
12842 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12843
12844         * attribute.cs: fixed compilation. The error was:
12845         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12846         be assigned to before control leaves the current method."
12847         [FIXME:  Filed as bug #28186: MCS must report this error.]
12848
12849 2002-07-25  Martin Baulig  <martin@gnome.org>
12850
12851         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12852         method to pull the condition name ouf of a Conditional attribute.
12853         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12854         the obsolete message and error flag out of an Obsolete attribute.
12855
12856         * class.cs (Method.GetMethodFlags): New public method to get the
12857         TypeManager.MethodFlags for this method.
12858         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12859         private methods.
12860         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12861         if we're overriding a virtual function, set the new private variable
12862         `parent_method'; call the new TypeManager.AddMethod().
12863
12864         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12865         the MethodBuilder and the Method in a PtrHashtable.
12866         (TypeManager.builder_to_method): Added for this purpose.
12867         (TypeManager.MethodFlags): Added IsObsoleteError.
12868         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12869         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12870         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12871         the message from the attribute.
12872
12873 2002-07-24  Martin Baulig  <martin@gnome.org>
12874
12875         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12876         preprocessor directives, ensure that the argument to #define/#undef is
12877         exactly one identifier and that it's actually an identifier.
12878
12879         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12880         did not work ....
12881
12882 2002-07-24  Martin Baulig  <martin@gnome.org>
12883
12884         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12885         initialize it to TypeManager.object_type in the constructor.
12886         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12887         of the `hm.get_current' method if we're using the collection pattern.
12888         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12889         for the explicit conversion to make it work when we're using the collection
12890         pattern and the `Current' property has a different return type than `object'.
12891         Fixes #27713.
12892
12893 2002-07-24  Martin Baulig  <martin@gnome.org>
12894
12895         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12896         does not match, but don't report any errors.  This method is called in
12897         order for all methods in a MethodGroupExpr until a matching method is
12898         found, so we don't want to bail out if the first method doesn't match.
12899         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12900         matches, report the 123.  Fixes #28070.
12901
12902 2002-07-24  Martin Baulig  <martin@gnome.org>
12903
12904         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12905         TypeManager.TypeToCoreType() to the top of the method so the
12906         following equality checks will work.  Fixes #28107.
12907
12908 2002-07-24  Martin Baulig  <martin@gnome.org>
12909
12910         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12911         operand is of type uint, and the other operand is of type sbyte,
12912         short or int, the operands are converted to type long." -
12913         Actually do what this comment already told us.  Fixes bug #28106,
12914         added test-150.cs.
12915
12916 2002-07-24  Martin Baulig  <martin@gnome.org>
12917
12918         * class.cs (MethodBase): New abstract class.  This is now a base
12919         class for Property, Indexer and Event to avoid some code duplication
12920         in their Define() and DefineMethods() methods.
12921         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12922         generic methods for Define() and DefineMethods().
12923         (FieldBase): Derive from MemberBase, not MemberCore.
12924         (Property): Derive from MemberBase, not MemberCore.
12925         (Property.DefineMethod): Moved all the code from this method to the
12926         new MethodBase.DefineAccessor(), just call it with appropriate
12927         argumetnts.
12928         (Property.Define): Call the new Property.DoDefine(), this does some
12929         sanity checks and we don't need to duplicate the code everywhere.
12930         (Event): Derive from MemberBase, not MemberCore.
12931         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12932         accessors, this will also make them work with interface events.
12933         (Indexer): Derive from MemberBase, not MemberCore.
12934         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12935         (Indexer.Define): Use the new MethodBase functions.
12936
12937         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12938         argument to the constructor.
12939         (Interface.FindMembers): Added support for interface events.
12940         (Interface.PopluateEvent): Implemented.
12941
12942         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12943
12944 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12945
12946         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12947         but this is required to check for a method name being the same as
12948         the containing class.  
12949
12950         Handle this now.
12951
12952 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12953
12954         * interface.cs: initialize variable.
12955
12956 2002-07-23  Martin Baulig  <martin@gnome.org>
12957
12958         Implemented the IndexerName attribute in interfaces.
12959
12960         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12961         name if this is an explicit interface implementation.
12962         (Indexer.InterfaceIndexerName): New public variable.  If we're
12963         implementing an interface indexer, this is the IndexerName in that
12964         interface.  Otherwise, it's the IndexerName.
12965         (Indexer.DefineMethod): If we're implementing interface indexer,
12966         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12967         and Pending.ImplementIndexer methods.
12968         (Indexer.Define): Also define the PropertyBuilder if we're
12969         implementing an interface indexer and this is neither an explicit
12970         interface implementation nor do the IndexerName match the one in
12971         the interface.
12972
12973         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12974         If a method is defined here, then we always need to create a proxy
12975         for it.  This is used when implementing interface indexers.
12976         (Pending.IsInterfaceIndexer): New public method.
12977         (Pending.ImplementIndexer): New public method.
12978         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12979         This is used when implementing interface indexers to define a proxy
12980         if necessary.
12981         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12982         define a proxy if necessary.
12983
12984         * interface.cs (Interface.IndexerName): New public variable.
12985         (Interface.PopulateIndexer): Set the IndexerName.
12986         (Interface.DefineIndexers): New private method.  Populate all the
12987         indexers and make sure their IndexerNames match.
12988
12989         * typemanager.cs (IndexerPropertyName): Added support for interface
12990         indexers.
12991
12992 2002-07-22  Martin Baulig  <martin@gnome.org>
12993
12994         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12995         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12996         ret if HasReturnLabel.
12997         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12998         variables.
12999
13000         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13001         and set the ec.LoopBeginTryCatchLevel.
13002         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13003         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13004         the current ec.TryCatchLevel, the branch goes out of an exception
13005         block.  In this case, we need to use Leave and not Br.
13006
13007 2002-07-22  Martin Baulig  <martin@gnome.org>
13008
13009         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13010         block unless the block does not always return or it is contained in
13011         another try { ... } catch { ... } block.  Fixes bug #26506.
13012         Added verify-1.cs to the test suite.
13013
13014 2002-07-22  Martin Baulig  <martin@gnome.org>
13015
13016         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13017         then we do not always return.  Fixes bug #24985.
13018
13019 2002-07-22  Martin Baulig  <martin@gnome.org>
13020
13021         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13022         lookup on a per-class level; ie. walk up the class hierarchy until we
13023         found at least one applicable method, then choose the best among them.
13024         Fixes bug #24463 and test-29.cs.
13025
13026 2002-07-22  Martin Baulig  <martin@gnome.org>
13027
13028         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13029         return types of the methods.  The return type is not part of the
13030         signature and we must not check it to make the `new' modifier work.
13031         Fixes bug #27999, also added test-147.cs.
13032         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13033
13034         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13035         on the method's return type.
13036
13037 2002-07-21  Martin Baulig  <martin@gnome.org>
13038
13039         * assign.cs: Make this work if the rightmost source is a constant and
13040         we need to do an implicit type conversion.  Also adding a few more tests
13041         to test-38.cs which should have caught this.
13042
13043         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13044         target in the makefile for this.  The makefile.gnu is primarily intended
13045         for end-users who don't want to debug the compiler.
13046
13047 2002-07-21  Martin Baulig  <martin@gnome.org>
13048
13049         * assign.cs: Improved the Assign class so it can now handle embedded
13050         assignments (X = Y = Z = something).  As a side-effect this'll now also
13051         consume less local variables.  test-38.cs now passes with MCS, added
13052         a few new test cases to that test.
13053
13054 2002-07-20  Martin Baulig  <martin@gnome.org>
13055
13056         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13057         instructions.  Fixes bug #27977, also added test-146.cs.
13058
13059 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13060
13061         * cs-tokenizer.cs: fixed getHex ().
13062
13063 2002-07-19  Martin Baulig  <martin@gnome.org>
13064
13065         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13066         not Type.GetType() to lookup the array type.  This is needed when
13067         we're constructing an array of a user-defined type.
13068         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13069         single-dimensional arrays, but also for single-dimensial arrays of
13070         type decimal.
13071
13072 2002-07-19  Martin Baulig  <martin@gnome.org>
13073
13074         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13075         this function is called, it's not allowed to share LocalBuilders
13076         among ILGenerators.
13077
13078 2002-07-19  Martin Baulig  <martin@gnome.org>
13079
13080         * expression.cs (Argument.Resolve): Report an error 118 when trying
13081         to pass a type as argument.
13082
13083 2002-07-18  Martin Baulig  <martin@gnome.org>
13084
13085         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13086         Conv_R_Un for the signed `long' type.
13087
13088 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13089
13090         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13091         `expr' for the temporary result, as that will fail if we do
13092         multiple resolves on the same expression.
13093
13094 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13095
13096         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13097         ec.TypeContainer for looking up aliases. 
13098
13099         * class.cs (TypeContainer): Remove LookupAlias from here.
13100
13101         * decl.cs (DeclSpace); Move here.
13102
13103 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13104
13105         * class.cs (FindMembers): Only call filter if the constructor
13106         bulider is not null.
13107
13108         Also handle delegates in `NestedTypes' now.  Now we will perform
13109         type lookups using the standard resolution process.  This also
13110         fixes a bug.
13111
13112         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13113         This uses Expressions (the limited kind that can be parsed by the
13114         tree) instead of strings.
13115
13116         * expression.cs (ComposedCast.ToString): Implement, used to flag
13117         errors since now we have to render expressions.
13118
13119         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13120         FormArrayType. 
13121
13122         * ecore.cs (SimpleName.ToString): ditto.
13123
13124         * cs-parser.jay: Instead of using strings to assemble types, use
13125         Expressions to assemble the type (using SimpleName, ComposedCast,
13126         MemberAccess).  This should fix the type lookups in declarations,
13127         because we were using a different code path for this.
13128
13129         * statement.cs (Block.Resolve): Continue processing statements
13130         even when there is an error.
13131
13132 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13133
13134         * class.cs (Event.Define): Also remove the `remove' method from
13135         the list of pending items.
13136
13137         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13138         generate more compact code. 
13139
13140 2002-07-17  Martin Baulig  <martin@gnome.org>
13141
13142         * const.cs (Const.LookupConstantValue): Add support for constant
13143         `unchecked' and `checked' expressions.
13144         Also adding test case test-140.cs for this.
13145
13146 2002-07-17  Martin Baulig  <martin@gnome.org>
13147
13148         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13149         check whether mi.ReturnType implements the IEnumerator interface; the
13150         `==' and the IsAssignableFrom() will fail in this situation.
13151
13152 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13153
13154         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13155         here too.
13156
13157 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13158
13159         * expression.cs: fixed bug #27811.
13160
13161 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13162
13163         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13164         Molaro: when we are a ref, the value already contains a pointer
13165         value, do not take the address of it.
13166
13167 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13168         * removed mb-parser.jay and mb-tokenizer.cs
13169
13170 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13171
13172         * expression.cs: check against the building corlib void type.
13173
13174 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13175
13176         * ecore.cs: fix for valuetype static readonly fields: when 
13177         initializing them, we need their address, not the address of a copy.
13178
13179 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13180
13181         * typemanager.cs: register also enum_type in corlib.
13182
13183 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13184
13185         * class.cs: allow calling this (but not base) initializers in structs.
13186
13187 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13188
13189         * ecore.cs: make sure we compare against the building base types
13190         in GetTypeSize ().
13191
13192 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13193
13194         * typemanager.cs: fix TypeToCoreType() to handle void and object
13195         (corlib gets no more typerefs after this change).
13196
13197 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13198
13199         * expression.cs (ArrayCreation.EmitArrayArguments): use
13200         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13201
13202         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13203         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13204         array indexes, the runtime actually forbids them.
13205
13206         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13207         for array arguments here.
13208
13209         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13210         instead of the default for ValueTypes.
13211
13212         (New.DoEmit): Use IsValueType instead of
13213         IsSubclassOf (value_type)
13214         (New.DoResolve): ditto.
13215         (Invocation.EmitCall): ditto.
13216
13217         * assign.cs (Assign): ditto.
13218
13219         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13220         Statements *are* currently doing part of their resolution during
13221         Emit.  
13222
13223         Expressions do always resolve during resolve, but statements are
13224         only required to propagate resolution to their children.
13225
13226 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13227
13228         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13229
13230         (LoadAssembly): Do not add the dll if it is already specified
13231
13232         (MainDriver): Add the System directory to the link path at the end,
13233         after all the other -L arguments. 
13234
13235         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13236         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13237         ldelem.u1) and using the opposite for sbytes.
13238
13239         This fixes Digger, and we can finally run it.
13240
13241         * driver.cs (UnixParseOption): Move the option parsing here.  
13242         (CSCParseOption): Implement CSC-like parsing of options.
13243
13244         We now support both modes of operation, the old Unix way, and the
13245         new CSC-like way.  This should help those who wanted to make cross
13246         platform makefiles.
13247
13248         The only thing broken is that /r:, /reference: and /lib: are not
13249         implemented, because I want to make those have the same semantics
13250         as the CSC compiler has, and kill once and for all the confussion
13251         around this.   Will be doing this tomorrow.
13252
13253         * statement.cs (Unsafe.Resolve): The state is checked during
13254         resolve, not emit, so we have to set the flags for IsUnsfe here.
13255
13256 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13257
13258         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13259         not catch the Error_ObjectRefRequired in SimpleName (as it is
13260         possible to have a class/instance variable name that later gets
13261         deambiguated), we have to check this here.      
13262
13263 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13264
13265         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13266         make static and put into Expression.
13267
13268         (Event.Define): Register the private field of the event with the 
13269         TypeManager so that GetFieldFromEvent can get at it.
13270
13271         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13272         keep track of the private field associated with an event which
13273         has no accessors.
13274
13275         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13276         private field.
13277
13278         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13279
13280 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13281
13282         * expression.cs (Binary.EmitBranchable): this routine emits the
13283         Binary expression in a branchable context.  This basically means:
13284         we need to branch somewhere, not just get the value on the stack.
13285
13286         This works together with Statement.EmitBoolExpression.
13287
13288         * statement.cs (Statement.EmitBoolExpression): Use
13289         EmitBranchable. 
13290
13291 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13292
13293         * statement.cs (For): Reduce the number of jumps in loops.
13294
13295         (For): Implement loop inversion for the For statement.
13296
13297         (Break): We can be breaking out of a Try/Catch controlled section
13298         (foreach might have an implicit try/catch clause), so we need to
13299         use Leave instead of Br.
13300
13301         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13302         now).  If the instace expression supports IMemoryLocation, we use
13303         the AddressOf method from the IMemoryLocation to extract the
13304         address instead of emitting the instance.
13305
13306         This showed up with `This', as we were emitting the instance
13307         always (Emit) instead of the Address of This.  Particularly
13308         interesting when This is a value type, as we dont want the Emit
13309         effect (which was to load the object).
13310
13311 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13312
13313         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13314
13315         * statement.cs (Checked): Set the CheckedState during the resolve
13316         process too, as the ConvCast operations track the checked state on
13317         the resolve process, and not emit.
13318
13319         * cs-parser.jay (namespace_member_declaration): Flag that we have
13320         found a declaration when we do.  This is used to flag error 1529
13321
13322         * driver.cs: Report ok when we display the help only.
13323
13324 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13325
13326         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13327
13328 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13329
13330         * cs-tokenizer.cs (define): We also have to track locally the
13331         defines.  AllDefines is just used for the Conditional Attribute,
13332         but we also need the local defines for the current source code. 
13333
13334 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13335
13336         * statement.cs (While, For, Do): These loops can exit through a
13337         Break statement, use this information to tell whether the
13338         statement is the last piece of code.
13339
13340         (Break): Flag that we break.
13341
13342         * codegen.cs (EmitContexts): New `Breaks' state variable.
13343
13344 2002-07-03  Martin Baulig  <martin@gnome.org>
13345
13346         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13347         modifiers in method declarations in structs.  Otherwise, you won't
13348         be able to override things like Object.Equals().
13349
13350 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13351
13352         * class.cs (Method, Property, Indexer): Do not allow the public
13353         modifier to be used in explicit interface implementations.
13354
13355         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13356         override modifiers in method declarations in structs
13357
13358 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13359
13360         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13361         integer or real overflow, report an error
13362
13363 2002-07-02  Martin Baulig  <martin@gnome.org>
13364
13365         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13366         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13367         to tell the runtime about our newly created System.Object and
13368         System.ValueType types.
13369
13370 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13371
13372         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13373         struct instead of Ldarg/Starg.
13374
13375 2002-07-02  Martin Baulig  <martin@gnome.org>
13376
13377         * expression.cs (Indirection.Indirection): Call
13378         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13379
13380 2002-07-02  Martin Baulig  <martin@gnome.org>
13381
13382         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13383         ValueType, call TypeManager.TypeToCoreType() on it.
13384         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13385         the OpCodes.Newarr argument.
13386
13387 2002-07-02  Martin Baulig  <martin@gnome.org>
13388
13389         * expression.cs (Invocation.EmitCall): When compiling corlib,
13390         replace all calls to the system's System.Array type to calls to
13391         the newly created one.
13392
13393         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13394         System.Array methods.
13395         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13396         from the system's System.Array type which must be replaced.
13397
13398 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13399
13400         * typemanager.cs: load unverifiable_code_ctor so we can build
13401         corlib using the correct type. Avoid using GetTypeCode() with
13402         TypeBuilders.
13403         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13404         TypeManager.object_type to allow building corlib.
13405
13406 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13407
13408         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13409
13410 2002-07-01  Martin Baulig  <martin@gnome.org>
13411
13412         * class.cs: Make the last change actually work, we need to check
13413         whether `ifaces != null' to avoid a crash.
13414
13415 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13416
13417         * class.cs: when we build structs without fields that implement
13418         interfaces, we need to add the interfaces separately, since there is
13419         no API to both set the size and add the interfaces at type creation
13420         time.
13421
13422 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13423
13424         * expression.cs: the dimension arguments to the array constructors
13425         need to be converted if they are a long.
13426
13427 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13428
13429         * class.cs: don't emit ldarg.0 if there is no parent constructor
13430         (fixes showstopper for corlib).
13431
13432 2002-06-29  Martin Baulig  <martin@gnome.org>
13433
13434         MCS now compiles corlib on GNU/Linux :-)
13435
13436         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13437         ie. check for MethodImplOptions.InternalCall.
13438
13439         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13440         and TypeManager.attribute_type are null, so we must explicitly check
13441         whether parent is not null to find out whether it's an attribute type.
13442         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13443         and SetBuilder, not only if the property is neither abstract nor external.
13444         This is necessary to set the MethodImplOptions on the accessor methods.
13445         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13446         SetBuilder, see Property.Emit().
13447
13448         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13449         populate "System.Object", "System.ValueType" and "System.Attribute" since
13450         they've already been populated from BootCorlib_PopulateCoreTypes().
13451
13452 2002-06-29  Martin Baulig  <martin@gnome.org>
13453
13454         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13455         is the NullLiteral, we also need to make sure that target_type is not
13456         an enum type.   
13457
13458 2002-06-29  Martin Baulig  <martin@gnome.org>
13459
13460         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13461         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13462         before calling BootstrapCorlib_ResolveDelegate ().
13463
13464 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13465
13466         * statement.cs: fixed build-breaker. All tests passed ok.
13467
13468 2002-06-27  Martin Baulig  <martin@gnome.org>
13469
13470         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13471         for System.Decimal when compiling corlib.
13472
13473 2002-06-27  Martin Baulig  <martin@gnome.org>
13474
13475         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13476         switch blocks which contain nothing but a default clause.
13477
13478 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13479
13480        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13481
13482 2002-06-27  Martin Baulig  <martin@gnome.org>
13483
13484         * ecore.cs (PropertyExpr.PropertyExpr): Call
13485         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13486
13487         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13488         is already a TypeBuilder.
13489
13490 2002-06-27  Martin Baulig  <martin@gnome.org>
13491
13492         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13493         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13494         the "from an array-type to System.Array" case.  This makes it work
13495         when compiling corlib.
13496
13497 2002-06-27  Martin Baulig  <martin@gnome.org>
13498
13499         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13500         non-static PropertyExpr, set its InstanceExpression.  This makes
13501         the `ICollection.Count' property work in System/Array.cs.
13502
13503 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13504
13505         * driver.cs: Made error handling more consistent.  Errors now
13506         tracked by Report class, so many methods which used to return int
13507         now return void.  Main() now prints success/failure and 
13508         errors/warnings message.
13509
13510         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13511         the magic number return values (123 and 124).  Now, if the
13512         expected error occurs, the compiler exits with success (exit value
13513         0).  If the compilation completes without seeing that particular
13514         error, the compiler exits with failure (exit value 1).  The
13515         makefile in mcs/errors has been changed to handle the new behaviour.
13516
13517         * report.cs: Made 'expected error' number a property and renamed
13518         it from 'Probe' to 'ExpectedError'.
13519
13520         * genericparser.cs: Removed error handling support, since it is
13521         now all done by Report class.
13522
13523         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13524         class, so parse() no longer returns an int.
13525
13526         * namespace.cs: Use Report.Error instead of GenericParser.error
13527
13528 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13529
13530         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13531         TypeContainer.AddOperator): At the front of the list put the
13532         explicit implementations, so they get resolved/defined first. 
13533
13534 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13535
13536         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13537         interface type is implemented by this TypeContainer.  Used during
13538         explicit interface implementation.
13539
13540         (Property.Define, Indexer.Define, Method.Define): Validate that
13541         the given interface in the explicit implementation is one of the
13542         base classes for the containing type.
13543
13544         Also if we are explicitly implementing an interface, but there is
13545         no match in the pending implementation table, report an error.
13546
13547         (Property.Define): Only define the property if we are
13548         not explicitly implementing a property from an interface.  Use the
13549         correct name also for those properties (the same CSC uses,
13550         although that is really not needed).
13551
13552         (Property.Emit): Do not emit attributes for explicitly implemented
13553         properties, as there is no TypeBuilder.
13554
13555         (Indexer.Emit): ditto.
13556
13557         Hiding then means that we do not really *implement* a pending
13558         implementation, which makes code fail.
13559
13560 2002-06-22  Martin Baulig  <martin@gnome.org>
13561
13562         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13563         the return value of Object.GetType().  [FIXME: we need to do this whenever
13564         we get a type back from the reflection library].
13565
13566 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13567
13568         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13569
13570 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13571
13572         * attribute.cs: Return null if we can not look up the type.
13573
13574         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13575         the interface types found.
13576
13577         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13578         interface types found.
13579
13580         * typemanager.cs (GetInterfaces): Make this routine returns alll
13581         the interfaces and work around the lame differences between
13582         System.Type and System.Reflection.Emit.TypeBuilder in the results
13583         result for GetInterfaces.
13584
13585         (ExpandInterfaces): Given an array of interface types, expand and
13586         eliminate repeated ocurrences of an interface.  This expands in
13587         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13588         be IA, IB, IC.
13589
13590 2002-06-21  Martin Baulig  <martin@gnome.org>
13591
13592         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13593         on System.Enum.
13594
13595 2002-06-21  Martin Baulig  <martin@gnome.org>
13596
13597         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13598         and called with one of the core types, return the corresponding typebuilder for
13599         that type.
13600
13601         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13602         element type.
13603
13604 2002-06-21  Martin Baulig  <martin@gnome.org>
13605
13606         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13607         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13608         (Expression.ConvertReferenceExplicit): Likewise.
13609
13610         * expression.cs (ElementAccess.DoResolve): Likewise.
13611         (ElementAccess.DoResolveLValue): Likewise.
13612
13613 2002-06-10  Martin Baulig  <martin@gnome.org>
13614
13615         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13616         add the "value" parameter to the parameter list.
13617
13618         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13619         to our caller.
13620
13621 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13622
13623         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13624         the argument to an int, uint, long or ulong, per the spec.  Also
13625         catch negative constants in array creation.
13626
13627 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13628
13629         * class.cs: do not allow the same interface to appear twice in
13630         the definition list.
13631
13632 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13633
13634         * ecore.cs: don't use ldlen with System.Array.
13635
13636 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13637
13638         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13639
13640 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13641
13642         * modifiers.cs: produce correct field attributes for protected
13643         internal. Easy fix so miguel can work on ther harder stuff:-)
13644
13645 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13646
13647         * pending.cs: New file.  Move the code from class.cs here.
13648         Support clearning the pending flag for all methods (when not doing
13649         explicit interface implementation).
13650
13651 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13652
13653         * rootcontext.cs: added a couple more types needed to bootstrap.
13654
13655 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13656
13657         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13658         constructor in the type, instead of any constructor in the type
13659         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13660         a bug in the Mono runtime when applying the params attribute). 
13661
13662 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13663         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13664
13665 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13666
13667         * expression.cs (Unary.ResolveOperator): Use TypeManager
13668         to resolve the type.
13669
13670 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13671
13672         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13673         attached.
13674
13675         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13676         with each member too.
13677
13678         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13679         field builders too - this takes care of the enum member case.
13680
13681 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13682
13683         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13684         address-of operator on both value types and pointers.
13685
13686 2002-06-10  Martin Baulig  <martin@gnome.org>
13687
13688         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13689         PropertyBuilder to the `property_builders' list.
13690
13691         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13692         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13693         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13694         find any indexers which are inherited from an interface.
13695
13696 2002-06-09  Martin Baulig  <martin@gnome.org>
13697
13698         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13699         the same type as the constant if necessary.  There's also a test-130.cs
13700         for this.
13701
13702         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13703
13704         * typemanager.cs (TypeManager.ChangeType): Previously known as
13705         Enum.ChangeEnumType().
13706
13707 2002-06-09  Martin Baulig  <martin@gnome.org>
13708
13709         * expression.cs (Cast.TryReduce): Added support for consts.
13710
13711 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13712
13713         * class.cs (Accessor): Hold attributes information so we can pass
13714         it along.
13715
13716         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13717         Modify to pass in attributes attached to the methods.
13718
13719         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13720
13721         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13722         to handle the Accessor kind :-)
13723
13724         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13725
13726 2002-06-08  Martin Baulig  <martin@gnome.org>
13727
13728         * expression.cs (Unary.TryReduceNegative): Added support for
13729         ULongConstants.
13730
13731 2002-06-08  Martin Baulig  <martin@gnome.org>
13732
13733         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13734         name can't be found in the `defined_names' - the caller will do a
13735         MemberLookup in this case and thus find methods in System.Enum
13736         such as Enum.IsDefined().
13737
13738 2002-06-08  Martin Baulig  <martin@gnome.org>
13739
13740         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13741         Convert.ChangeType() which works with TypeBuilder created types.
13742         (Enum.LookupEnumValue, Enum.Define): Use it here.
13743
13744         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13745         `TypeBuilder.BaseType != null' check.
13746         (TypeContainer.FindMembers): Only lookup parent members if we
13747         actually have a parent.
13748         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13749         (ConstructorInitializer.Resolve): Likewise.
13750
13751         * interface.cs (Interface.FindMembers): Added
13752         `TypeBuilder.BaseType != null' check.
13753
13754         * rootcontext.cs (RootContext.ResolveCore): Added
13755         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13756         classes_second_stage.
13757
13758         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13759         debug_type and trace_type when compiling with --nostdlib.       
13760
13761 2002-06-07  Martin Baulig  <martin@gnome.org>
13762
13763         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13764         (AddField): Set it to true when adding a non-static field.
13765         (DefineType): Use `have_nonstatic_fields' to find out whether we
13766         have non-static fields, not `Fields != null'.
13767
13768 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13769
13770         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13771         dereferencing a null on the static-field code path)
13772
13773 2002-05-30  Martin Baulig  <martin@gnome.org>
13774
13775         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13776         to take command line arguments.  Use reflection to call the new
13777         custom `Initialize' function on the symbol writer and pass it the
13778         command line arguments.
13779
13780         * driver.cs (--debug-args): New command line argument to pass command
13781         line arguments to the symbol writer.
13782
13783 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13784
13785         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13786         the target type for indexers and properties.  Thanks to Joe for
13787         catching this.
13788
13789 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13790
13791         * typemanager.cs (MethodFlags): returns the method flags
13792         (Obsolete/ShouldIgnore) that control warning emission and whether
13793         the invocation should be made, or ignored. 
13794
13795         * expression.cs (Invocation.Emit): Remove previous hack, we should
13796         not do this on matching a base type, we should do this based on an attribute
13797
13798         Only emit calls to System.Diagnostics.Debug and
13799         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13800         on the command line.
13801
13802         * rootcontext.cs: Global settings for tracing and debugging.
13803
13804         * cs-tokenizer.cs (define): New utility function to track
13805         defines.   Set the global settings for TRACE and DEBUG if found.
13806
13807 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13808
13809         * interface.cs (Populate*): Pass in the TypeContainer as well as
13810         the DeclSpace as parameters so that we can create EmitContexts and
13811         then use that to apply attributes etc.
13812
13813         (PopulateMethod, PopulateEvent, PopulateProperty)
13814         (PopulateIndexer): Apply attributes everywhere.
13815
13816         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13817         etc.
13818
13819         (ApplyAttributes): Update accordingly.
13820
13821         We now apply interface attributes for all members too.
13822
13823 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13824
13825         * class.cs (Indexer.Define); Correctly check if we are explicit
13826         implementation (instead of checking the Name for a ".", we
13827         directly look up if the InterfaceType was specified).
13828
13829         Delay the creation of the PropertyBuilder.
13830
13831         Only create the PropertyBuilder if we are not an explicit
13832         interface implementation.   This means that explicit interface
13833         implementation members do not participate in regular function
13834         lookups, and hence fixes another major ambiguity problem in
13835         overload resolution (that was the visible effect).
13836
13837         (DefineMethod): Return whether we are doing an interface
13838         implementation. 
13839
13840         * typemanager.cs: Temporary hack until we get attributes in
13841         interfaces (Ravi is working on that) and we get IndexerName
13842         support in interfaces.
13843
13844         * interface.cs: Register the indexers as properties.
13845
13846         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13847         warning, I have verified that this is a bug in the .NET runtime
13848         (JavaScript suffers of the same problem).
13849
13850         * typemanager.cs (MemberLookup): When looking up members for
13851         interfaces, the parent of an interface is the implicit
13852         System.Object (so we succeed in searches of Object methods in an
13853         interface method invocation.  Example:  IEnumerable x;  x.ToString
13854         ()) 
13855
13856 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13857
13858         * class.cs (Event): Events should also register if they do
13859         implement the methods that an interface requires.
13860
13861         * typemanager.cs (MemberLookup); use the new GetInterfaces
13862         method. 
13863
13864         (GetInterfaces): The code used to lookup interfaces for a type is
13865         used in more than one place, factor it here. 
13866
13867         * driver.cs: Track the errors at the bottom of the file, we kept
13868         on going.
13869
13870         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13871         instance if the method we are calling is static!
13872
13873 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13874
13875         * attribute.cs (ApplyAttributes): Make this function filter out
13876         the IndexerName attribute (as that attribute in reality is never
13877         applied) and return the string constant for the IndexerName
13878         attribute. 
13879
13880         * class.cs (TypeContainer.Emit): Validate that all the indexers
13881         have the same IndexerName attribute, and if so, set the
13882         DefaultName attribute on the class. 
13883
13884         * typemanager.cs: The return value might contain other stuff (not
13885         only methods).  For instance, consider a method with an "Item"
13886         property and an Item method.
13887
13888         * class.cs: If there is a problem with the parameter types,
13889         return. 
13890
13891 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13892
13893         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13894         looks at user defined conversion after making a call to 
13895         StandardConversionExists - we need this for overload resolution.
13896
13897         * expression.cs : Update accordingly the various method calls.
13898
13899         This fixes 2 bugs filed against implicit user defined conversions 
13900
13901 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13902
13903         * statement.cs: Track the result of the assignment.
13904
13905 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13906
13907         * expression.cs (MemberAccess): Improved error reporting for
13908         inaccessible members.
13909
13910 2002-05-22  Martin Baulig  <martin@gnome.org>
13911
13912         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13913         itself with debugging support.
13914
13915 2002-05-22  Martin Baulig  <martin@gnome.org>
13916
13917         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13918         Removed, this isn't needed anymore.
13919
13920 2002-05-20  Martin Baulig  <martin@gnome.org>
13921
13922         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13923         be underlying type for an enum.
13924
13925 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13926
13927         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13928         that splits out the loading of just the core types.
13929
13930         * rootcontext.cs (ResolveCore): Split the struct resolution in
13931         two, so we can load the enumeration underlying types before any
13932         enums are used.
13933
13934         * expression.cs (Is): Bandaid until we fix properly Switch (see
13935         bug #24985 for details).
13936
13937         * typemanager.cs (ImplementsInterface): The hashtable will contain
13938         a null if there are no interfaces implemented.
13939
13940 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13941
13942         * cs-parser.jay (indexer_declarator): It is fine to have array
13943         parameters
13944
13945 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13946
13947         * typemanager.cs: (RegisterBuilder): New function used to register
13948         TypeBuilders that implement interfaces.  Since
13949         TypeBuilder.GetInterfaces (as usual) does not work with lame
13950         Reflection.Emit. 
13951         (AddUserType): register interfaces.
13952
13953         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13954         dealing with TypeBuilder.  Also, arrays are showing up as
13955         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13956         methods can not be invoked on them!
13957
13958         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13959         (ImplicitReferenceConversionExists): Split out from
13960         StandardConversionExists. 
13961
13962         * expression.cs (As): We were only implementing one of the three
13963         cases for the as operator.  We now implement them all.
13964         (Is): Implement the various other cases for Is as well.
13965
13966         * typemanager.cs (CACHE): New define used to control if we want or
13967         not the FindMembers cache.  Seems to have a negative impact on
13968         performance currently
13969
13970         (MemberLookup): Nested types have full acess to
13971         enclosing type members
13972
13973         Remove code that coped with instance/static returns for events, we
13974         now catch this in RealFindMembers.
13975
13976         (RealFindMembers): only perform static lookup if the instance
13977         lookup did not return a type or an event.  
13978
13979 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13980
13981         * assign.cs (CompoundAssign): We pass more semantic information
13982         now to Compound Assignments than we did before: now we have all
13983         the information at hand, and now we resolve the target *before* we
13984         do the expression expansion, which allows the "CacheValue" method
13985         to have the effect we intended (before, a [x] += 1 would generate
13986         two differen ArrayAccess expressions from the ElementAccess,
13987         during the resolution process).
13988
13989         (CompoundAssign.DoResolve): Resolve target and original_source here.
13990
13991 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13992
13993         * expression.cs (ArrayAccess): dropped debugging information. 
13994
13995         * typemanager.cs: Small bug fix: I was always returning i_members,
13996         instead of one of i_members or s_members (depending on which had
13997         the content).
13998
13999         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14000         method is invoked before any code generation takes place, and it
14001         is a mechanism to inform that the expression will be invoked more
14002         than once, and that the method should use temporary values to
14003         avoid having side effects
14004
14005         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14006
14007         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14008         implementation.
14009
14010         * expression.cs (Indirection, ArrayAccess): Add support for
14011         CacheTemporaries in these two bad boys. 
14012
14013         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14014         ldobj or ldind_ref.  
14015         (StoreFromPtr): Handle stobj as well.
14016
14017         * expression.cs (UnaryMutator): Share more code.
14018
14019         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14020         down: I was not tracking the Filter function as well, which
14021         was affecting the results of the cache.
14022
14023 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14024
14025         * attribute.cs: Remove the hack to handle the CharSet property on
14026         StructLayouts. 
14027
14028 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14029
14030         * attribute.cs (DoResolve): More uglyness, we now only try to
14031         resolve the attribute partially, to extract the CharSet
14032         information (only if we are a StructLayout attribute).  Otherwise 
14033
14034         (GetExtraTypeInfo): Add some code to conditionally kill in the
14035         future this.   I am more and more convinced that the .NET
14036         framework has special code to handle the attribute setting on
14037         certain elements.
14038
14039         * expression.cs (IsParamsMethodApplicable): Revert my previous
14040         foreach change here, it was wrong.
14041
14042 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14043
14044         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14045         (pp_expr): do not abort on unknown input, just return.
14046         (eval): abort if there are pending chars.
14047
14048         * attribute.cs (Attribute.Resolve): Positional parameters are
14049         optional.  Deal with that case.
14050
14051         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14052         the Ansi/Unicode/Auto information for the type.
14053
14054         (TypeContainer.DefineType): instantiate the EmitContext here, as
14055         we will be using it during the type definition (to resolve
14056         attributes) and during the emit phase.
14057
14058         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14059         to pull type information out of the attributes
14060
14061         (Attribute.Resolve): track the constructor builder, and allow for
14062         multiple invocations (structs and classes will use this).
14063
14064         * ecore.cs (MemberLookupFinal): new version with all the
14065         parameters customizable.
14066
14067         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14068         constructors.  Return if the result value is null (as the error
14069         would have been flagged already by MemberLookupFinal)
14070
14071         Do not allow instances of abstract classes or interfaces to be
14072         created.
14073
14074         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14075         We have to compare the assembly property here when dealing with
14076         FamANDAssem and Assembly access modifiers, because we might be
14077         creating an assembly from *modules* (that means that we are not
14078         getting TypeBuilders for types defined in other modules that are
14079         part of this assembly).
14080
14081         (Method.Emit): If the method is marked abstract and has a body,
14082         emit an error. 
14083
14084         (TypeContainer.DefineMembers): If both the defined member and the
14085         parent name match are methods, then do not emit any warnings: let
14086         the Method.Define routine take care of flagging warnings.  But if
14087         there is a mismatch (method overrides something else, or method is
14088         overriwritten by something, then emit warning).
14089
14090         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14091         set to null, this means `do not check for the return type on the
14092         signature'. 
14093
14094         (Method.Define): set the return type for the method signature to
14095         null, so that we get methods with the same name and parameters and
14096         different return types.  This is used to flag warning 114 (you are
14097         hiding a method, and you probably want to use the new/override
14098         keywords instead).
14099
14100         * typemanager.cs (MemberLookup): Implemented proper access
14101         control, closing a long standing set of bug reports.  The problem
14102         was that the Framework only has two bits: Public and NonPublic,
14103         and NonPublic includes private and protected methods, but we need
14104         to enforce the FamANDAssem, FamOrAssem and Family. 
14105
14106 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14107
14108         * statement.cs (GotoCase): Return true: Ammounts to giving up
14109         knowledge on whether we return or not, and letting the other case
14110         be responsible for it.
14111
14112 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14113
14114         * driver.cs: Do not load directories for each file processed, only
14115         do it if there is a pattern.
14116
14117         * ecore.cs: Report readonly assigns here as well, as we might have
14118         been resolved only by MemberAccess.
14119
14120         (SimpleName.SimpleNameResolve): Also be useful for LValue
14121         resolution.   We need this to propagate assign to local readonly variables
14122
14123         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14124         do not want to reuse potential criteria memory.
14125
14126         * class.cs (MyEventBuilder): Set reflected_type;
14127
14128         * ecore.cs (Constantify): Added support for constifying bools.
14129
14130         (RootContext.LookupType): Added a cache for values looked up in
14131         the declaration space.
14132
14133         * typemanager.cs (FindMembers): Now is a front-end to
14134         RealFindMembers, and provides a two-level hashtable-based cache to
14135         the request.  
14136
14137         15% performance improvement: from 22.5 to 19.2 seconds.
14138
14139         * expression.cs (IsParamsMethodApplicable): use foreach.
14140         (Invocation.DoResolve): ditto.
14141         (New.DoResolve): ditto.
14142         (ArrayCreation.DoResolve): ditto.
14143
14144         * ecore.cs (FindMostEncompassingType): use foreach.
14145
14146         * delegate.cs (NewDelegate.DoResolve): Use foreach
14147
14148         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14149         (RemoveMethods): use foreach.
14150
14151         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14152         nested foreach statements instead of for, and also break out of
14153         the inner loop once a match is found.
14154
14155         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14156
14157 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14158
14159         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14160         we actually unwrap the expression to allow for extra information
14161         to be extracted. 
14162
14163         * expression.cs: Use Shr_Un on unsigned operations. 
14164
14165 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14166
14167         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14168         applicable operators was not being considered correctly. This closes
14169         the bug Miguel reported.
14170
14171 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14172
14173         * attribute.cs: check that the type derives from System.Attribute
14174         and report the correct error in that case (moved the duplicate code to
14175         its own method, too).
14176
14177 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14178
14179         * attribute.cs: lookup attribute type name as the spec says: first the
14180         bare attribute name and then name + "Attribute" (nant compiles with
14181         mcs after this fix).
14182
14183 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14184
14185         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14186         Because of the way we parse things, we should try to see if a
14187         UIntConstant can fit in an integer.
14188
14189 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14190
14191         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14192         when we are in an explicit context.
14193
14194         (ConvertReferenceExplicit): When converting from Iface type S to Class
14195         T make sure the rules are implemented as an OR.
14196
14197         * parameter.cs (ParameterType): Make it a property for now although the
14198         purpose really isn't anything immediate.
14199
14200         * expression.cs (Is*Applicable): Do better checking on the parameter type
14201         of a ref/out parameter. The ones from the system assemblies are already 
14202         marked with the correct type so we don't need to do any correction.
14203
14204         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14205         the object type is standard too so include that.
14206
14207 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14208
14209         * ecore.cs (StandardConversionExists): Augment with missing code:
14210         deal with IntConstant, LongConstants and Enumerations.
14211
14212         * assign.cs: Report the error, instead of failing silently
14213
14214         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14215         typecontainer that they are declared, because the
14216         typecontainer/namespace will have the list of using clauses that
14217         need to be applied.
14218
14219         Assembly Attributes were escaping the normal registration
14220         mechanism. 
14221
14222         (EmitCode): Apply attributes within an EmitContext that represents
14223         the container they were declared on.
14224
14225         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14226
14227 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14228
14229         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14230         Revamp completely - make much cleaner as we now operate only
14231         on a set of Types.
14232
14233         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14234         to implement the logic detailed in the spec more correctly.
14235
14236         (UserDefinedConversion): Update accordingly.
14237
14238 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14239
14240         * statement.cs: Return flow analysis information up.
14241
14242         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14243         and the default.
14244
14245         (token): Do not consume an extra character before calling
14246         decimal_digits.
14247
14248 2002-05-06  Piers Haken <piersh@friskit.com>
14249
14250         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14251
14252 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14253
14254         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14255         EmitContext during the instance constructor initializer
14256         resolution, to stop access to instance variables.
14257
14258         This is mandated by the spec, last paragraph of the `constructor
14259         initializers' section. 
14260
14261 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14262
14263         * cs-parser.jay, class.cs (Accessor): new class used to represent
14264         an accessor (get or set).  In the past we used `null' to represent
14265         a missing accessor.  But this is ambiguous because there was no
14266         way to tell in abstract indexers/properties if one of them was
14267         specified.
14268
14269         Now there is a way of addressing that.
14270
14271         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14272         instead of FindMembers.
14273
14274         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14275         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14276
14277         * attribute.cs: Treat indexers and properties as the same in terms
14278         of applying attributes
14279
14280         * ecore.cs (FindMostEncompassedType): Use statically initialized
14281         EmptyExpressions()s like we do elsewhere to avoid creating useless
14282         objects (and we take this out of the tight loop).
14283
14284         (GetConversionOperators): Move the code to extract the actual
14285         operators to a separate routine to clean things up.
14286
14287 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14288
14289         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14290         events are always registered FieldBuilders.
14291
14292         * class.cs (FieldBase): New class shared by Fields 
14293
14294         * delegate.cs: If we are a toplevel delegate, use our full name.
14295         If we are a nested delegate, then only use our tail name.
14296
14297 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14298
14299         * expression.cs (IsApplicable): Ensure that we add the "&" to
14300         ref/out types before comparing it with the type of the argument.
14301
14302         (IsParamsMethodApplicable): Ditto.
14303
14304         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14305         silly me ;-)
14306
14307         * delegate.cs : Handle the case when we have more than one applicable
14308         method. Flag an error only when we finish checking all.
14309
14310 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14311
14312         * expression.cs: Add support for boolean static initializers.
14313
14314 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14315
14316         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14317
14318         * parameter.cs (ComputeParameterTypes,
14319         ComputeAndDefineParameterTypes): Better error handling: now we
14320         clear the `types' cache if we fail during any of the type lookups.
14321         We also return the status code correctly to our caller
14322
14323         * delegate.cs: If we fail to define a delegate, abort the extra
14324         steps. 
14325
14326         * expression.cs (Binary.ResolveOperator): for
14327         operator==(object,object) and operator !=(object, object) we also
14328         have to verify that there is an implicit conversion from one to
14329         the other.
14330
14331         (ArrayAccess.DoResolve): Array Access can operate on
14332         non-variables. 
14333
14334 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14335
14336         * assign.cs (CompoundAssign): A new class used as a "flag" that
14337         the assignment actually is happening as part of a compound
14338         assignment operator.
14339
14340         During compound assignment, a few new rules exist to enable things
14341         like:
14342
14343         byte b |= 1 + 2
14344
14345         From the spec:
14346
14347         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14348         to the type of x) if y is implicitly convertible to the type of x,
14349         and the operator is a builtin operator and the return type of the
14350         operator is explicitly convertible to the type of x. 
14351
14352         * rootcontext.cs: Reset warning level to 2.  4 catches various
14353         "interesting" features in mcs, we must clean this up at some
14354         point, but currently am trying to kill other bugs ;-)
14355
14356         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14357         in container classes as well.  
14358
14359         * expression.cs (Binary.ResolveOperator): Handle string case
14360         before anything else (as operator overloading does emit an error
14361         before doing anything else).
14362
14363         This code could go away when we move to a table driven model, but
14364         i could not come up with a good plan last night.
14365
14366 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14367
14368         * typemanager.cs (CSharpName): reimplementation using regex.
14369         * class.cs: added null check for fields in Emit
14370         * rootcontext.cs: set warninglevel to 4
14371
14372 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14373
14374         * typemanager.cs (CSharpName): reimplemented with Lupus
14375         suggestion.
14376
14377 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14378
14379         * statement.cs (If): correclty implement Resolve, because we were
14380         not catching sem errors in there.  The same process is needed
14381         everywhere else. 
14382         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14383
14384
14385         (Statement.Warning_DeadCodeFound): Factorize code.
14386         (While): Report dead code here too.
14387
14388         (Statement): Added Resolve virtual method to allow
14389         for resolution split from the emit code.
14390
14391 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * statement.cs (EmitBoolExpression): No longer try to resolve the
14394         expression here.    
14395         (MakeBoolean): New utility function that resolve, implicitly
14396         converts to boolean and tags the expression. 
14397
14398
14399         (If, Do): Implement dead code elimination.
14400         (While): Implement loop inversion
14401
14402         (Do, While, For, If): Resolve the expression prior to calling our
14403         code generation.
14404
14405 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14406
14407         * class.cs:
14408           - added method Report28 (warning: program has more than one entry point)
14409           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14410           - modified method Method.Define, the part at the end of the method
14411
14412         * rootcontext.cs: added static public Location EntryPointLocation;
14413           
14414         * ../errors/cs0028.cs : Add test case for the above warning.              
14415
14416         * typemanager.cs:
14417           - modified method CSharpName to allow arrays of primitive type to
14418             be printed nicely (e.g. instead of System.Int32[][] it now prints
14419             int[][])
14420           - added method CSharpSignature: returns the signature of a method
14421             in string format to be used in reporting errors, warnings, etc.
14422
14423         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14424         with String.Empty.
14425
14426 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14427
14428         * delegate.cs (Define): Fix extremely silly bug where I was
14429         setting the type of the 'object' parameter of the BeginInvoke
14430         method to System.IAsyncResult instead of System.Object ;-)
14431
14432 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14433
14434         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14435         here. 
14436
14437         (Constructor.Emit): return if we fail to initialize the
14438         constructor.  Another door closed!  
14439
14440         * expression.cs (New.DoResolve): Improve error message (from -6 to
14441         1501).  Use DeclaredOnly lookup to find the exact constructor.
14442
14443         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14444         loop.  This is useful.
14445
14446         * cs-parser.jay: Adjust the default parameters so that destructors
14447         have the proper signature.
14448
14449 2002-04-26  Martin Baulig  <martin@gnome.org>
14450
14451         * driver.cs (LoadAssembly): If `assembly' contains any characters
14452         which are only valid in path names and not in assembly names
14453         (currently slash, backslash and point), use Assembly.LoadFrom ()
14454         instead of Assembly.Load () on the `assembly' (before iteration
14455         over the link_paths).
14456
14457 2002-04-26  Martin Baulig  <martin@gnome.org>
14458
14459         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14460
14461 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14462
14463         * class.cs (Property): use the new typemanager.MemberLookup
14464
14465         (TypeContainer.MemberLookup): Implement using the
14466         TypeManager.MemberLookup now. 
14467
14468         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14469         and return MemberInfos, so that these can be used without an
14470         EmitContext (what we had before).
14471
14472 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14473
14474         * expression.cs: Fix the case where the argument to params if the
14475         type of the params.  I omitted handling this before.   Fixed
14476
14477 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14478
14479         * driver.cs: Call BootCorlib_PopulateCoreType
14480
14481         * class.cs (Property.CheckBase): Check for properties only, not
14482         for all members. 
14483
14484         * interface.cs: Temporary hack: try/catch around the
14485         CustomAttributeBuilder, because I am getting an exception that I
14486         do not understand.
14487
14488         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14489         types whose definitions are required to be there (attributes are
14490         defined before standard types).
14491
14492         Compute definitions as we boot the various types, as they are used
14493         immediately (value_type class will need object_type, but if we do
14494         not initialize object_type, we will pass a null, which will let
14495         the runtime pick the System.Object from the existing corlib, which
14496         is not what we want).
14497
14498 2002-04-22  Patrik Torstensson <totte@labs2.com>
14499
14500         * cs-tokenizer.cs: fixed a number of trim() issues.
14501
14502 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14503
14504         * expression.cs (Argument.Type): Ensure that we return the correct
14505         type when we have out or ref parameters [in which case we 
14506         append a "&"].
14507
14508 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14509
14510         * class.cs (Property, Indexer): Allow extern modifier in there. 
14511
14512         * typemanager.cs (InitBaseTypes): Initializes object_type and
14513         value_type, since those will be used early on during the bootstrap
14514         process to compile corlib.
14515
14516         (InitCoreTypes): Move code from here to InitBaseTypes.
14517
14518 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14519
14520         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14521         single-dimension arrays as using the ldlen opcode.  
14522
14523         Daniel Lewis discovered this optimization.  
14524
14525         * typemanager.cs: Add signature for System.Array::get_Length
14526
14527 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14528
14529         * statement.cs: report the error when the foreach does not apply to an
14530         array nor a collection.
14531
14532 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14533
14534         * expression.cs: Add implicit conversions to the operator ~.
14535
14536         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14537
14538         * typemanager.cs: Locate the decimal constructor.
14539
14540 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14541
14542         * attribute.cs: use the new property of TypeOf.
14543         * expression.cs: added 'get' property around typearg.
14544
14545         These changes fix a build breaker reported by NickD. Is this the
14546         correct way to fix?  If not, please, revert my changes and make it
14547         work :-).
14548
14549 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14550
14551         * attribute.cs: Add support for typeof in attribute invocations.
14552         I am not sure that this is right though.
14553
14554 2002-04-14  Duncan Mak  <duncan@ximian.com>
14555
14556         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14557         Binary.Operator.Division case.
14558
14559 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14560
14561         * class.cs (DefineType): Ensure that we do a proper check on
14562         attribute types and also register it with the TypeManager.
14563
14564         (TypeContainer.Targets): The default for attribute types is
14565         AttributeTargets.All.
14566
14567         * attribute.cs (ApplyAttributes): Registering the attribute type
14568         is done elsewhere, not when we discover we have a Usage attribute.
14569
14570 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14571
14572         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14573         and get rid of is_delegate parameter.
14574
14575         * everywhere : update.
14576
14577 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14578
14579         * cs-parser.jay (compilation_unit): Revamp completely to use
14580         some new ideas that I got from Rhys' grammar to solve the problems
14581         with assembly level attributes.
14582
14583         (outer_declaration): New grammar production.
14584
14585         (attribute_sections): Add.
14586
14587         (opt_attributes): Base on attribute_sections
14588
14589         (namespace_declaration): Allow opt_attributes to tackle the case
14590         when we have assembly level attributes - we are clever in this
14591         regard now ;-)
14592
14593         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14594         attributes in the non-global context.
14595
14596         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14597         instead of SetGlobalAttributes.
14598
14599         * class.cs, rootcontext.cs : Ensure we define and generate 
14600         attribute types before anything else.
14601
14602         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14603         and flag the new error -20 for the case when the attribute type
14604         does not have valid targets specified. csc does not catch this.
14605
14606         * ../errors/errors.txt : update for error # -20
14607
14608 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14609
14610         * support.cs (InternalParameters.ParameterModifier): Do some null
14611         checking and return sane values.
14612
14613         * class.cs (Method.Define): If we are a PInvoke method, ensure
14614         that we are static and extern. Report error # 601
14615
14616         * ../errors/cs0601.cs : Add test case for the above error.
14617
14618 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14619
14620         * rootcontext.cs (attribute_types): We need to keep type of
14621         all attribute types separately and emit code for them first.
14622
14623         (RegisterAttribute) : Implement.
14624
14625         * class.cs (DefineType): Check if the current Type is a custom
14626         attribute type and register it accordingly.
14627
14628         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14629         adding the first attribute twice and rename to
14630
14631         (SetGlobalAttributes): this.
14632
14633         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14634         lookups.
14635
14636         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14637         if we are processing global arguments. Hmm, I am unsure of this.
14638
14639 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14640
14641         * expression.cs: added static array of strings to avoid calling
14642         Enum.ToString () for Operator in Binary. Significant recover of
14643         performance.
14644
14645 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14646
14647         * class.cs (FindMembers): Allow the Builders of the various
14648         members to be null.  If they are skip them.  This only happens
14649         during the PInvoke declaration.
14650
14651 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14652
14653         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14654         failure, so we do not keep going afterwards.
14655
14656         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14657         wanted to pass `false' as the `is_delegate' argument.  If this is
14658         the case, why not use delegate_type == null to mean `is_delegate =
14659         false' and anything else as is_delegate = true.
14660
14661 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14662
14663         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14664         code for the section, not the beginning of the tests.
14665
14666 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14667
14668         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14669
14670         * expression.cs (Binary): same.  Warn about errors where we have
14671         Enum/Enum in operator + as well.
14672
14673 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14674
14675         * statement.cs:
14676                 - added support for switch(bool)
14677                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14678                 - add TableSwitchEmit() to handle table-based switch statements
14679
14680 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14681
14682         * expression.cs (Invocation.OverloadResolve): Factor out code which
14683         does parameter compatibility checking with arguments so that we can 
14684         re-use the code even from Delegate.VerifyApplicability
14685
14686         (VerifyArgumentsCompat): Move above code here.
14687
14688         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14689         and instead make a call to the above method.
14690
14691 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14692
14693         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14694         We use it to keep track of classes which are attribute types.
14695
14696 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14697
14698         * delegate.cs (Delegate.Define): Correctly define the types in the
14699         presence of fixed and array parameters.
14700
14701         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14702         doing FindMembers.
14703
14704         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14705         include NonPublic after the first iteration.
14706
14707         * class.cs (Indexer.CheckBase): Only check if both parents are
14708         non-null. 
14709
14710         * cs-parser.jay (accessor_body): If empty, set to null.
14711
14712         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14713         same code path here to resolve constants names that we did have in
14714         MemberAccess.DoResolve.  There is too much code duplicated here.
14715
14716 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14717
14718         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14719
14720         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14721         to MakeUnionSet.
14722
14723         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14724         tokens, numbers and strings.
14725
14726         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14727         parenthesis.
14728
14729         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14730         asyncronous parameters and the regular parameters.  
14731
14732         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14733         specify the target directory.
14734
14735         * expression.cs: (This.DoResolve): Simplify
14736         (As.Emit): Optimize, do not generate IsInst if the expression is
14737         always of the given type.
14738
14739         (Is.DoResolve): Bug fix, we were reporting both always/never for
14740         the is expression.
14741
14742         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14743         creating too many unnecessary arrays.
14744
14745 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14746
14747         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14748         fields instead of rolling our own initializer.   Takes care of all
14749         implicit conversions, and drops unnecessary static checks/argument.
14750
14751 2002-03-31  Dick Porter  <dick@ximian.com>
14752
14753         * driver.cs: use the GetDirectories() return values properly, and
14754         use "/" as path separator.
14755
14756 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14757
14758         * expression.cs (Unary): Optimize - - expr into expr.
14759         (Binary): Optimize a + (-b) into a -b.
14760
14761         * codegen.cs (CodeGen): Made all methods static.
14762
14763 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14764
14765         * rootcontext.cs: 
14766
14767         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14768         TypeBuilder property.
14769
14770         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14771         instead. 
14772
14773         * tree.cs: Removed the various RecordXXXX, and replaced with a
14774         single RecordDecl.  Removed all the accessor methods, and just
14775         left a single access point Type 
14776
14777         * enum.cs: Rename DefineEnum to DefineType.
14778
14779         * decl.cs: New abstract method `DefineType' used to unify the
14780         Defines for Enumerations, Interfaces, TypeContainers and
14781         Delegates.
14782
14783         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14784         LookupBaseClasses method that used to live in class.cs and
14785         interface.cs here, and renamed to FindType.
14786
14787         * delegate.cs: Implement DefineType.  Take advantage of the
14788         refactored pattern for locating the parent builder without taking
14789         the parent_builder argument (which we know does not work if we are
14790         nested, and triggering a toplevel definition).
14791
14792 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14793
14794         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14795         accessibility of a member has changed during override and report
14796         an error if so.
14797
14798         * class.cs (Method.Define, Property.Define): Only complain on
14799         overrides if the method is private, any other accessibility is
14800         fine (and since we just checked the permission is the same, we are
14801         good to go).
14802
14803         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14804         and elif are processed always.  The other pre-processing
14805         directives are only processed if we are "taking" the path
14806
14807 2002-03-29  Martin Baulig  <martin@gnome.org>
14808
14809         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14810         current location is not Null.
14811
14812         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14813         a separate method so we can profile it.
14814
14815         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14816         `span.Seconds' are just seconds, but no minutes or hours.
14817         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14818
14819 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14820
14821         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14822         Remove the gratuitous set of Final:
14823
14824                                 // If an interface implementation, then we can set Final.
14825                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14826                                     implementing.DeclaringType.IsInterface)
14827                                         flags |= MethodAttributes.Final;
14828
14829         I do not know what I was smoking when I used that.
14830
14831
14832         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14833         step into fixing the name resolution issues for delegates and
14834         unifying the toplevel name resolution.
14835
14836 2002-03-28  Martin Baulig  <martin@gnome.org>
14837
14838         * class.cs (Method.Emit): If we have a symbol writer, call its
14839         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14840         tell it about the current method.
14841
14842         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14843         writer that we're going to emit the first byte of IL code for a new
14844         statement (a new source line).
14845         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14846         EmitContext.Mark() before emitting any code.
14847
14848         * location.cs (SymbolDocument): Return null when we're Null.
14849
14850         * statement.cs (Statement): Moved the `Location loc' variable here.
14851         (Statement.EmitBoolExpression): If we have a symbol writer, call
14852         ec.Mark() before emitting any code to tell it that we're at the
14853         beginning of a new statement.
14854         (StatementExpression): Added `Location' argument to the constructor.
14855         (Block): Added public readonly variable `StartLocation' and public
14856         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14857         (Block): Added constructor which takes a start and end location.
14858         (Block.SetEndLocation): New method. This sets the end location.
14859         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14860         local variables we create.
14861         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14862         each statement and do also mark the begin and end of the block.
14863
14864         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14865         tell it the current lexer.Location, use Location.Null for the end of the
14866         block.
14867         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14868         current block, set its end location using SetEndLocation().
14869         (statement_expression): StatementExpression constructor now takes the
14870         lexer.Location as additional argument.
14871         (for_statement, declare_local_variables): Likewise.
14872         (declare_local_variables): When creating a new implicit block, use the
14873         new Block constructor and pass it the lexer.Location.
14874
14875 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14876
14877         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14878         members also on the parent interfaces recursively.
14879
14880 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14881
14882         * report.cs: Use new formats, since Gonzalo finished the missing
14883         bits. 
14884
14885         * expression.cs (Binary.ResolveOperator): added missing operator|
14886         operator& and operator^ for bool/bool.
14887
14888         * cs-parser.jay: CheckDef now takes a Location argument that is
14889         used to report errors more precisly (instead of reporting the end
14890         of a definition, we try to track something which is a lot closer
14891         to the source of the problem).
14892
14893         * cs-tokenizer.cs: Track global token use, so we can properly flag
14894         the use of #define/#undef after the first token has been seen.
14895
14896         Also, rename the reportXXXX to Error_DescriptiveName
14897
14898         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14899         TypeContainer, so that Enum and Interface can use this too.
14900
14901         * class.cs (TypeContainer.LookupInterfaceOrClass,
14902         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14903         `builder' argument.  Typically this was used to pass the parent
14904         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14905         the definition).  
14906
14907         The problem is that a nested class could trigger the definition of
14908         a toplevel class, and the builder would be obviously wrong in that
14909         case. 
14910
14911         So we drop this argument, and we compute dynamically the
14912         TypeBuilder/ModuleBuilder (the correct information was available
14913         to us anyways from DeclSpace.Parent)
14914
14915         * interface.cs (Interface.DefineInterface): Drop builder
14916         parameter cleanup like class.cs
14917
14918         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14919         like class.cs
14920
14921         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14922         values. 
14923
14924         (Try.Emit): Propagate the returns value from the statement.
14925
14926         (Return.Emit): Even if we are leavning 
14927
14928         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14929
14930         * modifiers.cs: Fix the computation of MethodAttributes flags.
14931
14932 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14933
14934         * driver.cs: allow compilation of files that start with '/'.
14935         Add a default case when checking the argument of --target.
14936
14937 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14938
14939         * interface.cs: Implement the same search algorithm for types in
14940         the interface code.
14941
14942         * delegate.cs: Do not allow multiple definition.
14943
14944         * Recovered ChangeLog that got accidentally amputated
14945
14946         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14947
14948         * rootcontext.cs: Load manually enum to allow core classes to
14949         contain enumerations.
14950
14951         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14952         Update to new static methods in TypeManager.
14953
14954         * typemanager.cs (GetMethod, GetConstructor): Use our
14955         implementation of FindMembers to find the members, since during
14956         corlib compilation, the types are TypeBuilders and GetMethod and
14957         GetConstructor do not work.
14958
14959         Make all methods in TypeManager static.
14960
14961         (InitCodeHelpers): Split the functionality from
14962         the InitCodeTypes function.
14963
14964         * driver.cs: Call InitCodeHelpers after we have populated the
14965         types. 
14966
14967         * cs-parser.jay (delegate_declaration): we did not used to compute
14968         the delegate name correctly for void delegates.
14969
14970 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14971
14972         * rootcontext.cs (RootContext): Init the interface_resolve_order
14973         and type_container_resolve_order always.
14974
14975         (ResolveCore, BootstrapCorlib_ResolveClass,
14976         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14977         compiler when compiling with --nostdlib
14978
14979         * class.cs (TypeContainer.DefineType): Check that our parent is
14980         not null.  This test is most important when we are bootstraping
14981         the core types.
14982
14983         * codegen.cs: Split out the symbol writing code.
14984
14985 2002-03-25  Martin Baulig  <martin@gnome.org>
14986
14987         * driver.cs (-g): Made -g an alias for --debug.
14988
14989 2002-03-24  Martin Baulig  <martin@gnome.org>
14990
14991         * codegen.cs (SymbolWriter): New public variable. Returns the
14992         current symbol writer.
14993         (CodeGen): Added `bool want_debugging_support' argument to the
14994          constructor. If true, tell the ModuleBuild that we want debugging
14995         support and ask it for the ISymbolWriter.
14996         (Save): If we have a symbol writer, call it's Close() method after
14997         saving the assembly.
14998
14999         * driver.c (--debug): New command line argument to create a
15000         debugger information file.
15001
15002         * location.cs (SymbolDocument): New public property. Returns an
15003         ISymbolDocumentWriter object for the current source file or null
15004         if we don't have a symbol writer.
15005
15006 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15007
15008         * driver.cs (LoadAssembly): Correctly return when all the paths
15009         have been tried and not before.
15010
15011         * statement.cs (Switch.Emit): return the actual coverage for this
15012         statement (returns/not-returns)
15013
15014         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15015         switch of the statement if we are the last switch section.  That
15016         kills two problems: try/catch problems (we used to emit an empty
15017         nop at the end) and switch statements where all branches would
15018         return. 
15019
15020 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15021
15022         * driver.cs: Add default assemblies (the equivalent to the
15023         Microsoft CSC.RSP file)
15024
15025         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15026         also update tokens_seen and set it to false.
15027
15028         * driver.cs: Implement --recurse for Mike.
15029
15030         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15031         correctly splitting out the paths.
15032
15033 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15034
15035         * interface.cs (Interface.PopulateProperty): Instead of using
15036         `parent' as the declaration space for the set parameters, use
15037         `this' 
15038
15039         * support.cs (InternalParameters): InternalParameters constructor
15040         takes a DeclSpace instead of a TypeContainer.
15041
15042         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15043         types are being initialized, load the address of it before calling
15044         the function.  
15045
15046         (New): Provide a mechanism to disable the generation of local
15047         value type temporaries when the caller will be providing us with
15048         an address to store it.
15049
15050         (ArrayCreation.EmitDynamicInitializers): Use it.
15051
15052 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15053
15054         * expression.cs (Invocation.EmitArguments): Only probe for array
15055         property if there is more than one argument.  Sorry about that.
15056
15057         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15058         empty param arrays.
15059
15060         * class.cs (Method.LabelParameters): Fix incorrect code path that
15061         prevented the `ParamArrayAttribute' from being applied to the
15062         params attribute.
15063
15064 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15065
15066         * support.cs (ReflectionParameters): Correctly compute whether the
15067         last argument is a params array.  Fixes the problem with
15068         string.Split ('a')
15069
15070         * typemanager.cs: Make the assemblies array always be non-null
15071         (empty, but non-null)
15072
15073         * tree.cs (RecordDecl): New function that abstracts the recording
15074         of names.  This reports error 101, and provides a pointer to the
15075         previous declaration.  Fixes a crash in the compiler.
15076
15077         * cs-parser.jay (constructor_declaration): Update to new grammar,
15078         and provide a constructor_body that can be empty.
15079
15080 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15081
15082         * driver.cs: Add support for --resources.
15083
15084         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15085         Make all types for the various array helper methods be integer.
15086
15087         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15088         CheckState to ConvCast.
15089
15090         (ConvCast): Now it takes a `checked' state argument, to avoid
15091         depending on the emit context for the conversion, and just using
15092         the resolve time setting.
15093
15094         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15095         instead of Invocation.EmitArguments.  We do not emit the original
15096         arguments, instead we emit those which have been converted to
15097         unsigned int expressions.
15098
15099         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15100
15101         * codegen.cs: ditto.
15102
15103         * expression.cs (LocalVariableReference): Drop the use of the
15104         Store function that depended on the variable index.
15105
15106         * statement.cs (VariableInfo): Drop the `Idx' property from this
15107         class, as this is not taking into account the indexes for
15108         temporaries tat we generate during the execution, getting the
15109         indexes wrong.
15110
15111         * class.cs: First emit class initializers, then call the parent
15112         constructor. 
15113
15114         * expression.cs (Binary): Fix opcode emision.
15115         (UnaryMutator.EmitCode): Support checked code generation
15116
15117         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15118         matches for events for both the Static and Instance scans,
15119         pointing to the same element.   Fix that.
15120
15121 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15122
15123         * rootcontext.cs (ResolveTree): Always set the
15124         interface_resolve_order, because nested interfaces will be calling
15125         into us.
15126
15127         * class.cs (GetInterfaceOrClass): Track the same resolution
15128         process used by TypeManager.LookupType.  This fixes the nested
15129         type lookups in class declarations (separate path from
15130         LookupType). 
15131
15132         (TypeContainer.DefineType): Also define nested interfaces.
15133         (TypeContainer.RegisterOrder): New public function used to
15134         register the order in which child interfaces need to be closed.
15135
15136         Nested interfaces need to be closed after their parents have been
15137         created. 
15138
15139         * interface.cs (InterfaceAttr): Put all the logic for computing
15140         the interface attribute here. 
15141
15142         (DefineInterface): Register our interface order with the
15143         RootContext or with the TypeContainer depending on the case.
15144
15145 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15146
15147         * cs-parser.jay: rework foreach statement to work with the new
15148         changes to the policy on SimpleNames.
15149
15150         * report.cs: support Stacktrace on warnings as well.
15151
15152         * makefile: drop --unsafe and /unsafe from the compile.
15153
15154 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15155
15156         * ecore.cs (StandardConversionExists): Modify to take an Expression
15157         as the first parameter. Ensure we do null -> reference type conversion
15158         checking.
15159
15160         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15161         temporary Expression objects.
15162
15163 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15164
15165         * interface.cs: workaround bug in method overloading resolution
15166         (there is already a bugzilla bug for it).
15167
15168 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15169
15170         We could also solve this problem by having a separate path for
15171         performing type lookups, instead of DoResolve, we could have a
15172         ResolveType entry point, and only participating pieces of the
15173         production (simplename, deref, array) would implement this. 
15174
15175         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15176         signal SimpleName to only resolve type names and not attempt to
15177         resolve anything else.
15178
15179         * expression.cs (Cast): Set the flag.
15180
15181         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15182
15183         * class.cs: Only report 108 if there is no `new' modifier.
15184
15185         * cs-parser.jay: rework foreach statement to work with the new
15186         changes to the policy on SimpleNames.
15187
15188         * report.cs: support Stacktrace on warnings as well.
15189
15190         * makefile: drop --unsafe and /unsafe from the compile.
15191
15192 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15193
15194         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15195         lookups here, instead of doing that at parse time.  This means
15196         that our grammar will not introduce `LocalVariableReferences' as
15197         expressions at this point.  That solves the problem of code like
15198         this:
15199
15200         class X {
15201            static void Main ()
15202            { int X = 1;
15203             { X x = null }}}
15204
15205         This is only half the fix.  The full fix requires parameters to
15206         also be handled in this way.
15207
15208         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15209         makes the use more obvious of the DeclSpace.  The
15210         ec.TypeContainer.TypeBuilder is now only used to pull the
15211         TypeBuilder for it.
15212
15213         My theory is that I can get rid of the TypeBuilder completely from
15214         the EmitContext, and have typecasts where it is used (from
15215         DeclSpace to where it matters).  
15216
15217         The only pending problem is that the code that implements Aliases
15218         is on TypeContainer, and probably should go in DeclSpace.
15219
15220         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15221         lookups here, instead of doing that at parse time.  This means
15222         that our grammar will not introduce `LocalVariableReferences' as
15223         expressions at this point.  That solves the problem of code like
15224         this:
15225
15226         class X {
15227            static void Main ()
15228            { int X = 1;
15229             { X x = null }}}
15230
15231         This is only half the fix.  The full fix requires parameters to
15232         also be handled in this way.
15233
15234         * class.cs (Property.DefineMethod): When implementing an interface
15235         method, set newslot, when implementing an abstract method, do not
15236         set the flag (before we tried never setting it, or always setting
15237         it, which is the difference).
15238         (Indexer.DefineMethod): same.
15239         (Method.DefineMethod): same.
15240
15241         * ecore.cs: Only set the status used flag if we get back a Field.
15242
15243         * attribute.cs: Temporary hack, so Paolo can keep working.
15244
15245 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15246
15247         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15248         the unmanaged type in the case we have a MarshalAs attribute.
15249
15250         (Resolve): Handle the case when we are parsing the special MarshalAs
15251         attribute [we need to store the unmanaged type to use later]
15252
15253         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15254         MarshalAs Attribute.
15255
15256         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15257         on parameters and accordingly set the marshalling info.
15258
15259 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15260
15261         * class.cs: Optimizing slightly by removing redundant code after
15262         we switched to the `NoTypes' return value.
15263         (Property.DefineMethod): use NoTypes here too.
15264
15265         This fixes the bug I introduced in my last batch of changes.
15266
15267 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15268
15269         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15270
15271         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15272         Enums since those are types too. 
15273
15274         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15275
15276         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15277         thanks to a call during the lookup process.
15278
15279 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15280
15281         * statement.cs (Foreach): Lots of work to accomodate a particular
15282         kind of foreach statement that I had not kept in mind.  It is
15283         possible to have foreachs on classes that provide a GetEnumerator
15284         method that return objects that implement the "pattern" for using
15285         a foreach, there is no need to support GetEnumerator
15286         specifically. 
15287
15288         This is needed to compile nant.
15289
15290         * decl.cs: Only report 114 if the member is not `Finalize' and if
15291         the warning level is at least 2.
15292
15293         * class.cs: Moved the compare function from Method to
15294         MethodSignature. 
15295
15296         (MethodSignature.InheritableMemberSignatureCompare): Add new
15297         filter function that is used to extract inheritable methods from a
15298         class. 
15299
15300         (Method.Define): Use the new `inheritable_method_signature_filter'
15301         delegate
15302
15303         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15304         command. 
15305
15306 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15307
15308         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15309
15310         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15311
15312         * expression.cs: Pass location information to
15313         ConvertImplicitStandard. 
15314
15315         * class.cs: Added debugging code to track return values from
15316         interfaces. 
15317
15318 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15319
15320         * expression.cs (Is.DoResolve): If either side of the `is' is an
15321         interface, do not flag the warning.
15322
15323         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15324         for interfaces
15325
15326         * report.cs: Allow for --fatal to be used with --probe.
15327
15328         * typemanager.cs (NoTypes): Move the definition for the empty Type
15329         array here. 
15330
15331         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15332         properties. 
15333         (TypeContainer.DefineProxy): New function used to proxy to parent
15334         implementations when implementing interfaces.
15335         (TypeContainer.ParentImplements): used to lookup if our parent
15336         implements a public function that is required by an interface.
15337         (TypeContainer.VerifyPendingMethods): Hook this up.
15338
15339         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15340         `modules' and `assemblies' arraylists into arrays.  We only grow
15341         these are the very early start up of the program, so this improves
15342         the speedof LookupType (nicely measured).
15343
15344         * expression.cs (MakeByteBlob): Replaced unsafe code with
15345         BitConverter, as suggested by Paolo.
15346
15347         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15348         folding of string concatenation, but if either side is a string,
15349         and the other is not, then return null, and let the runtime use
15350         the concatenation on the string plus the object (using
15351         `Object.ToString'). 
15352
15353 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15354
15355         Constant Folding has been implemented now.
15356
15357         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15358         the error instead on types that are not supported in one's
15359         complement. 
15360
15361         * constant.cs (Constant and all children): New set of functions to
15362         perform implict and explicit conversions.
15363
15364         * ecore.cs (EnumConstant): Implement the new functions to perform
15365         conversion by proxying to the child expression.
15366
15367         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15368         own separate setting that can not be turned off from the command
15369         line using --unchecked or --checked and is only controlled using
15370         the checked/unchecked statements and expressions.  This setting is
15371         used by the constant folder to flag errors.
15372
15373         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15374         ConstantCheckState as well.   
15375
15376         During Resolve, they also have to flag the state, because the
15377         constant folder runs completely in the Resolve phase.
15378
15379         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15380         well.
15381
15382 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15383
15384         * cfold.cs: New file, this file contains the constant folder.
15385
15386         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15387         argument to track whether we are using the resulting address to
15388         load or store a value and provide better error messages. 
15389
15390         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15391         new AddressOf arguments.
15392
15393         * statement.cs (Foreach.EmitCollectionForeach): Update
15394
15395         * expression.cs (Argument.Emit): Call AddressOf with proper
15396         arguments to track usage.
15397
15398         (New.DoEmit): Call AddressOf with new arguments.
15399
15400         (Unary.Emit): Adjust AddressOf call.
15401
15402 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15403
15404         * cs-parser.jay (member_access): Change the case for pre-defined types
15405         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15406         this suggestion.
15407
15408         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15409         a method body.
15410
15411         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15412         essentially like methods and apply attributes like MethodImplOptions to them too.
15413
15414         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15415         not being null.
15416
15417         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15418         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15419         is the DeclSpace.
15420
15421         * Update code everywhere accordingly.
15422
15423         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15424
15425         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15426
15427 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15428
15429         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15430         try performing lookups against those instead of jumping straight into using
15431         the 'using' clauses.
15432
15433         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15434
15435         (LookupType): Perform lookups in implicit parents too.
15436
15437         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15438         sequence as RootContext.LookupType. 
15439
15440         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15441         the various cases of namespace lookups into this method.
15442
15443 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15444
15445         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15446         in positional arguments)
15447
15448         * class.cs (Operator): Update the AllowedModifiers to contain
15449         extern. 
15450
15451         * cs-parser.jay: Update operator declaration to allow for the
15452         operator body to be empty.
15453
15454         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15455         values. 
15456
15457 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15458
15459         * class.cs (Method.Emit): Label parameters.
15460
15461         * driver.cs: Return 1 or 0 as the program exit code.
15462
15463 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15464
15465         * expression.cs: Special case the `null' object when trying to
15466         auto-compute the type, as anything can be explicitly converted to
15467         that. 
15468
15469         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15470         spotting this Paolo.
15471
15472         (Expression.ImplicitNumericConversion): Perform comparissions of
15473         the type using the underlying type in the case of an enumeration
15474         rather than using the enumeration type for the compare.
15475
15476         Cope with the underlying == type case, which is not possible to
15477         catch before. 
15478
15479         (Expression.ConvertNumericExplicit): Perform comparissions of
15480         the type using the underlying type in the case of an enumeration
15481         rather than using the enumeration type for the compare.
15482
15483         * driver.cs: If the user does not supply an extension, assume .exe
15484
15485         * cs-parser.jay (if_statement): Rewrote so that we can track the
15486         location for the if statement.
15487
15488         * expression.cs (Binary.ConstantFold): Only concat strings when
15489         the operation is "+", not everything ;-)
15490
15491         * statement.cs (Statement.EmitBoolExpression): Take a location
15492         argument. 
15493         (If, While, Do): Track location.
15494
15495         * expression.cs (Binary.ResolveOperator): In the object + string
15496         case, I was missing a call to ConvertImplicit
15497
15498 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15499
15500         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15501         Location arguments. Ensure we use RootContext.LookupType to do our work
15502         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15503
15504         * interface.cs (PopulateMethod): Handle the type of the parameter being
15505         null gracefully.
15506
15507         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15508         have a params method with no fixed arguments and a call is made with no
15509         arguments.
15510
15511 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15512
15513         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15514         the verbatim-string-literal
15515
15516         * support.cs (InternalParameters.ParameterModifier): handle null
15517         fixed parameters.
15518         (InternalParameters.ParameterType): ditto.
15519
15520         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15521         duplicating the name of the variable parameter.
15522         (GetParameterByName): Fix bug where we were not looking up array
15523         paramters if they were the only present (thanks Paolo!).
15524         (GetParameterInfo): We only have an empty set of types if both
15525         fixed and array are set to null.
15526         (GetParameterInfo-idx): Handle FixedParameter == null
15527
15528         * cs-parser.jay: Handle the case where there is no catch
15529         statements (missing null test).
15530
15531 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15532
15533         * driver.cs (MainDriver): Be conservative on our command line
15534         handling.
15535
15536         Catch DirectoryNotFoundException when calling GetFiles.
15537
15538         (SplitPathAndPattern): Used to split the input specification into
15539         a path and a pattern that we can feed to Directory.GetFiles.
15540
15541 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15542
15543         * statement.cs (Fixed): Implement the last case of the Fixed
15544         statement (string handling).
15545
15546         * expression.cs (StringPtr): New class used to return a char * to
15547         a string;  Used by the Fixed statement.
15548
15549         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15550
15551         * expression.cs (Binary.ResolveOperator): Remove redundant
15552         MemberLookup pn parent type.
15553         Optimize union call, we do not need a union if the types are the same.
15554         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15555         type.
15556
15557         Specialize the use of MemberLookup everywhere, instead of using
15558         the default settings. 
15559
15560         (StackAlloc): Implement stackalloc keyword.
15561
15562         * cs-parser.jay: Add rule to parse stackalloc.
15563
15564         * driver.cs: Handle /h, /help, /?
15565
15566         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15567         before we supported unsafe code.
15568
15569         * makefile: add --unsafe to the self compilation of mcs.
15570
15571 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15572
15573         * expression.cs (PointerArithmetic): New class that is used to
15574         perform pointer arithmetic.
15575         (Binary.Resolve): Handle pointer arithmetic
15576         Handle pointer comparission.
15577         (ArrayPtr): Utility expression class that is used to take the
15578         address of an array.
15579
15580         (ElementAccess): Implement array access for pointers
15581
15582         * statement.cs (Fixed): Implement fixed statement for arrays, we
15583         are missing one more case before we are done.
15584
15585         * expression.cs (Indirection): Implement EmitAssign and set the
15586         ExprClass to Variable.  This allows pointer dereferences to be
15587         treated as variables, and to have values assigned to them.
15588
15589         * ecore.cs (Expression.StoreFromPtr): New utility function to
15590         store values dereferencing.
15591
15592 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15593
15594         * expression.cs (Binary.ResolveOperator): Ensure that we are
15595         not trying to operate on a void type - this fixes the reported
15596         bug.
15597
15598         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15599         the parent implementation is sealed.
15600
15601         * ../errors/cs0239.cs : Add.
15602
15603         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15604
15605         * typemanager.cs (unverifiable_code_type): Corresponds to 
15606         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15607         which have unsafe code in them.
15608
15609         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15610         unsafe context.
15611
15612 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15613
15614         * cs-tokenizer.cs: Add support for @"litreal strings"
15615
15616         Make tokenizer accept pre-processor directives
15617         on any column (remove the old C-like limitation). 
15618
15619         * rootcontext.cs (EmitCode): Emit any global attributes.
15620         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15621
15622         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15623
15624         * cs-parser.jay: Add support for global attributes.  
15625
15626 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15627
15628         * expression.cs (Indirection): New helper class.  Unary will
15629         create Indirection classes to be able to implement the
15630         IMemoryLocation interface on it.
15631
15632 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15633
15634         * cs-parser.jay (fixed_statement): reference the right statement.
15635
15636         * statement.cs (Fixed.Emit): Finish implementing the fixed
15637         statement for the &x case.
15638
15639 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15640
15641         * class.cs (Property.Define, Method.Define): Remove newslot when
15642         `implementing'.  
15643
15644         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15645         wrong.  NewSlot should only be used if the `new' keyword is present.
15646
15647         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15648         locating our system dir.  Sorry about this.
15649
15650 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15651
15652         * driver.cs (GetSystemDir): Compute correctly the location of our
15653         system assemblies.  I was using the compiler directory instead of
15654         the library directory.
15655
15656 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15657
15658         * expression.cs (BetterFunction): Put back in what Miguel commented out
15659         since it is the correct fix. The problem is elsewhere ;-)
15660
15661         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15662         parameters of the parms method are themselves compatible or not !
15663
15664         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15665         to check that a class implements an interface before saying that an implicit
15666         conversion was allowed. Use ImplementsInterface to do the checking.
15667
15668 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15669
15670         * class.cs (Method.Define): Track whether we are an explicit
15671         implementation or not.  And only call DefineMethodOverride if we
15672         are an explicit implementation.
15673
15674         (Property.DefineMethod): Ditto.
15675
15676 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15677
15678         * expression.cs (BetterFunction): Catch hideous bug which was
15679          preventing us from detecting ambiguous calls due to implicit casts i.e
15680         cs0121.
15681
15682 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15683
15684         * support.cs (Pair): Remove un-needed method.  I figured why I was
15685         getting the error in cs-parser.jay, the variable in a foreach loop
15686         is readonly, and the compiler does not really treat this as a variable.
15687
15688         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15689         instead of EQUALS in grammar.  
15690
15691         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15692
15693         * expression.cs (Unary.DoResolve): Check whether the argument is
15694         managed or not.
15695
15696 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15697
15698         * support.cs: Api for Pair to set a value.  Despite the fact that
15699         the variables are public the MS C# compiler refuses to compile
15700         code that accesses the field if the variable is part of a foreach
15701         statement. 
15702
15703         * statement.cs (Fixed): Begin implementation of the fixed
15704         statement.
15705
15706         (Block.AddVariable): Return the VariableInfo on success and null
15707         on failure instead of true/false. 
15708
15709         * cs-parser.jay (foreach): Catch errors on variables already
15710         defined (we were ignoring this value before) and properly unwind
15711         the block hierarchy
15712
15713         (fixed_statement): grammar for the fixed statement.
15714
15715 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15716
15717         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15718         pointer types to be incretemented.
15719
15720         (SizeOf): Implement.
15721
15722         * cs-parser.jay (pointer_member_access): Implement
15723         expr->IDENTIFIER production.
15724
15725         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15726         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15727         on safe contexts.
15728
15729         (Unary): Implement indirection.
15730
15731         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15732         use in non-unsafe context).
15733
15734         (SimpleName.DoResolve): Check for pointers in field access on safe
15735         contexts. 
15736
15737         (Expression.LoadFromPtr): Factor the load-indirect code in this
15738         function.  This was duplicated in UnboxCast and ParameterReference
15739
15740 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15741
15742         * expression.cs (ComposedCast): report an error if a pointer cast
15743         is used in a safe region.
15744
15745         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15746         pointer type casts in unsafe context.
15747
15748         * codegen.cs (EmitContext): Set up IsUnsafe.
15749
15750         * cs-parser.jay (non_expression_type): Add productions for pointer
15751         casts. 
15752
15753         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15754         code.  We should not use force into static mode if the method is
15755         not virtual.  Fixes bug in MIS
15756
15757         * statement.cs (Do.Emit, While.Emit, For.Emit,
15758         Statement.EmitBoolExpression): Add support to Do and While to
15759         propagate infinite loop as `I do return' semantics.
15760
15761         Improve the For case to also test for boolean constants.
15762
15763         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15764         to the list of attributes we can add.
15765
15766         Remove `EmitContext' argument.
15767
15768         * class.cs (Method.Define): Apply parameter attributes.
15769         (Constructor.Define): Apply parameter attributes.
15770         (MethodCore.LabelParameters): Move here the core of labeling
15771         parameters. 
15772
15773         * support.cs (ReflectionParameters.ParameterModifier,
15774         InternalParameters.ParameterModifier): Use IsByRef on the type and
15775         only return the OUT bit for these parameters instead of in/out/ref
15776         flags.
15777
15778         This is because I miss-understood things.  The ParameterInfo.IsIn
15779         and IsOut represent whether the parameter has the [In] and [Out]
15780         attributes set.  
15781
15782 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15783
15784         * ecore.cs (FieldExpr.Emit): Release temporaries.
15785
15786         * assign.cs (LocalTemporary.Release): new function.
15787
15788         * codegen.cs (EmitContext.GetTemporaryStorage,
15789         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15790         temporary storage.  Now we can "put back" localbuilders when we
15791         are done with them
15792
15793 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15794
15795         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15796         need to make a copy of the variable to generate verifiable code.
15797
15798 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15799
15800         * driver.cs: Compute dynamically the system directory.
15801
15802         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15803         Slower, but more generally useful.  Used by the abstract
15804         registering implementation. 
15805
15806         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15807         the rules for the special rule on Type/instances.  First check if
15808         we have the same name, and if so, try that special static path
15809         rather than the instance path.
15810
15811 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15812
15813         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15814         for, while and if.
15815
15816         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15817         Enum, ValueType, Delegate or Array for non-corlib compiles.
15818
15819         * cs-tokenizer.cs: Catch long identifiers (645)
15820
15821         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15822         piece of code.
15823
15824         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15825         fix, we were returning too early, so we were not registering
15826         pending methods from abstract classes.
15827
15828         Do not register pending methods if the class is abstract.
15829
15830         * expression.cs (Conditional.DoResolve): Report circular implicit
15831         conversions when we neecd to compute it for conditional
15832         expressions. 
15833
15834         (Is.DoResolve): If the expression is always of the provided type,
15835         flag warning 183.  If the expression can not ever be of the
15836         provided type flag warning 184.
15837
15838         * class.cs: Catch 169 as well.
15839
15840         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15841         read. 
15842
15843 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15844
15845         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15846
15847 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15848
15849         * interface.cs: (PopulateMethod): Check for pointers being defined
15850         only if the unsafe context is active.
15851         (PopulateProperty): ditto.
15852         (PopulateIndexer): ditto.
15853
15854         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15855         specified.  If pointers are present, make sure that they are
15856         present in an unsafe context.
15857         (Constructor, Constructor.Define): ditto.
15858         (Field, Field.Define): ditto.
15859         (Property, Property.Define): ditto.
15860         (Event, Event.Define): ditto.
15861
15862         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15863         hashtable if there are classes or structs defined.
15864
15865         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15866         code, as the constant resolution moved.
15867
15868         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15869         the metadata, so we can flag error 133. 
15870
15871         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15872         pointer is being declared in an unsafe context.
15873
15874 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15875
15876         * modifiers.cs (Modifiers.Check): Require a Location argument.
15877         Report error 227 for Unsafe use.
15878
15879         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15880
15881         * statement.cs (For.Emit): If the test is null, then report that
15882         we do `return', as we wont reach anything afterwards.
15883
15884         (Switch.SwitchGoverningType): Track the expression that matched
15885         the conversion.
15886
15887         * driver.cs: Allow negative numbers as an error code to flag.
15888
15889         * cs-parser.jay: Handle 1551.
15890
15891         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15892
15893 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15894
15895         * cs-parser.jay: Report 1518 (type declaration can only contain
15896         class, struct, interface, enum or delegate)
15897
15898         (switch_label): Report 1523 (keywords `case' or `default' must
15899         preced code)
15900
15901         (opt_switch_sections): Report 1522 (empty switch)
15902
15903         * driver.cs: Report 1515 (response file specified multiple times)
15904         Report 1516 (Source file specified multiple times).
15905
15906         * expression.cs (Argument.Resolve): Signal 1510
15907
15908         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15909         access not allowed in static code)
15910
15911 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15912
15913         * typemanager.cs (IsPointerType): Utility method which we are going
15914         to need a lot.
15915
15916         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15917         the object type, so we take care of that.
15918
15919         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15920
15921         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15922         added to non-params parameters :-)
15923
15924         * typemanager.cs (CSharpName): Include 'void' type too. 
15925
15926         (void_ptr_type): Include in the set of core types.
15927
15928         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15929         duplicating code.
15930
15931         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15932         an unsafe context.
15933
15934         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15935         completely forgotten about it.
15936
15937 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15938
15939         * cs-parser.jay (pointer_type): Add. This begins our implementation
15940         of parsing rules for unsafe code.
15941
15942         (unsafe_statement): Implement.
15943
15944         (embedded_statement): Modify to include the above.
15945
15946         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15947
15948         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15949         if the current context is an unsafe one.
15950
15951         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15952         are handled differently, we need separate rules for them.
15953
15954         (local_variable_declaration): Update to use local_variable_pointer_type
15955         to allow variable declarations of unmanaged pointer types.
15956
15957         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15958         in unsafe contexts.
15959
15960         * ../errors/cs0214.cs : Add.
15961
15962 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15963
15964         * makefile: remove 'response' file when cleaning.
15965
15966 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * cs-parser.jay: Report 1524.
15969
15970 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15971
15972         * typemanager.cs (RegisterMethod): drop checking if we have
15973         registered this from here
15974
15975 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15976
15977         * class.cs (Method.EmitDestructor): Implement calling our base
15978         destructor. 
15979
15980         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15981         value of InFinally.
15982
15983         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15984         this routine and will wrap the call in a try/catch block.  Deal
15985         with the case.
15986
15987 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15988
15989         * ecore.cs (Expression.MemberLookup): instead of taking a
15990         parameter `same_type' that was used to tell whether we could
15991         access private members we compute our containing type from the
15992         EmitContext.
15993
15994         (FieldExpr): Added partial support for volatile fields.  This does
15995         not work for volatile fields exposed from assemblies, as I can not
15996         figure out how to extract the modreq from it.
15997
15998         Updated all the source files to use this.
15999
16000         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16001         because it is referenced by MemberLookup very often. 
16002
16003 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16004
16005         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16006         TypeBuilder.GetCustomAttributes to retrieve what we need.
16007
16008         Get rid of redundant default_member_attr_type as this is the same as
16009         default_member_type which already exists.
16010
16011         * interface.cs, attribute.cs : Update accordingly.
16012
16013 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16014
16015         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16016         work for TYpeBuilders though.  Ravi, can you please fix this?
16017
16018         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16019
16020         * expression.cs (Argument.Emit): Handle the case of ref objects
16021         being passed to ref functions;  
16022
16023         (ParameterReference.EmitLoad): Loads the content of the pointer
16024         without dereferencing.
16025
16026 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16027
16028         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16029
16030 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16031
16032         * class.cs (Indexer.DefineMethod): Incorporate the interface
16033         type in the name of the method if we are doing explicit interface
16034         implementation.
16035
16036         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16037
16038         (BetterConversion): Fix extremely trivial bug where we were referring to
16039         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16040         again !
16041
16042         * ../errors/bug16.cs : Add although we have fixed it.
16043
16044 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16045
16046         * expression.cs (BaseIndexer): Begin implementation.
16047
16048         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16049
16050         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16051         production directly to remove a shift/reduce, and implement
16052         explicit interface implementation.
16053
16054         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16055         after a floating point suffix.
16056
16057         * expression.cs (DoNumericPromotions): Improved the conversion for
16058         uint/uint.  If we have a constant, we avoid doing a typecast to a
16059         larger type.
16060
16061         * class.cs (Indexer): Implement explicit interface implementation
16062         for indexers.
16063
16064 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16065
16066         * class.cs: make the default instance constructor public and hidebysig.
16067
16068 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16069
16070         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16071         so we can call it from elsewhere.
16072
16073         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16074         we emit it internally if the class has a defined indexer; otherwise the user
16075         emits it by decorating the class definition with the DefaultMemberAttribute.
16076
16077         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16078         attribute is not used on a type which defines an indexer.
16079
16080         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16081         character when we skip whitespace.
16082
16083         * ../errors/cs0646.cs : Add.
16084
16085 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16086
16087         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16088         again. 
16089
16090         * makefile: Add practical target `mcs3.exe' which builds the third
16091         generation compiler. 
16092
16093         * expression.cs (New): Fix structures constructor calling.
16094
16095         * class.cs (Property, Method, Indexer): Emit Final flag on the
16096         method if we are an interface implementation and we are not
16097         abstract. 
16098
16099         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16100         whether this property is referencing a `base' method.
16101
16102         * expression.cs (Invocation.EmitCall): take an extra argument:
16103         is_base, this is used to determine whether the `call' or
16104         `callvirt' opcode should be used.
16105
16106
16107         * delegate.cs: update EmitCall.
16108
16109         * class.cs (Method.Define): Set NewSlot for the cases where we are
16110         not implementing an interface method.
16111
16112         (Property.Define): ditto.
16113
16114 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16115
16116         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16117         'r'.  Allows mcs to parse itself fully.
16118
16119 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16120
16121         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16122         of the number of initializers that require the InitializeArray method.
16123
16124         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16125         update the above field where necessary.
16126
16127         (MakeByteBlob): Update accordingly.
16128
16129         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16130         greater than 2.
16131
16132         (EmitDynamicInitializers): Update in accordance with the new optimization.
16133
16134         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16135         same OpCode applies.
16136
16137         * cs-parser.jay : Fix some glaring errors I introduced.
16138
16139 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16140
16141         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16142         so that we can check for name clashes there too.
16143
16144         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16145         for interface indexers.
16146
16147         * interfaces.cs (Define): Emit the default member attribute.
16148
16149         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16150         variable was being referred to while setting the value ;-)
16151
16152 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16153
16154         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16155         byte-by-byte information when we know the data is zero.
16156
16157         Make the block always a multiple of 4, because
16158         DefineInitializedData has a bug.
16159
16160         * assign.cs: Fix, we should assign from the temporary, not from
16161         the source. 
16162
16163         * expression.cs (MakeByteBlob): Fix my incorrect code.
16164
16165 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16166
16167         * typemanager.cs (EnumToUnderlying): This function is used to get
16168         the underlying type from an enumeration, because it does not
16169         always work. 
16170
16171         * constant.cs: Use the I4_S form for values between -128 and 127.
16172
16173         * statement.cs (Block.LookupLabel): Looks up a label.
16174         (Block): Drop support for labeled blocks.
16175
16176         (LabeledStatement): New kind of statement that represents a label
16177         only.
16178
16179         (Goto): Finally implement this bad boy.
16180
16181         * cs-parser.jay: Update to reflect new mechanism to implement
16182         labels.
16183
16184 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16185
16186         * codegen.cs (EmitContext.This): a codegen property that keeps the
16187         a single instance of this instead of creating many different this
16188         instances. 
16189
16190         * delegate.cs (Delegate.DoResolve): Update to use the property;
16191
16192         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16193
16194         * expression.cs (BaseAccess.DoResolve): Ditto.
16195
16196 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16197
16198         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16199         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16200
16201         (InitCoreTypes): Update accordingly.
16202
16203         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16204         so we can quickly store the state.
16205
16206         (ApplyAttributes): Set the correct implementation flags
16207         for InternalCall methods.
16208
16209 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16210
16211         * expression.cs (EmitCall): if a method is not virtual, then do
16212         not use callvirt on it.
16213
16214         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16215         user defined stuff) requires the use of stobj, which takes an
16216         address on the stack instead of an array and an index.  So emit
16217         the Ldelema operation for it.
16218
16219         (EmitStoreOpcode): Use stobj for valuetypes.
16220
16221         (UnaryMutator.EmitCode): Use the right 1 value depending on
16222         whether we are dealing with int64/uint64, float or doubles.
16223
16224         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16225         constructors that I implemented last night.
16226
16227         (Constructor.IsDefault): Fix to work properly for static
16228         constructors.
16229
16230         * cs-parser.jay (CheckDef): report method signature errors.
16231         Update error number 103 to be 132.
16232
16233         * decl.cs: New AdditionResult enumeration value: MethodExists.
16234         Although we do this check for methods later on in the semantic
16235         analysis, catching repeated default constructors is so easy that
16236         we catch these here. 
16237
16238         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16239         promotions code.
16240
16241         (ParameterReference.EmitAssign, Emit): handle
16242         bools as bytes.
16243
16244         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16245         (ArrayAccess.EmitStoreOpcode): ditto.
16246
16247         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16248
16249         * expression.cs (MakeByteBlob): Complete all the missing types
16250         (uint, short, ushort, byte, sbyte)
16251
16252         * class.cs: Only init instance field initializers on instance
16253         constructors. 
16254
16255         Rename `constructors' to instance_constructors. 
16256
16257         (TypeContainer.AddConstructor): Only add constructors to the list
16258         if it is not static.
16259
16260         Make sure that we handle default_static_constructor independently
16261         everywhere where we handle instance_constructors
16262
16263 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16264
16265         * class.cs: Do not lookup or create a base initializer for a
16266         static constructor.
16267
16268         (ConstructorInitializer.Resolve): use the proper type to lookup
16269         for constructors.
16270
16271         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16272
16273         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16274         in DeclSpace. 
16275
16276         * decl.cs: CloseType is now an virtual method, the default
16277         implementation just closes this type.
16278
16279 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16280
16281         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16282         to PreserveSig by default. Also emit HideBySig on such methods.
16283
16284         Basically, set the defaults to standard values.
16285
16286         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16287         argument, if candidate is better, it can't be worse than the best !
16288
16289         (Invocation): Re-write bits to differentiate between methods being
16290         applicable in their expanded form and their normal form - for params
16291         methods of course.
16292
16293         Get rid of use_standard everywhere as only standard conversions are allowed
16294         in overload resolution. 
16295
16296         More spec conformance.
16297
16298 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16299
16300         * driver.cs: Add --timestamp, to see where the compiler spends
16301         most of its time.
16302
16303         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16304         `this' in static code.
16305
16306         (SimpleName.DoResolve): Implement in terms of a helper function
16307         that allows static-references to be passed upstream to
16308         MemberAccess.
16309
16310         (Expression.ResolveWithSimpleName): Resolve specially simple
16311         names when called by MemberAccess to implement the special
16312         semantics. 
16313
16314         (Expression.ImplicitReferenceConversion): Handle conversions from
16315         Null to reference types before others, as Null's type is
16316         System.Object. 
16317
16318         * expression.cs (Invocation.EmitCall): Handle the special case of
16319         calling methods declared on a reference type from a ValueType
16320         (Base classes System.Object and System.Enum)
16321
16322         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16323         the left hand side is a TypeExpr, not on every enumeration. 
16324
16325         (Binary.Resolve): If types are reference types, then do a cast to
16326         object on operators != and == of both arguments.
16327
16328         * typemanager.cs (FindMembers): Extract instance and static
16329         members if requested.
16330
16331         * interface.cs (PopulateProperty): Use void_type instead of null
16332         as the return type for the setter method.
16333
16334         (PopulateIndexer): ditto.
16335
16336 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16337
16338         * support.cs (ReflectionParameters): Fix minor bug where we
16339         were examining the wrong parameter for the ParamArray attribute.
16340
16341         Cope with requests for the type of the parameter at position
16342         greater than the params parameter's. We now return the element
16343         type of the params array as that makes more sense.
16344
16345         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16346         accordingly as we no longer have to extract the element type
16347         ourselves.
16348
16349         (Invocation.OverloadResolve): Update.
16350
16351 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16352
16353         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16354         against IEnumerator, test whether the return value is a descendant
16355         of the IEnumerator interface.
16356
16357         * class.cs (Indexer.Define): Use an auxiliary method to implement
16358         the other bits of the method definition.  Begin support for
16359         explicit interface implementation.
16360
16361         (Property.DefineMethod): Use TypeManager.void_type instead of null
16362         for an empty return value.
16363
16364 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16365
16366         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16367         dealing with a FieldExpr which is composed of a FieldBuilder, in
16368         the code path we did extract the constant, but we should have
16369         obtained the underlying value to be able to cast it (otherwise we
16370         end up in an infinite loop, this is what Ravi was running into).
16371
16372         (ArrayCreation.UpdateIndices): Arrays might be empty.
16373
16374         (MemberAccess.ResolveMemberAccess): Add support for section
16375         14.5.4.1 that deals with the special case of E.I when E is a type
16376         and something else, that I can be a reference to a static member.
16377
16378         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16379         handle a particular array type to create byte blobs, it is just
16380         something we dont generate byteblobs for.
16381
16382         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16383         arguments. 
16384
16385         * location.cs (Push): remove the key from the hashtable that we
16386         are about to add.   This happens for empty files.
16387
16388         * driver.cs: Dispose files after we have parsed them.
16389
16390         (tokenize): new function that only runs the tokenizer on its
16391         input, for speed testing.
16392
16393 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16394
16395         * class.cs (Event.Define): Define the private field only if there
16396         are no accessors defined.
16397
16398         * expression.cs (ResolveMemberAccess): If there is no associated
16399         field with the event, that means we have an event defined with its
16400         own accessors and we should flag error cs0070 since transforming
16401         ourselves into a field is not valid in that case.
16402
16403         * ecore.cs (SimpleName.DoResolve): Same as above.
16404
16405         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16406         and charset to sane values.
16407
16408 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16409
16410         * assign.cs (DoResolve): Perform check on events only if they 
16411         are being accessed outside the declaring type.
16412
16413         * cs-parser.jay (event_declarations): Update rules to correctly
16414         set the type of the implicit parameter etc.
16415
16416         (add_accessor, remove_accessor): Set current local parameters.
16417
16418         * expression.cs (Binary): For delegate addition and subtraction,
16419         cast the return value from the method into the appropriate delegate
16420         type.
16421
16422 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16423
16424         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16425         of these as the workaround is unnecessary.
16426
16427         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16428         delegate data - none of that is needed at all.
16429
16430         Re-write bits to extract the instance expression and the delegate method
16431         correctly.
16432
16433         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16434         on delegates too.
16435
16436         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16437         of attaching attributes instead of duplicating code everywhere.
16438
16439         * everywhere : Update code to do attribute emission using the above method.
16440
16441 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16442
16443         * expression.cs (IsParamsMethodApplicable): if there are not
16444         parameters, return immediately.
16445
16446         * ecore.cs: The 0 literal can be implicity converted to an enum
16447         type. 
16448
16449         (SimpleName.DoResolve): First lookup the type, then lookup the
16450         members. 
16451
16452         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16453         want to get its address.  If the InstanceExpression is not
16454         addressable, store the result in a temporary variable, then get
16455         the address of it.
16456
16457         * codegen.cs: Only display 219 errors on warning level or above. 
16458
16459         * expression.cs (ArrayAccess): Make it implement the
16460         IMemoryLocation interface.
16461
16462         (Binary.DoResolve): handle the operator == (object a, object b)
16463         and operator != (object a, object b) without incurring into a
16464         BoxedCast (because 5 != o should never be performed).
16465
16466         Handle binary enumerator operators.
16467
16468         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16469         value type, otherwise use Ldelem_ref.
16470
16471         Use precomputed names;
16472
16473         (AddressOf): Implement address of
16474
16475         * cs-parser.jay (labeled_statement): Fix recursive block
16476         addition by reworking the production.
16477
16478         * expression.cs (New.DoEmit): New has a special case:
16479                 
16480                  If we are dealing with a ValueType, we have a few
16481                  situations to deal with:
16482                 
16483                     * The target of New is a ValueType variable, that is
16484                       easy, we just pass this as the variable reference
16485                 
16486                     * The target of New is being passed as an argument,
16487                       to a boxing operation or a function that takes a
16488                       ValueType.
16489                 
16490                       In this case, we need to create a temporary variable
16491                       that is the argument of New.
16492
16493
16494 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16495
16496         * rootcontext.cs (LookupType): Check that current_type is not null before
16497         going about looking at nested types.
16498
16499         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16500         not implement the IAssignMethod interface any more.
16501
16502         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16503         where we tranform them into FieldExprs if they are being resolved from within
16504         the declaring type.
16505
16506         * ecore.cs (SimpleName.DoResolve): Do the same here.
16507
16508         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16509
16510         * ../errors/bug10.cs : Add.
16511
16512         * ../errors/cs0070.cs : Add.
16513
16514         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16515
16516         * assign.cs : Get rid of EventIsLocal everywhere.
16517
16518 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16519
16520         * ecore.cs (ConvertIntLiteral): finished the implementation.
16521
16522         * statement.cs (SwitchLabel): Convert the value we are using as a
16523         key before looking up the table.
16524
16525 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16526
16527         * codegen.cs (EmitTopBlock): Require a Location argument now.
16528
16529         * cs-parser.jay (constructor_declarator): We need to setup
16530         current_local_parameters before we parse the
16531         opt_constructor_initializer, to allow the variables to be bound
16532         to the constructor arguments.
16533
16534         * rootcontext.cs (LookupType): First lookup nested classes in our
16535         class and our parents before we go looking outside our class.
16536
16537         * expression.cs (ConstantFold): Extract/debox the values at the
16538         beginnning. 
16539
16540         * rootcontext.cs (EmitCode): Resolve the constants first before we
16541         resolve the types.  This is not really needed, but it helps debugging.
16542
16543         * statement.cs: report location.
16544
16545         * cs-parser.jay: pass location to throw statement.
16546
16547         * driver.cs: Small bug fix.
16548
16549         * report.cs: Updated format to be 4-zero filled digits.
16550
16551 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16552
16553         * expression.cs (CheckIndices): Fix minor bug where the wrong
16554         variable was being referred to ;-)
16555
16556         (DoEmit): Do not call EmitStaticInitializers when the 
16557         underlying type is System.Object.
16558
16559 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16560
16561         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16562         and do the usual workaround for SRE.
16563
16564         * class.cs (MyEventBuilder.EventType): New member to get at the type
16565         of the event, quickly.
16566
16567         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16568
16569         * assign.cs (Assign.DoResolve): Handle the case when the target
16570         is an EventExpr and perform the necessary checks.
16571
16572         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16573         interface.
16574
16575         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16576
16577         (EventExpr): Set the type in the constructor itself since we 
16578         are meant to be born fully resolved.
16579
16580         (EventExpr.Define): Revert code I wrote earlier.
16581                 
16582         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16583         instance expression is null. The instance expression is a This in that case
16584         or a null, depending on whether it is a static method or not.
16585
16586         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16587         refers to more than one method.
16588
16589         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16590         and accordingly flag errors.
16591
16592 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16593
16594         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16595
16596 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16597
16598         * location.cs (ToString): Provide useful rutine.
16599
16600 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16601
16602         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16603         objects, return the actual integral boxed.
16604
16605         * statement.cs (SwitchLabel): define an ILLabel for each
16606         SwitchLabel. 
16607
16608         (Switch.CheckSwitch): If the value is a Literal, extract
16609         the underlying literal.
16610
16611         Also in the unused hashtable we had, add the SwitchLabel so we can
16612         quickly look this value up.
16613
16614         * constant.cs: Implement a bunch of new constants.  Rewrite
16615         Literal based on this.  Made changes everywhere to adapt to this.
16616
16617         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16618         dereferencing array only once, and also copes with enumrations.
16619
16620         bytes are two bytes wide, not one.
16621
16622         (Cast): Perform constant conversions.
16623
16624         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16625         wrappers to the literals here.
16626
16627         * expression.cs (DoNumericPromotions): long literals can converted
16628         to ulong implicity (this is taken care of elsewhere, but I was
16629         missing this spot).
16630
16631         * ecore.cs (Expression.Literalize): Make the return type Literal,
16632         to improve type checking.
16633
16634         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16635
16636 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16637
16638         * literal.cs: Revert code from ravi that checked the bounds.  The
16639         bounds are sane by the definition of the type itself. 
16640
16641         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16642         need to actually look up in our parent hierarchy for interfaces
16643         implemented. 
16644
16645         * const.cs: Use the underlying type for enumerations
16646
16647         * delegate.cs: Compute the basename for the delegate creation,
16648         that should fix the delegate test case, and restore the correct
16649         Type Lookup semantics in rootcontext
16650
16651         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16652         referencing a nested type with the Reflection API is using the "+"
16653         sign. 
16654
16655         * cs-parser.jay: Do not require EOF token at the end.
16656
16657 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16658
16659         * rootcontext.cs (LookupType): Concatenate type names with
16660         a '.' instead of a '+' The test suite passes again.
16661
16662         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16663         field of the enumeration.
16664
16665         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16666         the case when the member is an EventExpr.
16667
16668         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16669         static has an associated instance expression.
16670
16671         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16672
16673         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16674
16675         * class.cs (Event.Define): Register event and perform appropriate checks
16676         for error #111.
16677
16678         We define the Add and Remove methods even if the use provides none because
16679         in that case, we provide default implementations ourselves.
16680
16681         Define a private field of the type of the event. This is done by the CSC compiler
16682         and we should be doing it too ;-)
16683
16684         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16685         More methods we use in code we generate.
16686
16687         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16688         is important.
16689
16690         (InitCoreTypes): Update accordingly for the above.
16691
16692         * class.cs (Event.Emit): Generate code for default accessors that we provide
16693
16694         (EmitDefaultMethod): Do the job in the above.
16695
16696         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16697         appropriate place.
16698
16699 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16700
16701         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16702         builders even if we were missing one.
16703
16704         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16705         pass the Basename as our class name instead of the Name.  The
16706         basename will be correctly composed for us.
16707
16708         * parameter.cs (Paramters): Now takes a Location argument.
16709
16710         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16711         make all the code call directly LookupType in RootContext and take
16712         this chance to pass the Location information everywhere.
16713
16714         * Everywhere: pass Location information.
16715
16716 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16717
16718         * class.cs (Constructor.Define): Updated way of detecting the
16719         length of the parameters.
16720
16721         (TypeContainer.DefineType): Use basename as the type name for
16722         nested types.
16723
16724         (TypeContainer.Define): Do not recursively define types here, as
16725         definition is taken care in order by the RootContext.
16726
16727         * tree.cs: Keep track of namespaces in a per-file basis.
16728
16729         * parameter.cs (Parameter.ComputeSignature): Update to use
16730         DeclSpace. 
16731
16732         (Parameters.GetSignature): ditto.
16733
16734         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16735         instead of a TypeContainer.
16736
16737         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16738         resolve names.  Because we need to be resolve in our context, not
16739         our parents.
16740
16741         * driver.cs: Implement response files.
16742
16743         * class.cs (TypeContainer.DefineType): If we are defined, do not
16744         redefine ourselves.
16745
16746         (Event.Emit): Emit the code for add/remove handlers.
16747         (Event.Define): Save the MethodBuilders for add/remove.
16748
16749         * typemanager.cs: Use pair here too.
16750
16751         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16752         DictionaryEntry requires the first argument to be non-null.  
16753
16754         (enum_declaration): Compute full name for registering the
16755         enumeration.
16756
16757         (delegate_declaration): Instead of using
16758         formal_parameter_list, use opt_formal_parameter_list as the list
16759         can be empty.
16760
16761         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16762         (EventParsing): New property that controls whether `add' and
16763         `remove' are returned as tokens or identifiers (for events);
16764
16765 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16766
16767         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16768         use MyEventBuilder only and let it wrap the real builder for us.
16769
16770         (MyEventBuilder): Revamp constructor etc.
16771
16772         Implement all operations that we perform on EventBuilder in precisely the same
16773         way here too.
16774
16775         (FindMembers): Update to use the EventBuilder member.
16776
16777         (Event.Emit): Update accordingly.
16778
16779 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16780
16781         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16782         by calling the appropriate methods.
16783
16784         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16785         useful.
16786
16787         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16788
16789 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16790
16791         * delegate.cs (Delegate.Populate): Check that the return type
16792         and various parameters types are indeed accessible.
16793
16794         * class.cs (Constructor.Define): Same here.
16795
16796         (Field.Define): Ditto.
16797
16798         (Event.Define): Ditto.
16799
16800         (Operator.Define): Check that the underlying Method defined itself
16801         correctly - so it's MethodBuilder should not be null.
16802
16803         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16804         expression happens to be null.
16805
16806         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16807         members but as of now we don't seem to be able to do anything really useful with it.
16808
16809         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16810         not the EventBuilder.
16811
16812 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16813
16814         * cs-tokenizer.cs: Add support for defines.
16815         Add support for #if, #elif, #else, #endif
16816
16817         (eval_var): evaluates a variable.
16818         (eval): stubbed for evaluating functions.
16819
16820         * cs-parser.jay: Pass the defines information
16821
16822         * driver.cs: Add --define command line option.
16823
16824         * decl.cs: Move MemberCore here.
16825
16826         Make it the base class for DeclSpace.  This allows us to catch and
16827         report 108 and 109 for everything now.
16828
16829         * class.cs (TypeContainer.Define): Extract all the members
16830         before populating and emit the warning 108 (new keyword required
16831         to override) instead of having each member implement this.
16832
16833         (MemberCore.Define): New abstract method, we will be using this in
16834         the warning reporting engine in Populate.
16835
16836         (Operator.Define): Adjust to new MemberCore protocol. 
16837
16838         * const.cs (Const): This does not derive from Expression, it is a
16839         temporary object we use to create fields, it is a MemberCore. 
16840
16841         * class.cs (Method.Define): Allow the entry point to be in a
16842         specific class.
16843
16844         * driver.cs: Rewrite the argument handler to clean it up a bit.
16845
16846         * rootcontext.cs: Made it just an auxiliary namespace feature by
16847         making everything static.
16848
16849         * driver.cs: Adapt code to use RootContext type name instead of
16850         instance variable.
16851
16852         * delegate.cs: Remove RootContext argument.
16853
16854         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16855         argument. 
16856
16857         * class.cs (Event.Define): The lookup can fail.
16858
16859         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16860
16861         * expression.cs: Resolve the this instance before invoking the code.
16862
16863 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16864
16865         * cs-parser.jay: Add a production in element_access that allows
16866         the thing to become a "type" reference.  This way we can parse
16867         things like "(string [])" as a type.
16868
16869         Note that this still does not handle the more complex rules of
16870         casts. 
16871
16872
16873         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16874
16875         * ecore.cs: (CopyNewMethods): new utility function used to
16876         assemble the list of methods from running FindMembers.
16877
16878         (MemberLookup): Rework FindMembers so that 
16879
16880 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16881
16882         * class.cs (TypeContainer): Remove Delegates who fail to be
16883         defined.
16884
16885         * delegate.cs (Populate): Verify that we dont get null return
16886         values.   TODO: Check for AsAccessible.
16887
16888         * cs-parser.jay: Use basename to emit error 574 (destructor should
16889         have the same name as container class), not the full name.
16890
16891         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16892         possible representation.  
16893
16894         Also implements integer type suffixes U and L.
16895
16896 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16897
16898         * expression.cs (ArrayCreation.DoResolve): We need to do the
16899         argument resolution *always*.
16900
16901         * decl.cs: Make this hold the namespace.  Hold the root context as
16902         well.
16903         (LookupType): Move here.
16904
16905         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16906
16907         * location.cs (Row, Name): Fixed the code, it was always returning
16908         references to the first file.
16909
16910         * interface.cs: Register properties defined through interfaces.
16911
16912         * driver.cs: Add support for globbing on the command line
16913
16914         * class.cs (Field): Make it derive from MemberCore as well.
16915         (Event): ditto.
16916
16917 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16918
16919         * class.cs (Event::Define): Check that the type of the event is a delegate
16920         type else flag error #66.
16921
16922         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16923         same.
16924
16925         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16926         values of EntryPoint, CharSet etc etc.
16927
16928         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16929
16930         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16931         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16932         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16933         which needs this to do its work.
16934
16935         * ../errors/cs0066.cs : Add.
16936
16937 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16938
16939         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16940         helper functions.
16941
16942         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16943         clears out the parameters field.
16944         (MemberSignatureCompare): Cleanup
16945
16946         (MemberCore): New base class used to share code between MethodCore
16947         and Property.
16948
16949         (RegisterRequiredImplementations) BindingFlags.Public requires
16950         either BindingFlags.Instace or Static.  Use instance here.
16951
16952         (Property): Refactored code to cope better with the full spec.
16953
16954         * parameter.cs (GetParameterInfo): Return an empty array instead
16955         of null on error.
16956
16957         * class.cs (Property): Abstract or extern properties have no bodies.
16958
16959         * parameter.cs (GetParameterInfo): return a zero-sized array.
16960
16961         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16962         method modifier validation to the typecontainer so we can reuse
16963         this on properties.
16964
16965         (MethodCore.ParameterTypes): return an empty sized array of types.
16966
16967         (Property.Define): Test property modifier validity.
16968
16969         Add tests for sealed/override too.
16970
16971         (Method.Emit): abstract or extern methods have no bodies.
16972
16973 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16974
16975         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16976         thing.
16977
16978         (Method::Define, ::Emit): Modify accordingly.
16979
16980         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16981
16982         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16983
16984         * makefile: Pass in /unsafe.
16985
16986 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16987
16988         * class.cs (MakeKey): Kill routine.
16989
16990         * class.cs (TypeContainer.Define): Correctly define explicit
16991         method implementations (they require the full interface name plus
16992         the method name).
16993
16994         * typemanager.cs: Deply the PtrHashtable here and stop using the
16995         lame keys.  Things work so much better.
16996
16997         This of course broke everyone who depended on `RegisterMethod' to
16998         do the `test for existance' test.  This has to be done elsewhere.
16999
17000         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17001         the object stupid Equals method (because, that like fails all over
17002         the place).  We still do not use it.
17003
17004         * class.cs (TypeContainer.SetRequiredInterface,
17005         TypeContainer.RequireMethods): Killed these two routines and moved
17006         all the functionality to RegisterRequiredImplementations.
17007
17008         (TypeContainer.RegisterRequiredImplementations): This routine now
17009         registers all the implementations required in an array for the
17010         interfaces and abstract methods.  We use an array of structures
17011         which can be computed ahead of time to reduce memory usage and we
17012         also assume that lookups are cheap as most classes will not
17013         implement too many interfaces.
17014
17015         We also avoid creating too many MethodSignatures.
17016
17017         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17018         clear the "pending" bit if we find that there are problems with
17019         the declaration.
17020
17021         (TypeContainer.VerifyPendingMethods): Update to report errors of
17022         methods that look like implementations but are not.
17023
17024         (TypeContainer.Define): Add support for explicit interface method
17025         implementation. 
17026
17027 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17028
17029         * typemanager.cs: Keep track of the parameters here instead of
17030         being a feature of the TypeContainer.
17031
17032         * class.cs: Drop the registration of parameters here, as
17033         InterfaceMethods are also interface declarations.
17034
17035         * delegate.cs: Register methods with the TypeManager not only with
17036         the TypeContainer.  This code was buggy.
17037
17038         * interface.cs: Full registation here.
17039
17040 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17041
17042         * expression.cs: Remove reducer for binary expressions, it can not
17043         be done this way.
17044
17045         * const.cs: Put here the code that used to go into constant.cs
17046
17047         * constant.cs: Put here the code for constants, this is a new base
17048         class for Literals.
17049
17050         * literal.cs: Make Literal derive from Constant.
17051
17052 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17053
17054         * statement.cs (Return.Emit): Report error 157 if the user
17055         attempts to return from a finally block.
17056
17057         (Return.Emit): Instead of emitting a return, jump to the end of
17058         the function.
17059
17060         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17061         LocalBuilder to store the result of the function.  ReturnLabel is
17062         the target where we jump.
17063
17064
17065 2001-12-09  Radek Doulik  <rodo@ximian.com>
17066
17067         * cs-parser.jay: remember alias in current namespace
17068
17069         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17070         namespaces
17071
17072         * class.cs (LookupAlias): lookup alias in my_namespace
17073
17074         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17075         aliases hashtable
17076         (LookupAlias): lookup alias in this and if needed in parent
17077         namespaces
17078
17079 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17080
17081         * support.cs: 
17082
17083         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17084         making things static.  I need this to avoid passing the
17085         TypeContainer when calling ParameterType.
17086
17087         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17088         that did string manipulation to compute the type and then call
17089         GetType.  Use Parameter.ParameterType instead.
17090
17091         * cs-tokenizer.cs: Consume the suffix for floating values.
17092
17093         * expression.cs (ParameterReference): figure out whether this is a
17094         reference parameter or not.  Kill an extra variable by computing
17095         the arg_idx during emission.
17096
17097         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17098         function that returns whether a parameter is an out/ref value or not.
17099
17100         (Parameter.ParameterType): The type of the parameter (base,
17101         without ref/out applied).
17102
17103         (Parameter.Resolve): Perform resolution here.
17104         (Parameter.ExternalType): The full type (with ref/out applied).
17105
17106         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17107         support for expressions on the using statement.
17108
17109 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17110
17111         * statement.cs (Using.EmitLocalVariableDecls): Split the
17112         localvariable handling of the using statement.
17113
17114         (Block.EmitMeta): Keep track of variable count across blocks.  We
17115         were reusing slots on separate branches of blocks.
17116
17117         (Try.Emit): Emit the general code block, we were not emitting it. 
17118
17119         Check the type of the declaration to be an IDisposable or
17120         something that can be implicity converted to it. 
17121
17122         Emit conversions if required.
17123
17124         * ecore.cs (EmptyExpression): New utility class.
17125         (Expression.ImplicitConversionExists): New utility function.
17126
17127 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * statement.cs (Using): Implement.
17130
17131         * expression.cs (LocalVariableReference): Support read only variables.
17132
17133         * statement.cs: Remove the explicit emit for the Leave opcode.
17134         (VariableInfo): Add a readonly field.
17135
17136 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17137
17138         * ecore.cs (ConvCast): new class used to encapsulate the various
17139         explicit integer conversions that works in both checked and
17140         unchecked contexts.
17141
17142         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17143         properly generate the overflow opcodes.
17144
17145 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17146
17147         * statement.cs: The correct type for the EmptyExpression is the
17148         element_type, not the variable type.  Ravi pointed this out.
17149
17150 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17151
17152         * class.cs (Method::Define): Handle PInvoke methods specially
17153         by using DefinePInvokeMethod instead of the usual one.
17154
17155         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17156         above to do the task of extracting information and defining the method.
17157
17158 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17159
17160         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17161         of the condition for string type.
17162
17163         (Emit): Move that here. 
17164
17165         (ArrayCreation::CheckIndices): Keep string literals in their expression
17166         form.
17167
17168         (EmitDynamicInitializers): Handle strings appropriately.
17169
17170 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17171
17172         * codegen.cs (EmitContext): Replace multiple variables with a
17173         single pointer to the current Switch statement.
17174
17175         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17176         EmitContext.
17177
17178 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17179
17180         * statement.cs 
17181
17182         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17183         default'.
17184
17185         (Foreach.Emit): Foreach on arrays was not setting
17186         up the loop variables (for break/continue).
17187
17188         (GotoCase): Semi-implented.
17189
17190 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17191
17192         * attribute.cs (CheckAttribute): Handle system attributes by using
17193         Attribute.GetAttributes to examine information we need.
17194
17195         (GetValidPlaces): Same here.
17196
17197         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17198
17199         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17200
17201         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17202
17203         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17204
17205         (Method::Emit): Handle the case when we are a PInvoke method.
17206
17207 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17208
17209         * expression.cs: Use ResolveWithSimpleName on compound names.
17210
17211 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17212
17213         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17214         before trying to reduce it.
17215
17216         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17217
17218         * constant.cs (LookupConstantValue): Implement.
17219
17220         (EmitConstant): Use the above in emitting the constant.
17221
17222         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17223         that are user-defined by doing a LookupConstantValue on them.
17224
17225         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17226         too, like above.
17227
17228 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17229
17230         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17231
17232         (BaseAccess.DoResolve): Implement.
17233
17234         (MemberAccess.DoResolve): Split this routine into a
17235         ResolveMemberAccess routine that can be used independently
17236
17237 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17238
17239         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17240         As that share bits of the implementation.  Is returns a boolean,
17241         while As returns the Type that is being probed.
17242
17243 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17244
17245         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17246         instead of a Literal - much easier.
17247
17248         (EnumInTransit): Remove - utterly useless :-)
17249
17250         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17251
17252         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17253
17254         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17255         chain when we have no associated expression.
17256
17257 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17258
17259         * constant.cs (Define): Use Location while reporting the errror.
17260
17261         Also emit a warning when 'new' is used and there is no inherited
17262         member to hide.
17263
17264         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17265         populated.
17266
17267         (LookupEnumValue): Implement to lookup an enum member's value and define it
17268         if necessary.
17269
17270         (Populate): Re-write accordingly to use the above routine.
17271
17272 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17273
17274         * expression.cs (This): Fix prototype for DoResolveLValue to
17275         override the base class DoResolveLValue.
17276
17277         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17278         declarations) 
17279
17280         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17281         (we need to load the address of the field here).  This fixes
17282         test-22. 
17283
17284         (FieldExpr.DoResolveLValue): Call the DoResolve
17285         function to initialize the Instance expression.
17286
17287         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17288         correctly the GetEnumerator operation on a value type.
17289
17290         * cs-parser.jay: Add more simple parsing error catches.
17291
17292         * statement.cs (Switch): Add support for string switches.
17293         Handle null specially.
17294
17295         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17296
17297 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17298
17299         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17300
17301         (declare_local_constant): New helper function.
17302
17303         * statement.cs (AddConstant): Keep a separate record of constants
17304
17305         (IsConstant): Implement to determine if a variable is a constant.
17306
17307         (GetConstantExpression): Implement.
17308
17309         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17310
17311         * statement.cs (IsVariableDefined): Re-write.
17312
17313 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17314
17315         * class.cs (TypeContainer::FindMembers): Look for constants
17316         in the case when we are looking for MemberTypes.Field
17317
17318         * expression.cs (MemberAccess::DoResolve): Check that in the
17319         case we are a FieldExpr and a Literal, we are not being accessed
17320         by an instance reference.
17321
17322         * cs-parser.jay (local_constant_declaration): Implement.
17323
17324         (declaration_statement): Implement for constant declarations.
17325
17326 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17327
17328         * statement.cs (Switch): Catch double defaults.
17329
17330         (Switch): More work on the switch() statement
17331         implementation.  It works for integral values now, need to finish
17332         string support.
17333
17334
17335 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17336
17337         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17338         integer literals into other integer literals.  To be used by
17339         switch. 
17340
17341 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17342
17343         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17344         some memory.
17345
17346         (EmitDynamicInitializers): Cope with the above since we extract data
17347         directly from ArrayData now.
17348
17349         (ExpectInitializers): Keep track of whether initializers are mandatory
17350         or not.
17351
17352         (Bounds): Make it a hashtable to prevent the same dimension being 
17353         recorded for every element in that dimension.
17354
17355         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17356         from being found.
17357
17358         Also fix bug which was causing the indices to be emitted in the reverse
17359         order.
17360
17361 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17362
17363         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17364         unfinished.  They do not work, because the underlying code is
17365         sloppy.
17366
17367 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17368
17369         * cs-parser.jay: Remove bogus fixme.
17370
17371         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17372         on Switch statement.
17373
17374 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17375
17376         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17377         the same. 
17378
17379         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17380         parameter. Apparently, any expression is allowed. 
17381
17382         (ValidateInitializers): Update accordingly.
17383
17384         (CheckIndices): Fix some tricky bugs thanks to recursion.
17385
17386         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17387         I was being completely brain-dead.
17388
17389         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17390         and re-write acordingly.
17391
17392         (DelegateInvocation): Re-write accordingly.
17393
17394         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17395
17396         (MakeByteBlob): Handle types more correctly.
17397
17398         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17399         initialization from expressions but it is incomplete because I am a complete
17400         Dodo :-|
17401
17402 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17403
17404         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17405         on If.  Basically, we have to return `true' (ie, we do return to
17406         our caller) only if both branches of the if return.
17407
17408         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17409         short-circuit operators, handle them as short circuit operators. 
17410
17411         (Cast.DoResolve): Resolve type.
17412         (Cast.Cast): Take an expression as the target type.
17413
17414         * cs-parser.jay (cast_expression): Remove old hack that only
17415         allowed a limited set of types to be handled.  Now we take a
17416         unary_expression and we resolve to a type during semantic
17417         analysis.
17418
17419         Use the grammar productions from Rhys to handle casts (this is
17420         not complete like Rhys syntax yet, we fail to handle that corner
17421         case that C# has regarding (-x), but we will get there.
17422
17423 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17424
17425         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17426         field which is an array type.
17427
17428         * cs-parser.jay (declare_local_variables): Support array initialization too.
17429
17430         * typemanager.cs (MakeKey): Implement.
17431
17432         (everywhere): Use the above appropriately.
17433
17434         * cs-parser.jay (for_statement): Update for array initialization while
17435         declaring variables.
17436
17437         * ecore.cs : The error message was correct, it's the variable's names that
17438         were misleading ;-) Make the code more readable.
17439
17440         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17441         the correct type etc.
17442
17443         (ConvertExplicit): Handle Enum types by examining the underlying type.
17444
17445 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17446
17447         * parameter.cs (GetCallingConvention): Always return
17448         CallingConventions.Standard for now.
17449
17450 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17451
17452         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17453         and `r' after calling DoNumericPromotions.
17454
17455         * ecore.cs: Fix error message (the types were in the wrong order).
17456
17457         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17458         BindingFlags.Instance as well 
17459
17460         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17461         implicit int literal conversion in an empty cast so that we
17462         propagate the right type upstream.
17463
17464         (UnboxCast): new class used to unbox value types.
17465         (Expression.ConvertExplicit): Add explicit type conversions done
17466         by unboxing.
17467
17468         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17469         the target type before applying the implicit LongLiterals to ULong
17470         literal cast.
17471
17472 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17473
17474         * cs-parser.jay (for_statement): Reworked the way For works: now
17475         we declare manually any variables that are introduced in
17476         for_initializer to solve the problem of having out-of-band code
17477         emition (that is what got for broken).
17478
17479         (declaration_statement): Perform the actual variable declaration
17480         that used to be done in local_variable_declaration here.
17481
17482         (local_variable_declaration): Do not declare anything, just pass
17483         the information on a DictionaryEntry
17484
17485 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17486
17487         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17488         re-write of the logic to now make it recursive.
17489
17490         (UpdateIndices): Re-write accordingly.
17491
17492         Store element data in a separate ArrayData list in the above methods.
17493
17494         (MakeByteBlob): Implement to dump the array data into a byte array.
17495
17496 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17497
17498         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17499         into CheckIndices.
17500
17501         * constant.cs (Define): Implement.
17502
17503         (EmitConstant): Re-write fully.
17504
17505         Pass in location info.
17506
17507         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17508         respectively.
17509
17510         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17511         DictionaryEntry since we need location info too.
17512
17513         (constant_declaration): Update accordingly.
17514
17515         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17516         code into another method : UpdateIndices.
17517
17518 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17519
17520         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17521         some type checking etc.
17522
17523 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17524
17525         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17526         bits to provide dimension info if the user skips doing that.
17527
17528         Update second constructor to store the rank correctly.
17529
17530 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17531
17532         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17533         and try to implement.
17534
17535         * ../errors/cs0150.cs : Add.
17536
17537         * ../errors/cs0178.cs : Add.
17538
17539 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17540
17541         * statement.cs: Implement foreach on multi-dimensional arrays. 
17542
17543         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17544         name of the params argument.
17545
17546         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17547         initializing the array.
17548
17549         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17550         we can use this elsewhere.
17551
17552         * statement.cs: Finish implementation of foreach for single
17553         dimension arrays.
17554
17555         * cs-parser.jay: Use an out-of-band stack to pass information
17556         around, I wonder why I need this.
17557
17558         foreach_block: Make the new foreach_block the current_block.
17559
17560         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17561         function used to return a static Parameters structure.  Used for
17562         empty parameters, as those are created very frequently.
17563
17564         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17565
17566 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17567
17568         * interface.cs : Default modifier is private, not public. The
17569         make verify test passes again.
17570
17571 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17572
17573         * support.cs (ReflectionParameters): Fix logic to determine
17574         whether the last parameter is a params one. Test 9 passes again.
17575
17576         * delegate.cs (Populate): Register the builders we define with
17577         RegisterParameterForBuilder. Test 19 passes again.
17578
17579         * cs-parser.jay (property_declaration): Reference $6 instead
17580         of $$ to get at the location.
17581
17582         (indexer_declaration): Similar stuff.
17583
17584         (attribute): Ditto.
17585
17586         * class.cs (Property): Register parameters for the Get and Set methods
17587         if they exist. Test 23 passes again.
17588
17589         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17590         call to EmitArguments as we are sure there aren't any params arguments. 
17591         Test 32 passes again.
17592
17593         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17594         IndexOutOfRangeException. 
17595
17596         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17597         Test 33 now passes again.
17598
17599 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17600
17601         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17602         broke a bunch of things.  Will have to come up with a better way
17603         of tracking locations.
17604
17605         * statement.cs: Implemented foreach for single dimension arrays.
17606
17607 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17608
17609         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17610         an error.  This removes the lookup from the critical path.
17611
17612         * cs-parser.jay: Removed use of temporary_loc, which is completely
17613         broken. 
17614
17615 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17616
17617         * support.cs (ReflectionParameters.ParameterModifier): Report
17618         whether the argument is a PARAMS argument or not.
17619
17620         * class.cs: Set the attribute `ParamArrayAttribute' on the
17621         parameter argument.
17622
17623         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17624         and cons_param_array_attribute (ConstructorInfo for
17625         ParamArrayAttribute)., 
17626
17627         * codegen.cs: Emit the return using the `Return' statement, that
17628         way we can report the error correctly for missing return values. 
17629
17630         * class.cs (Method.Emit): Clean up.
17631
17632         * expression.cs (Argument.Resolve): Take another argument: the
17633         location where this argument is used.  Notice that this is not
17634         part of the "Argument" class as to reduce the size of the
17635         structure (we know the approximate location anyways).
17636
17637         Test if the argument is a variable-reference, if not, then
17638         complain with a 206.
17639
17640         (Argument.Emit): Emit addresses of variables.
17641
17642         (Argument.FullDesc): Simplify.
17643
17644         (Invocation.DoResolve): Update for Argument.Resolve.
17645
17646         (ElementAccess.DoResolve): ditto.
17647
17648         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17649         method should be virtual, as this method is always virtual.
17650
17651         (NewDelegate.DoResolve): Update for Argument.Resolve.
17652
17653         * class.cs (ConstructorInitializer.DoResolve): ditto.
17654
17655         * attribute.cs (Attribute.Resolve): ditto.
17656
17657 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17658
17659         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17660
17661         * expression.cs (ParameterReference): Drop IStackStorage and implement
17662         IAssignMethod instead. 
17663
17664         (LocalVariableReference): ditto.
17665
17666         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17667         IAssignMethod instead. 
17668
17669 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17670
17671         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17672         enumerations that are used in heavily used structures derive from
17673         byte in a laughable and pathetic attempt to reduce memory usage.
17674         This is the kind of pre-optimzations that you should not do at
17675         home without adult supervision.
17676
17677         * expression.cs (UnaryMutator): New class, used to handle ++ and
17678         -- separatedly from the other unary operators.  Cleans up the
17679         code, and kills the ExpressionStatement dependency in Unary.
17680
17681         (Unary): Removed `method' and `Arguments' from this class, making
17682         it smaller, and moving it all to SimpleCall, so I can reuse this
17683         code in other locations and avoid creating a lot of transient data
17684         strucutres when not required.
17685
17686         * cs-parser.jay: Adjust for new changes.
17687
17688 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17689
17690         * enum.cs (Enum.Populate): If there is a failure during
17691         definition, return
17692
17693         * cs-parser.jay (opt_enum_base): we used to catch type errors
17694         here, but this is really incorrect.  The type error should be
17695         catched during semantic analysis.
17696
17697 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17698
17699         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17700         current_local_parameters as expected since I, in my stupidity, had forgotten
17701         to do this :-)
17702
17703         * attribute.cs (GetValidPlaces): Fix stupid bug.
17704
17705         * class.cs (Method::Emit): Perform check on applicability of attributes.
17706
17707         (Constructor::Emit): Ditto.
17708
17709         (Field::Emit): Ditto.
17710
17711         (Field.Location): Store location information.
17712
17713         (Property, Event, Indexer, Operator): Ditto.
17714
17715         * cs-parser.jay (field_declaration): Pass in location for each field.
17716
17717         * ../errors/cs0592.cs : Add.
17718
17719 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17720
17721         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17722
17723         (InitCoreTypes): Update accordingly.
17724
17725         (RegisterAttrType, LookupAttr): Implement.
17726
17727         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17728         info about the same.
17729
17730         (Resolve): Update to populate the above as necessary.
17731
17732         (Error592): Helper.
17733
17734         (GetValidPlaces): Helper to the above.
17735
17736         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17737
17738         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17739
17740 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17741
17742         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17743
17744         * ../errors/cs0617.cs : Add.
17745
17746 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17747
17748         * enum.cs (Emit): Rename to Populate to be more consistent with what
17749         we expect it to do and when exactly it is called.
17750
17751         * class.cs, rootcontext.cs : Update accordingly.
17752
17753         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17754         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17755
17756         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17757
17758         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17759         of a fieldinfo using the above, when dealing with a FieldBuilder.
17760
17761 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17762
17763         * ../errors/cs0031.cs : Add.
17764
17765         * ../errors/cs1008.cs : Add.
17766
17767         * ../errrors/cs0543.cs : Add.
17768
17769         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17770         enum type.
17771
17772         (FindMembers): Implement.
17773
17774         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17775         enums and delegates too.
17776
17777         (enum_types): Rename to builder_to_enum.
17778
17779         (delegate_types): Rename to builder_to_delegate.
17780
17781         * delegate.cs (FindMembers): Implement.
17782
17783 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17784
17785         * typemanager.cs (IsEnumType): Implement.
17786
17787         * enum.cs (Emit): Re-write parts to account for the underlying type
17788         better and perform checking etc.
17789
17790         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17791         of the underlying type.
17792
17793         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17794         value
17795
17796         * enum.cs (error31): Helper to report error #31.
17797
17798         * cs-parser.jay (enum_declaration): Store location of each member too.
17799
17800         * enum.cs (member_to_location): New hashtable. 
17801
17802         (AddEnumMember): Update location hashtable.
17803
17804         (Emit): Use the location of each member while reporting errors.
17805
17806 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17807
17808         * cs-parser.jay: A for_initializer if is a
17809         local_variable_declaration really ammount to have an implicit
17810         block with the variable declaration and no initializer for for.
17811
17812         * statement.cs (For.Emit): Cope with null initializers.
17813
17814         This fixes the infinite loop on for initializers.
17815
17816 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17817
17818         * enum.cs: More cleanup.
17819
17820         * ecore.cs: Remove dead code.
17821
17822         * class.cs (Property.Emit): More simplification.
17823         (Event.Emit): ditto.
17824
17825         Reworked to have less levels of indentation.
17826
17827 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17828
17829         * class.cs (Property): Emit attributes.
17830
17831         (Field): Ditto.
17832
17833         (Event): Ditto.
17834
17835         (Indexer): Ditto.
17836
17837         (Operator): Ditto.
17838
17839         * enum.cs (Emit): Ditto.
17840
17841         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17842         Enums too.
17843
17844         * class.cs (Field, Event, etc.): Move attribute generation into the
17845         Emit method everywhere.
17846
17847         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17848         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17849         as we had no way of defining nested enums !
17850
17851         * rootcontext.cs : Adjust code accordingly.
17852
17853         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17854
17855 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17856
17857         * expression.cs (EvalConstantExpression): Move into ecore.cs
17858
17859         * enum.cs (Enum): Rename some members and make them public and readonly
17860         according to our convention.
17861
17862         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17863         nothing else.
17864
17865         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17866
17867         (Enum::Emit): Write a simple version for now which doesn't try to compute
17868         expressions. I shall modify this to be more robust in just a while.
17869
17870         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17871
17872         (TypeContainer::CloseType): Create the Enum types too.
17873
17874         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17875
17876         * expression.cs (EvalConstantExpression): Get rid of completely.
17877
17878         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17879         user-defined values and other cases.
17880
17881         (IsValidEnumLiteral): Helper function.
17882
17883         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17884         out there in the case we had a literal FieldExpr.
17885
17886         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17887
17888         (Literalize): Revamp a bit to take two arguments.
17889
17890         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17891
17892 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17893
17894         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17895
17896         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17897
17898         (Resolve): Use the above to ensure we have proper initializers.
17899
17900 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17901
17902         * expression.cs (Expression::EvalConstantExpression): New method to 
17903         evaluate constant expressions.
17904
17905         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17906
17907 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17908
17909         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17910         in an array.
17911
17912         (Binary.ResolveOperator): Handle operator != (object a, object b)
17913         and operator == (object a, object b);
17914
17915         (Binary.DoNumericPromotions): Indicate whether the numeric
17916         promotion was possible.
17917
17918         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17919         Implement.  
17920
17921         Made the ArrayAccess implement interface IAssignMethod instead of
17922         IStackStore as the order in which arguments are passed reflects
17923         this.
17924
17925         * assign.cs: Instead of using expr.ExprClass to select the way of
17926         assinging, probe for the IStackStore/IAssignMethod interfaces.
17927
17928         * typemanager.cs: Load InitializeArray definition.
17929
17930         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17931         static data that can be used to initialize arrays. 
17932
17933 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17934
17935         * expression.cs: Handle operator== and operator!= for booleans.
17936
17937         (Conditioal.Reduce): Implement reducer for the ?: operator.
17938
17939         (Conditional.Resolve): Implement dead code elimination.
17940
17941         (Binary.Resolve): Catch string literals and return a new
17942         concatenated string.
17943
17944         (Unary.Reduce): Implement reduction of unary expressions.
17945
17946         * ecore.cs: Split out the expression core handling here.
17947
17948         (Expression.Reduce): New method used to perform constant folding
17949         and CSE.  This is needed to support constant-expressions. 
17950
17951         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17952         targets, and optimize for !x.
17953
17954 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17955
17956         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17957         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17958         set custom atttributes.
17959
17960         * literal.cs (Literal::GetValue): New abstract method to return the actual
17961         value of the literal, cast as an object.
17962
17963         (*Literal): Implement GetValue method.
17964
17965         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17966         expressions to the arraylist but objects of type Argument.
17967
17968         * class.cs (TypeContainer::Emit): Emit our attributes too.
17969
17970         (Method::Emit, Constructor::Emit): Ditto.
17971
17972         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17973         to be ignoring earlier.
17974
17975 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17976
17977         * attribute.cs (AttributeSection::Define): Implement to do the business
17978         of constructing a CustomAttributeBuilder.
17979
17980         (Attribute): New trivial class. Increases readability of code.  
17981
17982         * cs-parser.jay : Update accordingly.
17983
17984         (positional_argument_list, named_argument_list, named_argument): New rules
17985
17986         (attribute_arguments): Use the above so that we are more correct.
17987
17988 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17989
17990         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17991         to perform all checks for a method with a params parameter.
17992
17993         (Invocation::OverloadResolve): Update to use the above method and therefore
17994         cope correctly with params method invocations.
17995
17996         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17997         params too.
17998
17999         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18000         constructors in our parent too because we can't afford to miss out on 
18001         protected ones ;-)
18002
18003         * attribute.cs (AttributeSection): New name for the class Attribute
18004
18005         Other trivial changes to improve readability.
18006
18007         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18008         use the new class names.
18009
18010 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18011
18012         * class.cs (Method::Define): Complete definition for params types too
18013
18014         (Indexer::Define): Ditto.
18015
18016         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18017         Cope everywhere with a request for info about the array parameter.
18018
18019 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18020
18021         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18022
18023         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18024         local_variable_type to extract the string corresponding to the type.
18025
18026         (local_variable_type): Fixup the action to use the new helper method.
18027
18028         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18029         go.
18030
18031         * expression.cs : Clean out code which uses the above.
18032
18033 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18034
18035         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18036         and bale out if necessary by returning a false.
18037
18038         (RegisterProperty): Ditto.
18039
18040         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18041         and print out appropriate error messages.
18042
18043         * interface.cs (everywhere): Ditto.
18044
18045         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18046         location to constructor.
18047
18048         * class.cs (Property, Event, Indexer): Update accordingly.
18049
18050         * ../errors/cs111.cs : Added.
18051
18052         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18053         of a method, as laid down by the spec.
18054
18055         (Invocation::OverloadResolve): Use the above method.
18056
18057 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18058
18059         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18060         now take a TypeContainer and a Parameters object.
18061
18062         (ParameterData): Modify return type of ParameterModifier method to be 
18063         Parameter.Modifier and not a string.
18064
18065         (ReflectionParameters, InternalParameters): Update accordingly.
18066
18067         * expression.cs (Argument::GetParameterModifier): Same here.
18068
18069         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18070         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18071         symbol in it at all so maybe this is only for now.
18072
18073 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18074
18075         * support.cs (InternalParameters): Constructor now takes an extra argument 
18076         which is the actual Parameters class.
18077
18078         (ParameterDesc): Update to provide info on ref/out modifiers.
18079
18080         * class.cs (everywhere): Update call to InternalParameters to pass in
18081         the second argument too.
18082
18083         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18084         to return the modifier info [ref/out etc]
18085
18086         (InternalParameters, ReflectionParameters): Implement the above.
18087
18088         * expression.cs (Argument::ParameterModifier): Similar function to return
18089         info about the argument's modifiers.
18090
18091         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18092         too.
18093
18094         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18095         a new SetFormalParameters object which we pass to InternalParameters.
18096
18097 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18098
18099         * expression.cs (NewArray): Merge into the ArrayCreation class.
18100
18101 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18102
18103         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18104         NewUserdefinedArray into one as there wasn't much of a use in having
18105         two separate ones.
18106
18107         * expression.cs (Argument): Change field's name to ArgType from Type.
18108
18109         (Type): New readonly property which returns the proper type, taking into 
18110         account ref/out modifiers.
18111
18112         (everywhere): Adjust code accordingly for the above.
18113
18114         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18115         whether we are emitting for a ref or out parameter.
18116
18117         * expression.cs (Argument::Emit): Use the above field to set the state.
18118
18119         (LocalVariableReference::Emit): Update to honour the flag and emit the
18120         right stuff.
18121
18122         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18123
18124         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18125
18126         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18127
18128         (ReflectionParameters, InternalParameters): Implement the above method.
18129
18130         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18131         reporting errors.
18132
18133         (Invocation::FullMethodDesc): Ditto. 
18134
18135 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18136
18137         * cs-parser.jay: Add extra production for the second form of array
18138         creation. 
18139
18140         * expression.cs (ArrayCreation): Update to reflect the above
18141         change. 
18142
18143         * Small changes to prepare for Array initialization.
18144
18145 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18146
18147         * typemanager.cs (ImplementsInterface): interface might be null;
18148         Deal with this problem;
18149
18150         Also, we do store negative hits on the cache (null values), so use
18151         this instead of calling t.GetInterfaces on the type everytime.
18152
18153 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18154
18155         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18156
18157         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18158         split functionality out into different classes.
18159
18160         (New::FormArrayType): Move into NewBuiltinArray.
18161
18162         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18163         quite useless.
18164
18165         (NewBuiltinArray): New class to handle creation of built-in arrays.
18166
18167         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18168         account creation of one-dimensional arrays.
18169
18170         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18171
18172         (NewUserdefinedArray::DoResolve): Implement.
18173
18174         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18175
18176         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18177         we maintain inside the TypeManager. This is necessary to perform lookups on the
18178         module builder.
18179
18180         (LookupType): Update to perform GetType on the module builders too.     
18181
18182         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18183
18184         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18185
18186 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18187
18188         * expression.cs (New::DoResolve): Implement guts of array creation.
18189
18190         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18191
18192 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18193
18194         * expression.cs: Fix bug I introduced lsat night that broke
18195         Delegates. 
18196
18197         (Expression.Resolve): Report a 246 error (can not resolve name)
18198         if we find a SimpleName in the stream.
18199
18200         (Expression.ResolveLValue): Ditto.
18201
18202         (Expression.ResolveWithSimpleName): This function is a variant of
18203         ResolveName, this one allows SimpleNames to be returned without a
18204         warning.  The only consumer of SimpleNames is MemberAccess
18205
18206 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18207
18208         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18209         might arrive here.  I have my doubts that this is correct.
18210
18211         * statement.cs (Lock): Implement lock statement.
18212
18213         * cs-parser.jay: Small fixes to support `lock' and `using'
18214
18215         * cs-tokenizer.cs: Remove extra space
18216
18217         * driver.cs: New flag --checked, allows to turn on integer math
18218         checking. 
18219
18220         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18221         Threading.Monitor.Exit 
18222
18223 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18224
18225         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18226         Expression Class to be IndexerAccess.
18227
18228         Notice that Indexer::DoResolve sets the eclass to Value.
18229
18230 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18231
18232         * class.cs (TypeContainer::Emit): Emit code for indexers.
18233
18234         * assign.cs (IAssignMethod): New interface implemented by Indexers
18235         and Properties for handling assignment.
18236
18237         (Assign::Emit): Simplify and reuse code. 
18238
18239         * expression.cs (IndexerAccess, PropertyExpr): Implement
18240         IAssignMethod, clean up old code. 
18241
18242 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18243
18244         * typemanager.cs (ImplementsInterface): New method to determine if a type
18245         implements a given interface. Provides a nice cache too.
18246
18247         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18248         method.
18249
18250         (ConvertReferenceExplicit): Ditto.
18251
18252         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18253         various methods, with correct names etc.
18254
18255         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18256         Operator.UnaryNegation.
18257
18258         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18259         we have a unary plus or minus operator.
18260
18261         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18262         UnaryMinus.
18263
18264         * everywhere : update accordingly.
18265
18266         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18267         respectively.
18268
18269         * class.cs (Method::Define): For the case where we are implementing a method
18270         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18271         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18272
18273 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18274
18275         * interface.cs (FindMembers): Implement to work around S.R.E
18276         lameness.
18277
18278         * typemanager.cs (IsInterfaceType): Implement.
18279
18280         (FindMembers): Update to handle interface types too.
18281
18282         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18283         use IsAssignableFrom as that is not correct - it doesn't work.
18284
18285         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18286         and accordingly override EmitStatement.
18287
18288         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18289         using the correct logic :-)
18290
18291 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18292
18293         * ../errors/cs-11.cs : Add to demonstrate error -11 
18294
18295 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18296
18297         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18298         then pass this as a hint to ResolveLValue.
18299
18300         * expression.cs (FieldExpr): Add Location information
18301
18302         (FieldExpr::LValueResolve): Report assignment to readonly
18303         variable. 
18304
18305         (Expression::ExprClassFromMemberInfo): Pass location information.
18306
18307         (Expression::ResolveLValue): Add new method that resolves an
18308         LValue. 
18309
18310         (Expression::DoResolveLValue): Default invocation calls
18311         DoResolve. 
18312
18313         (Indexers): New class used to keep track of indexers in a given
18314         Type. 
18315
18316         (IStackStore): Renamed from LValue, as it did not really describe
18317         what this did.  Also ResolveLValue is gone from this interface and
18318         now is part of Expression.
18319
18320         (ElementAccess): Depending on the element access type
18321
18322         * typemanager.cs: Add `indexer_name_type' as a Core type
18323         (System.Runtime.CompilerServices.IndexerNameAttribute)
18324
18325         * statement.cs (Goto): Take a location.
18326
18327 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18328
18329         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18330         if two delegates are compatible.
18331
18332         (NewDelegate::DoResolve): Update to take care of the case when
18333         we instantiate a delegate from another delegate.
18334
18335         * typemanager.cs (FindMembers): Don't even try to look up members
18336         of Delegate types for now.
18337
18338 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18339
18340         * delegate.cs (NewDelegate): New class to take care of delegate
18341         instantiation.
18342
18343         * expression.cs (New): Split the delegate related code out into 
18344         the NewDelegate class.
18345
18346         * delegate.cs (DelegateInvocation): New class to handle delegate 
18347         invocation.
18348
18349         * expression.cs (Invocation): Split out delegate related code into
18350         the DelegateInvocation class.
18351
18352 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18353
18354         * expression.cs (New::DoResolve): Implement delegate creation fully
18355         and according to the spec.
18356
18357         (New::DoEmit): Update to handle delegates differently.
18358
18359         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18360         because of which we were printing out arguments in reverse order !
18361
18362         * delegate.cs (VerifyMethod): Implement to check if the given method
18363         matches the delegate.
18364
18365         (FullDelegateDesc): Implement.
18366
18367         (VerifyApplicability): Implement.
18368
18369         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18370         delegate invocations too.
18371
18372         (Invocation::Emit): Ditto.
18373
18374         * ../errors/cs1593.cs : Added.
18375
18376         * ../errors/cs1594.cs : Added.
18377
18378         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18379
18380 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18381
18382         * typemanager.cs (intptr_type): Core type for System.IntPtr
18383
18384         (InitCoreTypes): Update for the same.
18385
18386         (iasyncresult_type, asynccallback_type): Ditto.
18387
18388         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18389         correct.
18390
18391         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18392         too.
18393
18394         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18395         the builders for the 4 members of a delegate type :-)
18396
18397         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18398         type.
18399
18400         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18401
18402         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18403
18404 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18405
18406         * statement.cs (Break::Emit): Implement.   
18407         (Continue::Emit): Implement.
18408
18409         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18410         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18411         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18412         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18413         end loop
18414
18415         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18416         properties that track the label for the current loop (begin of the
18417         loop and end of the loop).
18418
18419 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18420
18421         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18422         use of emitting anything at all.
18423
18424         * class.cs, rootcontext.cs : Get rid of calls to the same.
18425
18426         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18427
18428         (Populate): Define the constructor correctly and set the implementation
18429         attributes.
18430
18431         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18432         have been defined.
18433
18434         (AddDelegateType): Implement.
18435
18436         (IsDelegateType): Implement helper method.
18437
18438         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18439
18440         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18441         and accordingly handle it.
18442
18443         * delegate.cs (Populate): Take TypeContainer argument.
18444         Implement bits to define the Invoke method. However, I still haven't figured out
18445         how to take care of the native int bit :-(
18446
18447         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18448         Qualify the name of the delegate, not its return type !
18449
18450         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18451         conversion.
18452
18453         (StandardConversionExists): Checking for array types turns out to be recursive.
18454
18455         (ConvertReferenceExplicit): Implement array conversion.
18456
18457         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18458
18459 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18460
18461         * cs-parser.jay (delegate_declaration): Store the fully qualified
18462         name as it is a type declaration.
18463
18464         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18465         readonly.
18466
18467         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18468         as TypeContainer::DefineType.
18469
18470         (Populate): Method in which all the definition of the various methods (Invoke)
18471         etc is done.
18472
18473         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18474         see.
18475
18476         (CloseDelegate): Finally creates the delegate.
18477
18478         * class.cs (TypeContainer::DefineType): Update to define delegates.
18479         (Populate, Emit and CloseType): Do the same thing here too.
18480
18481         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18482         delegates in all these operations.
18483
18484 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18485
18486         * expression.cs: LocalTemporary: a new expression used to
18487         reference a temporary that has been created.
18488
18489         * assign.cs: Handle PropertyAccess back here, so that we can
18490         provide the proper semantic access to properties.
18491
18492         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18493         a few more explicit conversions. 
18494
18495         * modifiers.cs: `NEW' modifier maps to HideBySig.
18496
18497         * expression.cs (PropertyExpr): Make this into an
18498         ExpressionStatement, and support the EmitStatement code path. 
18499
18500         Perform get/set error checking, clean up the interface.
18501
18502         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18503         them into toplevel access objects.
18504
18505 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18506
18507         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18508         SRE.
18509
18510         * typemanager.cs: Keep track here of our PropertyBuilders again to
18511         work around lameness in SRE.
18512
18513 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18514
18515         * expression.cs (LValue::LValueResolve): New method in the
18516         interface, used to perform a second resolution pass for LValues. 
18517
18518         (This::DoResolve): Catch the use of this in static methods.
18519
18520         (This::LValueResolve): Implement.
18521
18522         (This::Store): Remove warning, assigning to `this' in structures
18523         is 
18524
18525         (Invocation::Emit): Deal with invocation of
18526         methods on value types.  We need to pass the address to structure
18527         methods rather than the object itself.  (The equivalent code to
18528         emit "this" for structures leaves the entire structure on the
18529         stack instead of a pointer to it). 
18530
18531         (ParameterReference::DoResolve): Compute the real index for the
18532         argument based on whether the method takes or not a `this' pointer
18533         (ie, the method is static).
18534
18535         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18536         value types returned from functions when we need to invoke a
18537         method on the sturcture.
18538
18539
18540 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18541
18542         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18543         defining the type in the Modulebuilder or Typebuilder. This is to take
18544         care of nested types which need to be defined on the TypeBuilder using
18545         DefineNestedMethod.
18546
18547         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18548         methods in RootContext, only ported to be part of TypeContainer.
18549
18550         (TypeContainer::GetInterfaceOrClass): Ditto.
18551
18552         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18553
18554         * interface.cs (Interface::DefineInterface): New method. Does exactly
18555         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18556         too.
18557
18558         (Interface::GetInterfaces): Move from RootContext here and port.
18559
18560         (Interface::GetInterfaceByName): Same here.
18561
18562         * rootcontext.cs (ResolveTree): Re-write.
18563
18564         (PopulateTypes): Re-write.
18565
18566         * class.cs (TypeContainer::Populate): Populate nested types too.
18567         (TypeContainer::Emit): Emit nested members too.
18568
18569         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18570         instead just use the name argument passed in as it is already fully
18571         qualified.
18572
18573         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18574         to TypeContainer mapping to see if a type is user-defined.
18575
18576         * class.cs (TypeContainer::CloseType): Implement. 
18577
18578         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18579         the default constructor.
18580
18581         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18582         twice.
18583
18584         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18585
18586         * interface.cs (CloseType): Create the type here.
18587
18588         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18589         the hierarchy.
18590
18591         Remove all the methods which are now in TypeContainer.
18592
18593 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18594
18595         * delegate.cs (Define): Re-write bits to define the delegate
18596         correctly.
18597
18598 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18599
18600         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18601
18602         * expression.cs (ImplicitReferenceConversion): handle null as well
18603         as a source to convert to any reference type.
18604
18605         * statement.cs (Return): Perform any implicit conversions to
18606         expected return type.  
18607
18608         Validate use of return statement.  
18609
18610         * codegen.cs (EmitContext): Pass the expected return type here.
18611
18612         * class.cs (Method, Constructor, Property): Pass expected return
18613         type to EmitContext.
18614
18615 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18616
18617         * expression.cs: Make DoResolve take an EmitContext instead of a
18618         TypeContainer.
18619
18620         Replaced `l' and `location' for `loc', for consistency.
18621
18622         (Error, Warning): Remove unneeded Tc argument.
18623
18624         * assign.cs, literal.cs, constant.cs: Update to new calling
18625         convention. 
18626
18627         * codegen.cs: EmitContext now contains a flag indicating whether
18628         code is being generated in a static method or not.
18629
18630         * cs-parser.jay: DecomposeQI, new function that replaces the old
18631         QualifiedIdentifier.  Now we always decompose the assembled
18632         strings from qualified_identifier productions into a group of
18633         memberaccesses.
18634
18635 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18636
18637         * rootcontext.cs: Deal with field-less struct types correctly now
18638         by passing the size option to Define Type.
18639
18640         * class.cs: Removed hack that created one static field. 
18641
18642 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18643
18644         * statement.cs: Moved most of the code generation here. 
18645
18646 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18647
18648         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18649         seem very right.
18650
18651         (ElementAccess): Remove useless bits for now - keep checks as the spec
18652         says.
18653
18654 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18655
18656         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18657         and start performing checks according to the spec.
18658
18659 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18660
18661         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18662         rank_specifiers instead.
18663
18664         (rank_specifiers): Change the order in which the rank specifiers are stored
18665
18666         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18667
18668         * expression.cs (ElementAccess): Implement the LValue interface too.
18669
18670 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18671
18672         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18673         except that user defined conversions are not included.
18674
18675         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18676         perform the conversion of the return type, if necessary.
18677
18678         (New::DoResolve): Check whether we are creating an array or an object
18679         and accordingly do the needful.
18680
18681         (New::Emit): Same here.
18682
18683         (New::DoResolve): Implement guts of array creation.
18684
18685         (New::FormLookupType): Helper function.
18686
18687 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18688
18689         * codegen.cs: Removed most of the code generation here, and move the
18690         corresponding code generation bits to the statement classes. 
18691
18692         Added support for try/catch/finalize and throw.
18693
18694         * cs-parser.jay: Added support for try/catch/finalize.
18695
18696         * class.cs: Catch static methods having the flags override,
18697         virtual or abstract.
18698
18699         * expression.cs (UserCast): This user cast was not really doing
18700         what it was supposed to do.  Which is to be born in fully resolved
18701         state.  Parts of the resolution were being performed at Emit time! 
18702
18703         Fixed this code.
18704
18705 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18706
18707         * expression.cs: Implicity convert the result from UserCast.
18708
18709 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18710
18711         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18712         prevented it from working correctly. 
18713
18714         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18715         merely ConvertImplicit.
18716
18717 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18718
18719         * typemanager.cs: Make the LookupTypeContainer function static,
18720         and not per-instance.  
18721
18722         * class.cs: Make static FindMembers (the one that takes a Type
18723         argument). 
18724
18725         * codegen.cs: Add EmitForeach here.
18726
18727         * cs-parser.jay: Make foreach a toplevel object instead of the
18728         inline expansion, as we need to perform semantic analysis on it. 
18729
18730 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18731
18732         * expression.cs (Expression::ImplicitUserConversion): Rename to
18733         UserDefinedConversion.
18734
18735         (Expression::UserDefinedConversion): Take an extra argument specifying 
18736         whether we look for explicit user conversions too.
18737
18738         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18739
18740         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18741
18742         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18743         with the appropriate arguments.
18744
18745         * cs-parser.jay (cast_expression): Record location too.
18746
18747         * expression.cs (Cast): Record location info.
18748
18749         (Expression::ConvertExplicit): Take location argument.
18750
18751         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18752         to determine if we are doing explicit conversions.
18753
18754         (UserCast::Emit): Update accordingly.
18755
18756         (Expression::ConvertExplicit): Report an error if everything fails.
18757
18758         * ../errors/cs0030.cs : Add.
18759
18760 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18761
18762         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18763         virtual and newslot bits. 
18764
18765         * class.cs (TypeContainer::RegisterRequiredImplementations):
18766         Record methods we need.
18767
18768         (TypeContainer::MakeKey): Helper function to make keys for
18769         MethodBases, since the Methodbase key is useless.
18770
18771         (TypeContainer::Populate): Call RegisterRequiredImplementations
18772         before defining the methods.   
18773
18774         Create a mapping for method_builders_to_methods ahead of time
18775         instead of inside a tight loop.
18776
18777         (::RequireMethods):  Accept an object as the data to set into the
18778         hashtable so we can report interface vs abstract method mismatch.
18779
18780 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18781
18782         * report.cs: Make all of it static.
18783
18784         * rootcontext.cs: Drop object_type and value_type computations, as
18785         we have those in the TypeManager anyways.
18786
18787         Drop report instance variable too, now it is a global.
18788
18789         * driver.cs: Use try/catch on command line handling.
18790
18791         Add --probe option to debug the error reporting system with a test
18792         suite. 
18793
18794         * report.cs: Add support for exiting program when a probe
18795         condition is reached.
18796
18797 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18798
18799         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18800         we do a forcible conversion regardless of type, to check if 
18801         ForceConversion returns a null.
18802
18803         (Binary::error19): Use location to report error.
18804
18805         (Unary::error23): Use location here too.
18806
18807         * ../errors/cs0019.cs : Check in.
18808
18809         * ../errors/cs0023.cs : Check in.
18810
18811         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18812         case of a non-null MethodInfo object with a length of 0 !
18813
18814         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18815         an applicable member - according to the spec :-)
18816         Also fix logic to find members in base types.
18817
18818         (Unary::ResolveOperator): Same here.
18819
18820         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18821         as I was getting thoroughly confused between this and error19 :-)
18822
18823         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18824         (::FindMostEncompassedType): Implement.
18825         (::FindMostEncompassingType): Implement.
18826         (::StandardConversionExists): Implement.
18827
18828         (UserImplicitCast): Re-vamp. We now need info about most specific
18829         source and target types so that we can do the necessary conversions.
18830
18831         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18832         mathematical union with no duplicates.
18833
18834 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18835
18836         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18837         in order from base classes to child classes, so that we can in
18838         child classes look up in our parent for method names and
18839         attributes (required for handling abstract, virtual, new, override
18840         constructs: we need to instrospect our base class, and if we dont
18841         populate the classes in order, the introspection might be
18842         incorrect.  For example, a method could query its parent before
18843         the parent has any methods and would determine that the parent has
18844         no abstract methods (while it could have had them)).
18845
18846         (RootContext::CreateType): Record the order in which we define the
18847         classes.
18848
18849 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18850
18851         * class.cs (TypeContainer::Populate): Also method definitions can
18852         fail now, keep track of this.
18853
18854         (TypeContainer::FindMembers): Implement support for
18855         DeclaredOnly/noDeclaredOnly flag.
18856
18857         (Constructor::Emit) Return the ConstructorBuilder.
18858
18859         (Method::Emit) Return the MethodBuilder. 
18860         Check for abstract or virtual methods to be public.
18861
18862         * rootcontext.cs (RootContext::CreateType): Register all the
18863         abstract methods required for the class to be complete and the
18864         interface methods that must be implemented. 
18865
18866         * cs-parser.jay: Report error 501 (method requires body if it is
18867         not marked abstract or extern).
18868
18869         * expression.cs (TypeOf::Emit): Implement.
18870
18871         * typemanager.cs: runtime_handle_type, new global type.
18872
18873         * class.cs (Property::Emit): Generate code for properties.
18874
18875 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18876
18877         * expression.cs (Unary::ResolveOperator): Find operators on base type
18878         too - we now conform exactly to the spec.
18879
18880         (Binary::ResolveOperator): Same here.
18881
18882         * class.cs (Operator::Define): Fix minor quirk in the tests.
18883
18884         * ../errors/cs0215.cs : Added.
18885
18886         * ../errors/cs0556.cs : Added.
18887
18888         * ../errors/cs0555.cs : Added.
18889
18890 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18891
18892         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18893         single integer which is really efficient
18894
18895 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18896
18897         *  expression.cs (Expression::ImplicitUserConversion): Use location
18898         even in the case when we are examining True operators.
18899  
18900         * class.cs (Operator::Define): Perform extensive checks to conform
18901         with the rules for operator overloading in the spec.
18902
18903         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18904         some of the other conversions mentioned in the spec.
18905
18906         * typemanager.cs (array_type): New static member for the System.Array built-in
18907         type.
18908
18909         (cloneable_interface): For System.ICloneable interface.
18910
18911         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18912         we start resolving the tree and populating types.
18913
18914         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18915  
18916 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18917
18918         * expression.cs (Expression::ExprClassFromMemberInfo,
18919         Expression::Literalize): Create literal expressions from
18920         FieldInfos which are literals.
18921
18922         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18923         type casts, because they were wrong.  The test suite in tests
18924         caught these ones.
18925
18926         (ImplicitNumericConversion): ushort to ulong requires a widening
18927         cast. 
18928
18929         Int32 constant to long requires widening cast as well.
18930
18931         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18932         for integers because the type on the stack is not i4.
18933
18934 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18935
18936         * expression.cs (report118): require location argument. 
18937
18938         * parameter.cs: Do not dereference potential null value.
18939
18940         * class.cs: Catch methods that lack the `new' keyword when
18941         overriding a name.  Report warnings when `new' is used without
18942         anything being there to override.
18943
18944         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18945
18946         * class.cs: Only add constructor to hashtable if it is non-null
18947         (as now constructors can fail on define).
18948
18949         (TypeManager, Class, Struct): Take location arguments.
18950
18951         Catch field instance initialization in structs as errors.
18952
18953         accepting_filter: a new filter for FindMembers that is static so
18954         that we dont create an instance per invocation.
18955
18956         (Constructor::Define): Catch errors where a struct constructor is
18957         parameterless 
18958
18959         * cs-parser.jay: Pass location information for various new
18960         constructs. 
18961
18962         * delegate.cs (Delegate): take a location argument.
18963
18964         * driver.cs: Do not call EmitCode if there were problesm in the
18965         Definition of the types, as many Builders wont be there. 
18966
18967         * decl.cs (Decl::Decl): Require a location argument.
18968
18969         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18970         into integers, and find the most appropiate integer for it.
18971
18972         * literal.cs: Implement ULongLiteral.
18973
18974         * rootcontext.cs: Provide better information about the location of
18975         failure when CreateType fails.
18976
18977 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18978
18979         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18980         as well.
18981
18982         * expression.cs (Binary::CheckShiftArguments): Add missing type
18983         computation.
18984         (Binary::ResolveOperator): Add type to the logical and and logical
18985         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18986         before.
18987
18988         (Binary::DoNumericPromotions): In the case where either argument
18989         is ulong (and most signed types combined with ulong cause an
18990         error) perform implicit integer constant conversions as well.
18991
18992 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18993
18994         * expression.cs (UserImplicitCast): Method should always be
18995         non-null. 
18996         (Invocation::BetterConversion): Simplified test for IntLiteral.
18997
18998         (Expression::ImplicitNumericConversion): Split this routine out.
18999         Put the code that performs implicit constant integer conversions
19000         here. 
19001
19002         (Expression::Resolve): Become a wrapper around DoResolve so we can
19003         check eclass and type being set after resolve.
19004
19005         (Invocation::Badness): Remove this dead function
19006
19007         (Binary::ResolveOperator): Do not compute the expensive argumnets
19008         unless we have a union for it.
19009
19010         (Probe::Emit): Is needs to do an isinst and then
19011         compare against null.
19012
19013         (::CanConvert): Added Location argument.  If the Location argument
19014         is null (Location.Null), then we do not report errors.  This is
19015         used by the `probe' mechanism of the Explicit conversion.  We do
19016         not want to generate an error for something that the user
19017         explicitly requested to be casted.  But the pipeline for an
19018         explicit cast first tests for potential implicit casts.
19019
19020         So for now, if the Location is null, it means `Probe only' to
19021         avoid adding another argument.   Might have to revise this
19022         strategy later.
19023
19024         (ClassCast): New class used to type cast objects into arbitrary
19025         classes (used in Explicit Reference Conversions).
19026
19027         Implement `as' as well.
19028
19029         Reverted all the patches from Ravi below: they were broken:
19030
19031                 * The use of `level' as a mechanism to stop recursive
19032                   invocations is wrong.  That was there just to catch the
19033                   bug with a strack trace but not as a way of addressing
19034                   the problem.
19035
19036                   To fix the problem we have to *understand* what is going
19037                   on and the interactions and come up with a plan, not
19038                   just get things going.
19039
19040                 * The use of the type conversion cache that I proposed
19041                   last night had an open topic: How does this work across
19042                   protection domains.  A user defined conversion might not
19043                   be public in the location where we are applying the
19044                   conversion, a different conversion might be selected
19045                   (ie, private A->B (better) but public B->A (worse),
19046                   inside A, A->B applies, but outside it, B->A will
19047                   apply).
19048
19049                 * On top of that (ie, even if the above is solved),
19050                   conversions in a cache need to be abstract.  Ie, `To
19051                   convert from an Int to a Short use an OpcodeCast', not
19052                   `To convert from an Int to a Short use the OpcodeCast on
19053                   the variable 5' (which is what this patch was doing).
19054
19055 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19056
19057         * expression.cs (Invocation::ConversionExists): Re-write to use
19058         the conversion cache
19059
19060         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19061         cache all conversions done, not just user-defined ones.
19062
19063         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19064         to determine if a conversion exists instead of acutually trying to 
19065         perform the conversion. It's faster too.
19066
19067         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19068         and only then attempt the implicit conversion.
19069
19070 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19071
19072         * expression.cs (ConvertImplicit): Use a cache for conversions
19073         already found. Check level of recursion and bail out if necessary.
19074
19075 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19076
19077         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19078         Export standard methods that we expect for string operations.
19079
19080         * statement.cs (Block::UsageWarning): Track usage of variables and
19081         report the errors for not used variables.
19082
19083         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19084         operator. 
19085
19086 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19087
19088         * codegen.cs: remove unnneded code 
19089
19090         * expression.cs: Removed BuiltinTypeAccess class
19091
19092         Fix the order in which implicit conversions are
19093         done.  
19094
19095         The previous fixed dropped support for boxed conversions (adding a
19096         test to the test suite now)
19097
19098         (UserImplicitCast::CanConvert): Remove test for source being null,
19099         that code is broken.  We should not feed a null to begin with, if
19100         we do, then we should track the bug where the problem originates
19101         and not try to cover it up here.
19102
19103         Return a resolved expression of type UserImplicitCast on success
19104         rather than true/false.  Ravi: this is what I was talking about,
19105         the pattern is to use a static method as a "constructor" for
19106         objects. 
19107
19108         Also, do not create arguments until the very last minute,
19109         otherwise we always create the arguments even for lookups that
19110         will never be performed. 
19111
19112         (UserImplicitCast::Resolve): Eliminate, objects of type
19113         UserImplicitCast are born in a fully resolved state. 
19114
19115         * typemanager.cs (InitCoreTypes): Init also value_type
19116         (System.ValueType). 
19117
19118         * expression.cs (Cast::Resolve): First resolve the child expression.
19119
19120         (LValue): Add new method AddressOf to be used by
19121         the `&' operator.  
19122
19123         Change the argument of Store to take an EmitContext instead of an
19124         ILGenerator, because things like FieldExpr need to be able to call
19125         their children expression to generate the instance code. 
19126
19127         (Expression::Error, Expression::Warning): Sugar functions for
19128         reporting errors.
19129
19130         (Expression::MemberLookup): Accept a TypeContainer instead of a
19131         Report as the first argument.
19132
19133         (Expression::ResolvePrimary): Killed.  I still want to improve
19134         this as currently the code is just not right.
19135
19136         (Expression::ResolveMemberAccess): Simplify, but it is still
19137         wrong. 
19138
19139         (Unary::Resolve): Catch errors in AddressOf operators.
19140
19141         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19142         index to a byte for the short-version, or the compiler will choose
19143         the wrong Emit call, which generates the wrong data.
19144
19145         (ParameterReference::Emit, ::Store): same.
19146
19147         (FieldExpr::AddressOf): Implement.
19148
19149         * typemanager.cs: TypeManager: made public variable instead of
19150         property.
19151
19152         * driver.cs: document --fatal.
19153
19154         * report.cs (ErrorMessage, WarningMessage): new names for the old
19155         Error and Warning classes.
19156
19157         * cs-parser.jay (member_access): Turn built-in access to types
19158         into a normal simplename
19159
19160 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19161
19162         * expression.cs (Invocation::BetterConversion): Fix to cope
19163         with q being null, since this was introducing a bug.
19164
19165         * expression.cs (ConvertImplicit): Do built-in conversions first.
19166
19167 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19168
19169         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19170
19171 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19172
19173         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19174         I had introduced long ago (what's new ?).
19175
19176         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19177         the work of all the checking. 
19178         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19179         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19180
19181         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19182         that is the right way. 
19183
19184         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19185         overloading resolution. Use everywhere instead of cutting and pasting code.
19186
19187         (Binary::ResolveOperator): Use MakeUnionSet.
19188
19189         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19190         we have to convert to bool types. Not complete yet.
19191
19192 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19193
19194         * typemanager.cs (TypeManager::CSharpName): support ushort.
19195
19196         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19197         to provide an expression that performsn an implicit constant int
19198         conversion (section 6.1.6).
19199         (Expression::ConvertImplicitRequired): Reworked to include
19200         implicit constant expression conversions.
19201
19202         (Expression::ConvertNumericExplicit): Finished.
19203
19204         (Invocation::Emit): If InstanceExpression is null, then it means
19205         that we perform a call on this.
19206
19207 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19208
19209         * expression.cs (Unary::Emit): Remove some dead code.
19210         (Probe): Implement Resolve and Emit for `is'.
19211         (Expression::ConvertImplicitRequired): Attempt to do constant
19212         expression conversions here.  Maybe should be moved to
19213         ConvertImplicit, but I am not sure.
19214         (Expression::ImplicitLongConstantConversionPossible,
19215         Expression::ImplicitIntConstantConversionPossible): New functions
19216         that tell whether is it possible to apply an implicit constant
19217         expression conversion.
19218
19219         (ConvertNumericExplicit): Started work on explicit numeric
19220         conversions.
19221
19222         * cs-parser.jay: Update operator constants.
19223
19224         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19225         (Parameters::GetSignature): Hook up VerifyArgs here.
19226         (Parameters::VerifyArgs): Verifies that no two arguments have the
19227         same name. 
19228
19229         * class.cs (Operator): Update the operator names to reflect the
19230         ones that the spec expects (as we are just stringizing the
19231         operator names).
19232
19233         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19234         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19235         previous usage did only work for our methods.
19236         (Expression::ConvertImplicit): Handle decimal implicit numeric
19237         conversions as well.
19238         (Expression::InternalTypeConstructor): Used to invoke constructors
19239         on internal types for default promotions.
19240
19241         (Unary::Emit): Implement special handling for the pre/post
19242         increment/decrement for overloaded operators, as they need to have
19243         the same semantics as the other operators.
19244
19245         (Binary::ResolveOperator): ditto.
19246         (Invocation::ConversionExists): ditto.
19247         (UserImplicitCast::Resolve): ditto.
19248
19249 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19250
19251         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19252         operator, return after emitting body. Regression tests pass again !
19253
19254         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19255         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19256         (Invocation::OverloadResolve): Ditto.
19257         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19258
19259         * everywhere : update calls to the above methods accordingly.
19260
19261 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19262
19263         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19264
19265         * expression.cs (ExpressionStatement): New base class used for
19266         expressions that can appear in statements, so that we can provide
19267         an alternate path to generate expression that do not leave a value
19268         on the stack.
19269
19270         (Expression::Emit, and all the derivatives): We no longer return
19271         whether a value is left on the stack or not.  Every expression
19272         after being emitted leaves a single value on the stack.
19273
19274         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19275         facilties of ExpressionStatement if possible.
19276
19277         * cs-parser.jay: Update statement_expression.
19278
19279 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19280
19281         * driver.cs: Change the wording of message
19282
19283 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19284
19285         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19286         the type of the expression to the return type of the method if
19287         we have an overloaded operator match ! The regression tests pass again !
19288         (Unary::ResolveOperator): Ditto.
19289
19290         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19291         to find "op_Implicit", not "implicit" ;-)
19292         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19293         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19294
19295         * everywhere : Correct calls to the above accordingly.
19296
19297         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19298         (ConvertImplicit): Do user-defined conversion if it exists.
19299
19300 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19301
19302         * assign.cs: track location.
19303         (Resolve): Use implicit conversions on assignment.
19304
19305         * literal.cs: Oops.  Not good, Emit of short access values should
19306         pass (Bytes) or the wrong argument will be selected.
19307
19308         * expression.cs (Unary::Emit): Emit code for -expr.
19309
19310         (Unary::ResolveOperator): Handle `Substract' for non-constants
19311         (substract from zero from the non-constants).
19312         Deal with Doubles as well. 
19313
19314         (Expression::ConvertImplicitRequired): New routine that reports an
19315         error if no implicit conversion exists. 
19316
19317         (Invocation::OverloadResolve): Store the converted implicit
19318         expressions if we make them
19319
19320 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19321
19322         * class.cs (ConstructorInitializer): Take a Location argument.
19323         (ConstructorBaseInitializer): Same here.
19324         (ConstructorThisInitializer): Same here.
19325
19326         * cs-parser.jay : Update all calls accordingly.
19327
19328         * expression.cs (Unary, Binary, New): Take location argument.
19329         Update accordingly everywhere.
19330
19331         * cs-parser.jay : Update all calls to the above to take a location
19332         argument.
19333
19334         * class.cs : Ditto.
19335
19336 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19337
19338         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19339         (Invocation::BetterConversion): Same here
19340         (Invocation::ConversionExists): Ditto.
19341
19342         (Invocation::ConversionExists): Implement.
19343
19344 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19345
19346         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19347         Also take an additional TypeContainer argument.
19348
19349         * All over : Pass in TypeContainer as argument to OverloadResolve.
19350
19351         * typemanager.cs (CSharpName): Update to check for the string type and return
19352         that too.
19353
19354         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19355         a given method.
19356
19357 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19358
19359         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19360         (Invocation::BetterFunction): Implement.
19361         (Invocation::BetterConversion): Implement.
19362         (Invocation::ConversionExists): Skeleton, no implementation yet.
19363
19364         Okay, things work fine !
19365
19366 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19367
19368         * typemanager.cs: declare and load enum_type, delegate_type and
19369         void_type. 
19370
19371         * expression.cs (Expression::Emit): Now emit returns a value that
19372         tells whether a value is left on the stack or not.  This strategy
19373         might be reveted tomorrow with a mechanism that would address
19374         multiple assignments.
19375         (Expression::report118): Utility routine to report mismatches on
19376         the ExprClass.
19377
19378         (Unary::Report23): Report impossible type/operator combination
19379         utility function.
19380
19381         (Unary::IsIncrementableNumber): Whether the type can be
19382         incremented or decremented with add.
19383         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19384         complemented. 
19385         (Unary::ResolveOperator): Implement ++, !, ~,
19386
19387         (Invocation::Emit): Deal with new Emit convetion.
19388
19389         * All Expression derivatives: Updated their Emit method to return
19390         whether they leave values on the stack or not.
19391
19392         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19393         stack for expressions that are statements. 
19394
19395 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19396
19397         * expression.cs (LValue): New interface.  Must be implemented by
19398         LValue objects.
19399         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19400         LValue interface.
19401
19402         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19403         interface for generating code, simplifies the code.
19404
19405 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19406
19407         * expression.cs (everywhere): Comment out return statements in ::Resolve
19408         methods to avoid the warnings.
19409
19410 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19411
19412         * driver.cs (parse): Report error 2001 if we can not open the
19413         source file.
19414
19415         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19416         not resolve it.
19417
19418         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19419         object. 
19420
19421         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19422         otherwise nested blocks end up with the same index.
19423
19424         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19425
19426         * expression.cs:  Instead of having FIXMEs in the Resolve
19427         functions, throw exceptions so it is obvious that we are facing a
19428         bug. 
19429
19430         * cs-parser.jay (invocation_expression): Pass Location information.
19431
19432         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19433         Use a basename for those routines because .NET does not like paths
19434         on them. 
19435
19436         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19437         already defined.
19438
19439 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19440
19441         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19442         are loading the correct data types (throws an exception if not).
19443         (TypeManager::InitCoreTypes): Use CoreLookupType
19444
19445         * expression.cs (Unary::ResolveOperator): return the child
19446         expression for expressions which are just +expr.
19447         (Unary::ResolveOperator): Return negative literals for -LITERAL
19448         expressions (otherwise they are Unary {Literal}).
19449         (Invocation::Badness): Take into account `Implicit constant
19450         expression conversions'.
19451
19452         * literal.cs (LongLiteral): Implement long literal class.
19453         (IntLiteral): export the `Value' of the intliteral. 
19454
19455 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19456
19457         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19458
19459         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19460         instead of 'Operator'
19461
19462         * expression.cs (Binary::ResolveOperator): Update accordingly.
19463         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19464         and 'Minus'
19465
19466         * cs-parser.jay (unary_expression): Update to use the new names.
19467
19468         * gen-treedump.cs (GetUnary): Same here.
19469
19470         * expression.cs (Unary::Resolve): Implement.
19471         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19472         operators are found instead of making noise ;-)
19473         (Unary::ResolveOperator): New method to do precisely the same thing which
19474         Binary::ResolveOperator does for Binary expressions.
19475         (Unary.method, .Arguments): Add.
19476         (Unary::OperName): Implement.   
19477         (Unary::ForceConversion): Copy and Paste !
19478
19479         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19480         a unary operator.
19481
19482         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19483         for the inbuilt operators. Only overloading works for now ;-)
19484
19485 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19486
19487         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19488         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19489
19490         * expression.cs (This::Emit): Implement. 
19491         (This::Resolve): Implement.
19492         (TypeOf:Resolve): Implement.
19493         (Expression::ResolveSimpleName): Add an implicit this to instance
19494         field references. 
19495         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19496         Bind instance variable to Field expressions.
19497         (FieldExpr::Instance): New field used to track the expression that
19498         represents the object instance.
19499         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19500         binding 
19501         (FieldExpr::Emit): Implement.
19502
19503         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19504         the last instruction contains a return opcode to avoid generating
19505         the last `ret' instruction (this generates correct code, and it is
19506         nice to pass the peverify output).
19507
19508         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19509         initializer for static and instance variables.
19510         (Constructor::Emit): Allow initializer to be null in the case of
19511         static constructors.  Only emit initializer for instance
19512         constructors. 
19513
19514         (TypeContainer::FindMembers): Return a null array if there are no
19515         matches.
19516
19517         Also fix the code for the MemberTypes.Method branch, as it was not
19518         scanning that for operators (or tried to access null variables before).
19519
19520         * assign.cs (Assign::Emit): Handle instance and static fields. 
19521
19522         * TODO: Updated.
19523
19524         * driver.cs: Stop compilation if there are parse errors.
19525
19526         * cs-parser.jay (constructor_declaration): Provide default base
19527         initializer for non-static constructors.
19528         (constructor_declarator): Do not provide a default base
19529         initializers if none was specified.
19530         Catch the fact that constructors should not have parameters.
19531
19532         * class.cs: Do not emit parent class initializers for static
19533         constructors, that should be flagged as an error.
19534
19535 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19536
19537         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19538         Move back code into TypeContainer::Populate.
19539
19540 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19541
19542         * class.cs (TypeContainer::AddConstructor): Fix the check to
19543         compare against Name, not Basename. 
19544         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19545
19546         * cs-parser.jay : Update accordingly.
19547
19548         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19549         for methods, don't forget to look into the operators too.
19550         (RegisterMethodBuilder): Helper method to take care of this for
19551         methods, constructors and operators.
19552         (Operator::Define): Completely revamp.
19553         (Operator.OperatorMethod, MethodName): New fields.
19554         (TypeContainer::Populate): Move the registering of builders into
19555         RegisterMethodBuilder.
19556         (Operator::Emit): Re-write.
19557
19558         * expression.cs (Binary::Emit): Comment out code path to emit method
19559         invocation stuff for the case when we have a user defined operator. I am
19560         just not able to get it right !
19561
19562 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19563
19564         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19565         argument. 
19566
19567         (Expression::MemberLookup): Provide a version that allows to
19568         specify the MemberTypes and BindingFlags. 
19569
19570         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19571         so it was not fetching variable information from outer blocks.
19572
19573         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19574         Beforefieldinit as it was buggy.
19575
19576         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19577         that Ravi put here.  
19578
19579         * class.cs (Constructor::Emit): Only emit if block is not null.
19580         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19581         deal with this by semantically definining it as if the user had
19582         done it.
19583
19584         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19585         constructors as we now "emit" them at a higher level.
19586
19587         (TypeContainer::DefineDefaultConstructor): Used to define the
19588         default constructors if none was provided.
19589
19590         (ConstructorInitializer): Add methods Resolve and Emit. 
19591
19592         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19593
19594 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19595
19596         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19597         the default constructor builder with our hashtable for methodbuilders
19598         to methodcores.
19599
19600         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19601         and argument_count is 0 in which case we have a match.
19602         (Binary::ResolveOperator): More null checking and miscellaneous coding
19603         style cleanup.
19604
19605 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19606
19607         * rootcontext.cs (IsNameSpace): Compare against null.
19608
19609         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19610
19611         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19612         and Unary::Operator.
19613
19614         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19615         accordingly.
19616
19617         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19618         we have overloaded operators.
19619         (Binary::ResolveOperator): Implement the part which does the operator overload
19620         resolution.
19621
19622         * class.cs (Operator::Emit): Implement.
19623         (TypeContainer::Emit): Emit the operators we have too.
19624
19625         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19626         the case when we have a user-defined operator.
19627
19628 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19629
19630         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19631
19632 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19633
19634         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19635         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19636         (Constructor::Emit): Implement.
19637         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19638         if we have no work to do. 
19639         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19640         Emit method.
19641
19642         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19643         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19644
19645         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19646         of parent.parent.
19647
19648 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19649
19650         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19651         in the source.
19652         (Tree::RecordNamespace): Method to do what the name says ;-)
19653         (Tree::Namespaces): Property to get at the namespaces hashtable.
19654
19655         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19656         keep track.
19657
19658         * rootcontext.cs (IsNamespace): Fixed it :-)
19659
19660 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19661
19662         * class.cs (TypeContainer::FindMembers): Add support for
19663         constructors. 
19664         (MethodCore): New class that encapsulates both the shared aspects
19665         of a Constructor and a Method.  
19666         (Method, Constructor): Factored pieces into MethodCore.
19667
19668         * driver.cs: Added --fatal which makes errors throw exceptions.
19669         Load System assembly as well as part of the standard library.
19670
19671         * report.cs: Allow throwing exceptions on errors for debugging.
19672
19673         * modifiers.cs: Do not use `parent', instead use the real type
19674         container to evaluate permission settings.
19675
19676         * class.cs: Put Ravi's patch back in.  He is right, and we will
19677         have to cope with the
19678
19679 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19680
19681         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19682         FamORAssem, not FamANDAssem.
19683
19684 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19685
19686         * driver.cs: Added --parse option that only parses its input files
19687         and terminates.
19688
19689         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19690         incorrect.  IsTopLevel is not used to tell whether an object is
19691         root_types or not (that can be achieved by testing this ==
19692         root_types).  But to see if this is a top-level *class* (not
19693         necessarly our "toplevel" container). 
19694
19695 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19696
19697         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19698         parent instead of a direct call to GetType.
19699
19700 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19701
19702         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19703         Modifiers.TypeAttr. This should just be a call to that method.
19704
19705         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19706         object so that we can determine if we are top-level or not.
19707
19708         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19709         TypeContainer too.
19710
19711         * enum.cs (Enum::Define): Ditto.
19712
19713         * modifiers.cs (FieldAttr): Re-write.
19714
19715         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19716         (TypeContainer::HaveStaticConstructor): New property to provide access
19717         to precisely that info.
19718
19719         * modifiers.cs (MethodAttr): Re-write.
19720         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19721
19722         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19723         of top-level types as claimed.
19724
19725 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19726
19727         * expression.cs (MemberLookup): Fruitless attempt to lookup
19728         constructors.  Maybe I need to emit default constructors?  That
19729         might be it (currently .NET emits this for me automatically).
19730         (Invocation::OverloadResolve): Cope with Arguments == null.
19731         (Invocation::EmitArguments): new function, shared by the new
19732         constructor and us.
19733         (Invocation::Emit): Handle static and instance methods.  Emit
19734         proper call instruction for virtual or non-virtual invocations.
19735         (New::Emit): Implement.
19736         (New::Resolve): Implement.
19737         (MemberAccess:Resolve): Implement.
19738         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19739         to track instances.
19740         (FieldExpr::Resolve): Set type.
19741
19742         * support.cs: Handle empty arguments.
19743                 
19744         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19745         SimpleLookup): Auxiliary routines to help parse a qualifier
19746         identifier.  
19747
19748         Update qualifier_identifier rule.
19749
19750         * codegen.cs: Removed debugging messages.
19751
19752         * class.cs: Make this a global thing, this acts just as a "key" to
19753         objects that we might have around.
19754
19755         (Populate): Only initialize method_builders_to_methods once.
19756
19757         * expression.cs (PropertyExpr): Initialize type from the
19758         PropertyType. 
19759
19760         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19761         Resolve pattern.  Attempt to implicitly convert value to boolean.
19762         Emit code.
19763
19764         * expression.cs: Set the type for the int32/int32 argument case.
19765         (Binary::ResolveOperator): Set the return type to boolean for
19766         comparission operators
19767
19768         * typemanager.cs: Remove debugging print code.
19769
19770         (Invocation::Resolve): resolve type.
19771
19772         * class.cs: Allocate a MemberInfo of the correct size, as the code
19773         elsewhere depends on the test to reflect the correct contents.
19774
19775         (Method::) Keep track of parameters, due to System.Reflection holes
19776
19777         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19778         mapping here.
19779
19780         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19781         of the exact size and return that.
19782
19783         (Class::LookupMethodByBuilder): New function that maps
19784         MethodBuilders to its methods.  Required to locate the information
19785         on methods because System.Reflection bit us again.
19786
19787         * support.cs: New file, contains an interface ParameterData and
19788         two implementations: ReflectionParameters and InternalParameters
19789         used to access Parameter information.  We will need to grow this
19790         as required.
19791
19792         * expression.cs (Invocation::GetParameterData): implement a cache
19793         and a wrapper around the ParameterData creation for methods. 
19794         (Invocation::OverloadResolve): Use new code.
19795
19796 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19797
19798         * class.cs (TypeContainer::EmitField): Remove and move into 
19799         (Field::Define): here and modify accordingly.
19800         (Field.FieldBuilder): New member.
19801         (TypeContainer::Populate): Update accordingly.
19802         (TypeContainer::FindMembers): Implement.
19803
19804 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19805
19806         * statement.cs: (VariableInfo::VariableType): New field to be
19807         initialized with the full type once it is resolved. 
19808
19809 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19810
19811         * parameter.cs (GetParameterInfo): Use a type cache to compute
19812         things only once, and to reuse this information
19813
19814         * expression.cs (LocalVariableReference::Emit): Implement.
19815         (OpcodeCast::Emit): fix.
19816
19817         (ParameterReference::Resolve): Implement.
19818         (ParameterReference::Emit): Implement.
19819
19820         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19821         that are expressions need to stay as Expressions.
19822
19823         * typemanager.cs (CSharpName): Returns the C# name of a type if
19824         possible. 
19825
19826         * expression.cs (Expression::ConvertImplicit): New function that
19827         implements implicit type conversions.
19828
19829         (Expression::ImplicitReferenceConversion): Implements implicit
19830         reference conversions.
19831
19832         (EmptyCast): New type for transparent casts.
19833
19834         (OpcodeCast): New type for casts of types that are performed with
19835         a sequence of bytecodes.
19836
19837         (BoxedCast): New type used for casting value types into reference
19838         types.  Emits a box opcode.
19839
19840         (Binary::DoNumericPromotions): Implements numeric promotions of
19841         and computation of the Binary::Type.
19842
19843         (Binary::EmitBranchable): Optimization.
19844
19845         (Binary::Emit): Implement code emission for expressions.
19846
19847         * typemanager.cs (TypeManager): Added two new core types: sbyte
19848         and byte.
19849
19850 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19851
19852         * class.cs (TypeContainer::FindMembers): Method which does exactly
19853         what Type.FindMembers does, only we don't have to use reflection. No
19854         implementation yet.
19855
19856         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19857         typecontainer objects as we need to get at them.
19858         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19859
19860         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19861         typecontainer object.
19862
19863         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19864         of just a Report object.
19865
19866 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19867
19868         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19869         "remove_"
19870         (TypeContainer::Populate): Now define the delegates of the type too.
19871         (TypeContainer.Delegates): Property to access the list of delegates defined
19872         in the type.
19873
19874         * delegates.cs (Delegate::Define): Implement partially.
19875
19876         * modifiers.cs (TypeAttr): Handle more flags.
19877
19878 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19879
19880         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19881         and not <=
19882         (Operator::Define): Re-write logic to get types by using the LookupType method
19883         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19884         (Indexer::Define): Ditto.
19885         (Event::Define): Ditto.
19886         (Property::Define): Ditto.
19887
19888 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19889
19890         * class.cs (TypeContainer::Populate): Now define operators too. 
19891         (TypeContainer.Operators): New property to access the list of operators
19892         in a type.
19893         (Operator.OperatorMethodBuilder): New member to hold the method builder
19894         for the operator we are defining.
19895         (Operator::Define): Implement.
19896
19897 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19898
19899         * class.cs (Event::Define): Make the prefixes of the accessor methods
19900         addOn_ and removeOn_ 
19901
19902         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19903         of the location being passed in too. Ideally, this should go later since all
19904         error reporting should be done through the Report object.
19905
19906         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19907         (Populate): Iterate thru the indexers we have and define them too.
19908         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19909         for the get and set accessors.
19910         (Indexer::Define): Implement.
19911
19912 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19913
19914         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19915         my previous implementation, did not work.
19916
19917         * typemanager.cs: Add a couple of missing types (the longs).
19918
19919         * literal.cs: Use TypeManager.bool_type instead of getting it.
19920
19921         * expression.cs (EventExpr): New kind of expressions.
19922         (Expressio::ExprClassFromMemberInfo): finish
19923
19924 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19925
19926         * assign.cs: Emit stores to static fields differently.
19927
19928 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19929
19930         * Merge in changes and adjust code to tackle conflicts. Backed out my
19931         code in Assign::Resolve ;-) 
19932
19933 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19934
19935         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19936         instead Report.Error and also pass in the location.
19937         (CSharpParser::Lexer): New readonly property to return the reference
19938         to the Tokenizer object.
19939         (declare_local_variables): Use Report.Error with location instead of plain 
19940         old error.
19941         (CheckDef): Ditto.
19942
19943         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19944         (Operator.CheckBinaryOperator): Ditto.
19945
19946         * cs-parser.jay (operator_declarator): Update accordingly.
19947
19948         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19949         (CheckBinaryOperator): Same here.
19950
19951         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19952         on the name without any prefixes of namespace names etc. This is because we
19953         already might have something already fully qualified like 
19954         'System.Console.WriteLine'
19955
19956         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19957
19958 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19959
19960         * cs-tokenizer.cs (location): Return a string which also contains
19961         the file name.
19962
19963         * expression.cs (ElementAccess): New class for expressions of the
19964         type 'element access.'
19965         (BaseAccess): New class for expressions of the type 'base access.'
19966         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19967         respectively.
19968
19969         * cs-parser.jay (element_access): Implement action.
19970         (base_access): Implement actions.
19971         (checked_expression, unchecked_expression): Implement.
19972
19973         * cs-parser.jay (local_variable_type): Correct and implement.
19974         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19975
19976         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19977
19978         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19979         name and the specifiers.
19980
19981         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19982
19983         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19984         making them all public ;-)
19985
19986         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19987         class anyways.
19988
19989 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19990
19991         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19992         PropertyExprs.
19993         (FieldExpr, PropertyExprs): New resolved expressions.
19994         (SimpleName::MemberStaticCheck): Perform static checks for access
19995         to non-static fields on static methods. Maybe this should be
19996         generalized for MemberAccesses. 
19997         (SimpleName::ResolveSimpleName): More work on simple name
19998         resolution. 
19999
20000         * cs-parser.jay (primary_expression/qualified_identifier): track
20001         the parameter index.
20002
20003         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20004         (EmitContext::EmitBoolExpression): Chain to expression generation
20005         instead of temporary hack.
20006         (::EmitStatementExpression): Put generic expression code generation.
20007
20008         * assign.cs (Assign::Emit): Implement variable assignments to
20009         local variables, parameters and fields.
20010
20011 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20012
20013         * statement.cs (Block::GetVariableInfo): New method, returns the
20014         VariableInfo for a variable name in a block.
20015         (Block::GetVariableType): Implement in terms of GetVariableInfo
20016
20017         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20018         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20019
20020 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20021
20022         * cs-parser.jay (operator_declaration): Continue on my quest : update
20023         to take attributes argument.
20024         (event_declaration): Ditto.
20025         (enum_declaration): Ditto.
20026         (indexer_declaration): Ditto.
20027
20028         * class.cs (Operator::Operator): Update constructor accordingly.
20029         (Event::Event): Ditto.
20030
20031         * delegate.cs (Delegate::Delegate): Same here.
20032
20033         * enum.cs (Enum::Enum): Same here.
20034
20035 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20036
20037         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20038
20039         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20040
20041         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20042         being passed around as an arraylist.
20043         (Attributes::AddAttribute): Method to add attribute sections.
20044
20045         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20046         (struct_declaration): Update accordingly.
20047         (constant_declaration): Update.
20048         (field_declaration): Update.
20049         (method_header): Update.
20050         (fixed_parameter): Update.
20051         (parameter_array): Ditto.
20052         (property_declaration): Ditto.
20053         (destructor_declaration): Ditto.
20054
20055         * class.cs (Struct::Struct): Update constructors accordingly.
20056         (Class::Class): Ditto.
20057         (Field::Field): Ditto.
20058         (Method::Method): Ditto.
20059         (Property::Property): Ditto.
20060         (TypeContainer::OptAttribute): update property's return type.
20061
20062         * interface.cs (Interface.opt_attributes): New member.
20063         (Interface::Interface): Update to take the extra Attributes argument.
20064
20065         * parameter.cs (Parameter::Parameter): Ditto.
20066
20067         * constant.cs (Constant::Constant): Ditto.
20068
20069         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20070         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20071         the attributes as a parameter.
20072         (InterfaceProperty): Update constructor call.
20073         (InterfaceEvent): Ditto.
20074         (InterfaceMethod): Ditto.
20075         (InterfaceIndexer): Ditto.
20076
20077         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20078         pass the attributes too.
20079         (interface_event_declaration): Ditto.
20080         (interface_property_declaration): Ditto.
20081         (interface_method_declaration): Ditto.
20082         (interface_declaration): Ditto.
20083
20084 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20085
20086         * class.cs (Method::Define): Track the "static Main" definition to
20087         create an entry point. 
20088
20089         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20090         EntryPoint if we find it. 
20091
20092         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20093         (EmitContext::ig): Make this variable public.
20094
20095         * driver.cs: Make the default output file be the first file name
20096         with the .exe extension.  
20097
20098         Detect empty compilations
20099
20100         Handle various kinds of output targets.  Handle --target and
20101         rename -t to --dumper.
20102
20103         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20104         methods inherited from Expression return now an Expression.  This
20105         will is used during the tree rewriting as we resolve them during
20106         semantic analysis.
20107
20108         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20109         the spec.  Missing entirely is the information about
20110         accessability of elements of it.
20111
20112         (Expression::ExprClassFromMemberInfo): New constructor for
20113         Expressions that creates a fully initialized Expression based on
20114         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20115         a Type.
20116
20117         (Invocation::Resolve): Begin implementing resolution of invocations.
20118
20119         * literal.cs (StringLiteral):  Implement Emit.
20120
20121 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20122
20123         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20124         member.
20125
20126 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20127
20128         * cs-parser.jay (attribute_arguments): Implement actions.
20129         (attribute): Fix bug in production. Implement action.
20130         (attribute_list): Implement.
20131         (attribute_target): Implement.
20132         (attribute_target_specifier, opt_target_specifier): Implement
20133         (CheckAttributeTarget): New method to check if the attribute target
20134         is valid.
20135         (attribute_section): Implement.
20136         (opt_attributes): Implement.
20137
20138         * attribute.cs : New file to handle attributes.
20139         (Attribute): Class to hold attribute info.
20140
20141         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20142         (attribute_section): Modify production to use 2 different rules to 
20143         achieve the same thing. 1 s/r conflict down !
20144         Clean out commented, useless, non-reducing dimension_separator rules.
20145
20146         * class.cs (TypeContainer.attributes): New member to hold list
20147         of attributes for a type.
20148         (Struct::Struct): Modify to take one more argument, the attribute list.
20149         (Class::Class): Ditto.
20150         (Field::Field): Ditto.
20151         (Method::Method): Ditto.
20152         (Property::Property): Ditto.
20153
20154         * cs-parser.jay (struct_declaration): Update constructor call to
20155         pass in the attributes too.
20156         (class_declaration): Ditto.
20157         (constant_declaration): Ditto.
20158         (field_declaration): Ditto.
20159         (method_header): Ditto.
20160         (fixed_parameter): Ditto.
20161         (parameter_array): Ditto.
20162         (property_declaration): Ditto.
20163
20164         * constant.cs (Constant::Constant): Update constructor similarly.
20165         Use System.Collections.
20166
20167         * parameter.cs (Parameter::Parameter): Update as above.
20168
20169 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20170
20171         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20172         (TypeContainer.delegates): New member to hold list of delegates.
20173
20174         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20175         this time as I seem to be on crack ;-)
20176
20177 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20178
20179         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20180         tell whether an identifier represents a namespace.
20181
20182         * expression.cs (NamespaceExpr): A namespace expression, used only
20183         temporarly during expression resolution.
20184         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20185         utility functions to resolve names on expressions.
20186
20187 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20188
20189         * codegen.cs: Add hook for StatementExpressions. 
20190
20191         * class.cs: Fix inverted test for static flag in methods.
20192
20193 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20194
20195         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20196         to make it coincide with MS' number.
20197         (Operator::CheckBinaryOperator): Ditto.
20198
20199         * ../errors/errors.txt : Remove error numbers added earlier.
20200
20201         * ../errors/cs1019.cs : Test case for error # 1019
20202
20203         * ../errros/cs1020.cs : Test case for error # 1020
20204
20205         * cs-parser.jay : Clean out commented cruft.
20206         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20207         used anywhere - non-reducing rule.
20208         (namespace_declarations): Non-reducing rule - comment out.
20209
20210         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20211         with TypeContainer::AddEnum.
20212
20213         * delegate.cs : New file for delegate handling classes.
20214         (Delegate): Class for declaring delegates.
20215
20216         * makefile : Update.
20217
20218         * cs-parser.jay (delegate_declaration): Implement.
20219
20220 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20221
20222         * class.cs (Event::Define): Implement.
20223         (Event.EventBuilder): New member.
20224
20225         * class.cs (TypeContainer::Populate): Update to define all enums and events
20226         we have.
20227         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20228         readonly fields for all these cases ?
20229
20230 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20231
20232         * class.cs (Property): Revamp to use the convention of making fields readonly.
20233         Accordingly modify code elsewhere.
20234
20235         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20236         the Define method of the Property class.
20237
20238         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20239         trivial bug.
20240         (TypeContainer::Populate): Update to define all the properties we have. Also
20241         define all enumerations.
20242
20243         * enum.cs (Define): Implement.
20244
20245 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20246
20247         * cs-parser.jay (overloadable_operator): The semantic value is an
20248         enum of the Operator class.
20249         (operator_declarator): Implement actions.
20250         (operator_declaration): Implement.
20251
20252         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20253         validity of definitions.
20254         (Operator::CheckBinaryOperator): Static method to check for binary operators
20255         (TypeContainer::AddOperator): New method to add an operator to a type.
20256
20257         * cs-parser.jay (indexer_declaration): Added line to actually call the
20258         AddIndexer method so it gets added ;-)
20259
20260         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20261         already taken care of by the MS compiler ?  
20262
20263 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20264
20265         * class.cs (Operator): New class for operator declarations.
20266         (Operator::OpType): Enum for the various operators.
20267
20268 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20269
20270         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20271         ostensibly handle this in semantic analysis.
20272
20273         * cs-parser.jay (general_catch_clause): Comment out
20274         (specific_catch_clauses, specific_catch_clause): Ditto.
20275         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20276         (catch_args, opt_catch_args): New productions.
20277         (catch_clause): Rewrite to use the new productions above
20278         (catch_clauses): Modify accordingly.
20279         (opt_catch_clauses): New production to use in try_statement
20280         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20281         and re-write the code in the actions to extract the specific and
20282         general catch clauses by being a little smart ;-)
20283
20284         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20285         Hooray, try and catch statements parse fine !
20286
20287 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20288
20289         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20290         string from the hashtable of variables.
20291
20292         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20293         I end up making that mistake ;-)
20294         (catch_clauses): Fixed gross error which made Key and Value of the 
20295         DictionaryEntry the same : $1 !!
20296
20297 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20298
20299         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20300
20301         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20302         when the add and remove accessors are specified. 
20303
20304 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20305
20306         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20307         information about indexer_declarator.
20308         (indexer_declarator): Implement actions.
20309         (parsing_indexer): New local boolean used to keep track of whether
20310         we are parsing indexers or properties. This is necessary because 
20311         implicit_parameters come into picture even for the get accessor in the 
20312         case of an indexer.
20313         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20314
20315         * class.cs (Indexer): New class for indexer declarations.
20316         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20317         (TypeContainer::indexers): New member to hold list of indexers for the
20318         type.
20319
20320 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20321
20322         * cs-parser.jay (add_accessor_declaration): Implement action.
20323         (remove_accessor_declaration): Implement action.
20324         (event_accessors_declaration): Implement
20325         (variable_declarators): swap statements for first rule - trivial.
20326
20327         * class.cs (Event): New class to hold information about event
20328         declarations.
20329         (TypeContainer::AddEvent): New method to add an event to a type
20330         (TypeContainer::events): New member to hold list of events.
20331
20332         * cs-parser.jay (event_declaration): Implement actions.
20333
20334 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20335
20336         * cs-parser.jay (dim_separators): Implement. Make it a string
20337         concatenating all the commas together, just as they appear.
20338         (opt_dim_separators): Modify accordingly
20339         (rank_specifiers): Update accordingly. Basically do the same
20340         thing - instead, collect the brackets here.
20341         (opt_rank_sepcifiers): Modify accordingly.
20342         (array_type): Modify to actually return the complete type string
20343         instead of ignoring the rank_specifiers.
20344         (expression_list): Implement to collect the expressions
20345         (variable_initializer): Implement. We make it a list of expressions
20346         essentially so that we can handle the array_initializer case neatly too.
20347         (variable_initializer_list): Implement.
20348         (array_initializer): Make it a list of variable_initializers
20349         (opt_array_initializer): Modify accordingly.
20350
20351         * expression.cs (New::NType): Add enumeration to help us
20352         keep track of whether we have an object/delegate creation
20353         or an array creation.
20354         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20355         members to hold data about array creation.
20356         (New:New): Modify to update NewType
20357         (New:New): New Overloaded contructor for the array creation
20358         case.
20359
20360         * cs-parser.jay (array_creation_expression): Implement to call
20361         the overloaded New constructor.
20362
20363 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20364
20365         * class.cs (TypeContainer::Constructors): Return member
20366         constructors instead of returning null.
20367
20368 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20369
20370         * typemanager.cs (InitCoreTypes): Initialize the various core
20371         types after we have populated the type manager with the user
20372         defined types (this distinction will be important later while
20373         compiling corlib.dll)
20374
20375         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20376         on Expression Classification.  Now all expressions have a method
20377         `Resolve' and a method `Emit'.
20378
20379         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20380         generation from working.     Also add some temporary debugging
20381         code. 
20382
20383 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20384
20385         * codegen.cs: Lots of code generation pieces.  This is only the
20386         beginning, will continue tomorrow with more touches of polish.  We
20387         handle the fundamentals of if, while, do, for, return.  Others are
20388         trickier and I need to start working on invocations soon.
20389
20390         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20391         s.InitStatement. 
20392
20393         * codegen.cs (EmitContext): New struct, used during code
20394         emission to keep a context.   Most of the code generation will be
20395         here. 
20396
20397         * cs-parser.jay: Add embedded blocks to the list of statements of
20398         this block.  So code generation proceeds in a top down fashion.
20399
20400 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20401
20402         * statement.cs: Add support for multiple child blocks.
20403
20404 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20405
20406         * codegen.cs (EmitCode): New function, will emit the code for a
20407         Block of code given a TypeContainer and its ILGenerator. 
20408
20409         * statement.cs (Block): Standard public readonly optimization.
20410         (Block::Block constructors): Link children. 
20411         (Block::Child): Child Linker.
20412         (Block::EmitVariables): Emits IL variable declarations.
20413
20414         * class.cs: Drop support for MethodGroups here, delay until
20415         Semantic Analysis.
20416         (Method::): Applied the same simplification that I did before, and
20417         move from Properties to public readonly fields.
20418         (Method::ParameterTypes): Returns the parameter types for the
20419         function, and implements a cache that will be useful later when I
20420         do error checking and the semantic analysis on the methods is
20421         performed.
20422         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20423         and made a method, optional argument tells whether this is a class
20424         or a structure to apply the `has-this' bit.
20425         (Method::GetCallingConvention): Implement, returns the calling
20426         convention. 
20427         (Method::Define): Defines the type, a second pass is performed
20428         later to populate the methods.
20429
20430         (Constructor::ParameterTypes): implement a cache similar to the
20431         one on Method::ParameterTypes, useful later when we do semantic
20432         analysis. 
20433
20434         (TypeContainer::EmitMethod):  New method.  Emits methods.
20435
20436         * expression.cs: Removed MethodGroup class from here.
20437
20438         * parameter.cs (Parameters::GetCallingConvention): new method.
20439
20440 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20441
20442         * class.cs (TypeContainer::Populate): Drop RootContext from the
20443         argument. 
20444
20445         (Constructor::CallingConvention): Returns the calling convention.
20446         (Constructor::ParameterTypes): Returns the constructor parameter
20447         types. 
20448
20449         (TypeContainer::AddConstructor): Keep track of default constructor
20450         and the default static constructor.
20451
20452         (Constructor::) Another class that starts using `public readonly'
20453         instead of properties. 
20454
20455         (Constructor::IsDefault): Whether this is a default constructor. 
20456
20457         (Field::) use readonly public fields instead of properties also.
20458
20459         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20460         track of static constructors;  If none is used, turn on
20461         BeforeFieldInit in the TypeAttributes. 
20462
20463         * cs-parser.jay (opt_argument_list): now the return can be null
20464         for the cases where there are no arguments. 
20465
20466         (constructor_declarator): If there is no implicit `base' or
20467         `this', then invoke the default parent constructor. 
20468
20469         * modifiers.cs (MethodAttr): New static function maps a set of
20470         modifiers flags into a MethodAttributes enum
20471         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20472         MethodAttr, TypeAttr to represent the various mappings where the
20473         modifiers are used.
20474         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20475
20476 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20477
20478         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20479         method arguments.
20480
20481         * interface.cs (PopulateIndexer): Implemented the code generator
20482         for interface indexers.
20483
20484 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20485
20486         * interface.cs (InterfaceMemberBase): Now we track the new status
20487         here.  
20488
20489         (PopulateProperty): Implement property population.  Woohoo!  Got
20490         Methods and Properties going today. 
20491
20492         Removed all the properties for interfaces, and replaced them with
20493         `public readonly' fields. 
20494
20495 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20496
20497         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20498         initialize their hashtables/arraylists only when they are needed
20499         instead of doing this always.
20500
20501         * parameter.cs: Handle refs and out parameters.
20502
20503         * cs-parser.jay: Use an ArrayList to construct the arguments
20504         instead of the ParameterCollection, and then cast that to a
20505         Parameter[] array.
20506
20507         * parameter.cs: Drop the use of ParameterCollection and use
20508         instead arrays of Parameters.
20509
20510         (GetParameterInfo): Use the Type, not the Name when resolving
20511         types. 
20512
20513 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20514
20515         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20516         and instead use public readonly fields.
20517
20518         * class.cs: Put back walking code for type containers.
20519
20520 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20521
20522         * class.cs (MakeConstant): Code to define constants.
20523
20524         * rootcontext.cs (LookupType): New function.  Used to locate types 
20525
20526
20527 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20528
20529         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20530         this System.Reflection code is.  Kudos to Microsoft
20531
20532         * typemanager.cs: Implement a type cache and avoid loading all
20533         types at boot time.  Wrap in LookupType the internals.  This made
20534         the compiler so much faster.  Wow.  I rule!
20535
20536         * driver.cs: Make sure we always load mscorlib first (for
20537         debugging purposes, nothing really important).
20538
20539         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20540         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20541
20542         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20543         on namespaces that have been imported using the `using' keyword.
20544
20545         * class.cs (TypeContainer::TypeAttr): Virtualize.
20546         (Class::TypeAttr): Return attributes suitable for this bad boy.
20547         (Struct::TypeAttr): ditto.
20548         Handle nested classes.
20549         (TypeContainer::) Remove all the type visiting code, it is now
20550         replaced with the rootcontext.cs code
20551
20552         * rootcontext.cs (GetClassBases): Added support for structs. 
20553
20554 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20555
20556         * interface.cs, statement.cs, class.cs, parameter.cs,
20557         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20558         Drop use of TypeRefs, and use strings instead.
20559
20560 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20561
20562         * rootcontext.cs: 
20563
20564         * class.cs (Struct::Struct): set the SEALED flags after
20565         checking the modifiers.
20566         (TypeContainer::TypeAttr): new property, returns the
20567         TypeAttributes for a class.  
20568
20569         * cs-parser.jay (type_list): Oops, list production was creating a
20570         new list of base types.
20571
20572         * rootcontext.cs (StdLib): New property.
20573         (GetInterfaceTypeByName): returns an interface by type name, and
20574         encapsulates error handling here.
20575         (GetInterfaces): simplified.
20576         (ResolveTree): Encapsulated all the tree resolution here.
20577         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20578         types. 
20579
20580         * driver.cs: Add support for --nostdlib, to avoid loading the
20581         default assemblies.
20582         (Main): Do not put tree resolution here. 
20583
20584         * rootcontext.cs: Beginning of the class resolution.
20585
20586 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20587
20588         * rootcontext.cs: Provide better error reporting. 
20589
20590         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20591
20592         * rootcontext.cs (CreateInterface): Handle the case where there
20593         are no parent interfaces.
20594
20595         (CloseTypes): Routine to flush types at the end.
20596         (CreateInterface): Track types.
20597         (GetInterfaces): Returns an array of Types from the list of
20598         defined interfaces.
20599
20600         * typemanager.c (AddUserType): Mechanism to track user types (puts
20601         the type on the global type hash, and allows us to close it at the
20602         end). 
20603
20604 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20605
20606         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20607         RecordInterface instead.
20608
20609         * cs-parser.jay: Updated to reflect changes above.
20610
20611         * decl.cs (Definition): Keep track of the TypeBuilder type that
20612         represents this type here.  Not sure we will use it in the long
20613         run, but wont hurt for now.
20614
20615         * driver.cs: Smaller changes to accomodate the new code.
20616
20617         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20618         when done. 
20619
20620         * rootcontext.cs (CreateInterface):  New method, used to create
20621         the System.TypeBuilder type for interfaces.
20622         (ResolveInterfaces): new entry point to resolve the interface
20623         hierarchy. 
20624         (CodeGen): Property, used to keep track of the code generator.
20625
20626 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20627
20628         * cs-parser.jay: Add a second production for delegate_declaration
20629         with `VOID'.
20630
20631         (enum_body): Put an opt_comma here instead of putting it on
20632         enum_body or enum_member_declarations so we can handle trailing
20633         commas on enumeration members.  Gets rid of a shift/reduce.
20634
20635         (type_list): Need a COMMA in the middle.
20636
20637         (indexer_declaration): Tell tokenizer to recognize get/set
20638
20639         * Remove old targets.
20640
20641         * Re-add the parser target.
20642
20643 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20644
20645         * cs-parser.jay: Add precendence rules for a number of operators
20646         ot reduce the number of shift/reduce conflicts in the grammar.
20647
20648 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20649
20650         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20651         and put it here.
20652
20653         Get rid of old crufty code.
20654
20655         * rootcontext.cs: Use this to keep track of the parsed
20656         representation and the defined types available to the program. 
20657
20658         * gen-treedump.cs: adjust for new convention.
20659
20660         * type.cs: Split out the type manager, and the assembly builder
20661         from here. 
20662
20663         * typemanager.cs: the type manager will live here now.
20664
20665         * cil-codegen.cs: And the code generator here. 
20666
20667 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20668
20669         * makefile: Fixed up for easy making.
20670
20671 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20672
20673         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20674         the 
20675
20676         (unary_expression): Expand pre_increment_expression and
20677         post_decrement_expression to reduce a shift/reduce.
20678
20679 2001-07-11  Simon Cozens
20680
20681         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20682
20683         Improve allow_keyword_as_indent name.
20684
20685 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20686
20687         * Adjustments for Beta2. 
20688
20689 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20690
20691         * decl.cs: Added `Define' abstract method.
20692         (InTransit): new property, used to catch recursive definitions. 
20693
20694         * interface.cs: Implement `Define'. 
20695
20696         * modifiers.cs: Map Modifiers.constants to
20697         System.Reflection.TypeAttribute flags.
20698
20699         * class.cs: Keep track of types and user-defined types.
20700         (BuilderInit): New method for creating an assembly
20701         (ResolveType): New function to launch the resolution process, only
20702         used by interfaces for now.
20703
20704         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20705         that are inserted into the name space. 
20706
20707 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20708
20709         * ARGH.  I have screwed up my tree so many times due to the use of
20710         rsync rather than using CVS.  Going to fix this at once. 
20711
20712         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20713         load types.
20714
20715 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20716
20717         * Experiment successful: Use System.Type rather that our own
20718         version of Type.  
20719
20720 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20721
20722         * cs-parser.jay: Removed nsAliases from here.
20723
20724         Use new namespaces, handle `using XXX;' 
20725
20726         * namespace.cs: Reimplemented namespace handling, use a recursive
20727         definition of the class.  Now we can keep track of using clauses
20728         and catch invalid using clauses.
20729
20730 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20731
20732         * gen-treedump.cs: Adapted for all the renaming.
20733
20734         * expression.cs (Expression): this class now has a Type property
20735         which returns an expression Type.
20736
20737         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20738         `Type', as this has a different meaning now in the base
20739
20740 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20741
20742         * interface.cs, class.cs: Removed from all the sources the
20743         references to signature computation, as we can not do method
20744         signature computation during the parsing time, as we are not
20745         trying to solve at that point distinguishing:
20746
20747         class X {
20748                 void a (Blah x) {}
20749                 void a (NS.Blah x) {}
20750         }
20751
20752         Which depending on the context might be valid or not, as we do not
20753         know if Blah is the same thing as NS.Blah at that point.
20754
20755         * Redid everything so the code uses TypeRefs now instead of
20756         Types.  TypeRefs are just temporary type placeholders, that need
20757         to be resolved.  They initially have a pointer to a string and the
20758         current scope in which they are used.  This is used later by the
20759         compiler to resolve the reference to an actual Type. 
20760
20761         * DeclSpace is no longer a CIR.Type, and neither are
20762         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20763         are all DeclSpaces, but no Types. 
20764
20765         * type.cs (TypeRefManager): This implements the TypeRef manager,
20766         which keeps track of all the types that need to be resolved after
20767         the parsing has finished. 
20768
20769 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20770
20771         * ARGH.  We are going to have to store `foreach' as a class rather
20772         than resolving it, as we need to verify error 1579 after name
20773         resolution.   *OR* we could keep a flag that says `This request to
20774         IEnumerator comes from a foreach statement' which we can then use
20775         to generate the error.
20776
20777 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20778
20779         * class.cs (TypeContainer.AddMethod): we now add methods to the
20780         MethodGroup instead of the method hashtable.  
20781
20782         * expression.cs: Add MethodGroup abstraction, which gets us one
20783         step closer to the specification in the way we handle method
20784         declarations.  
20785
20786         * cs-parser.jay (primary_expression): qualified_identifier now
20787         tried to match up an identifier to a local variable reference or
20788         to a parameter reference.
20789
20790         current_local_parameters is now a parser global variable that
20791         points to the current parameters for the block, used during name
20792         lookup.
20793
20794         (property_declaration): Now creates an implicit `value' argument to
20795         the set accessor.
20796
20797 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20798
20799         * parameter.cs: Do not use `param' arguments as part of the
20800         signature, per the spec.
20801
20802 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20803
20804         * decl.cs: Base class for classes, structs and interfaces.  This
20805         is the "Declaration Space" 
20806
20807         * cs-parser.jay: Use CheckDef for checking declaration errors
20808         instead of having one on each function.
20809
20810         * class.cs: Factor out some code for handling error handling in
20811         accordance to the "Declarations" section in the "Basic Concepts"
20812         chapter in the ECMA C# spec.
20813
20814         * interface.cs: Make all interface member classes derive from
20815         InterfaceMemberBase.
20816
20817 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20818
20819         * Many things: all interfaces are parsed and generated in
20820         gen-treedump.  Support for member variables, constructors,
20821         destructors, properties, constants is there.
20822
20823         Beginning of the IL backend, but very little done, just there for
20824         testing purposes. 
20825
20826 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20827
20828         * cs-parser.jay: Fix labeled statement.
20829
20830         * cs-tokenizer.cs (escape): Escape " and ' always.
20831         ref_line, ref_name: keep track of the line/filename as instructed
20832         by #line by the compiler.
20833         Parse #line.
20834
20835 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20836
20837         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20838         to match the values in System.CodeDOM.
20839
20840         Divid renamed to Divide.
20841
20842         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20843         statements. 
20844         (Statements.set): remove.
20845
20846         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20847         statements. 
20848
20849         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20850         falseStatements always have valid values. 
20851
20852         * cs-parser.jay: Use System.CodeDOM now.
20853