2005-03-10 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / ChangeLog
1 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2
3         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4         It caused exception in namespace resolving (again!).
5         
6         * class.cs (Class.ctor): Removed exit.
7         (PropertyMethod.ctor): ditto.
8         
9         * codegen.cs (Codegen.Reset): Reset static data.
10         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
11         
12         * cs-tokenizer.cs (Cleanup): Removed.
13         
14         * driver.cs (GetSystemDir): Rewrote to one line command.
15         It caused problem with unloaded dynamic modules.
16         (UnixParseOption): Removed Exit.
17         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
18         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
19         Now can be mcs used as library.
20         
21         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
22         empty location.
23         
24         * location.cs (Reset): Reset static data.
25         
26         * namespace.cs (Reset): Reset static data.
27         
28         * report.cs (Report.Reset): Reset static data.
29         
30         * rootcontext.cs (RootContext.Reset): Reset static data.
31         
32         * tree.cs (RootTypes.ctor): Use Location.Null
33         
34         * typemanager.cs (TypeManager.Reset): Reset static data.
35         (CoreLookupType): Removed Exit.
36         (TypeHandle.Reset): Reset static data.
37         
38 2005-03-10  Raja R Harinath  <rharinath@novell.com>
39
40         Fix #73516.
41         * typemanager.cs (ComputeNamespaces): Import namespaces from
42         referenced modules too.
43
44 2005-03-09  Raja R Harinath  <rharinath@novell.com>
45
46         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
47         than '.'.
48
49 2005-03-09  Raja R Harinath  <rharinath@novell.com>
50
51         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
52         enclosing DeclSpace.  This ensures that a name-lookup populates
53         more caches and there are fewer 'TypeExpression's.  Carve out
54         nested type lookup into ...
55         (LookupNestedTypeInHierarchy): ... this.
56
57 2005-03-09  Raja R Harinath  <rharinath@novell.com>
58
59         Clean up a few partial-class semantics.  
60         Fixes test-357.cs and cs1618-2.cs.
61         * cs-parser.jay (struct_declaration): Use 'current_class' as
62         parent of newly-created struct.  Remove call to Register ().
63         Use 'pop_current_class' to complete handing the current struct.
64         (interface_declaration): Likewise.
65         (class_declaration): Likewise.
66         (enum_declaration): Use 'current_class' as parent of newly created
67         enum.
68         (delegate_declaration): Likewise.
69         (pop_current_class): New function.  This is used to handle closing
70         up the 'current_class' and 'current_container', and pointing them
71         to the enclosing class/container.
72         (CSharpParser): Initialize 'current_class' too.
73         * decl.cs (MemberCore): Add check for invariant: a partial
74         container is not a parsed entity, and thus does not enclose any
75         parsed members.
76         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
77         (DeclSpace.BaseTypeExpr): Use it.
78         (DeclSpace.LookupType): Add check for invariant.
79         * class.cs (TypeContainer): Add check for invariant: a nested
80         class should have the same NamespaceEntry as its enclosing class.
81         (TypeContainer.EmitFieldInitializers): Make virtual.
82         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
83         MemberCore.
84         (TypeContainer.Register): Remove.
85         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
86         null.  Use TypeResolveEmitContext for resolving base types and
87         interfaces.  Move initialization of Parts.TypeBuilder here from
88         ...
89         (TypeContainer.DefineNestedTypes): ... here.
90         (PartialContainer): Take a Namespace not a NamespaceEntry.
91         (PartialContainer.Create): Don't use Register.  Call the
92         appropriate Add... function directly.
93         (ClassPart): Take both the PartialContainer and the enclosing
94         class as constructor arguments.
95         (ClassPart.EmitFieldInitializers): Override.
96         (ClassPart.PartFindNestedTypes): Remove.
97         (FieldBase.GetInitializerExpression): Resolve the initializer
98         expression in the emit context of the enclosing class.
99         * tree.cs (RootTypes): Remove Register ().
100         
101 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
102
103         * cs-parser.jay: Removed CS0134.
104         
105         * driver.cs: Removed CS1901.
106         
107         * expression.cs (SizeOf.DoResolve): Don't report CS0233
108         for predefined types.
109
110 2005-03-07  Duncan Mak  <duncan@novell.com>
111
112         * codegen.cs (Save):  Catch UnauthorizedAccessException as
113         well. Fixes bug #73454.
114
115 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
116
117         * cs-tokenizer.cs (xtoken): Add CS1035.
118         
119         * class.cs (MethodData.Define): Add CS0683.
120         (FieldMember.ctor): Add CS0681.
121
122 2005-03-07  Raja R Harinath  <rharinath@novell.com>
123
124         * ecore.cs (SimpleName.DoResolve): Rename from
125         SimpleName.DoResolveAllowStatic.
126         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
127         Pass 'intermediate' flag to MemberStaticCheck.
128         (SimpleName.MemberStaticCheck): Skip "static check" only in case
129         of "intermediate" lookups via MemberAccess.
130         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
131         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
132
133 2005-03-07  Raja R Harinath  <rharinath@novell.com>
134
135         Fix #73394.
136         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
137         slipped in because of variable names that are identical to a
138         builtin type's BCL equivalent ('string String;', 'int Int32;').
139         (PropertyExpr.EmitInstance): Likewise.
140
141 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
142
143         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
144         
145         * report.cs (warning_ignore_table): Made public.
146
147 2005-03-04  Raja R Harinath  <rharinath@novell.com>
148
149         Fix #73282.
150         * class.cs (MethodData.Emit): Pass 'container' to
151         container.GetObsoleteAttribute instead of 'container.Parent'.
152
153 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
154
155         * cs-parser.jay: Add 1534 error test.
156
157         * iterators.cs (Yield.CheckContext): Add error 1629.
158         (Iterator.ctor): Save unsafe modifier.
159         (MoveNextMethod.DoEmit): Restore unsafe context.
160
161         * namespace.cs (UsingAlias): Better error message.
162
163 2005-03-03  Dan Winship  <danw@novell.com>
164
165         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
166         the warning message [#73219]
167
168 2005-03-03  Raja R Harinath  <rharinath@novell.com>
169
170         Fix compile with MCS 1.0.0.0.
171         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
172         w_restore to not depend on string constant folding.
173
174 2005-03-03  Raja R Harinath  <rharinath@novell.com>
175
176         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
177         CS0246 check to users who passed 'silent = false'.
178         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
179         check.
180         (SimpleName.SimpleNameResolve): Update.
181         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
182         (MemberAccess.IdenticalNameAndTypeName): Update.
183         * doc.cs (FindDocumentedTypeNonArray): Update.
184
185 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
186
187         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
188         * parameters.cs (ComputeAndDefineParameters): Remove.
189         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
190         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
191         Use GetParameterInfo.
192
193 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
194
195         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
196
197 2005-03-02  Raja R Harinath  <rharinath@novell.com>
198
199         Unify DeclSpace.LookupType and DeclSpace.FindType.
200         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
201         is in charge of defining nested types on demand.
202         (DeclSpace.LookupType): Use it when the current_type is a
203         TypeBuilder.  Use LookupTypeDirect for reflected types.
204         (DeclSpace.FindType): Remove.
205         (DeclSpace.LookupInterfaceOrClass): Likewise.
206         (DeclSpace.DefineTypeAndParents): Likewise.
207         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
208         DeclSpace.LookupType.
209         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
210         * typemanager.cs (LookupType): Simplify.
211         (AddUserType): Remove type from negative_hits.
212         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
213         * class.cs (TypeContainer.FindMembers): Move handling of nested
214         types ...
215         (TypeContainer.FindMembers_NestedTypes): ... here.
216         (TypeContainer.FindNestedType): Implement override.
217         (ClassPart.FindNestedType): Delegate to PartialContainer.
218         (ClassPart.PartFindNestedType): Looks up the nested types of the
219         part alone.
220
221 2005-03-02  Martin Baulig  <martin@ximian.com>
222
223         * class.cs (TypeContainer.DoDefineMembers): We also need a default
224         static constructor in static classes.
225
226 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
227
228         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
229         sizeParamIndex is not specified.
230
231 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
232
233         Fix #73117
234         * report.cs (WarningMessage.IsEnabled): Missing null check.
235
236 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
237
238         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
239         in the fields and not in the properties.
240
241 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
242
243         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
244         fields as well.
245
246 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
247
248         * attribute.cs: Small refactoring (improved robustness).
249         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
250         (ValidateGuid): Removed.
251         (Resolve): Removed referenced to above mentioned.
252         (GetAttributeUsage): Made private and changed to work without
253         class assistance.
254         (GetIndexerAttributeValue): Don't crash.
255         (GetConditionalAttributeValue): Ditto.
256         (GetClsCompliantAttributeValue): Ditto.
257         (ExtractSecurityPermissionSet): All attributes exceptions are
258         error 648.
259         (GetPropertyValue): New helper.
260         (GetMethodImplOptions): New method.
261         (DefinePInvokeMethod): Reuse common code. Implemented handling of
262         some missing properties.
263         
264         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
265         (Method.ApplyAttributeBuilder): Updated.
266         
267         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
268         exception.
269
270 2005-02-28  Raja R Harinath  <rharinath@novell.com>
271
272         Fix #73052.
273         * report.cs (Report.SymbolRelatedToPreviousError): Handle
274         non-simple types (array, pointer, reference).
275
276 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
277
278         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
279
280         * class.cs (MethodCore.IsDuplicateImplementation): Special error
281         for operators.
282         (Method.CheckBase): Catch wrong destructor here.
283         (MethodData.Define): Add errors 550, 668.
284
285         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
286
287         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
288
289         * pending.cs (VerifyPendingMethods): Add error 551.
290
291         * typemanager.cs (CSharpName): Next error report helper.
292
293 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
294
295         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
296         attributes. Removed useless attribute double check.
297         It saves almost 2MBs for corlib.
298
299 2005-02-25  Raja R Harinath  <rharinath@novell.com>
300
301         Fix #72924.
302         * statement.cs (ExpressionStatement.Resolve): Make robust to being
303         called twice in case of error.
304
305 2005-02-23  Chris Toshok  <toshok@ximian.com>
306
307         Fix compiler portions of #72827.
308         * statement.cs (Block.Emit): call Begin/EndScope on the
309         EmitContext instead of the ILGenerator.
310
311         * codegen.cs (EmitContext.BeginScope): new method, call
312         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
313         we have one.)
314         (EmitContext.BeginScope): same, but EndScope and CloseScope
315
316         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
317         offset and call the superclass's OpenScope(int) with it.
318         (SymbolWriter.CloseScope): get the current il
319         offset and call superclass's CloseScope(int) with it.
320
321 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
322
323         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
324         CS1677 for out and ref as well.
325
326         * class.cs (Method.Define): Add error CS1599 detection.
327         
328         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
329         
330         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
331         
332         * delegate.cs (Delegate.Define): Add error CS1599 detection.
333         
334         * support.cs.cs (ModifierDesc): New helper method.
335
336 2005-02-23  Raja R Harinath  <rharinath@novell.com>
337             Abin Thomas  <projectmonokochi@rediffmail.com>
338             Anoob V E  <projectmonokochi@rediffmail.com>
339             Harilal P R  <projectmonokochi@rediffmail.com>
340
341         Fix #57851, #72718.
342         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
343         MemberLookup (used for error reporting) actually returns a result.
344         Fix error report number (122, not 112).
345
346 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
347             Anoob V E  <projectmonokochi@rediffmail.com>
348             Harilal P R  <projectmonokochi@rediffmail.com>
349
350         Fix #71134.
351         * pending.cs (PendingImplementation.GetAbstractMethods):
352         Find NonPublic members too.
353
354 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
355
356         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
357         Fixed error 217.
358         
359         * class.cs (MethodCore.CheckMethodAgainstBase):
360         Add error 239 report.
361
362 2005-02-21  Raja R Harinath  <rharinath@novell.com>
363
364         Fix #68955.
365         * expression.cs (Invocation.IsApplicable): Make public.
366         (Invocation.IsParamsMethodApplicable): Likewise.
367         * delegate.cs (Delegate.VerifyApplicability): Don't use
368         Invocation.VerifyArgumentCompat for parameter applicability
369         testing.  Use Invocation.IsApplicable and
370         Invocation.IsParamsMethodApplicable.
371
372 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
373
374         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
375         
376         * class.cs (Operator.Define): Add error 217 report.
377         
378 2005-02-21  Raja R Harinath  <rharinath@novell.com>
379
380         * namespace.cs (UsingEntry.Resolve): Undo change below.
381
382 2005-02-21  Raja R Harinath  <rharinath@novell.com>
383
384         Fix #72756.
385         * ecore.cs (Expression.MemberLookupFailed): Add argument to
386         disable the error message when the extended MemberLookup also
387         fails.
388         (Expression.MemberLookupFinal): Update.
389         (SimpleName.DoSimpleNameResolve): Update.
390         * expression.cs (MemberAccess.ResolveNamespaceOrType):
391         Don't use MemberLookupFinal.
392         (New.DoResolve): Update.
393         (BaseAccess.CommonResolve): Update.
394
395 2005-02-21  Raja R Harinath  <rharinath@novell.com>
396
397         Fix #72732.
398         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
399         occured previously, don't resolve again.
400
401 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
402
403         Fix #69949
404         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
405         argument. Call ResolveAttributeUsage for unresolved.
406         when types doesn't match ctor arguments.
407         
408         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
409         for nested attribute classes.
410         (Class.attribute_usage): Removed.
411         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
412         for attribute class.
413         
414         * ecore.cs (IsAttribute): Removed.
415         
416         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
417         
418         * rootcontext.cs (RegisterAttribute): Removed, attributes are
419         now normal types.
420         (attribute_types): Removed.
421         (EmitCode): Global attributes are emited as the latest.
422
423 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
424
425         * class.cs (EmitFieldInitializers): Don't emit field initializer
426         for default values when optimilization is on.
427         
428         * constant.cs (Constant.IsDefaultValue): New property.
429         
430         * driver.cs: Add /optimize handling.
431         
432         * constant.cs,
433         * ecore.cs,
434         * literal.cs: Implement new IsDefaultValue property.
435         
436         * rootcontext.cs (Optimize): New field, holds /optimize option.
437
438 2005-02-18  Raja R Harinath  <rharinath@novell.com>
439
440         Fix crasher in re-opened #72347.
441         * namespace.cs (Namespace.Lookup): Return null if
442         DeclSpace.DefineType returns null.
443
444         Fix #72678.
445         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
446
447 2005-02-18  Raja R Harinath  <rharinath@novell.com>
448
449         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
450         now returns null if it cannot resolve to an lvalue.
451         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
452         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
453         returned null.  Remove check for SimpleName.
454         (EventExpr.DoResolveLValue): New.
455         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
456         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
457         error from ...
458         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
459         avoid CS0131 error.
460         (Unary.ResolveOperator): Move CS0211 check ...
461         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
462         CS0131 error.
463         (Unary.DoResolveLValue): Simplify.
464         (AddressOf.DoResolveLValue): New.
465         (ArrayAccess.DoResolveLValue): New.
466
467 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
468
469         * attribute.cs (Attribute.Resolve): Add arguments casting for
470         when types doesn't match ctor arguments.
471
472 2005-02-16  Raja R Harinath  <rharinath@novell.com>
473
474         Fix parts of #63202.
475         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
476         lookup of operator in base type.  Ensure that all checks happen
477         when the operator resolves to an "op_..." method.
478
479 2005-02-15  Raja R Harinath  <rharinath@novell.com>
480
481         Fix #71992.
482         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
483         'ignore_cs0104' parameter.  Pass it to ...
484         (NamespaceEntry.Lookup): ... this.
485         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
486         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
487         (TypeLookupExpression.DoResolveAsTypeStep): Update.
488         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
489         Update.  Request that cs0104 errors be ignored.
490         (ComposedCast.ResolveAsTypeStep): Update.
491
492 2005-02-14  Raja R Harinath  <rharinath@novell.com>
493
494         Fix #59209.
495         * expression.cs (Invocation.BetterFunction): Remove support for
496         comparing virtual functions and their overrides.
497         (Invocation.IsOverride): New.
498         (Invocation.OverloadResolve): Don't consider 'override' functions
499         during candidate selection.  Store them in a lookaside list.
500         If the selected method is a 'virtual' function, use the list to
501         find any overrides that are closer to the LHS type.
502
503 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
504
505         * expression.cs (New.DoResolve): Add complex core type reduction.
506         (New.Constantify): Converts complex core type syntax like 'new int ()'
507         to simple constant.
508         
509 2005-02-14  Raja R Harinath  <rharinath@novell.com>
510
511         * decl.cs (EntryType.EntryType): New constructor to create an
512         updated copy of a cache entry.
513         (MemberCache.AddMethods): Use it.
514         (MemberCache.ClearDeclaredOnly): Remove.
515         (MemberCache.MemberCache): Update.
516
517 2005-02-11  Miguel de Icaza  <miguel@novell.com>
518
519         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
520         variable.  This one is represents the actual low-level declaration
521         of the method, as opposed to the semantic level `IsStatic'.   
522
523         An anonymous method which is hosted into a static method might be
524         actually an instance method.  IsStatic would reflect the
525         container, while MethodIsStatic represents the actual code
526         generated.
527
528         * expression.cs (ParameterReference): Use the new MethodIsStatic
529         instead of IsStatic.
530
531         * anonymous.cs (AnonymousMethod.Compatible): Pass the
532         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
533         set on the current EmitContext. 
534
535         * expression.cs (Cast): Overload DoResolveLValue so we can pass
536         resolve our casted expression as an LValue.  This triggers the
537         proper LValue processing that is later required by Assign.
538
539         This fixes 72347.
540
541         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
542
543 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
544
545         C# 2.0 Fixed buffer implementation
546
547         * anonymous.cs: Update after RegisterHelperClass renaming.
548
549         * attribute.cs (AttributeTester.fixed_buffer_cache):
550         Cache of external fixed buffers.
551         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
552         implementation if field is fixed buffer else null.
553
554         * class.cs
555         (TypeContainer.AddField): Accept FieldMember instead of Field.
556         (FieldBase.IsFieldClsCompliant): Extracted code from
557         VerifyClsCompliance descendant customization.
558         (FixedField): New class handles fixed buffer fields.
559         (FixedFieldExternal): Keeps information about imported fixed
560         buffer.
561         (IFixedField): Make access to internal or external fixed buffer
562         same.
563
564         * cs-parser.jay: Add fixed buffer parsing.
565
566         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
567         buffer.
568
569         * expression.cs (Indirection): Extended implementation to accept
570         fixed buffer field.
571         (PointerArithmetic.Emit): Get element from fixed buffer as well.
572         (ElementAccess.MakePointerAccess): Get type as parameter.
573         (DoResolve): Add fixed buffer field expression conversion.
574         (DoResolveLValue): Ditto.
575         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
576         (ArrayPtr): Derives from FixedBufferPtr.
577         (ArrayPtr.Emit): Add extra emit for array elements.
578
579         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
580
581         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
582         for compiler generated types.
583         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
584
585         * statement.cs (Fixed): Refactored to be easier add fixed buffer
586         and consume less memory.
587         (Fixed.Resolve): Add fixed buffer case.
588
589         * typemanager.cs (compiler_generated_attr_ctor,
590         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
591         (HasElementType): Add our own implementation to work on every
592         runtime.
593
594 2005-02-11  Miguel de Icaza  <miguel@novell.com>
595
596         * anonymous.cs (CaptureContext): Track whether `this' has been
597         referenced.   
598
599         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
600         only captured `this' if it was implicitly done (instance
601         methods/variables were used). 
602
603         * codegen.cs (EmitContext.CaptureThis): New method to flag that
604         `this' must be captured.
605
606 2005-01-30  Miguel de Icaza  <miguel@novell.com>
607  
608         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
609         is null it means that there has been no need to capture anything,
610         so we just create a sibling.
611
612         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
613
614         Just a partial fix.  The other half is fairly elusive.
615         
616 2005-02-10  Raja R Harinath  <rharinath@novell.com>
617
618         Fix #52586, cs0121-4.cs.
619         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
620         and return a hashtable.
621         (MemberCache.ClearDeclaredOnly): New.
622         (MemberCache.MemberCache): Update to change.  Make a deep copy of
623         the method_hash of a base type too.
624         (MemberCache.AddMethods): Adapt to having a deep copy of the base
625         type methods.  Overwrite entries with the same MethodHandle so
626         that the ReflectedType is correct.  The process leaves in base
627         virtual functions and their overrides as distinct entries.
628         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
629         matters since it was boxed in a ArrayList before.
630         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
631         modifier.
632         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
633         case of a virtual function and its override (choose the overload
634         as better).
635         (Invocation.OverloadResolve): Avoid 'override' members during
636         'applicable_type' calculation.
637
638 2005-02-09  Raja R Harinath  <rharinath@novell.com>
639
640         Combine two near-redundant caches.
641         * typemanager.cs (method_params): Rename from method_internal_params.
642         (TypeManager.GetParameterData): New.  Replace
643         Invocation.GetParameterData.
644         (TypeManager.LookupParametersByBuilder): Remove.
645         * expression.cs (Invocation.method_parameter_cache): Remove.
646         (Invocation.GetParameterData): Remove.
647         Update to changes.
648         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
649         Update to changes.
650
651 2005-02-08  Raja R Harinath  <rharinath@novell.com>
652
653         Fix #72015.
654         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
655         TypeManager.multicast_delegate_type is null, resolve it by looking
656         up "System.MulticastDelegate".
657         * rootcontext.cs (RootContext.ResolveCore): Simplify.
658
659 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
660             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
661             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
662
663         Fix cs0164.cs.
664         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
665         (LabeledStatement.AddReference): New.  Set 'referenced'.
666         (Goto.Resolve): Use it.
667
668 2005-02-05  John Luke  <john.luke@gmail.com>
669
670         * driver.cs: remove duplicate -doc line in Usage ()
671
672 2005-02-04  Raja R Harinath  <rharinath@novell.com>
673
674         * location.cs (Location.AddFile): Fix CS2002 error report.
675
676 2005-02-02  Martin Baulig  <martin@ximian.com>
677
678         * delegate.cs (Delegate.DefineType): Report an internal error if
679         TypeManager.multicast_delegate_type is null.  See bug #72015 for
680         details.        
681
682 2005-02-02  Raja R Harinath  <rharinath@novell.com>
683
684         Fix a crasher in a variant of #31984.
685         * const.cs (Constant.CheckBase): New override that defers the
686         new-or-override check in case the base type hasn't been populated
687         yet.
688         (Constant.Define): Ensure the new-or-override check is performed.
689
690 2005-02-01  Duncan Mak  <duncan@ximian.com>
691
692         * const.cs (LookupConstantValue): Check that `ce' is not null
693         before calling GetValue ().
694
695 2005-02-01  Raja R Harinath  <rharinath@novell.com>
696
697         Fix test-334.cs (#69519).
698         * cs-parser.jay (using_alias_directive): Pass in an expression to
699         NamespaceEntry.UsingAlias.
700         (using_namespace_directive): Pass in an expression to
701         NamespaceEntry.Using.
702         (namespace_name): Don't flatten to a string.
703         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
704         (NamespaceEntry.AliasEntry.Resolve): Lookup using
705         ResolveAsTypeStep.
706         (NamespaceEntry.UsingEntry): Likewise.
707         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
708         changes.
709         (NamespaceEntry.LookupForUsing): Remove.
710         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
711         names.
712         (NamespaceEntry.Lookup): Remove support for dotted names.
713
714 2005-02-01  Raja R Harinath  <rharinath@novell.com>
715
716         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
717         split into two.
718         (NamespaceEntry.ImplicitParent): Compute on demand.
719         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
720         parallels the current.
721         (NamespaceEntry.LookupForUsing): Use it.
722         (NamespaceEntry.Lookup): If the current namespace-entry is
723         implicit, don't search aliases and using tables.
724
725 2005-02-01  Raja R Harinath  <rharinath@novell.com>
726
727         Fix #31984.
728         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
729         BaseCache here.
730         (TypeContainer.BaseCache): Compute on demand.
731         (TypeContainer.FindMembers): Define constants and types if they're
732         not already created.
733         (FieldMember.Define): Move resetting of ec.InUnsafe before error
734         check.
735         * const.cs (Constant.Define): Make idempotent.
736
737 2005-01-29  Miguel de Icaza  <miguel@novell.com>
738
739         * pending.cs: Produce better code (no nops produced by using Ldarg
740         + value).
741         
742         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
743         i - 1' it should be arg + 1.
744
745         Fixes bug #71819.
746
747 2005-01-28  Raja R Harinath  <rharinath@novell.com>
748
749         * attribute.cs (Attribute.CheckAttributeType): Make private
750         non-virtual.
751         (Attribute.ResolveType): Make virtual.
752         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
753         handling of RootContext.Tree.Types.
754
755 2005-01-27  Raja R Harinath  <rharinath@novell.com>
756
757         Update attribute-handling to use the SimpleName/MemberAccess
758         mechanisms.
759         * cs-parser.jay (attribute): Pass in an expression to the
760         constructors of Attribute and GlobalAttribute.
761         * attribute.cs (Attribute): Take an expression for the name.
762         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
763         passed in attribute name expression.
764         (Attribute.CheckAttributeType): Use it.
765         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
766         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
767         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
768         argument to prevent error messages if the lookup fails.
769
770 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
771
772         * expression.cs (Indirection): Implemented IVariable interface
773         to support indirection in AddressOf operator.
774         (PointerArithmetic.Emit): Add optimalization for case where
775         result can be precomputed.
776
777 2005-01-26  Martin Baulig  <martin@ximian.com>
778
779         * class.cs (TypeContainer.AttributeTargets): Return the correct
780         AttributeTargets depending on our `Kind' instead of throwing an
781         exception; fixes #71632.
782
783 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
784
785         Fix #71257
786         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
787         constant members.
788
789 2005-01-25  Raja R Harinath  <rharinath@novell.com>
790
791         Fix #71602.
792         * expression.cs (MemberAccess.DoResolve): Don't complain with
793         cs0572 when the LHS of a member access has identical name and type
794         name.
795
796 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
797
798         Fix #71651, #71675
799         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
800         CreatePermission.
801         Create custom PermissionSet only for PermissionSetAttribute.
802
803 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
804
805         Fix #71649
806         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
807         delegates in static class.
808
809 2005-01-24  Martin Baulig  <martin@ximian.com>
810
811         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
812         merging an implicit block, just use its reachability.
813
814         * statement.cs (Block.Resolve): Make the unreachable code check
815         work wrt. implicit blocks; see test-337 from #63842.
816
817 2005-01-21  Alp Toker  <alp@atoker.com>
818  
819         * cs-parser.jay: destructor_declaration's container is PartialContainer
820         not Class when partial types are used, so use Kind prop instead of
821         'is'.
822         
823 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
824
825         * cs-parser.jay: Improve error reporting when an interface
826         declares new types.
827
828 2005-01-20  Dick Porter  <dick@ximian.com>
829
830         * support.cs: SeekableStreamReader fix from Sandor Dobos
831         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
832         chars are read.  Fixes bug 70369.
833
834 2005-01-20  Raja R Harinath  <rharinath@novell.com>
835
836         * cs-parser.jay (catch_clause): Simplify current_block handling
837         somewhat.
838
839 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
840
841         * convert.cs (ImplicitStandardConversionExists): Synchronize the
842         code with ImplicitStandardConversion to handle the implicit
843         conversion of method groups into valid delegate invocations. 
844
845         The problem is that in parameter handling we were using this code
846         path.  Fixes bug #64698
847
848 2005-01-19  Raja R Harinath  <rharinath@novell.com>
849
850         * cs-parser.jay: Fix several infelicities.
851         - Avoid assigning to the parser value stack.  Code like 
852           '$3 = null' is unclean.  Synthesize a value for the code block
853           instead. 
854         - Avoid using oob_stack for storing location information.  Use ...
855         (_mark_): ... this.  New (empty) rule.  Saves the current location
856         in $$.
857         (foreach_statement): Avoid using oob_stack for current_block
858         handling.  Use technique used in for_statement and
859         using_statement.  Synthesize a value for the code block to store
860         additional intermediate information.
861
862 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
863
864         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
865         of a different type is only allowed to private fields of a
866         containing type, not on fields of a base class.
867
868         See test-174.cs and error cs0122-9.cs
869
870 2005-01-13  Raja R Harinath  <rharinath@novell.com>
871
872         Fix test-335.cs (bug #58126).
873         * cs-parser.jay (argument): Split out non-expression parts of the
874         rule into 'non_simple_argument'.
875         (invocation_expression): Support parenthesized invocations with
876         multiple arguments, and with single non-simple arguments.
877
878 2005-01-13  Raja R Harinath  <rharinath@novell.com>
879
880         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
881         places.
882
883 2005-01-12  Raja R Harinath  <rharinath@novell.com>
884
885         Fix cs0038-1.cs, cs1640-6.cs.
886         * ecore.cs (Expression.Resolve): Remove special-case for
887         SimpleName in error-handling.
888         (Expression.almostMatchedMembers): Relax access permission to
889         protected.
890         (Expression.MemberLookupFailed): Handle duplicates in
891         almostMatchedMembers list.
892         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
893         * expression.cs (New.DoResolve): Report CS1540 for more cases.
894         * typemanager.cs (GetFullNameSignature): Use the MethodBase
895         overload if the passed in MemberInfo is a MethodBase.
896
897 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
898
899         Fix #70749
900         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
901         for non-CAS & merge permission sets properly.
902
903 2005-01-11  Raja R Harinath  <rharinath@novell.com>
904
905         Improve standard-compliance of simple name and member access 
906         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
907         * ecore.cs (FullNamedExpression): New abstract base class 
908         for Namespaces and TypeExpressions.
909         (ResolveFlags.SimpleName): Remove.
910         (SimpleName): Remove support for dotted names.
911         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
912         DeclSpace.FindType and DeclSpace.LookupType.
913         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
914         (Expression.ExprClassName): Make member function.
915         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
916         a namespace.  Remove creation of dotted "SimpleName"s.
917         (MemberAccess.DoResolve): Likewise.
918         * decl.cs (DeclSpace.Cache): Make private.
919         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
920         (DeclSpace.FindType): Update.
921         (DeclSpace.LookupType): Move here from RootContext.  Return a 
922         FullNamedExpression.
923         * namespace.cs (Namespace): Derive from FullNamedExpression
924         so that it can be part of expression resolution.
925         (Namespace.Lookup): Return an FullNamedExpression.
926         (NamespaceEntry.LookupAlias): Lookup aliases only in current
927         namespace.
928         * rootcontext.cs (NamespaceLookup): Remove.
929         (LookupType): Move to DeclSpace.
930         * attribute.cs (CheckAttributeType): Update.
931         * doc.cs (FindDocumentedType): Remove allowAlias argument.
932         (FindDocumentedTypeNonArray): Likewise.
933
934 2005-01-11  Raja R Harinath  <rharinath@novell.com>
935
936         Fix cs0509.cs, cs1632.cs.
937         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
938         is the same as IsInterface.
939         (TypeContainer.GetClassBases): Likewise.
940         * statement.cs (LabeledStatement.ig): New field.
941         (LabeledStatement.LabelTarget): Save ILGenerator which created the
942         label.
943         (LabeledStatement.DoEmit): Check that the label was created with
944         the same ILGenerator.
945
946 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
947
948         Fix #71058
949         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
950         accessors to its properties.
951
952         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
953         from accessors to property.
954         
955 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
956
957         Fix #70722
958         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
959         only for overrides.
960         
961 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
962
963         * attribute.cs: Check for null and empty strings.  
964
965         I have lost another battle to Paolo.
966
967 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
968
969         Fix #70942
970         * class.cs (PropertyMethod): Set Parent field in ctors.
971         (SetMethod.InternalParameters): Add unsafe switch hack.
972         Override MarkForDuplicationCheck where it is appropriate.
973
974         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
975         It says whether container allows members with the same name.
976         Base default is no.
977         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
978         Removed is_method parameter.
979
980 2005-01-06  Duncan Mak  <duncan@ximian.com>
981
982         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
983         because the previous change led to incorrect reporting of CS1032
984         ("Cannot define/undefine preprocessor symbols after first token in
985         file"). Instead of using `tokens_seen' as the only flag that
986         triggers CS1040, introduce `comments_seen'. This new flag is used
987         to signify having seen comments on the current line, so it is
988         unset after a newline.
989
990 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
991
992         * doc.cs : When searching for a type, find nested type too.
993           This fixes bug #71040.
994
995 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
996
997         * doc.cs :
998           - Warn missing member comment on those classes which also does not
999             have doc comments. Fixed bug #71041.
1000           - Don't warn missing doc comment on default constructor.
1001             Fixed bug #71042.
1002
1003 2005-01-06  Duncan Mak  <duncan@ximian.com>
1004
1005         * cs-tokenizer.cs (xtoken): After handling traditional C-style
1006         comments, set `tokens_seen' to true. This allows us to detect
1007         misplaced preprocessor directives (i.e. not at the beginning of
1008         the a line, nor after whitespaces). In that case, report error
1009         CS1040. This fixes bug #56460.
1010
1011         * cs-parser.jay (interface_member_declaration): Add checks for
1012         IsExplicitImpl, and report CS0541 error if an interface member is
1013         defined as an explicit interface declaration.
1014
1015 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
1016
1017         Fix #70817
1018         * class.cs (PropertyMethod): Set Parent field in ctors.
1019         (SetMethod.InternalParameters): Add unsafe switch hack.
1020         
1021         * decl.cs (MemberCore.Parent): Cannot be readonly.
1022
1023 2005-01-06  Raja R Harinath  <rharinath@novell.com>
1024
1025         * decl.cs (DeclSpace.ResolveType): Remove.
1026         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
1027         Merge in code from ...
1028         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
1029         * class.cs, enum.cs: Update to changes.
1030
1031 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
1032
1033         * anonymous.cs: Ensure that we init the scope of our parent if it
1034         has not been initialized yet.
1035
1036 2004-12-30  Duncan Mak  <duncan@ximian.com>
1037
1038         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
1039         if field.FieldBuilder is null. Fixes #70758.
1040
1041         * convert.cs: Fixed some typos and updated some of the comments.
1042         (ImplicitStandardConversionExists):
1043         (TryImplicitIntConversion): If `target_type' is an interface and
1044         the type of `ic' implements this interface, return true or a new
1045         BoxedCast instead of null. This fixes #70468.
1046
1047 2004-12-29  Duncan Mak  <duncan@ximian.com>
1048
1049         * expression.cs (Argument.Emit): Check that Expr is
1050         IMemoryLocation before casting to it, and report CS1510 otherwise.
1051
1052         This fixes #70402.
1053
1054 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
1055
1056         * statement.cs (Block.ThisVariable): remove the recursion here, to
1057         make the --profile more sane.
1058
1059 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
1060
1061         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
1062         assembly, by JB Evain.
1063
1064 2004-12-17  Raja R Harinath  <rharinath@novell.com>
1065
1066         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
1067           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
1068         "parent" refers to enclosing type/class.  "base" refers to superclass.
1069
1070 2004-12-17  Raja R Harinath  <rharinath@novell.com>
1071
1072         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1073         Ensure that we only have GlobalAttributes.
1074         * attribute.cs (Attribute.Emit): Make non-virtual.
1075         (GlobalAttribute.Emit): Remove.
1076         (Attribute.Resolve): Make virtual.
1077         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
1078         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
1079         the argument. Don't create one.
1080         (Attribute.GetObsoleteAttribute): Likewise.
1081         (Attribute.GetClsCompliantAttributeValue): Likewise.
1082         * class.cs, decl.cs: Update to changes.
1083
1084 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
1085
1086         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
1087         
1088         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
1089         
1090         * statement.cs (Foreach.Resolve): Add error 186 report.
1091
1092 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
1093
1094         * expression.cs (Conditional.DoResolve): Add warning 429.
1095         
1096         * statement.cs (If.Resolve): Add warning 665.
1097
1098 2004-12-16  Raja R Harinath  <rharinath@novell.com>
1099
1100         New invariant: RootContext.Tree.Types.NamespaceEntry == null
1101         except when in the parser, and in GlobalAttribute.
1102         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
1103         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
1104         RootContext.Tree.Types.NamespaceEntry once work is done.
1105         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
1106         and resets RootContext.Tree.Types.NamespaceEntry.
1107
1108 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
1109
1110         * cs-parser.jay: Don't create a block for every variable.
1111
1112 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
1113
1114         * location.cs: Provide extra information.
1115
1116         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
1117         variables from the captured environment, it is the ldarg_0.
1118
1119 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
1120
1121         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
1122         find a conclusion.
1123         
1124         * class.cs: Changed warning level for 169 to avoid developer
1125         displeasure from warning flooding. It will be changed back when they
1126         fix most of current BCL warnings.
1127         
1128         * RootContext.cs: Pushed default WarningLevel to 3.
1129         
1130         * statement.cs: Removed unused variable.
1131
1132 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
1133
1134         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
1135         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
1136         Add error 502 report.
1137         (StaticClass.DefineType): Add error 441 report.
1138         (Class.AllowedModifiersProp): New virtual property as temporary
1139         extension to AllowedModifiers.
1140         (Class.DefineType): Add error 418 report. Moved ModFlags check here
1141         to share implementation with StaticClass and don't call virtual
1142         methods from ctor.
1143         
1144         * driver.cs (MainDriver): Add error 1558 test.
1145
1146         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
1147         report. Moved error 36 test here.
1148
1149         * statement.cs (Throw.Resolve): Add error 724 report.
1150
1151         * typemanager.cs: Add out_attribute_type core type.
1152         
1153 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
1154
1155         * class.cs (TypeContainer.VerifyClsCompliance): Add error
1156         3018 report.
1157         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
1158
1159         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
1160         3017 report.
1161         
1162         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
1163
1164         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
1165         Add error 3023 report.
1166         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
1167
1168         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
1169         implementation.
1170
1171 2004-12-12  John Luke  <john.luke@gmail.com>
1172
1173         * driver.cs (AddArgs): take -- into account when
1174         adding arguments, fixes bug 65710 
1175
1176 2004-12-12  Martin Baulig  <martin@ximian.com>
1177
1178         * expression.cs (Unary.TryReduceNegative): Added support for
1179         SByteConstant and ByteConstant.
1180         (Unary.Reduce): Check error values from TryReduceNegative().
1181
1182 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
1183
1184         * attributes.cs (Attribute.Resolve): Avoid multiple error report
1185         and report exception as error 182.
1186
1187 2004-12-10  Raja R Harinath  <rharinath@novell.com>
1188
1189         * driver.cs (Main): Fix message when there are warnings.
1190
1191 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
1192
1193         * delegate.cs: Fixed my fix from yesterday, sorry about that.
1194
1195 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
1196
1197         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
1198         Reduced number of warnings.
1199         
1200         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
1201
1202 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
1203
1204         * driver.cs: Removed message.
1205
1206         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
1207
1208 2004-12-08    <vargaz@freemail.hu>
1209
1210         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1211
1212 2004-12-08  Martin Baulig  <martin@ximian.com>
1213
1214         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1215         instead of a CS3002 for properties and indexer.
1216
1217 2004-12-08  Martin Baulig  <martin@ximian.com>
1218
1219         * decl.cs (MemberName.ToString): Make this work again.
1220
1221 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
1222
1223         * attribute.cs (Resolve): Add error 591 detection.
1224
1225         * class.cs (FieldMember.Define): Add error 1547 detection.
1226         (Indexer.Define): Add error 620 detection.
1227         (Operator.Define): Add error 590 detection.
1228
1229         * ecore.cs: Missing argument for error 79.
1230
1231         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1232         detection.
1233
1234 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1235
1236         Fix #70106
1237         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1238         only.
1239
1240 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1241
1242         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1243           Some operator comments were suppressed.
1244         * doc.cs : Implicit/explicit operator name in doc comments are like
1245           "op_Explicit(type)~returnType", so added suffix handling.
1246
1247 2004-12-07  Martin Baulig  <martin@ximian.com>
1248
1249         * decl.cs
1250         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
1251         (MemberCore.GetClsCompliantAttributeValue): Likewise.
1252         (DeclSpace.ec): New protected field; store the EmitContext here.
1253         (DeclSpace.EmitContext): New public property; moved here from
1254         `TypeContainer'.
1255         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
1256         EmitContext.
1257
1258         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
1259         (Enum.Emit): Don't create a new EmitContext.
1260
1261         * delegate.cs (Delegate.DefineType): Always create the
1262         EmitContext.
1263
1264         * iterators.cs (Iterators.DefineIterator): Create a new
1265         EmitContext and store it in `ec'.
1266
1267 2004-08-24  Martin Baulig  <martin@ximian.com>
1268
1269         * typemanager.cs
1270         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
1271         this for accessibility checks.
1272         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
1273         IsNestedFamilyAccessible.
1274         (TypeManager.IsSubclassOf): New method, do what the name actually
1275         says.   
1276
1277 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1278
1279         Fix crash on cs0657-17.cs.
1280         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1281         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1282         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1283         the case where the NamespaceEntry gets overwritten.
1284
1285 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1286
1287         Fixed #69195, #56821
1288         * ecore.cs (ResolveBoolean): Tiny refactoring.
1289
1290         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1291         of right expression resolving when left is false constant and
1292         operator is LogicalAnd OR true constant and operator is LogicalOr.
1293
1294         * statement.cs (ResolveUnreachable): Always reports warning.
1295
1296 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1297
1298         * class.cs: Distinguish between 1721 and 1722 (just a little help
1299         for the programmer).
1300
1301 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1302
1303         * delegate.cs: Only allow this on new versions of the language. 
1304
1305 2004-12-02  Duncan Mak  <duncan@ximian.com>
1306
1307         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1308         Expression class.
1309         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1310         here as a static method. Take an additional bool out parameter
1311         `must_do_cs1540_check' for signaling to InstanceResolve.
1312         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1313         member field from PropertyExpr class and made it an argument of
1314         the method instead.
1315         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1316         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1317         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1318         and `remove_accessor' as well as InstanceResolve: report CS0122
1319         where applicable.
1320
1321         Fixes #70129.
1322
1323 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1324
1325         Fix test-327.cs, test-328.cs, and put in early infrastructure
1326         for eventually fixing #52697.
1327         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1328         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1329         from other methods.
1330         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1331         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1332         (VerifyUsing, error246): Update.
1333         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1334         'NamespaceEntry.LookupNamespaceOrType'.
1335
1336 2004-12-03  Martin Baulig  <martin@ximian.com>
1337
1338         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1339         method as our child, call AnonymousMethod.Compatible() on it.
1340
1341 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1342
1343         Disable XML documentation support in 'basic' profile.
1344         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
1345         Redirect XmlElement to System.Object.
1346         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
1347         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
1348         * mcs.exe.sources: Add doc-bootstrap.cs.
1349         * doc-bootstrap.cs: New file.  Contains empty stub implementation
1350         of doc.cs.
1351
1352 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1353
1354         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1355           comments are allowed.
1356
1357 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1358
1359         * delegate.cs: Add checks for subtypes in paramaters and return values
1360         in VerifyMethod () to add support for Covariance/Contravariance
1361         in delegates.
1362         
1363 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1364
1365         * report.cs: Remove extra closing parenthesis.
1366
1367         * convert.cs (Error_CannotImplicitConversion): If the name of the
1368         types are the same, provide some extra information.
1369
1370         * class.cs (FieldBase): Use an unused bit field from the field to
1371         encode the `has_offset' property from the FieldMember.  This saves
1372         a couple of Ks on bootstrap compilation.
1373
1374         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1375         method as our child, return the AnonymousMethod resolved
1376         expression.
1377
1378         * expression.cs (New.DoResolve): Allow return values from
1379         NewDelegate to also include AnonymousMethods.
1380
1381         Fixes #70150.
1382
1383 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1384
1385         Fix bug #70102
1386         * attribute.cs (Resolve): Improved implementation of params
1387         attribute arguments.
1388
1389         * support.cs (ParameterData): Add HasParams to be faster.
1390
1391 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1392
1393         all things are for /doc support:
1394
1395         * doc.cs: new file that supports XML documentation generation.
1396         * mcs.exe.sources: added doc.cs.
1397         * driver.cs:
1398           Handle /doc command line option.
1399           Report error 2006 instead of 5 for missing file name for /doc.
1400           Generate XML documentation when required, after type resolution.
1401         * cs-tokenizer.cs:
1402           Added support for picking up documentation (/// and /** ... */),
1403           including a new XmlCommentState enumeration.
1404         * cs-parser.jay:
1405           Added lines to fill Documentation element for field, constant,
1406           property, indexer, method, constructor, destructor, operator, event
1407           and class, struct, interface, delegate, enum.
1408           Added lines to warn incorrect comment.
1409         * rootcontext.cs :
1410           Added Documentation field (passed only when /doc was specified).
1411         * decl.cs:
1412           Added DocComment, DocCommentHeader, GenerateDocComment() and
1413           OnGenerateDocComment() and some supporting private members for
1414           /doc feature to MemberCore.
1415         * class.cs:
1416           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1417         * delegate.cs:
1418           Added overriden DocCommentHeader.
1419         * enum.cs:
1420           Added overriden DocCommentHeader and GenerateDocComment().
1421
1422 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1423
1424         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1425         unwrapping the enumeration values, chain to
1426         DoConstantNumericPromotions again, so we can promote things to the
1427         fundamental types (takes care of enums that are bytes, sbytes).
1428
1429         Fixes bug #62054.
1430
1431 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1432
1433         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1434         Fix long-standing bug in type-lookup.  Use FindType instead of
1435         LookupType when ec.ResolvingTypeTree.
1436         (Attribute.ResolveType, Attribute.Resolve)
1437         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1438         Update to changes.
1439         (Attributes.Search): Remove internal version.  Update.
1440         (Attributes.SearchMulti): Update.
1441         (Attributes.GetClsCompliantAttribute): Remove.
1442         (Attributes.GetIndexerNameAttribute): Remove.
1443         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1444         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1445         * class.cs (Indexer.Define): Likewise.
1446
1447 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1448
1449         Fix bug #68790
1450         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1451         MarshallByReference members access.
1452
1453         * expression.cs: Use CheckMarshallByRefAccess;
1454         Better error CS0197 message.
1455
1456         * report.cs: Print whole related error message.
1457
1458 2004-11-30  Raja R Harinath  <rharinath@novell.com>
1459
1460         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
1461         the current directory to help debugging.
1462
1463 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1464
1465         * class (GetClassBases): Better error 60 report.
1466         (EventProperty): Disabled warning 67 detection.
1467
1468 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1469
1470         Fix bug #60324
1471         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1472
1473         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1474         precise values.
1475
1476 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1477
1478         Fix bug #49488
1479         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1480
1481         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1482
1483 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
1484
1485         * attribute.cs (Attribute.Resolve): Refine error reporting and
1486         report a cs0117 if the identifier does not exist, to distinguish
1487         from 0617 which is a miss-use of the actual identifier.
1488
1489         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1490         between cs0070 and cs0079.
1491
1492         * class.cs (MemberBase.DoDefine): When reporting a wrong
1493         accessibility level, we use MethodCore to compare instead of
1494         Method (this was a regression in some refactoring effort).
1495
1496         So now we correctly report cs0056 again.
1497
1498         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1499         testing the target_type (which was known to be object_type) and
1500         not the source type (which is anonymous_method).
1501
1502         Fixed reporting of error cs1660.
1503
1504         * expression.cs (UserCast.Source): Expose the underlying cast.
1505
1506         * statement.cs (Switch.SwitchGoverningType): Sort the list of
1507         allowed types to find a match to int32 first (most common).
1508
1509         In addition, it ignores any ImplicitUserConversions that did an
1510         internal implicit conversion (as the switch statement allows only
1511         one integral conversion to exist).
1512
1513         * class.cs (PartialContainer.Create): rename `name' to
1514         `member_name' for clarity.  Then replace the string calls with a
1515         call to MemberName.GetPartialName, as now using
1516         MemberName.ToString is an error (this is due to the side effects
1517         it had, that were fixed in the past).
1518
1519         This will restore the error reporting on a number of partial class
1520         errors that were missusing this (and getting an exception as a
1521         results, which is now just a plain textual warning, because
1522         yyparse debug output would crash otherwise).
1523
1524 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1525
1526         * Makefile (PROGRAM_INSTALL_DIR): Remove.
1527
1528 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1529
1530         * rootcontext.cs (LookupType): Make sure to cache lookups that
1531         don't give us a negative result. This saves about 5% of corlib
1532         compilation time.
1533
1534 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1535
1536         * report.cs (AbstractMessage.Print): messages are sent to stderr
1537
1538         * class.cs (TypeContainer.GetClassBases): It is an error to have a
1539         non-interface in the list of interfaces (at this point, either
1540         parent was properly set, or a base class is being listed in the
1541         interfaces section).
1542
1543         This flags error 1722, and resolves the crash from bug 69259.
1544
1545 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1546
1547         * statement.cs (Using.EmitExpressionFinally): make this work right
1548         for valuetypes. Fixes 69926.
1549
1550 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1551
1552         * const.cs (Const.ChangeType): Cope with the "0 literal can be
1553         converted to an enum" here, before we try to change the underlying
1554         type.  This code exists, but it is a different code path than the
1555         one used while encoding constants.
1556
1557         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1558         old bug: when converting from the null literal to a pointer,
1559         return an EmptyCast, not the NullLiteral.
1560
1561         This fixes #69921, the recent null_type changes probably made this
1562         bug more prominent.
1563
1564         (ImplicitReferenceConversionExists): In addition, resynchronized
1565         the code here, so it matches the same code in
1566         ImplicitReferenceConversionExists for the `from any class-type S
1567         to any interface-type T'.
1568         
1569
1570 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
1571
1572         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1573
1574 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
1575
1576         * cs-parser.jay: Use verbosity accordingly. 
1577
1578 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1579
1580         * expression.cs (Unary.ResolveOperator): Do not report warning;
1581         AddressOf reads from variable.
1582         
1583         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1584
1585 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1586
1587         Fix bug #69462
1588
1589         * attribute.cs (Attributable): Removed CheckTargets.
1590         (Attributes.Emit): Explicit attribute targets are tested here.
1591
1592         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1593         not enabled for interfaces.
1594
1595         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1596         (GetAssemblyName): Ouch next bug there.
1597
1598 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1599
1600         * expression.cs: Error 275 added.
1601         
1602 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1603
1604         Fix bug #69177 (Implemented decimal constant support)
1605
1606         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1607         (BinaryFold): Add DecimalConstant.
1608
1609         * const.cs (Define): Decimal constant 
1610         (is not constant.
1611         (ChangeType): Add decimal type handling.
1612         (LookupConstantValue): Don't set value for decimal type but
1613         emit DecimalConstantAttribute. Needed for constant optimization.
1614
1615         * constant.cs (ToDecimal): New method.
1616         (ConvertToDecimal): New method.
1617         (IntConstant): Implemented ConvertToDecimal.
1618         (DecimalConstant.Emit): Emit optimized version for decimals in
1619         int range.
1620
1621         * expression.cs (ResolveOperator): Changed order of constant
1622         reduction to work correctly with native types which have
1623         overloaded operators.
1624         (ResolveMemberAccess): Extract constant value from attribute
1625         for decimal type.
1626
1627         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1628
1629         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1630         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1631         (ChangeType): Decimal is special.
1632         (TypeToCoreType): Add decimal type.
1633
1634 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1635
1636         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1637         decimal types.
1638
1639 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1640
1641         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1642         test cs1667-5.cs.
1643
1644 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1645
1646         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1647
1648         * pending.cs (PendingImplementation): Grab only interfaces.
1649
1650 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1651
1652         * statement.cs (ForeachHelperMethods): Add location member and
1653         error 202 detection.
1654
1655 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1656
1657         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
1658         automatically handled by executable.make.
1659         (PROGRAM): Make profile-specific.
1660
1661 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1662
1663         * expression.cs (DoResolveBase): Fixed wrong warning for out
1664         variables.
1665
1666 2004-11-18  Martin Baulig  <martin@ximian.com>
1667
1668         Merged latest changes into gmcs.  Please keep this comment in
1669         here, it makes it easier for me to see what changed in MCS since
1670         the last time I merged.
1671
1672 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1673
1674         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1675         (TypeHandle.GetMemberCache): New.
1676         (TypeHandle.TypeHandle): Update.
1677         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1678         (TypeManager.LookupParentInterfacesCache):
1679         Rename from LookupInterfaceCache.  Optimize slightly.
1680         (TypeManager.MemberLookup_FindMembers): Update.
1681         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1682         multi-type variant.
1683         (AddCacheContents): Rename from AddHashtable.
1684         * class.cs (TypeContainer.parent_container): Remove.
1685         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1686         (TypeContainer.DoDefineMembers): Don't initialize it.
1687         Update to name changes.
1688         
1689 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1690
1691         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1692         that factors the code to check access modifiers on override.  
1693
1694         (PropertyBase): Use the code here.
1695
1696         Patch from Lluis S'anchez, fixes bug #69361.
1697
1698 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1699
1700         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1701         routine that is used to report the use of a captured variable
1702         whose address has been taken.
1703
1704         There are two checks: one when variables are being captured and
1705         the other check is when the address of a variable is taken. 
1706         
1707         (because an anonymous methods might be resolved before *or* after
1708         the address has been taken) and 
1709
1710         * expression.cs (Conditional.DoResolve): Remove the special
1711         casing that Martin added to trueExpr and falseExpr being both
1712         NullLiteral.  We get the right behavior now just by introducing
1713         the null_type into the compiler. 
1714
1715         * convert.cs (ExplicitConversion): Change the code to use
1716         null_type instead of testing `expr is NullLiteral'.
1717         (ImplicitConversionStandard): use null_type too.
1718         (ImplicitReferenceConversionExists): use null_type too.
1719         (ImplicitReferenceConversion): use null_type too.
1720
1721         * literal.cs: The type of `NullLiteral' is now null_type instead
1722         of object_type. 
1723         (Resolve): Set the type here.
1724
1725         * typemanager.cs: Introduce null_type.
1726
1727 2004-11-17  Martin Baulig  <martin@ximian.com>
1728
1729         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1730         direction, like FindMembers() does.  Fixes #69546, testcase is in
1731         test-315.cs.    
1732
1733 2004-11-16  Martin Baulig  <martin@ximian.com>
1734
1735         This is based on a patch from Marek Safar, see bug #69082.
1736         Fixes bugs #63705 and #67130.
1737
1738         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1739         method; create a MemberCache for an interface type and cache the
1740         result.
1741
1742         * decl.cs (IMemberContainer.ParentContainer): Removed.
1743         (IMemberContainer.ParentCache): New property.
1744         (MemberCache.SetupCacheForInterface): Removed.
1745         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1746         to create a cache for an interface's "parent".
1747
1748         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1749         interfaces too.
1750
1751 2004-11-16  Martin Baulig  <martin@ximian.com>
1752
1753         Merged back from gmcs; these changes already went into gmcs a
1754         couple of weeks ago.
1755
1756         * typemanager.cs
1757         (TypeManager.AddUserType): Removed the `ifaces' argument.
1758         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
1759         `TypeExpr []'.
1760         (TypeManager.AddUserInterface): Removed.
1761         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
1762         `TypeExpr []'.
1763         (TypeManager.GetInterfaces): Likewise.
1764         (TypeManager.GetExplicitInterfaces): Likewise.
1765
1766         * ecore.cs (TypeExpr.GetInterfaces): Removed.
1767
1768         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
1769         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
1770
1771 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1772
1773         * statement.cs: Avoid adding bools to a hashtable.
1774
1775 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1776
1777         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1778         calling an unsafe method from a safe location.
1779
1780 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1781
1782         Fix #69167
1783         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1784
1785 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1786
1787         * namespace.cs (VerifyUsing): use GetPartialName instead of
1788         ToString. 
1789
1790 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1791
1792         * statement.cs (Return.Resolve): Fix regression in typo: if
1793         `in_exc', we have to request a NeedReturnLabel, this was a typo
1794         introduced in the anonymous method check-in.  Fixes #69131.
1795
1796         * Indexers were using the ShortName when defining themselves,
1797         causing a regression in the compiler bootstrap when applying the
1798         patch from 2004-11-02 (first part), now they use their full name
1799         and the bug is gone.
1800
1801 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1802
1803         * driver.cs: Strip the path from the names of embedded resources. Fixes
1804         #68519.
1805
1806 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1807
1808         Fix error message regression: cs0104-2.cs.
1809         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1810         (AliasEntry.Resolve): Update.
1811         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1812         'silent' flag.
1813         (RootContext.LookupType): Update.
1814
1815 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1816
1817         * cs-parser.jay: Add support for handling accessor modifiers
1818         * class: Add support port accessor modifiers and error checking,
1819         define PropertyMethod.Define as virtual (not abstract anymore)
1820         * ecore.cs: Add checking for proeprties access with access modifiers
1821         * iterators.cs: Modify Accessor constructor call based in the modified
1822         constructor
1823 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1824
1825         * expression.cs (StringConcat): Handle being called twice,
1826         as when we have a concat in a field init with more than two
1827         ctors in the class
1828
1829 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1830
1831         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1832         special case explicit implementations, we should always produce
1833         the .property or .event declaration.
1834         
1835         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1836         since it will not return correct data if people use this
1837         unresolved in the presence of using statements (see test-313).
1838
1839         * class.cs (MethodData.Define): If we are an explicit interface
1840         implementation, set the method name to the full name of the
1841         interface plus the name of the method.  
1842
1843         Notice that using the method.MethodName.GetFullName() does not
1844         work, as it will only contain the name as declared on the source
1845         file (it can be a shorthand in the presence of using statements)
1846         and not the fully qualifed type name, for example:
1847
1848         using System;
1849
1850         class D : ICloneable {
1851                 object ICloneable.Clone ()  {
1852                 }
1853         }
1854
1855         Would produce a method called `ICloneable.Clone' instead of
1856         `System.ICloneable.Clone'.
1857
1858         * namespace.cs (Alias.Resolve): Use GetPartialName.
1859         
1860 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1861
1862         * cs-parser.jay: Add error 1055 report.
1863
1864 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1865
1866         * assign.cs (Assign.DoResolve): Only do the transform of
1867         assignment into a New if the types are compatible, if not, fall
1868         through and let the implicit code deal with the errors and with
1869         the necessary conversions. 
1870
1871 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1872
1873         * cs-parser.jay: Add error 1031 report.
1874
1875         * cs-tokenizer.cs: Add location for error 1038.
1876
1877 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1878
1879         * cs-parser.jay: Add error 1016 report.
1880
1881 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1882
1883         * cs-parser.jay: Add errors 1575,1611 report.
1884
1885 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1886
1887         * cs-parser.jay: Add error 1001 report.
1888
1889 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1890
1891         Fix #68850
1892         * attribute.cs (GetMarshal): Add method argument for
1893         caller identification.
1894
1895         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1896         agument for GetMarshal and RuntimeMissingSupport.
1897
1898 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1899
1900         * attribute.cs (ExtractSecurityPermissionSet): Removed
1901         TypeManager.code_access_permission_type.
1902
1903         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1904
1905 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1906
1907         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1908         for obsolete use of a variable here.   Fixes regression on errors
1909         cs0619-25 and cs0619-26.
1910
1911 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1912
1913         Fix #62358, implemented security attribute encoding.
1914
1915         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1916         Tests permitted SecurityAction for assembly or other types.
1917         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1918         data from SecurityPermissionAttribute to PermisionSet class.
1919
1920         * class.cs (ApplyAttributeBuilder): Added special handling
1921         for System.Security.Permissions.SecurityAttribute based types.
1922
1923         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1924         special handling for System.Security.Permissions.SecurityAttribute
1925         based types.
1926
1927         * enum.cs (ApplyAttributeBuilder): Added special handling
1928         for System.Security.Permissions.SecurityAttribute based types.
1929
1930         * parameter.cs (ApplyAttributeBuilder): Added special handling
1931         for System.Security.Permissions.SecurityAttribute based types.
1932
1933         * rootcontext.cs: Next 2 core types.
1934
1935         * typemanager.cs (TypeManager.security_permission_attr_type):
1936         Built in type for the SecurityPermission Attribute.
1937         (code_access_permission_type): Build in type.
1938
1939 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1940
1941         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1942         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1943         all of this information into
1944         EmitContext.EmitCapturedVariableInstance.
1945         
1946         * codegen.cs (EmitCapturedVariableInstance): move here the
1947         funcionality of emitting an ldarg.0 in the presence of a
1948         remapping.   This centralizes the instance emit code.
1949
1950         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1951         then emit a load of this: it means that we have reached the
1952         topmost ScopeInfo: the one that contains the pointer to the
1953         instance of the class hosting the anonymous method.
1954
1955         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1956         captures to the topmost CaptureContext.
1957
1958 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1959
1960         * expression.cs (LocalVariableReference): Move the knowledge about
1961         the iterators into codegen's EmitCapturedVariableInstance.
1962
1963 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1964
1965         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1966         all code paths return a value from an anonymous method (it is the
1967         same as the 161 error, but for anonymous methods).
1968
1969 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1970
1971         The introduction of anonymous methods in the compiler changed
1972         various ways of doing things in the compiler.  The most
1973         significant one is the hard split between the resolution phase
1974         and the emission phases of the compiler.
1975
1976         For instance, routines that referenced local variables no
1977         longer can safely create temporary variables during the
1978         resolution phase: they must do so from the emission phase,
1979         since the variable might have been "captured", hence access to
1980         it can not be done with the local-variable operations from the runtime.
1981         
1982         * statement.cs 
1983
1984         (Block.Flags): New flag `IsTopLevel' to indicate that this block
1985         is a toplevel block.
1986
1987         (ToplevelBlock): A new kind of Block, these are the blocks that
1988         are created by the parser for all toplevel method bodies.  These
1989         include methods, accessors and anonymous methods.
1990
1991         These contain some extra information not found in regular blocks:
1992         A pointer to an optional CaptureContext (for tracking captured
1993         local variables and parameters).  A pointer to the parent
1994         ToplevelBlock.
1995         
1996         (Return.Resolve): Catch missmatches when returning a value from an
1997         anonymous method (error 1662).
1998         Invoke NeedReturnLabel from the Resolve phase instead of the emit
1999         phase.
2000
2001         (Break.Resolve): ditto.
2002
2003         (SwitchLabel): instead of defining the labels during the
2004         resolution phase, we now turned the public ILLabel and ILLabelCode
2005         labels into methods called GetILLabelCode() and GetILLabel() that
2006         only define the label during the Emit phase.
2007
2008         (GotoCase): Track the SwitchLabel instead of the computed label
2009         (its contained therein).  Emit the code by using
2010         SwitchLabel.GetILLabelCode ().
2011
2012         (LocalInfo.Flags.Captured): A new flag has been introduce to track
2013         whether the Local has been captured or not.
2014
2015         (LocalInfo.IsCaptured): New property, used to tell whether the
2016         local has been captured.
2017         
2018         * anonymous.cs: Vastly updated to contain the anonymous method
2019         support.
2020
2021         The main classes here are: CaptureContext which tracks any
2022         captured information for a toplevel block and ScopeInfo used to
2023         track the activation frames for various local variables.   
2024
2025         Each toplevel block has an optional capture context associated
2026         with it.  When a method contains an anonymous method both the
2027         toplevel method and the anonymous method will create a capture
2028         context.   When variables or parameters are captured, they are
2029         recorded on the CaptureContext that owns them, for example:
2030
2031         void Demo () {
2032              int a;
2033              MyDelegate d = delegate {
2034                  a = 1;
2035              }
2036         }
2037
2038         Here `a' will be recorded as captured on the toplevel
2039         CapturedContext, the inner captured context will not have anything
2040         (it will only have data if local variables or parameters from it
2041         are captured in a nested anonymous method.
2042
2043         The ScopeInfo is used to track the activation frames for local
2044         variables, for example:
2045
2046         for (int i = 0; i < 10; i++)
2047                 for (int j = 0; j < 10; j++){
2048                    MyDelegate d = delegate {
2049                         call (i, j);
2050                    }
2051                 }
2052
2053         At runtime this captures a single captured variable `i', but it
2054         captures 10 different versions of the variable `j'.  The variable
2055         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2056         recorded on a child.  
2057
2058         The toplevel ScopeInfo will also track information like the `this'
2059         pointer if instance variables were referenced (this is necessary
2060         as the anonymous method lives inside a nested class in the host
2061         type of the method). 
2062
2063         (AnonymousMethod): Expanded to track the Toplevel, implement
2064         `AnonymousMethod.Compatible' to tell whether an anonymous method
2065         can be converted to a target delegate type. 
2066
2067         The routine now also produces the anonymous method content
2068
2069         (AnonymousDelegate): A helper class that derives from
2070         DelegateCreation, this is used to generate the code necessary to
2071         produce the delegate for the anonymous method that was created. 
2072
2073         * assign.cs: API adjustments for new changes in
2074         Convert.ImplicitStandardConversionExists.
2075
2076         * class.cs: Adjustments to cope with the fact that now toplevel
2077         blocks are of type `ToplevelBlock'. 
2078
2079         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2080         insteda of standard blocks.
2081
2082         Flag errors if params arguments are passed to anonymous methods.
2083
2084         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2085         `CurrentAnonymousMethod' which points to the current Anonymous
2086         Method.  The variable points to the AnonymousMethod class that
2087         holds the code being compiled.  It is set in the new EmitContext
2088         created for the anonymous method.
2089
2090         (EmitContext.Phase): Introduce a variable and an enumeration to
2091         assist in enforcing some rules about when and where we are allowed
2092         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2093         only one that enfonces this right now).
2094
2095         (EmitContext.HaveCaptureInfo): new helper method that returns
2096         whether we have a CapturedContext initialized.
2097
2098         (EmitContext.CaptureVariable): New method used to register that a
2099         LocalInfo must be flagged for capturing. 
2100
2101         (EmitContext.CapturedParameter): New method used to register that a
2102         parameters must be flagged for capturing. 
2103         
2104         (EmitContext.CapturedField): New method used to register that a
2105         field must be flagged for capturing. 
2106
2107         (EmitContext.HaveCapturedVariables,
2108         EmitContext.HaveCapturedFields): Return whether there are captured
2109         variables or fields. 
2110
2111         (EmitContext.EmitMethodHostInstance): This is used to emit the
2112         instance for the anonymous method.  The instance might be null
2113         (static methods), this (for anonymous methods that capture nothing
2114         and happen to live side-by-side with the current method body) or a
2115         more complicated expression if the method has a CaptureContext.
2116
2117         (EmitContext.EmitTopBlock): Routine that drives the emission of
2118         code: it will first resolve the top block, then emit any metadata
2119         and then emit the code.  The split is done so that we can extract
2120         any anonymous methods and flag any captured variables/parameters.
2121         
2122         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2123         during this phase, the ILGenerator should not be used as labels
2124         and local variables declared here might not be accessible to any
2125         code that is part of an anonymous method.  
2126
2127         Exceptions to this include the temporary variables that are
2128         created by some statements internally for holding temporary
2129         variables. 
2130         
2131         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2132         metadata for a cb
2133
2134         (EmitContext.TemporaryReturn): This method is typically called
2135         from the Emit phase, and its the only place where we allow the
2136         ReturnLabel to be defined other than the EmitMeta.  The reason is
2137         that otherwise we would have to duplicate a lot of logic in the
2138         Resolve phases of various methods that today is on the Emit
2139         phase. 
2140
2141         (EmitContext.NeedReturnLabel): This no longer creates the label,
2142         as the ILGenerator is not valid during the resolve phase.
2143
2144         (EmitContext.EmitThis): Extended the knowledge in this class to
2145         work in anonymous methods in addition to iterators. 
2146
2147         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2148         code is necessary on the stack to access the instance to a local
2149         variable (the variable will be accessed as a field).
2150
2151         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2152         EmitContext.EmitAddressOfParameter): Routines to support
2153         parameters (not completed at this point). 
2154         
2155         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2156         will also remove the parameters.
2157
2158         * convert.cs (Convert): Define a `ConstantEC' which points to a
2159         null.  This is just to prefity some code that uses
2160         ImplicitStandardConversion code and do not have an EmitContext
2161         handy.
2162
2163         The idea is to flag explicitly that at that point in time, it is
2164         known that the conversion will not trigger the delegate checking
2165         code in implicit conversions (which requires a valid
2166         EmitContext). 
2167
2168         Everywhere: pass new EmitContext parameter since
2169         ImplicitStandardConversionExists now requires it to check for
2170         anonymous method conversions. 
2171
2172         (Convert.ImplicitStandardConversionExists): If the type of an
2173         expression is the anonymous_method_type, and the type is a
2174         delegate, we invoke the AnonymousMethod.Compatible method to check
2175         whether an implicit conversion is possible. 
2176
2177         (Convert.ImplicitConversionStandard): Only do implicit method
2178         group conversions if the language level is not ISO_1.
2179
2180         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2181         MethodInfo for the Invoke method.  used by Delegate and
2182         AnonymousDelegate.
2183
2184         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2185         method conversions if the target type is a delegate.
2186
2187         Removed extra debugging nops.
2188
2189         (LocalVariableReference): Turn the `local_info' into a public
2190         field. 
2191
2192         Add `prepared' field, the same hack used for FieldExprs to cope
2193         with composed assignments, as Local variables do not necessarily
2194         operate purely on the stack as they used to: they can be captured
2195         fields. 
2196
2197         Add `temp' for a temporary result, like fields.
2198
2199         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2200
2201         It now copes with Local variables that are captured and emits the
2202         proper instance variable to load it from a field in the captured
2203         case. 
2204
2205         (ParameterReference.DoResolveBase): During the resolve phase,
2206         capture parameters if we are in an anonymous method.
2207
2208         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2209         anonymous method, use the EmitContext helper routines to emit the
2210         parameter reference.
2211
2212         * iterators.cs: Set RemapToProxy to true/false during the
2213         EmitDispose class.
2214
2215         * parameters.cs (GetParameterByName): New helper method. 
2216
2217         * typemanager.cs (anonymous_method_type) a new type that
2218         represents an anonyous method.  This is always an internal type,
2219         used as a fencepost to test against the anonymous-methodness of an
2220         expression. 
2221         
2222 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2223
2224         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2225         561 report.
2226         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2227
2228 2004-10-18  Martin Baulig  <martin@ximian.com>
2229
2230         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2231         `Type' directly, but call ResolveType() on it.
2232         (Catch.Resolve): Likewise.
2233         (Foreach.Resolve): Likewise.
2234
2235 2004-10-18  Martin Baulig  <martin@ximian.com>
2236
2237         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2238         `Type' directly, but call ResolveType() on it.
2239         (Probe.DoResolve): Likewise.
2240         (ArrayCreation.LookupType): Likewise.
2241         (TypeOf.DoResolve): Likewise.
2242         (SizeOf.DoResolve): Likewise.
2243
2244 2004-10-18  Martin Baulig  <martin@ximian.com>
2245
2246         * expression.cs (Invocation.BetterFunction): Put back
2247         TypeManager.TypeToCoreType().
2248
2249 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2250
2251         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2252         the ResolveType.
2253
2254 2004-10-18  Martin Baulig  <martin@ximian.com>
2255
2256         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
2257         `Type' directly, but call ResolveType() on it.
2258
2259 2004-10-18  Martin Baulig  <martin@ximian.com>
2260
2261         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2262         `Type' directly, but call ResolveType() on it.
2263         (MemberBase.DoDefine): Likewise.
2264
2265         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2266         `Type' directly, but call ResolveType() on it.
2267         (ComposedCast.DoResolveAsTypeStep): Likewise.
2268
2269         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2270         `Type' directly, but call ResolveType() on it.
2271
2272 2004-10-17  John Luke  <john.luke@gmail.com>
2273
2274         * class.cs (Operator.GetSignatureForError): use CSharpName
2275
2276         * parameter.cs (Parameter.GetSignatureForError): Returns
2277         correct name even if was not defined.
2278
2279 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2280
2281         Fix #65816.
2282         * class.cs (TypeContainer.EmitContext): New property.
2283         (DefineNestedTypes): Create an emitcontext for each part.
2284         (MethodCore.DoDefineParameters): Use container's emitcontext.
2285         Pass type array to InternalParameters.
2286         (MemberBase.DoDefine): Use container's emitcontext.
2287         (FieldMember.Define): Likewise.
2288         (Event.Define): Likewise.
2289         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2290         Pass type array to InternalParameters.
2291         (SetIndexerMethod.GetParameterInfo): Likewise.
2292         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2293         * delegate.cs (Define): Pass emitcontext to
2294         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2295         array to InternalParameters.
2296         * expression.cs (ParameterReference.DoResolveBase): Pass
2297         emitcontext to GetParameterInfo.
2298         (ComposedCast.DoResolveAsTypeStep): Remove check on
2299         ec.ResolvingTypeTree.
2300         * parameter.cs (Parameter.Resolve): Change argument to
2301         EmitContext.  Use ResolveAsTypeTerminal.
2302         (Parameter.GetSignature): Change argument to EmitContext.
2303         (Parameters.ComputeSignature): Likewise.
2304         (Parameters.ComputeParameterTypes): Likewise.
2305         (Parameters.GetParameterInfo): Likewise.
2306         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2307         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2308         * support.cs (InternalParameters..ctor): Remove variant that takes
2309         a DeclSpace.
2310         * typemanager.cs (system_intptr_expr): New.
2311         (InitExpressionTypes): Initialize it.
2312
2313 2004-10-12  Chris Toshok  <toshok@ximian.com>
2314
2315         * cs-parser.jay: fix location for try_statement and catch_clause.
2316
2317 2004-10-11  Martin Baulig  <martin@ximian.com>
2318
2319         * report.cs: Don't make --fatal abort on warnings, we have
2320         -warnaserror for that.
2321
2322 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2323
2324         More DeclSpace.ResolveType avoidance.
2325         * decl.cs (MemberCore.InUnsafe): New property.
2326         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2327         with newly created EmitContext.
2328         (FieldMember.Define): Likewise.
2329         * delegate.cs (Delegate.Define): Likewise.
2330         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2331         only if normal name-lookup fails.
2332         (TypeExpr.DoResolve): Enable error-checking.
2333         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2334         (SizeOf.DoResolve): Likewise.
2335         (ComposedCast.DoResolveAsTypeStep): Likewise.
2336         (StackAlloc.DoResolve): Likewise.
2337         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2338         (Block.Unsafe): New property.
2339         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2340         (Unsafe): Set 'unsafe' flag of contained block.
2341         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2342         (Fixed.Resolve): Likewise.
2343         (Catch.Resolve): Likewise.
2344         (Using.ResolveLocalVariableDecls): Likewise.
2345         (Foreach.Resolve): Likewise.
2346
2347 2004-10-05  John Luke <john.luke@gmail.com>
2348
2349         * cs-parser.jay: add location to error CS0175
2350
2351 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2352
2353         * ecore.cs (Expression.Constantity): Add support for turning null
2354         into a constant.
2355
2356         * const.cs (Const.Define): Allow constants to be reference types
2357         as long as the value is Null.
2358
2359 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2360
2361         * namespace.cs (NamespaceEntry.Using): No matter which warning
2362         level is set, check if this namespace name has already been added.
2363
2364 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2365
2366         * expression.cs: reftype [!=]= null should always use br[true,false].
2367         # 67410
2368
2369 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2370
2371         Fix #67108
2372         * attribute.cs: Enum conversion moved to 
2373         GetAttributeArgumentExpression to be applied to the all
2374         expressions.
2375
2376 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2377
2378         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2379         * class.c (TypeContainer.DefineType): Flag error if
2380         base types aren't accessible due to access permissions.
2381         * decl.cs (DeclSpace.ResolveType): Move logic to
2382         Expression.ResolveAsTypeTerminal.
2383         (DeclSpace.ResolveTypeExpr): Thin layer over
2384         Expression.ResolveAsTypeTerminal.
2385         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2386         Refactor code into NestedAccess.  Use it.
2387         (DeclSpace.NestedAccess): New.
2388         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2389         argument to silence errors.  Check access permissions.
2390         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2391         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2392         (Cast.DoResolve): Likewise.
2393         (New.DoResolve): Likewise.
2394         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2395         (TypeOf.DoResolve): Likewise.
2396
2397         * expression.cs (Invocation.BetterConversion): Return the Type of
2398         the better conversion.  Implement section 14.4.2.3 more faithfully.
2399         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2400         section 14.4.2.2 explicit.
2401         (Invocation.OverloadResolve): Update.
2402         (Invocation): Remove is_base field.
2403         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2404         (Invocation.Emit): Likewise.
2405
2406 2004-09-27  Raja R Harinath  <rharinath@novell.com>
2407
2408         * README: Update to changes.
2409
2410 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2411
2412         * cs-parser.jay: Reverted 642 warning fix.
2413
2414 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2415
2416         Fix bug #66615
2417         * decl.cs (FindMemberWithSameName): Indexer can have more than
2418         1 argument.
2419
2420 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2421
2422         * expression.cs (LocalVariableReference.DoResolveLValue):
2423         Do not report warning 219 for out values.
2424         (EmptyExpression.Null): New member to avoid extra allocations.
2425
2426 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2427
2428         * cs-parser.jay: Fix wrong warning 642 report.
2429
2430         * cs-tokenizer.cs (CheckNextToken): New helper;
2431         Inspect next character if is same as expected.
2432
2433 2004-09-23  Martin Baulig  <martin@ximian.com>
2434
2435         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2436         (Convert.ImplicitReferenceConversionExists): Likewise.
2437
2438 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2439
2440         * class.cs (Operator.Define): Add error 448 and 559 report.
2441
2442 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2443
2444         * class.cs (MemberBase.IsTypePermitted): New protected
2445         method for checking error CS0610.
2446
2447 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2448
2449         * class.cs (TypeContainer.HasExplicitLayout): New property
2450         Returns whether container has StructLayout attribute set Explicit.
2451         (FieldMember): New abstract class for consts and fields.
2452         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2453         (Field): Reuse FieldMember.
2454
2455         * const.cs (Const): Reuse FieldMember.
2456
2457         * rootcontext.cs: EmitConstants call moved to class.
2458
2459 2004-09-22  Martin Baulig  <martin@ximian.com>
2460
2461         Thanks to Peter Sestoft for this bug report.
2462
2463         * expression.cs (Conditional): If both the `trueExpr' and the
2464         `falseExpr' is a NullLiteral, return a NullLiteral.
2465
2466 2004-09-22  Martin Baulig  <martin@ximian.com>
2467
2468         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2469         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2470         for the "get_Current" call.
2471
2472 2004-09-22  Martin Baulig  <martin@ximian.com>
2473
2474         Marek and me just fixed one of our oldest bugs: #28562 :-)
2475
2476         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2477
2478         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2479         we're an EnumConstant, just return that.
2480         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2481         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2482         to get the value which'll actually be written into the attribute.
2483         However, we have to use GetValue() to access the attribute's value
2484         in the compiler.        
2485
2486 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2487
2488         * constant.cs (Constant.IsNegative): New abstract property
2489         IsNegative.
2490
2491         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2492         (StackAlloc.DoResolve): Reused IsNegative.
2493
2494 2004-09-21  Martin Baulig  <martin@ximian.com>
2495
2496         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
2497         if we're used in an iterator, we may be called from different
2498         methods.
2499
2500         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
2501         we actually have an exception block.
2502
2503 2004-09-20  John Luke <jluke@cfl.rr.com>
2504
2505         * class.cs, cs-parser.jay: Improve the error report for 1520:
2506         report the actual line where the error happens, not where the
2507         class was declared.
2508
2509         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
2510         Pass location information that was available elsewhere.
2511
2512 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
2513
2514         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
2515         runtime to delay sign assemblies.
2516
2517 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
2518
2519         * cs-parser.jay: Do not report the stack trace, this is barely
2520         used nowadays.
2521
2522 2004-08-22  John Luke  <john.luke@gmail.com>
2523  
2524         * driver.cs : check that a resource id is not already used
2525         before adding it, report CS1508 if it is, bug #63637
2526
2527 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
2528
2529         * ecore.cs: Removed dead code.
2530
2531 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
2532
2533         * class.cs: Do not report warning CS0067 on the interfaces.
2534
2535 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
2536
2537         * cs-parser.jay: Add error 504 report.
2538
2539 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
2540
2541         * rootcontext.cs: WarningLevel is 4 by default now.
2542
2543         * statement.cs (Fixed.Resolve): Do not null
2544         VariableInfo.
2545
2546 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
2547
2548         Fixed bug #55780
2549         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
2550         deep search when property is not virtual.
2551         (PropertyExpr.ResolveAccessors): Make one call for both
2552         accessors.
2553
2554 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
2555
2556         Fixed bug #65766
2557         * statement.cs: Error 152 report constains also location.
2558
2559 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
2560
2561         Fixed bug #65766
2562         * const.cs: Explicitly set constant as static.
2563
2564 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
2565
2566         Fixed bug #64226
2567         * cs-parser.jay: Add error 1017 report.
2568
2569 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
2570
2571         Fixed bug #59980, #64224
2572         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
2573
2574         * typemanager.cs (IsSpecialMethod): Simplified
2575
2576 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2577
2578         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
2579         condition with better params.
2580
2581 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2582
2583         Fixed bug #65238
2584         * attribute.cs (Resolve): Property has to have both
2585         accessors.
2586
2587 2004-09-14  Martin Baulig  <martin@ximian.com>
2588
2589         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2590
2591 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2592
2593         Fixed bug #61902
2594         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2595         called and is obsolete then this member suppress message
2596         when call is inside next [Obsolete] method or type.
2597
2598         * expression.cs: Use TestObsoleteMethodUsage member.
2599
2600 2004-09-14  Martin Baulig  <martin@ximian.com>
2601
2602         * cs-parser.jay: Sync a bit with the GMCS version.
2603
2604 2004-09-14  Martin Baulig  <martin@ximian.com>
2605
2606         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
2607         (CSharpParser.yacc_verbose_flag): New public field.
2608
2609         * genericparser.cs: Removed.
2610
2611 2004-09-14  Raja R Harinath  <rharinath@novell.com>
2612
2613         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
2614
2615 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2616
2617         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2618
2619 2004-09-10  Martin Baulig  <martin@ximian.com>
2620
2621         Backported my MemberName changes from GMCS into MCS.
2622
2623         - we are now using a special `MemberName' class instead of using
2624         strings; in GMCS, the `MemberName' also contains the type
2625         arguments.
2626
2627         - changed the grammar rules a bit:
2628           * the old `member_name' is now a `namespace_or_type_name':
2629             The rule is that we use `namespace_or_type_name' everywhere
2630             where we expect either a "member name" (GetEnumerator) or a
2631             "member name" with an explicit interface name
2632             (IEnumerable.GetEnumerator).
2633             In GMCS, the explicit interface name may include type arguments
2634             (IEnumerable<T>.GetEnumerator).
2635           * we use `member_name' instead of just `IDENTIFIER' for
2636             "member names":
2637             The rule is that we use `member_name' wherever a member may
2638             have type parameters in GMCS.       
2639
2640         * decl.cs (MemberName): New public class.
2641         (MemberCore.MemberName): New public readonly field.
2642         (MemberCore.ctor): Take a `MemberName' argument, not a string.
2643         (DeclSpace): Likewise.
2644
2645         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
2646         * enum.cs (Enum.ctor): Likewise.
2647
2648         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
2649         MemberName.     
2650         (AliasEntry.ctor): Take a MemberName, not an Expression.
2651         (AliasEntry.UsingAlias): Likewise.
2652
2653         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
2654         (IMethodData.MemberName): Changed type from string to MemberName.
2655         (MemberBase.ExplicitInterfaceName): Likewise.
2656         (AbstractPropertyEventMethod.SetupName): Make this private.
2657         (AbstractPropertyEventMethod.ctor): Added `string prefix'
2658         argument; compute the member name here.
2659         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
2660         on the `member.MemberName' and the `prefix'.
2661
2662         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
2663         not `type_name'.
2664         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
2665         thus, we get a `MemberName' instead of a `string'.  These
2666         declarations may have type parameters in GMCS.
2667         (interface_method_declaration, delegate_declaration): Likewise.
2668         (class_declaration, interface_declaration): Likewise.
2669         (method_header): Use `namespace_or_type_name' instead of
2670         `member_name'.  We may be an explicit interface implementation.
2671         (property_declaration, event_declaration): Likewise.
2672         (member_name): This is now just an `IDENTIFIER', not a
2673         `namespace_or_type_name'.
2674         (type_name, interface_type): Removed.
2675         (namespace_or_type_name): Return a MemberName, not an Expression.
2676         (primary_expression): Use `member_name' instead of `IDENTIFIER';
2677         call GetTypeExpression() on the MemberName to get an expression.
2678         (IndexerDeclaration.interface_type): Changed type from string to
2679         MemberName.
2680         (MakeName): Operate on MemberName's instead of string's.
2681
2682 2004-09-13  Raja R Harinath  <rharinath@novell.com>
2683
2684         Fix bug #55770.
2685         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
2686         (NamespaceEntry.Lookup): Add new argument to flag if we want the
2687         lookup to avoid symbols introduced by 'using'.
2688         * rootcontext.cs (NamespaceLookup): Update.
2689
2690 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2691
2692         * class.cs (TypeContainer.DoDefineMembers): Do not call
2693         DefineDefaultConstructor for static classes.
2694
2695 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2696
2697         * attribute.cs (Attribute.Resolve): Add error 653 report.
2698
2699         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2700         report.
2701         (Method.ApplyAttributeBuilder): Add error 685 report.
2702         (Operator.Define): Add error 564 report.
2703
2704         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2705
2706         * expression.cs (Invocation.DoResolve): Add error
2707         245 and 250 report.
2708
2709         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2710         error 674 report.
2711
2712 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2713
2714         * class.cs (ConstructorInitializer.Resolve):
2715         Wrong error number (515->516).
2716
2717 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2718
2719         * class.cs (Indexer.Define): Add error 631 report.
2720
2721 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2722
2723         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2724
2725 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2726
2727         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2728
2729 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2730
2731         * cs-parser.jay: Added error CS0241 report.
2732
2733 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2734
2735         * cs-parser.jay (fixed_statement): Introduce a scope for the
2736         declaration in the 'fixed' statement.
2737
2738 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2739
2740         * cs-parser.jay: Added CS0230 error report.
2741
2742 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2743
2744         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2745
2746 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2747
2748         * expression.cs (Argument.Resolve): Added error CS0192 and
2749         CS0199 report.
2750
2751 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2752
2753         C# 2.0 #pragma warning feature
2754
2755         * cs-tokenizer.cs (PreProcessPragma): New method; 
2756         Handles #pragma directive.
2757
2758         * report.cs (WarningRegions): New class; Support
2759         class for #pragma warning directive. It tests whether
2760         warning is enabled for a given line.
2761
2762 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2763
2764         * const.cs: Add more descriptive error report, tahnks to
2765         Sebastien. 
2766
2767 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2768
2769         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2770
2771 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2772
2773         * expression.cs: Apply patch from Ben: Remove dead code from
2774         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2775         as that code just threw an exception anwyays.
2776
2777         * const.cs: Remove the call to the turnintoconstant, for details
2778         see bug: #63144
2779         
2780         * literal.cs: The type of the null-literal is the null type;  So
2781         we use a placeholder type (literal.cs:System.Null, defined here)
2782         for it.
2783
2784         * expression.cs (Conditional.DoResolve): Remove some old code that
2785         is no longer needed, conversions have been fixed.
2786
2787         (ArrayCreationExpression.DoResolve): Return false if we fail to
2788         resolve the inner expression.
2789
2790 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2791
2792         Fix test-290.cs.
2793         * cs-parser.jay (delegate_declaration): Record a delegate
2794         declaration as a type declaration.
2795         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2796
2797 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2798
2799         * parameter.cs: Do not crash if the type can not be resolved. 
2800
2801         * expression.cs: Report errors with unsafe pointers, fixes #64896
2802
2803 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2804
2805         * expression.cs: Pointer arith always needs to do a conv.i
2806         if the operand is a long. fix 65320
2807
2808 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2809
2810         Fixed cs0619-37.cs, cs0619-38.cs
2811
2812         * enum.cs (GetObsoleteAttribute): Removed.
2813
2814         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2815         on Enum member is double staged. The first is tested member
2816         and then enum.
2817
2818 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2819
2820         Fixed #56986, #63631, #65231
2821
2822         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2823         adds member to name container.
2824         (TypeContainer.AddToTypeContainer): New method, adds type to
2825         name container.
2826         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2827         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2828         AddOperator): Simplified by reusing AddToMemberContainer.
2829         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2830         instead of field.
2831         (Method.CheckForDuplications): Fixed implementation to test all
2832         possibilities.
2833         (MemberBase): Detection whether member is explicit interface
2834         implementation is now in constructor.
2835         (MemberBase.UpdateMemberName): Handles IndexerName.
2836         (Accessor): Changed to keep also location information.
2837         (AbstractPropertyEventMethod): Is derived from MemberCore.
2838         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2839         will be emited or not.
2840         (PropertyBase.AreAccessorsDuplicateImplementation):
2841         Tests whether accessors are not in collision with some method.
2842         (Operator): Is derived from MethodCore to simplify common
2843         operations.
2844
2845         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2846         must be performed.
2847         (DeclSpace.AddToContainer): Adds the member to defined_names
2848         table. It tests for duplications and enclosing name conflicts.
2849
2850         * enum.cs (EnumMember): Clean up to reuse the base structures
2851
2852 2004-09-03  Martin Baulig  <martin@ximian.com>
2853
2854         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2855         into TypeContainer, to make partial classes work again.
2856
2857 2004-09-03  Martin Baulig  <martin@ximian.com>
2858
2859         * rootcontext.cs (RootContext.V2): Removed.
2860
2861 2004-03-23  Martin Baulig  <martin@ximian.com>
2862
2863         * expression.cs (Invocation.OverloadResolve): Added `bool
2864         may_fail' argument and use it instead of the Location.IsNull() hack.
2865
2866 2004-09-03  Martin Baulig  <martin@ximian.com>
2867
2868         Merged latest changes into gmcs.  Please keep this comment in
2869         here, it makes it easier for me to see what changed in MCS since
2870         the last time I merged.
2871
2872 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2873
2874         Fix #61128.
2875         * expression.cs (BetterConversion): Don't allow either conversion 
2876         to be null.  Remove redundant implicit conversion test when 'q ==
2877         null' -- when this function is invoked, we already know that the
2878         implicit conversion exists.
2879         (BetterFunction): Assume that 'best' is non-null.  Remove
2880         redundant reimplementation of IsApplicable when 'best' is null.
2881         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2882         number of arguments.
2883         (IsAncestralType): Extract from OverloadResolve.
2884         (OverloadResolve): Make robust to the MethodGroupExpr being
2885         unsorted.  Implement all the logic of Section 14.5.5.1, and
2886         support overloading of methods from multiple applicable types.
2887         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
2888
2889         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2890         (RealError, Warning): Append type of report to related symbol.
2891
2892 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
2893
2894         * enum.cs: Fixed CLS-Compliance checks for enum members.
2895         Error tests cs3008-8.cs, cs3014-8.cs
2896
2897 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2898
2899         Fixed bug #62342, #63102
2900         * class.cs: ImplementIndexer uses member.IsExplicitImpl
2901         like ImplementMethod.
2902
2903 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2904
2905         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2906         Fixed bug #65170.
2907
2908 2004-09-02  Martin Baulig  <martin@ximian.com>
2909
2910         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2911         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2912         on the MethodBase.
2913
2914 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
2915
2916         C# 2.0 Static classes implemented
2917
2918         * class.cs (TypeContainer): instance_constructors,
2919         initialized_fields, initialized_static_fields,
2920         default_constructor, base_inteface_types are protected to be
2921         accessible from StaticClass.
2922         (TypeContainer.DefineDefaultConstructor): New virtual method
2923         for custom default constructor generating
2924         (StaticClass): New class to handle "Static classes" feature.
2925
2926         * cs-parser.jay: Handle static keyword on class like instance
2927         of StaticClass.
2928
2929         * driver.cs: Added "/langversion" command line switch with two
2930         options (iso-1, default).
2931
2932 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
2933
2934         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
2935
2936 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
2937
2938         * delegate.cs: Style.
2939
2940 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2941
2942         * delegate.cs: Add seperate instance expr field for miguel.
2943
2944 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2945
2946         * PointerArithmetic (Resolve): make sure we are not doing
2947         pointer arith on void*. Also, make sure we are resolved
2948         by not setting eclass until resolve.
2949
2950         All callers: Make sure that PointerArithmetic gets resolved.
2951
2952 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2953
2954         * ArrayCreation (LookupType): If the type does not resolve 
2955         to an array, give an error.
2956
2957 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
2958
2959         * statement.cs (Try.Resolve): Fixed bug #64222
2960
2961 2004-08-27  Martin Baulig  <martin@ximian.com>
2962
2963         * class.cs
2964         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
2965         crash here.     
2966
2967 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
2968
2969         * ecore.cs (Constantify): Get underlying type via
2970         System.Enum.GetUnderlyingType to avoid StackOverflow on the
2971         Windows in special cases.
2972
2973 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
2974
2975         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
2976         for obtaining also private methods.
2977         (GetRemoveMethod): Used GetRemoveMethod (true)
2978         for obtaining also private methods.
2979
2980 2004-08-24  Martin Baulig  <martin@ximian.com>
2981
2982         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
2983         MethodAttributes.HideBySig for operators.
2984
2985 2004-08-23  Martin Baulig  <martin@ximian.com>
2986
2987         Back to the old error reporting system :-)
2988
2989         * report.cs (Message): Removed.
2990         (Report.MessageData, ErrorData, WarningData): Removed.
2991         (Report.Error, Warning): Back to the old system.
2992
2993 2004-08-23  Martin Baulig  <martin@ximian.com>
2994
2995         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
2996
2997         * class.cs (TypeContainer.ParentContainer): New public virtual
2998         method; replaces the explicit interface implementation.
2999         (ClassPart.ParentContainer): Override.
3000
3001 2004-08-23  Martin Baulig  <martin@ximian.com>
3002
3003         * statement.cs (Switch): Added support for constant switches; see
3004         #59428 or test-285.cs.
3005
3006 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3007
3008         Fixed bug #62740.
3009         * statement.cs (GetEnumeratorFilter): Removed useless
3010         logic because C# specs is strict. GetEnumerator must be
3011         public.
3012
3013 2004-08-22  Martin Baulig  <martin@ximian.com>
3014
3015         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3016         a switch and may break, reset the barrier.  Fixes #59867.
3017
3018 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3019
3020         CLS-Compliance speed up (~5% for corlib)
3021
3022         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3023         New method. Tests container for CLS-Compliant names
3024
3025         * class.cs (TypeContainer.VerifyClsName): New method.
3026         Checks whether container name is CLS Compliant.
3027         (Constructor): Implements IMethodData.
3028
3029         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3030         low-case table for CLS Compliance test.
3031         (MemberCache.VerifyClsParameterConflict): New method.
3032         Checks method parameters for CS3006 error.
3033
3034         * enum.cs (EnumMember): Is derived from MemberCore.
3035         (Enum.VerifyClsName): Optimized for better performance.
3036
3037 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3038
3039         * report.cs: Renamed Error_T to Error and changed all
3040         references.
3041
3042 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3043
3044         * class.cs (TypeContainer.IndexerArrayList): New inner class
3045         container for indexers.
3046         (TypeContainer.DefaultIndexerName): New constant for default
3047         indexer name. Replaced all "Item" with this constant.
3048         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3049
3050         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3051         DefaultMemberAttribute constructor.
3052
3053 2004-08-05  Martin Baulig  <martin@ximian.com>
3054
3055         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3056         Fix bug #59429.
3057
3058 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3059
3060         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3061         multi platforms problem.
3062
3063         * compiler.csproj: Included shared files.
3064
3065 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3066
3067         Fix bug 60333, 55971 in the more general way
3068         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3069         Added arg_type argument for constant conversion.
3070         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3071
3072 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3073
3074         Fix bug #59760
3075         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3076         OperatorArrayList, MethodCoreArrayList for typecontainer
3077         containers. Changed class member types to these new types.
3078         (MethodArrayList.DefineMembers): Added test for CS0659.
3079
3080 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3081
3082         * cfold.cs: Synchronize the folding with the code in expression.cs
3083         Binary.DoNumericPromotions for uint operands.
3084
3085         * attribute.cs: Revert patch from Raja, it introduced a regression
3086         while building Blam-1.2.1 (hard to isolate a test case).
3087
3088 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3089
3090         Fix for #55382
3091         * class.cs:
3092         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3093         name collision.
3094         (MethodCore.parent_method): New member. The method we're overriding
3095         if this is an override method.
3096         (MethodCore.CheckBase): Moved from Method class and made common.
3097         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3098         private.
3099         (MethodCore.CheckForDuplications): New abstract method. For custom
3100         member duplication search in a container
3101         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3102         method and its return type.
3103         (Event.conflict_symbol): New member. Symbol with same name in the
3104         parent class.
3105
3106         * decl.cs:
3107         (MemberCache.FindMemberWithSameName): New method. The method
3108         is looking for conflict with inherited symbols.
3109
3110 2004-08-04  Martin Baulig  <martin@ximian.com>
3111
3112         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3113
3114         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3115
3116 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3117
3118         * report.cs (Message): New enum for better error, warning reference in
3119         the code.
3120         (MessageData): New inner abstract class. It generally handles printing of
3121         error and warning messages.
3122         Removed unused Error, Warning, Message methods.
3123
3124 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3125
3126         Fix for cs0592-8.cs test
3127         * attribute.cs
3128         (Attributable.ValidAttributeTargets): Made public.
3129         (Attribute.ExplicitTarget): New member for explicit target value.
3130         (Attribute.CheckTargets): Now we translate explicit attribute
3131         target to Target here.
3132
3133 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3134
3135         * ecore.cs (MethodGroupExpr): new IsBase property.
3136
3137         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3138
3139         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3140         rather than an instance expr.
3141
3142         (DelegateCreation.Emit): Use the method group rather than
3143         the instance expression. Also, if you have base.Foo as the
3144         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3145
3146         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3147
3148         (NewDelegate.DoResolve): Only check for the existance of Invoke
3149         if the method is going to be needed. Use MethodGroupExpr.
3150
3151         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3152
3153         * expression.cs: For pointer arith., make sure to use
3154         the size of the type, not the size of the pointer to
3155         the type.
3156
3157 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3158
3159         Fix for #60722
3160         * class.cs (Class): Added error CS0502 test.
3161
3162 2004-08-03  John Luke  <jluke@cfl.rr.com>
3163             Raja R Harinath  <rharinath@novell.com>
3164
3165         Fix for #60997.
3166         * attribute.cs (Attribute.complained_before): New flag.
3167         (Attribute.ResolveType, Attribute.Resolve),
3168         (Attribute.DefinePInvokeMethod): Set it.
3169         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3170         
3171 2004-08-03  Martin Baulig  <martin@ximian.com>
3172
3173         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3174         use a user-defined operator; we still need to do numeric
3175         promotions in case one argument is a builtin type and the other
3176         one has an implicit conversion to that type.  Fixes #62322.
3177
3178 2004-08-02  Martin Baulig  <martin@ximian.com>
3179
3180         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3181         (LocalInfo.IsThis): New public property.
3182         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3183
3184 2004-08-01  Martin Baulig  <martin@ximian.com>
3185
3186         * class.cs (TypeContainer.GetClassBases): Don't set the default
3187         here since we may get called from GetPartialBases().
3188         (TypeContainer.DefineType): If GetClassBases() didn't return a
3189         parent, use the default one.
3190
3191 2004-07-30  Duncan Mak  <duncan@ximian.com>
3192
3193         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
3194
3195 2004-07-30  Martin Baulig  <martin@ximian.com>
3196
3197         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3198
3199         * class.cs (SourceMethod): New public class, derive from the
3200         symbol writer's ISourceMethod.
3201         (Method): Use the new symbol writer API.
3202
3203         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3204         as argument and use the new symbol writer.
3205
3206         * location.cs
3207         (SourceFile): Implement the symbol writer's ISourceFile.
3208         (Location.SymbolDocument): Removed.
3209         (Location.SourceFile): New public property.
3210
3211         * symbolwriter.cs: Use the new symbol writer API.
3212
3213 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3214
3215         * Makefile (install-local): Remove.  Functionality moved to
3216         executable.make.
3217
3218 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3219
3220         * Makefile: Install mcs.exe.config file together with mcs.exe.
3221         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3222         correct runtime version.
3223         
3224 2004-07-25  Martin Baulig  <martin@ximian.com>
3225
3226         * class.cs
3227         (TypeContainer.RegisterOrder): Removed, this was unused.
3228         (TypeContainer, interface_order): Removed.
3229         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3230         TypeContainer as argument since we can also be called with a
3231         `PartialContainer' for a partial class/struct/interface.
3232         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3233         of checking whether we're an `Interface' - we could be a
3234         `PartialContainer'.
3235         (PartialContainer.Register): Override; call
3236         AddClass()/AddStruct()/AddInterface() on our parent.
3237
3238         * cs-parser.jay (interface_member_declaration): Add things to the
3239         `current_container', not the `current_class'.
3240
3241         * rootcontext.cs (RegisterOrder): The overloaded version which
3242         takes an `Interface' was unused, removed.
3243
3244         * typemanager.cs (TypeManager.LookupInterface): Return a
3245         `TypeContainer', not an `Interface'.
3246         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3247         contain a `PartialContainer' for an interface, so check it's
3248         `Kind' to figure out what it is.
3249
3250 2004-07-25  Martin Baulig  <martin@ximian.com>
3251
3252         * class.cs (Class.DefaultTypeAttributes): New public constant.
3253         (Struct.DefaultTypeAttributes): Likewise.
3254         (Interface.DefaultTypeAttributes): Likewise.
3255         (PartialContainer.TypeAttr): Override this and add the
3256         DefaultTypeAttributes.
3257
3258 2004-07-25  Martin Baulig  <martin@ximian.com>
3259
3260         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3261         we can just use the `Parent' field instead.
3262
3263 2004-07-25  Martin Baulig  <martin@ximian.com>
3264
3265         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3266
3267 2004-07-25  Martin Baulig  <martin@ximian.com>
3268
3269         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3270         our parts before defining any methods.
3271         (TypeContainer.VerifyImplements): Make this virtual.
3272         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3273         on our PartialContainer.
3274
3275 2004-07-25  Martin Baulig  <martin@ximian.com>
3276
3277         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3278
3279         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3280         argument, we can just use the `Parent' field instead.
3281
3282         * class.cs
3283         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3284         (MemberBase.DoDefine): Likewise.
3285
3286 2004-07-24  Martin Baulig  <martin@ximian.com>
3287
3288         * decl.cs (MemberCore.Parent): New public field.
3289         (DeclSpace.Parent): Moved to MemberCore.
3290
3291         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3292         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3293         parent's .ctor.
3294         (FieldBase, Field, Operator): Likewise.
3295         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3296         (EventField, Event): Likewise.
3297
3298 2004-07-23  Martin Baulig  <martin@ximian.com>
3299
3300         * class.cs (PartialContainer): New public class.
3301         (ClassPart): New public class.
3302         (TypeContainer): Added support for partial classes.
3303         (TypeContainer.GetClassBases): Splitted some of the functionality
3304         out into GetNormalBases() and GetPartialBases().
3305
3306         * cs-tokenizer.cs (Token.PARTIAL): New token.
3307         (Tokenizer.consume_identifier): Added some hacks to recognize
3308         `partial', but only if it's immediately followed by `class',
3309         `struct' or `interface'.
3310
3311         * cs-parser.jay: Added support for partial clases.
3312
3313 2004-07-23  Martin Baulig  <martin@ximian.com>
3314
3315         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3316         a `DeclSpace' and also made it readonly.
3317         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3318         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3319         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3320
3321         * cs-parser.jay: Pass the `current_class', not the
3322         `current_container' (at the moment, this is still the same thing)
3323         to a new Method, Property, Event, Indexer or Constructor.
3324
3325 2004-07-23  Martin Baulig  <martin@ximian.com>
3326
3327         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3328         and removed the `current_interface' one.
3329         (struct_declaration, class_declaration, interface_declaration):
3330         Set `current_class' to the newly created class/struct/interface;
3331         set their `Bases' and call Register() before parsing their body.
3332
3333 2004-07-23  Martin Baulig  <martin@ximian.com>
3334
3335         * class.cs (Kind): New public enum.
3336         (TypeContainer): Made this class abstract.
3337         (TypeContainer.Kind): New public readonly field.
3338         (TypeContainer.CheckDef): New public method; moved here from
3339         cs-parser.jay.
3340         (TypeContainer.Register): New public abstract method.
3341         (TypeContainer.GetPendingImplementations): New public abstract
3342         method.
3343         (TypeContainer.GetClassBases): Removed the `is_class' and
3344         `is_iface' parameters.
3345         (TypeContainer.DefineNestedTypes): Formerly known as
3346         DoDefineType().
3347         (ClassOrStruct): Made this class abstract.
3348
3349         * tree.cs (RootTypes): New public type. 
3350
3351 2004-07-20  Martin Baulig  <martin@ximian.com>
3352
3353         * tree.cs (Tree.RecordNamespace): Removed.
3354         (Tree.Namespaces): Removed.
3355
3356         * rootcontext.cs (RootContext.IsNamespace): Removed.
3357
3358         * cs-parser.jay (namespace_declaration): Just create a new
3359         NamespaceEntry here.
3360
3361 2004-07-20  Martin Baulig  <martin@ximian.com>
3362
3363         * statement.cs (ExceptionStatement): New abstract class.  This is
3364         now used as a base class for everyone who's using `finally'.
3365         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
3366         our local variables before using them.
3367
3368         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
3369         virtual method.  This is used by Yield.Resolve() to "steal" an
3370         outer block's `finally' clauses.
3371         (FlowBranchingException): The .ctor now takes an ExceptionStatement
3372         argument.
3373
3374         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
3375         version which takes an ExceptionStatement.  This version must be
3376         used to create exception branchings.
3377
3378         * iterator.cs
3379         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
3380         (Iterator.EmitMoveNext): Added exception support; protect the
3381         block with a `fault' clause, properly handle 'finally' clauses.
3382         (Iterator.EmitDispose): Run all the `finally' clauses here.
3383
3384 2004-07-20  Martin Baulig  <martin@ximian.com>
3385
3386         * iterator.cs: This is the first of a set of changes in the
3387         iterator code.  Match the spec more closely: if we're an
3388         IEnumerable, then GetEnumerator() must be called.  The first time
3389         GetEnumerator() is called, it returns the current instance; all
3390         subsequent invocations (if any) must create a copy.
3391
3392 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
3393
3394         * expression.cs: Resolve the constant expression before returning
3395         it. 
3396
3397 2004-07-19  Martin Baulig  <martin@ximian.com>
3398
3399         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
3400         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
3401         the return type of the new EmitContext.
3402
3403 2004-07-18  Martin Baulig  <martin@ximian.com>
3404
3405         * class.cs (Property.Define): Fix iterators.
3406
3407         * iterators.cs (Iterator.Define): Moved the
3408         `container.AddInterator (this)' call here from the .ctor; only do
3409         it if we resolved successfully.
3410
3411 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
3412
3413         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
3414         `true' for preprocessing directives that we parse.  The return
3415         value indicates whether we should return to regular tokenizing or
3416         not, not whether it was parsed successfully.
3417
3418         In the past if we were in: #if false ... #line #endif, we would
3419         resume parsing after `#line'.  See bug 61604.
3420
3421         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
3422         building: IsEnumType should return true only for enums, not for
3423         enums or System.Enum itself.  This fixes #61593.
3424
3425         Likely what happened is that corlib was wrong: mcs depended on
3426         this bug in some places.  The bug got fixed, we had to add the
3427         hack, which caused bug 61593.
3428
3429         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
3430         that was a workaround for the older conditions.
3431
3432 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
3433
3434         * assign.cs: IAssignMethod has a new interface, as documented
3435         inline. All assignment code now uses this new api.
3436
3437         * ecore.cs, expression.cs: All classes which implement
3438         IAssignMethod now use the new interface.
3439
3440         * expression.cs (Invocation): add a hack to EmitCall so that
3441         IndexerAccess can be the target of a compound assignment without
3442         evaluating its arguments twice.
3443
3444         * statement.cs: Handle changes in Invocation api.
3445
3446 2004-07-16  Martin Baulig  <martin@ximian.com>
3447
3448         * iterators.cs: Rewrote this.  We're now using one single Proxy
3449         class for both the IEnumerable and the IEnumerator interface and
3450         `Iterator' derives from Class so we can use the high-level API.
3451
3452         * class.cs (TypeContainer.AddIterator): New method.
3453         (TypeContainer.DoDefineType): New protected virtual method, which
3454         is called from DefineType().
3455         (TypeContainer.DoDefineMembers): Call DefineType() and
3456         DefineMembers() on all our iterators.
3457         (TypeContainer.Emit): Call Emit() on all our iterators.
3458         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3459
3460         * codegen.cs (EmitContext.CurrentIterator): New public field.
3461
3462 2004-07-15  Martin Baulig  <martin@ximian.com>
3463
3464         * typemanager.cs
3465         (TypeManager.not_supported_exception_type): New type.   
3466
3467 2004-07-14  Martin Baulig  <martin@ximian.com>
3468
3469         * iterators.cs: Use real error numbers.
3470
3471 2004-07-14  Martin Baulig  <martin@ximian.com>
3472
3473         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3474         requires this to be a System.Collection.IEnumerable and not a
3475         class implementing that interface.
3476         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3477
3478 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3479
3480         * class.cs: Fixed previous fix, it broke some error tests.
3481
3482 2004-07-12  Martin Baulig  <martin@ximian.com>
3483
3484         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3485         Fixes #61293.
3486
3487 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3488
3489         * assign.cs (LocalTemporary): Add new argument: is_address,If
3490         `is_address' is true, then the value that we store is the address
3491         to the real value, and not the value itself.
3492         
3493         * ecore.cs (PropertyExpr): use the new local temporary
3494         stuff to allow us to handle X.Y += z (where X is a struct)
3495
3496 2004-07-08  Martin Baulig  <martin@ximian.com>
3497
3498         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3499         not always return, just like we're doing in Using.Resolve().
3500
3501 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3502
3503         * cs-parser.jay (fixed_statement): flag this as Pinned.
3504
3505 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3506
3507         * typemanager.cs (TypeManager): Removed MakePinned method, this
3508         mechanism is replaced with the .NET 2.x compatible mechanism of
3509         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3510
3511         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3512         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3513         `IsFixed' property which has a different meaning.
3514
3515 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3516
3517         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3518         visible from inside a nested class, not just the names of the
3519         immediately enclosing class.
3520         Fix for bug #60730.
3521
3522 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3523
3524         * expression.cs (BetterConversion): Remove buggy special-case
3525         handling of "implicit constant expression conversions".  At this
3526         point, we already know that the conversion is possible -- we're
3527         only checking to see which is better.
3528
3529 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3530
3531         * cs-parser.jay: Added error CS0210 test.
3532
3533 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3534
3535         * cs-parser.jay: Added error CS0134 test.
3536
3537 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3538
3539         Fix bug #52507
3540         * cs-parser.jay: Added error CS0145 test.
3541
3542 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3543
3544         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3545
3546 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3547         
3548         * expression.cs (StackAlloc.Resolve): The argument may not
3549         be a constant; deal with this case.
3550         
3551 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3552
3553         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3554         GetIndexerAttributeValue.
3555         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3556
3557         * class.cs (Indexer.Define): Added error tests for CS0415,
3558         CS0609.
3559
3560 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3561
3562         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3563         property code.
3564
3565 2004-06-23  Martin Baulig  <martin@ximian.com>
3566
3567         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3568         neither return nor throw, reset the barrier as well.  Fixes #60457.
3569
3570 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3571
3572         * class.cs : EventAttributes is now set to None by default.
3573           This fixes bug #60459.
3574
3575 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3576
3577         Fix bug #60219
3578         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3579         Don't throw exception but return null (it's sufficient now).
3580
3581 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3582
3583         * typemanager.cs (GetArgumentTypes): Faster implementation.
3584
3585 2004-06-18  Martin Baulig  <martin@ximian.com>
3586
3587         * attribute.cs (Attribute.Resolve): Check whether we're an
3588         EmptyCast which a Constant child.  Fixes #60333.
3589
3590 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3591
3592         * statement.cs (EmitCollectionForeach): Account for the fact that
3593         not all valuetypes are in areas which we can take the address of.
3594         For these variables, we store to a temporary variable. Also, make
3595         sure that we dont emit a `callvirt' on a valuetype method.
3596
3597 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3598
3599         * expression.cs (StackAlloc.DoReSolve): Added test for
3600         negative parameter (CS0247).
3601
3602 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3603
3604         Fix bug #59792
3605         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3606
3607 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3608
3609         Fix bug #59781
3610         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3611         ulong.
3612
3613 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3614
3615         Fix bug #58254 & cs1555.cs, cs1556.cs
3616         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3617
3618 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3619
3620         * cs-parser.jay: Added error CS1669 test for indexers.
3621
3622 2004-06-11  Martin Baulig  <martin@ximian.com>
3623
3624         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3625         call this twice: for params and varargs methods.
3626
3627 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3628
3629         * class.cs:
3630         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3631
3632 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3633
3634         * attribute.cs (Attribute.GetValidTargets): Made public.
3635
3636         * class.cs: 
3637         (AbstractPropertyEventMethod): New class for better code sharing.
3638         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3639         CS1667 report.
3640         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3641
3642 2004-06-11  Raja R Harinath  <rharinath@novell.com>
3643
3644         Fix bug #59477.
3645         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
3646         that the call to Resolve is part of a MemberAccess.
3647         (Expression.Resolve): Use it for SimpleName resolution.
3648         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
3649         Add 'intermediate' boolean argument.
3650         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
3651         error message when the SimpleName can be resolved ambiguously
3652         between an expression and a type.
3653         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
3654         public.
3655         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
3656         call on the left-side.
3657
3658 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3659
3660         * class.cs:
3661         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
3662
3663 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3664
3665         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
3666
3667 2004-06-11  Martin Baulig  <martin@ximian.com>
3668
3669         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
3670         varargs methods if applicable.
3671
3672 2004-06-11  Martin Baulig  <martin@ximian.com>
3673
3674         * expression.cs (Invocation.EmitCall): Don't use
3675         `method.CallingConvention == CallingConventions.VarArgs' since the
3676         method could also have `CallingConventions.HasThis'.
3677
3678 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3679
3680         * class.cs (Event.GetSignatureForError): Implemented.
3681         Fixed crash in error test cs3010.cs
3682
3683 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
3684
3685         * cs-tokenizer.cs: Change the way we track __arglist to be
3686         consistent with the other keywords.
3687
3688 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
3689
3690         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
3691         tomorrow.
3692
3693 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
3694
3695         * codegen.cs: Check that all referenced assemblies have a strongname
3696         before strongnaming the compiled assembly. If not report error CS1577.
3697         Fix bug #56563. Patch by Jackson Harper.
3698         * typemanager.cs: Added a method to return all referenced assemblies.
3699         Fix bug #56563. Patch by Jackson Harper.
3700
3701 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
3702
3703         * class.cs:
3704         (Method.ApplyAttributeBuilder): Moved and added conditional
3705         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
3706
3707         * delegate.cs:
3708         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
3709
3710 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
3711
3712         Fixed #59640
3713         * class.cs: (EventField.attribute_targets): Changed default target.
3714
3715 2004-06-08  Martin Baulig  <martin@ximian.com>
3716
3717         * expression.cs (Invocation.EmitCall): Enable varargs methods.
3718
3719 2004-06-08  Martin Baulig  <martin@ximian.com>
3720
3721         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
3722
3723 2004-06-07  Martin Baulig  <martin@ximian.com>
3724
3725         Added support for varargs methods.
3726
3727         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
3728         keyword.
3729
3730         * cs-parser.jay: Added support for `__arglist'.
3731
3732         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
3733
3734         * expression.cs (Argument.AType): Added `ArgList'.
3735         (Invocation): Added support for varargs methods.
3736         (ArglistAccess): New public class.
3737         (Arglist): New public class.
3738
3739         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
3740
3741         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
3742         a method's top-level block if the method has varargs.
3743
3744         * support.cs (ReflectionParameters, InternalParameters): Added
3745         support for varargs methods.    
3746
3747 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
3748
3749         * class.cs: Provide location in indexer error report.
3750
3751         * driver.cs: Use standard names.
3752
3753         * namespace.cs: Catch the use of using after a namespace has been
3754         declared also on using aliases.
3755
3756 2004-06-03  Raja R Harinath  <rharinath@novell.com>
3757
3758         Bug #50820.
3759         * typemanager.cs (closure_private_ok, closure_invocation_type)
3760         (closure_qualifier_type, closure_invocation_assembly)
3761         (FilterWithClosure): Move to ...
3762         (Closure): New internal nested class.
3763         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
3764         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
3765         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
3766         (MemberLookup, MemberLookupFailed): Use it.
3767         * expression.cs (New.DoResolve): Treat the lookup for the
3768         constructor as being qualified by the 'new'ed type.
3769         (Indexers.GetIndexersForTypeOrInterface): Update.
3770
3771 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
3772
3773         * attribute.cs
3774         (GetConditionalAttributeValue): New method. Returns
3775         condition of ConditionalAttribute.
3776         (SearchMulti): New method.  Returns all attributes of type 't'.
3777         Use it when attribute is AllowMultiple = true.
3778         (IsConditionalMethodExcluded): New method.
3779
3780         * class.cs
3781         (Method.IsExcluded): Implemented. Returns true if method has conditional
3782         attribute and the conditions is not defined (method is excluded).
3783         (IMethodData): Extended interface for ConditionalAttribute support.
3784         (PropertyMethod.IsExcluded): Implemented.
3785
3786         * decl.cs
3787         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
3788
3789         * expression.cs
3790         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
3791         on the method.
3792
3793 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
3794
3795         * expression.cs (ArrayCreationExpression): Make this just an
3796         `expression'. It can't be a statement, so the code here was
3797         dead.
3798
3799 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
3800
3801         Fixed #59072
3802         * typemanager.cs (GetFullNameSignature): New method for
3803         MethodBase types.
3804
3805 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
3806
3807         Fixed #56452
3808         * class.cs (MemberBase.GetSignatureForError): New virtual method.
3809         Use this method when MethodBuilder is null.
3810         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
3811         Added test for error CS0626 (MONO reports error for this situation).
3812         (IMethodData.GetSignatureForError): Extended interface.
3813
3814 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
3815
3816         * attribute.cs
3817         (AttributeTester.GetObsoleteAttribute): Returns instance of
3818         ObsoleteAttribute when type is obsolete.
3819
3820         * class.cs
3821         (TypeContainer.VerifyObsoleteAttribute): Override.
3822         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3823         (MethodCode.VerifyObsoleteAttribute): Override.
3824         (MemberBase.VerifyObsoleteAttribute): Override.
3825
3826         * decl.cs
3827         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3828         and report proper error.
3829
3830         *delegate.cs
3831         Delegate.VerifyObsoleteAttribute): Override.
3832
3833         * ecore.cs
3834         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3835         and report proper error.
3836         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3837
3838         * enum.cs
3839         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3840         and enum member.
3841
3842         * expression.cs
3843         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
3844         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
3845         Added test for ObsoleteAttribute.
3846
3847         * statement.cs
3848         (Catch): Derived from Statement.
3849
3850 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
3851  
3852         Fixed bug #59071 & cs0160.cs
3853  
3854         * statement.cs (Try.Resolve): Check here whether order of catch
3855         clauses matches their dependencies.
3856
3857 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
3858
3859         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
3860         caused a regression: #59343.  Referencing nested classes from an
3861         assembly stopped working.
3862
3863 2004-05-31  Martin Baulig  <martin@ximian.com>
3864
3865         MCS is now frozen for beta 2.
3866
3867 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3868
3869         * convert.cs: add a trivial cache for overload operator resolution.
3870
3871 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3872
3873         * decl.cs: If possible, use lookuptypedirect here. We can only do
3874         this if there is no `.' after the namespace. Avoids using
3875         LookupType, which does lots of slow processing.
3876         (FindNestedType) New method, does what it says :-).
3877         * namespace.cs: use LookupTypeDirect.
3878         * rootcontext.cs: use membercache, if possible.
3879         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3880
3881 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3882
3883         * expression.cs:
3884         According to the spec, 
3885
3886         In a member access of the form E.I, if E is a single identifier,
3887         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3888         field, property, localvariable, or parameter with the same type as
3889         the meaning of E as a type-name (§3.8), then both possible
3890         meanings of E are permitted.
3891
3892         We did not check that E as a simple-name had the same type as E as
3893         a type name.
3894
3895         This trivial check gives us 5-7% on bootstrap time.
3896
3897 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3898
3899         * expression.cs (Invocation.OverloadResolve): Avoid the
3900         use of hashtables and boxing here by allocating on demand.
3901
3902 2004-05-30  Martin Baulig  <martin@ximian.com>
3903
3904         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3905         we're doing a silent lookup.  Don't try to lookup nested types in
3906         TypeManager.object_type (thanks to Ben Maurer).
3907
3908 2004-05-30  Martin Baulig  <martin@ximian.com>
3909
3910         Committing a patch from Ben Maurer.
3911
3912         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3913
3914 2004-05-29  Martin Baulig  <martin@ximian.com>
3915
3916         * class.cs (IMethodData.ShouldIgnore): New method.
3917
3918         * typemanager.cs (TypeManager.MethodFlags): Don't take a
3919         `Location' argument, we don't need it anywhere.  Use
3920         `IMethodData.ShouldIgnore ()' instead of
3921         `MethodData.GetMethodFlags ()'.
3922         (TypeManager.AddMethod): Removed.
3923         (TypeManager.AddMethod2): Renamed to AddMethod.
3924
3925 2004-05-29  Martin Baulig  <martin@ximian.com>
3926
3927         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
3928
3929         * convert.cs (Convert.ImplicitReferenceConversion): If we're
3930         converting from a class type S to an interface type and we already
3931         have an object on the stack, don't box it again.  Fixes #52578.
3932
3933 2004-05-29  Martin Baulig  <martin@ximian.com>
3934
3935         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3936         Added support for `params' parameters.  Fixes #59267.
3937
3938 2004-05-29  Martin Baulig  <martin@ximian.com>
3939
3940         * literal.cs (NullPointer): Provide a private .ctor which sets
3941         `type' to TypeManager.object_type.  Fixes #59048.
3942
3943 2004-05-29  Martin Baulig  <martin@ximian.com>
3944
3945         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
3946         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
3947
3948         * ecore.cs (EventExpr.instance_expr): Make the field private.
3949
3950 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
3951
3952         Fixed bug #50080 & cs0214-2.cs
3953         * expression.cs (Cast.DoResolve): Check unsafe context here.
3954         
3955         * statement.cs (Resolve.DoResolve): Likewise.
3956
3957 2004-05-26  Martin Baulig  <martin@ximian.com>
3958
3959         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
3960
3961         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
3962         (RootContext.LookupType): Pass down the `silent' flag.
3963
3964 2004-05-25  Martin Baulig  <martin@ximian.com>
3965
3966         * expression.cs
3967         (MethodGroupExpr.IdenticalTypeName): New public property.
3968         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
3969         expression actually refers to a type.
3970
3971 2004-05-25  Martin Baulig  <martin@ximian.com>
3972
3973         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
3974         for #56176 and made it actually work.
3975
3976 2004-05-25  Martin Baulig  <martin@ximian.com>
3977
3978         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
3979         (FieldExpr, PropertyExpr): Override and implement
3980         CacheTemporaries.  Fixes #52279.
3981
3982 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
3983
3984         * location.cs: In the new compiler listing a file twice is a
3985         warning, not an error.
3986
3987 2004-05-24  Martin Baulig  <martin@ximian.com>
3988
3989         * enum.cs (Enum.DefineType): For the `BaseType' to be a
3990         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
3991
3992 2004-05-24  Martin Baulig  <martin@ximian.com>
3993
3994         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
3995         walking the `using' list.  Fixes #53921.
3996
3997 2004-05-24  Martin Baulig  <martin@ximian.com>
3998
3999         * const.cs (Const.LookupConstantValue): Added support for
4000         EmptyCast's; fixes #55251.
4001
4002 2004-05-24  Martin Baulig  <martin@ximian.com>
4003
4004         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4005         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4006         which does the CS0135 check.  The reason is that we first need to
4007         check whether the variable actually exists.
4008
4009 2004-05-24  Martin Baulig  <martin@ximian.com>
4010
4011         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4012         than RootContext.LookupType() to find the explicit interface
4013         type.  Fixes #58584.
4014
4015 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4016
4017         * Makefile: Simplify.  Use executable.make.
4018         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4019
4020 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4021
4022         * decl.cs:
4023         * enum.cs:
4024         Use the invariant culture when doing String.Compare for CLS case
4025         sensitivity.
4026         
4027 2004-05-23  Martin Baulig  <martin@ximian.com>
4028
4029         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4030         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4031
4032         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4033         
4034 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4035
4036         * class.cs (MemberBase.Define): Reuse MemberType member for 
4037         resolved type. Other methods can use it too.
4038
4039 2004-05-23  Martin Baulig  <martin@ximian.com>
4040
4041         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4042         the variable also exists in the current block (otherwise, we need
4043         to report a CS0103).  Fixes #58670.
4044
4045 2004-05-23  Martin Baulig  <martin@ximian.com>
4046
4047         * flowanalysis.cs (Reachability.Reachable): Compute this
4048         on-the-fly rather than storing it as a field.
4049
4050 2004-05-23  Martin Baulig  <martin@ximian.com>
4051
4052         * flowanalysis.cs (Reachability.And): Manually compute the
4053         resulting `barrier' from the reachability.      
4054        
4055 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4056
4057         Fix bug #57835
4058         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4059         instance of ObsoleteAttribute when symbol is obsolete.
4060
4061         * class.cs
4062         (IMethodData): Extended interface for ObsoleteAttribute support.
4063
4064 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4065
4066         * attribute.cs: Fix bug #55970
4067
4068 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4069
4070         Fix bug #52705
4071         * attribute.cs
4072         (GetObsoleteAttribute): New method. Creates the instance of
4073         ObsoleteAttribute.
4074         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4075         ObsoleteAttribute when member is obsolete.
4076         (AttributeTester.Report_ObsoleteMessage): Common method for
4077         Obsolete error/warning reporting.
4078
4079         * class.cs
4080         (TypeContainer.base_classs_type): New member for storing parent type.
4081
4082         * decl.cs
4083         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4084         for this MemberCore.
4085
4086 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4087
4088         * attribute.cs, const.cs: Fix bug #58590
4089
4090 2004-05-21  Martin Baulig  <martin@ximian.com>
4091
4092         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4093         out parameters if the end of the method is unreachable.  Fixes
4094         #58098. 
4095
4096 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4097
4098         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4099         Hari was right, why extra method.
4100
4101 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4102
4103         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4104
4105 2004-05-20  Martin Baulig  <martin@ximian.com>
4106
4107         Merged this back from gmcs to keep the differences to a minumum.
4108
4109         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
4110         instead of a Declspace.
4111         (Attribute.ResolveType): Likewise.
4112         (Attributes.Search): Likewise.
4113         (Attributes.Contains): Likewise.
4114         (Attributes.GetClsCompliantAttribute): Likewise.
4115
4116         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
4117         argument.
4118         (MethodData.ApplyAttributes): Take an EmitContext instead of a
4119         DeclSpace.
4120
4121 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4122
4123         Fix bug #58688 (MCS does not report error when the same attribute
4124         is assigned twice)
4125
4126         * attribute.cs (Attribute.Emit): Distinction between null and default.
4127
4128 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4129
4130         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4131         of a top-level attribute without an attribute target.
4132         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4133         Make non-static.
4134         (Attribute.Conditional_GetConditionName), 
4135         (Attribute.Obsolete_GetObsoleteMessage): Update.
4136         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4137         part of ScanForIndexerName.
4138         (Attribute.CanIgnoreInvalidAttribute): New function.
4139         (Attribute.ScanForIndexerName): Move to ...
4140         (Attributes.ScanForIndexerName): ... here.
4141         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4142         (Attributes.Search): New internal variant that can choose not to
4143         complain if types aren't resolved.  The original signature now
4144         complains.
4145         (Attributes.GetClsCompliantAttribute): Use internal variant, with
4146         complaints suppressed.
4147         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4148         only if it not useful.
4149         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4150         top-level for attributes that are shared between the assembly
4151         and a top-level class.
4152         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4153         * class.cs: Update to reflect changes.
4154         (DefineIndexers): Fuse loops.
4155         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4156         a couple more variants of attribute names.
4157
4158 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4159
4160         Fix bug #52585 (Implemented explicit attribute declaration)
4161
4162         * attribute.cs:
4163         (Attributable.ValidAttributeTargets): New abstract method. It gets
4164         list of valid attribute targets for explicit target declaration.
4165         (Attribute.Target): It holds target itself.
4166         (AttributeSection): Removed.
4167         (Attribute.CheckTargets): New method. It checks whether attribute
4168         target is valid for the current element.
4169
4170         * class.cs:
4171         (EventProperty): New class. For events that are declared like
4172         property (with add and remove accessors).
4173         (EventField): New class. For events that are declared like field.
4174         class.cs
4175
4176         * cs-parser.jay: Implemented explicit attribute target declaration.
4177
4178         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4179         Override ValidAttributeTargets.
4180
4181         * parameter.cs:
4182         (ReturnParameter): Class for applying custom attributes on 
4183         the return type.
4184         (ParameterAtribute): New class. Class for applying custom
4185         attributes on the parameter type.
4186
4187 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4188
4189         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4190         definitions. 
4191
4192         (Method): Allow UNSAFE here.
4193
4194         * modifiers.cs: Support unsafe reporting.
4195
4196 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4197
4198         * decl.cs: Fix bug #58478.
4199
4200 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4201
4202         * statement.cs: When checking for unreachable code on an EmptyStatement,
4203         set the location. Fixes bug #58488.
4204
4205 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4206
4207         * driver.cs: Add -pkg handling.
4208
4209         From Gonzalo: UseShelLExecute=false
4210
4211 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4212
4213         * attribute.cs:
4214         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4215         for attribute.
4216         (Attribute.IsClsCompliaceRequired): Moved to base for better
4217         accesibility.
4218         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4219         when attribute is AttributeUsageAttribute.
4220         (Attribute.GetValidTargets): Simplified.
4221         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4222         attribute for this type.
4223         (Attribute.ApplyAttributes): Method renamed to Emit and make
4224         non-static.
4225         (GlobalAttributeSection): New class for special handling of global
4226         attributes (assembly, module).
4227         (AttributeSection.Emit): New method.
4228
4229         * class.cs: Implemented Attributable abstract methods.
4230         (MethodCore.LabelParameters): Moved to Parameter class.
4231         (Accessor): Is back simple class.
4232         (PropertyMethod): Implemented Attributable abstract class.
4233         (DelegateMethod): Implemented Attributable abstract class.
4234         (Event): New constructor for disctintion between normal Event
4235         and Event with accessors.
4236
4237         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4238
4239         * codegen.cs, const.cs, decl.cs, delegate.cs:
4240         (CommonAssemblyModulClass): Implemented Attributable abstract class
4241         and simplified.
4242
4243         * enum.cs: Implement IAttributeSupport interface.
4244         (EnumMember): New class for emum members. Implemented Attributable
4245         abstract class
4246
4247         * parameter.cs:
4248         (ParameterBase): Is abstract.
4249         (ReturnParameter): New class for easier [return:] attribute handling.
4250
4251         * typemanager.cs: Removed builder_to_attr.
4252
4253 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4254
4255         Fix bug #57151.
4256         * attribute.cs (Attribute.GetPositionalValue): New function.
4257         * class.cs (TypeContainer.VerifyMembers): New function.
4258         (TypeContainer.Emit): Use it.
4259         (ClassOrStruct): New base class for Class and Struct.
4260         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4261         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4262         class.
4263         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4264         then each non-static field should have a FieldOffset attribute.
4265         Otherwise, none of the fields should have a FieldOffset attribute.
4266         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4267         and FieldOffset attributes.
4268         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4269         (TypeManager.field_offset_attribute_type): New core types.
4270         (TypeManager.InitCoreTypes): Initialize them.
4271
4272 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4273
4274         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4275         Return correct type.
4276         From bug #58270.
4277
4278 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4279
4280         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4281         be implicitly converted to ulong.
4282         
4283         * expression.cs: The logic for allowing operator &, | and ^ worked
4284         was wrong, it worked before because we did not report an error in
4285         an else branch.  Fixes 57895.
4286
4287         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4288         allow volatile fields to be reference types.
4289
4290 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4291
4292         * driver.cs: Add support for /debug-
4293
4294 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4295
4296         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4297         Add a 'complain' parameter to silence errors.
4298         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4299         silently overlooked type-resolutions.
4300         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4301         to reflect changes.
4302         (Attributes.Search): New function.
4303         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4304         (Attributes.GetAttributeFullName): Remove hack.
4305         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4306         Update to reflect changes.
4307         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4308         Use Attributes.Search instead of nested loops.
4309
4310 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4311
4312         * decl.cs:
4313         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4314         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4315         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4316
4317         * report.cs: (Report.Warning): Renamed to Warning_T because of
4318         parameter collision.
4319
4320 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4321
4322         * expression.cs (MemberAccess.ResolveMemberAccess):
4323         Exit with non-zero status after Report.Error.
4324         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4325         Likewise.
4326         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4327
4328 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4329
4330         * support.cs: Don't hang when the file is empty.
4331
4332 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4333
4334         * support.cs: In SeekableStreamReader, compute the preamble size of the
4335           underlying stream. Position changes should take into account that initial
4336           count of bytes.
4337
4338 2004-05-03  Todd Berman  <tberman@sevenl.net>
4339
4340         * driver.cs: remove unused GetSysVersion function.
4341
4342 2004-05-03  Todd Berman  <tberman@sevenl.net>
4343
4344         * driver.cs: Remove the hack from saturday, as well as the hack
4345         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4346         link_paths to get that bit proper.
4347
4348 2004-05-01  Todd Berman  <tberman@sevenl.net>
4349
4350         * driver.cs: Try a LoadFrom before a Load, this checks the current
4351         path. This is currently a bug in mono that is be fixed, however, this
4352         provides a workaround for now. This will be removed when the bug
4353         is fixed.
4354
4355 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4356
4357         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4358         incomplete key pairs (#57941).
4359
4360 2004-05-01  Todd Berman  <tberman@sevenl.net>
4361
4362         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4363         from the GAC
4364
4365 2004-04-30  Jackson Harper  <jackson@ximian.com>
4366
4367         * codegen.cs: Open keys readonly.
4368         
4369 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4370
4371         * typemanager.cs: don't report cyclic struct layout when a struct
4372         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4373         which has 2 Pango.Rectangle fields.
4374
4375 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4376
4377         * expression.cs: Handle IntPtr comparisons with IL code
4378         rather than a method call.
4379
4380 2004-04-29  Martin Baulig  <martin@ximian.com>
4381
4382         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4383         the list of PropertyInfo's in class hierarchy and find the
4384         accessor.  Fixes #56013.
4385
4386 2004-04-29  Martin Baulig  <martin@ximian.com>
4387
4388         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4389
4390 2004-04-29  Martin Baulig  <martin@ximian.com>
4391
4392         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4393
4394         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4395
4396 2004-04-29  Martin Baulig  <martin@ximian.com>
4397
4398         * class.cs (ConstructorInitializer.Resolve): Check whether the
4399         parent .ctor is accessible.  Fixes #52146.
4400
4401 2004-04-29  Martin Baulig  <martin@ximian.com>
4402
4403         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4404
4405         * statement.cs (Using.EmitLocalVariableDecls): Use
4406         TypeManager.idisposable_type, not typeof (IDisposable).
4407         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4408
4409 2004-04-29  Martin Baulig  <martin@ximian.com>
4410
4411         * class.cs (Event.Define): Don't emit the field and don't set
4412         RTSpecialName and SpecialName for events on interfaces.  Fixes
4413         #57703. 
4414
4415 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4416
4417         Refactor Attribute.ApplyAttributes.
4418         * attribute.cs (Attributable): New base class for objects that can
4419         have Attributes applied on them.
4420         (Attribute): Make AttributeUsage fields public.
4421         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4422         (Attribute.IsInternalCall): New property.
4423         (Attribute.UsageAttr): Convert to a public read-only property.
4424         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4425         (Attribute.ResolveType, Attribute.Resolve)
4426         (Attribute.ScanForIndexerName): Update to reflect changes.
4427         (Attribute.CheckAttributeTarget): Re-format.
4428         (Attribute.ApplyAttributes): Refactor, to various
4429         Attributable.ApplyAttributeBuilder methods.
4430         * decl.cs (MemberCore): Make Attributable.
4431         * class.cs (Accessor): Make Attributable.
4432         (MethodData.ApplyAttributes): Use proper attribute types, not
4433         attribute names.
4434         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4435         (TypeContainer.ApplyAttributeBuilder)
4436         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4437         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4438         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4439         (Operator.ApplyAttributeBuilder): New factored-out methods.
4440         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4441         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4442         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4443         * parameter.cs (ParameterBase): New Attributable base class
4444         that can also represent Return types.
4445         (Parameter): Update to the changes.
4446
4447 2004-04-29  Jackson Harper  <jackson@ximian.com>
4448
4449         * driver.cs: Prefer the corlib system version when looking for
4450         assemblies in the GAC. This is still a hack, but its a better hack
4451         now.
4452         
4453 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4454
4455         * decl.cs, enum.cs: Improved error 3005 reporting.
4456   
4457         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4458         (related_symbols): New private member for list of symbols
4459         related to reported error/warning.
4460         
4461         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4462
4463 2004-04-29  Martin Baulig  <martin@ximian.com>
4464
4465         * ecore.cs (Expression.Constantify): If we're an enum and
4466         TypeManager.TypeToCoreType() doesn't give us another type, use
4467         t.UnderlyingSystemType.  Fixes #56178.  
4468
4469 2004-04-29  Martin Baulig  <martin@ximian.com>
4470
4471         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4472         interfaces and for each interface, only add members directly
4473         declared in that interface.  Fixes #53255.
4474
4475 2004-04-28  Martin Baulig  <martin@ximian.com>
4476
4477         * expression.cs (ConditionalLogicalOperator): Use a temporary
4478         variable for `left' to avoid that we evaluate it more than once;
4479         bug #52588.
4480
4481 2004-04-28  Martin Baulig  <martin@ximian.com>
4482
4483         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4484         `void[]' (CS1547).
4485
4486 2004-04-28  Martin Baulig  <martin@ximian.com>
4487
4488         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4489         void (CS1547).
4490
4491         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4492         whether the type is not void (CS1547).
4493
4494 2004-04-28  Martin Baulig  <martin@ximian.com>
4495
4496         * expression.cs (Unary.DoResolveLValue): Override this and report
4497         CS0131 for anything but Operator.Indirection.
4498
4499 2004-04-28  Martin Baulig  <martin@ximian.com>
4500
4501         Committing a patch from Ben Maurer; see bug #50820.
4502
4503         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4504         check for classes.
4505
4506         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4507         classes.        
4508
4509 2004-04-28  Martin Baulig  <martin@ximian.com>
4510
4511         Committing a patch from Ben Maurer; see bug #50820.
4512
4513         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4514         check for classes.
4515
4516         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4517         classes.        
4518
4519 2004-04-28  Martin Baulig  <martin@ximian.com>
4520
4521         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4522         (Block.AddLabel): Call DoLookupLabel() to only search in the
4523         current block.
4524
4525 2004-04-28  Martin Baulig  <martin@ximian.com>
4526
4527         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4528         comparing StringConstants and NullLiterals in Equality and Inequality.
4529
4530 2004-04-28  Jackson Harper  <jackson@ximian.com>
4531
4532         * driver.cs: Attempt to load referenced assemblies from the
4533         GAC. This is the quick and dirty version of this method that
4534         doesnt take into account versions and just takes the first
4535         canidate found. Will be good enough for now as we will not have more
4536         then one version installed into the GAC until I update this method.
4537
4538 2004-04-28  Martin Baulig  <martin@ximian.com>
4539
4540         * typemanager.cs (TypeManager.CheckStructCycles): New public
4541         static method to check for cycles in the struct layout.
4542
4543         * rootcontext.cs (RootContext.PopulateTypes): Call
4544         TypeManager.CheckStructCycles() for each TypeContainer.
4545         [Note: We only need to visit each type once.]
4546
4547 2004-04-28  Martin Baulig  <martin@ximian.com>
4548
4549         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4550
4551         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4552         success and added `out object value'.  Use a `bool resolved' field
4553         to check whether we've already been called rather than
4554         `ConstantValue != null' since this breaks for NullLiterals.
4555
4556 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4557
4558         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4559         setting of this flag, since the 'set' method may be non-public.
4560
4561 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4562
4563         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4564         check on current_vector.Block.
4565
4566 2004-04-27  Martin Baulig  <martin@ximian.com>
4567
4568         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4569         a field initializer.  Fixes #56459.
4570
4571 2004-04-27  Martin Baulig  <martin@ximian.com>
4572
4573         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4574         we're not attempting to use an indexer.  Fixes #52154.
4575
4576 2004-04-27  Martin Baulig  <martin@ximian.com>
4577
4578         * statement.cs (Return): Don't create a return label if we don't
4579         need it; reverts my change from January 20th.  Thanks to Ben
4580         Maurer for this.
4581
4582 2004-04-27  Martin Baulig  <martin@ximian.com>
4583
4584         According to the spec, `goto' can only leave a nested scope, but
4585         never enter it.
4586
4587         * statement.cs (Block.LookupLabel): Only lookup in the current
4588         block, don't recurse into parent or child blocks.
4589         (Block.AddLabel): Check in parent and child blocks, report
4590         CS0140/CS0158 if we find a duplicate.
4591         (Block): Removed this indexer for label lookups.
4592         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4593         this already does the error reporting for us.
4594
4595         * flowanalysis.cs
4596         (FlowBranching.UsageVector.Block): New public variable; may be null.
4597         (FlowBranching.CreateSibling): Added `Block' argument.
4598         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4599         label for the target of a `goto' and check whether we're not
4600         leaving a `finally'.
4601
4602 2004-04-27  Martin Baulig  <martin@ximian.com>
4603
4604         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4605         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4606         just for returns).
4607
4608 2004-04-27  Martin Baulig  <martin@ximian.com>
4609
4610         * statement.cs (Block.AddLabel): Also check for implicit blocks
4611         and added a CS0158 check.
4612
4613 2004-04-27  Martin Baulig  <martin@ximian.com>
4614
4615         * flowanalysis.cs (FlowBranchingLoop): New class.
4616         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4617         UsageVector's instead of an ArrayList.
4618         (FlowBranching.Label): Likewise.
4619         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4620         (FlowBranching.AddBreakVector): New method.
4621
4622 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4623
4624         * attribute.cs: Small regression fix: only convert the type if we
4625         the type is different, fixes System.Drawing build.
4626
4627 2004-04-27  Martin Baulig  <martin@ximian.com>
4628
4629         * attribute.cs (Attribute.Resolve): If we have a constant value
4630         for a named field or property, implicity convert it to the correct
4631         type.
4632
4633 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4634
4635         * statement.cs (Block.Block): Implicit blocks share
4636         'child_variable_names' fields with parent blocks.
4637         (Block.AddChildVariableNames): Remove.
4638         (Block.AddVariable): Mark variable as "used by a child block" in
4639         every surrounding block.
4640         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4641         been used in a child block, complain about violation of "Invariant
4642         meaning in blocks" rule.
4643         * cs-parser.jay (declare_local_variables): Don't use
4644         AddChildVariableNames.
4645         (foreach_statement): Don't create an implicit block: 'foreach'
4646         introduces a scope.
4647
4648 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4649
4650         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4651         converting from 0L to ulong.  Fixes 57522.
4652
4653 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4654
4655         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4656         derived class hides via 'new' keyword field from base class (test-242.cs).
4657         TODO: Handle this in the more general way.
4658         
4659         * class.cs (CheckBase): Ditto.
4660
4661 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4662
4663         * decl.cs (caching_flags): New member for storing cached values
4664         as bit flags.
4665         (MemberCore.Flags): New enum where bit flags for caching_flags
4666         are defined.
4667         (MemberCore.cls_compliance): Moved to caching_flags.
4668         (DeclSpace.Created): Moved to caching_flags.
4669
4670         * class.cs: Use caching_flags instead of DeclSpace.Created
4671         
4672 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4673
4674         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4675         if we are only a derived class, not a nested class.
4676
4677         * typemanager.cs: Same as above, but do this at the MemberLookup
4678         level (used by field and methods, properties are handled in
4679         PropertyExpr).   Allow for the qualified access if we are a nested
4680         method. 
4681
4682 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4683
4684         * class.cs: Refactoring.
4685         (IMethodData): New inteface; Holds links to parent members
4686         to avoid member duplication (reduced memory allocation).
4687         (Method): Implemented IMethodData interface.
4688         (PropertyBase): New inner classes for get/set methods.
4689         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4690         (Event): New inner classes for add/remove methods.
4691         (Event.DelegateMethod): Implemented IMethodData interface.
4692
4693         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4694         EmitContext (related to class.cs refactoring).
4695
4696 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4697
4698         * delegate.cs (Delegate.VerifyApplicability): If the number of
4699         arguments are the same as the number of parameters, first try to
4700         verify applicability ignoring  any 'params' modifier on the last
4701         parameter.
4702         Fixes #56442.
4703
4704 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4705
4706         * class.cs (TypeContainer.AddIndexer): Use
4707         'ExplicitInterfaceName' to determine if interface name was
4708         explicitly specified.  'InterfaceType' is not initialized at this time.
4709         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4710         Indexers array is already in the required order.  Initialize
4711         'IndexerName' only if there are normal indexers.
4712         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4713         (TypeContainer.Emit): Emit DefaultMember attribute only if
4714         IndexerName is initialized.
4715         Fixes #56300.
4716
4717 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4718
4719         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4720         Fixes #57007
4721
4722 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4723
4724         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4725         attributes.
4726         Fix for #56456.
4727
4728         * attribute.cs (Attribute.Resolve): Check for duplicate named
4729         attributes.
4730         Fix for #56463.
4731
4732 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4733
4734         * iterators.cs (MarkYield): track whether we are in an exception,
4735         and generate code accordingly.  Use a temporary value to store the
4736         result for our state.
4737
4738         I had ignored a bit the interaction of try/catch with iterators
4739         since their behavior was not entirely obvious, but now it is
4740         possible to verify that our behavior is the same as MS .NET 2.0
4741
4742         Fixes 54814
4743
4744 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4745
4746         * iterators.cs: Avoid creating temporaries if there is no work to
4747         do. 
4748
4749         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4750         Enumerations, use TypeManager.EnumToUnderlying and call
4751         recursively. 
4752
4753         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4754         bug #57013
4755
4756         (This.Emit): Use EmitContext.EmitThis to emit our
4757         instance variable.
4758
4759         (This.EmitAssign): Ditto.
4760
4761         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4762         codepaths, we will move all the functionality into
4763         Mono.CSharp.This 
4764
4765         (FieldExpr.EmitAssign): Ditto.
4766
4767         This fixes several hidden bugs that I uncovered while doing a code
4768         review of this today.
4769
4770         * codegen.cs (EmitThis): reworked so the semantics are more clear
4771         and also support value types "this" instances.
4772
4773         * iterators.cs: Changed so that for iterators in value types, we
4774         do not pass the value type as a parameter.  
4775
4776         Initialization of the enumerator helpers is now done in the caller
4777         instead of passing the parameters to the constructors and having
4778         the constructor set the fields.
4779
4780         The fields have now `assembly' visibility instead of private.
4781
4782 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4783
4784         * expression.cs (Argument.Resolve): Check if fields passed as ref
4785         or out are contained in a MarshalByRefObject.
4786
4787         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4788         another compiler type.
4789
4790 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4791
4792         * class.cs (Indexer.Define): use the new name checking method.
4793         Also, return false on an error.
4794         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4795         (is_identifier_[start/part]_character): make static.
4796
4797 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4798
4799         * expression.cs (Binary.ResolveOperator): Do no append strings
4800         twice: since we can be invoked more than once (array evaluation)
4801         on the same concatenation, take care of this here.  Based on a fix
4802         from Ben (bug #56454)
4803
4804 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4805
4806         * codegen.cs: Fix another case where CS1548 must be reported (when 
4807         delay-sign isn't specified and no private is available #56564). Fix
4808         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4809         error when MCS is used on the MS runtime and we need to delay-sign 
4810         (which seems unsupported by AssemblyBuilder - see #56621).
4811
4812 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4813
4814         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4815         (TypeManager.ComputeNamespaces): Faster implementation for
4816         Microsoft runtime.
4817
4818         * compiler.csproj: Updated AssemblyName to mcs.
4819
4820 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
4821
4822         * rootcontext.cs: Add new types to the boot resolution.
4823
4824         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
4825         MulticastDelegate is not allowed.
4826
4827         * typemanager.cs: Add new types to lookup: System.TypedReference
4828         and ArgIterator.
4829
4830         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
4831         check for TypedReference or ArgIterator, they are not allowed. 
4832
4833         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
4834         makes us properly catch 1510 in some conditions (see bug 56016 for
4835         details). 
4836
4837 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
4838
4839         * CryptoConvert.cs: update from corlib version
4840         with endian fixes.
4841
4842 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
4843
4844         * class.cs (Indexer.Define): Check indexername declaration
4845
4846 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
4847
4848         * attribute.cs (IsClsCompliant): Fixed problem with handling
4849         all three states (compliant, not-compliant, undetected).
4850
4851 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
4852
4853         * attribute.cs (Attribute): Location is now public.
4854         (Resolve): Store resolved arguments (pos_values) in attribute class.
4855         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
4856         (GetClsCompliantAttributeValue): New method that gets
4857         CLSCompliantAttribute value.
4858         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
4859         if exists else null.
4860         (AttributeTester): New class for CLS-Compliant verification routines.
4861
4862         * class.cs (Emit): Add CLS-Compliant verification.
4863         (Method.GetSignatureForError): Implemented.
4864         (Constructor.GetSignatureForError): Implemented
4865         (Constructor.HasCompliantArgs): Returns if constructor has
4866         CLS-Compliant arguments.
4867         (Constructor.Emit): Override.
4868         (Construcor.IsIdentifierClsCompliant): New method; For constructors
4869         is needed to test only parameters.
4870         (FieldBase.GetSignatureForError): Implemented.
4871         (TypeContainer): New member for storing base interfaces.
4872         (TypeContainer.FindMembers): Search in base interfaces too.
4873
4874         * codegen.cs (GetClsComplianceAttribute): New method that gets
4875         assembly or module CLSCompliantAttribute value.
4876         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
4877         for assembly.
4878         (ModuleClass.Emit): Add error 3012 test.
4879
4880         * const.cs (Emit): Override and call base for CLS-Compliant tests.
4881
4882         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
4883         state for all decl types.
4884         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
4885         if CLS-Compliant tests are required.
4886         (IsClsCompliaceRequired): New method. Analyze whether code
4887         must be CLS-Compliant.
4888         (IsExposedFromAssembly): New method. Returns true when MemberCore
4889         is exposed from assembly.
4890         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
4891         value or gets cached value.
4892         (HasClsCompliantAttribute): New method. Returns true if MemberCore
4893         is explicitly marked with CLSCompliantAttribute.
4894         (IsIdentifierClsCompliant): New abstract method. This method is
4895         used to testing error 3005.
4896         (IsIdentifierAndParamClsCompliant): New method. Common helper method
4897         for identifier and parameters CLS-Compliant testing.
4898         (VerifyClsCompliance): New method. The main virtual method for
4899         CLS-Compliant verifications.
4900         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
4901         null. I don't know why is null (too many public members !).
4902         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
4903         and get value of first CLSCompliantAttribute that found.
4904
4905         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
4906         (VerifyClsCompliance): Override and add extra tests.
4907
4908         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
4909         clscheck- disable CLS-Compliant verification event if assembly is has
4910         CLSCompliantAttribute(true).
4911
4912         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
4913         ApllyAttribute is now called in emit section as in the other cases.
4914         Possible future Emit integration.
4915         (IsIdentifierClsCompliant): New override.
4916         (VerifyClsCompliance): New override.
4917         (GetEnumeratorName): Returns full enum name.
4918
4919         * parameter.cs (GetSignatureForError): Implemented.
4920
4921         * report.cs (WarningData): New struct for Warning message information.
4922         (LocationOfPreviousError): New method.
4923         (Warning): New method. Reports warning based on the warning table.
4924         (Error_T): New method. Reports error based on the error table.
4925
4926         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
4927         verifications are done here.
4928
4929         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
4930
4931         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
4932         CLSCompliantAttribute.
4933         (all_imported_types): New member holds all imported types from other
4934         assemblies.
4935         (LoadAllImportedTypes): New method fills static table with exported types
4936         from all referenced assemblies.
4937         (Modules): New property returns all assembly modules.
4938
4939 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
4940
4941         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
4942         throwing a parser error.
4943
4944         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
4945         which removes the hardcoded get_/set_ prefixes for properties, as
4946         IL allows for the properties to be named something else.  
4947
4948         Bug #56013
4949
4950         * expression.cs: Do not override operand before we know if it is
4951         non-null.  Fix 56207
4952
4953 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4954
4955         * typemanager.cs: support for pinned variables.
4956
4957 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4958
4959         * decl.cs, typemanager.cs: Avoid using an arraylist
4960         as a buffer if there is only one result set.
4961
4962 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4963
4964         * expression.cs: Make sure you cant call a static method
4965         with an instance expression, bug #56174.
4966
4967 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
4968
4969         * class.cs (IsDuplicateImplementation): Improve error reporting to
4970         flag 663 (method only differs in parameter modifier).
4971
4972         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
4973         in preprocessor directives.
4974
4975         * location.cs (LookupFile): Allow for the empty path.
4976
4977         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
4978         better approach for some of that patch, but its failing with the
4979         CharSet enumeration.  For now try/catch will do.
4980
4981         * typemanager.cs: Do not crash if a struct does not have fields.
4982         Fixes 56150.
4983
4984 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4985
4986         * expression.cs: cs0213, cant fix a fixed expression.
4987         fixes 50231.
4988
4989 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4990
4991         * cs-parser.jay: detect invalid embeded statements gracefully.
4992         bug #51113.
4993
4994 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4995
4996         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
4997         As a regex:
4998         s/
4999         the invocation type may not be a subclass of the tye of the item/
5000         The type of the item must be a subclass of the invocation item.
5001         /g
5002
5003         Fixes bug #50820.
5004
5005 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5006
5007         * attribute.cs: Added methods to get a string and a bool from an
5008         attribute. Required to information from AssemblyKeyFileAttribute,
5009         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5010         * codegen.cs: Modified AssemblyName creation to include support for
5011         strongnames. Catch additional exceptions to report them as CS1548.
5012         * compiler.csproj: Updated include CryptoConvert.cs.
5013         * compiler.csproj.user: Removed file - user specific configuration.
5014         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5015         Mono.Security assembly. The original class is maintained and tested in
5016         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5017         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5018         like CSC 8.0 (C# v2) supports.
5019         * Makefile: Added CryptoConvert.cs to mcs sources.
5020         * rootcontext.cs: Added new options for strongnames.
5021
5022 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5023
5024         * driver.cs: For --expect-error, report error code `2'
5025         if the program compiled with no errors, error code `1' if
5026         it compiled with an error other than the one expected.
5027
5028 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5029
5030         * compiler.csproj: Updated for Visual Studio .NET 2003.
5031         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5032         * compiler.sln: Updated for Visual Studio .NET 2003.
5033
5034 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5035
5036         * expression.cs: Fix bug #47234. We basically need to apply the
5037         rule that we prefer the conversion of null to a reference type
5038         when faced with a conversion to 'object' (csc behaviour).
5039
5040 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5041
5042         * statement.cs: Shorter form for foreach, eliminates
5043         a local variable. r=Martin.
5044
5045 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5046
5047         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5048         checks if we can use brtrue/brfalse to test for 0.
5049         * expression.cs: use the above in the test for using brtrue/brfalse.
5050         cleanup code a bit.
5051
5052 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5053
5054         * expression.cs: Rewrite string concat stuff. Benefits:
5055
5056         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5057         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5058         rather than a concat chain.
5059
5060         * typemanager.cs: Add lookups for more concat overloads.
5061
5062 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5063
5064         * expression.cs: Emit shorter il code for array init.
5065
5066         newarr
5067         dup
5068         // set 1
5069
5070         // set 2
5071
5072         newarr
5073         stloc.x
5074
5075         ldloc.x
5076         // set 1
5077
5078         ldloc.x
5079         // set 2
5080
5081 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5082
5083         * statement.cs: Before, two switch blocks would be merged if the
5084         total size of the blocks (end_item - begin_item + 1) was less than
5085         two times the combined sizes of the blocks.
5086
5087         Now, it will only merge if after the merge at least half of the
5088         slots are filled.
5089
5090         fixes 55885.
5091
5092 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5093
5094         * class.cs : csc build fix for GetMethods(). See bug #52503.
5095
5096 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5097
5098         * expression.cs: Make sure fp comparisons work with NaN.
5099         This fixes bug #54303. Mig approved this patch a long
5100         time ago, but we were not able to test b/c the runtime
5101         had a related bug.
5102
5103 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5104
5105         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5106
5107 2004-03-19  Martin Baulig  <martin@ximian.com>
5108
5109         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5110         error here and not in our caller.
5111
5112 2004-03-19  Martin Baulig  <martin@ximian.com>
5113
5114         * interface.cs: Completely killed this file.
5115         (Interface): We're now a TypeContainer and live in class.cs.
5116
5117         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5118         argument; we're now also called for interfaces.
5119         (TypeContainer.DefineMembers): Allow this method being called
5120         multiple times.
5121         (TypeContainer.GetMethods): New public method; formerly known as
5122         Interface.GetMethod().  This is used by PendingImplementation.
5123         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5124         it's now private and non-static.
5125         (Interface): Moved this here; it's now implemented similar to
5126         Class and Struct.
5127         (Method, Property, Event, Indexer): Added `bool is_interface'
5128         argument to their .ctor's.
5129         (MemberBase.IsInterface): New public field.
5130
5131         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5132         instances instead of InterfaceMethod, InterfaceProperty, etc.
5133         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5134         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5135
5136 2004-03-19  Martin Baulig  <martin@ximian.com>
5137
5138         * class.cs (MethodCore.IsDuplicateImplementation): New private
5139         method which does the CS0111 checking.
5140         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5141         Use IsDuplicateImplementation().
5142
5143 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5144
5145         * decl.cs (FindMemberToOverride): New method to find the correct
5146         method or property to override in the base class.
5147         * class.cs
5148             - Make Method/Property use the above method to find the
5149               version in the base class.
5150             - Remove the InheritableMemberSignatureCompare as it is now
5151               dead code.
5152
5153         This patch makes large code bases much faster to compile, as it is
5154         O(n) rather than O(n^2) to do this validation.
5155
5156         Also, it fixes bug 52458 which is that nested classes are not
5157         taken into account when finding the base class member.
5158
5159         Reviewed/Approved by Martin.
5160
5161 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5162
5163         * interface.cs: In all interface classes removed redundant
5164         member initialization.
5165
5166 2004-03-16  Martin Baulig  <martin@ximian.com>
5167
5168         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5169
5170 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5171
5172         * decl.cs (DefineTypeAndParents): New helper method to define a
5173         type's containers before the type itself is defined;  This is a
5174         bug exposed by the recent changes to Windows.Forms when an
5175         implemented interface was defined inside a class that had not been
5176         built yet.   
5177
5178         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5179
5180         (Check): Loop correctly to report errors modifiers
5181         (UNSAFE was not in the loop, since it was the same as TOP).
5182
5183         * interface.cs: Every interface member now takes a ModFlags,
5184         instead of a "is_new" bool, which we set on the base MemberCore. 
5185
5186         Every place where we called "UnsafeOk" in the interface, now we
5187         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5188         the unsafe settings from the member declaration instead of the
5189         container interface. 
5190
5191         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5192
5193         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5194         `set_indexer_name' to the pending bits (one per type).
5195
5196         We fixed a bug today that was picking the wrong method to
5197         override, since for properties the existing InterfaceMethod code
5198         basically ignored the method name.  Now we make sure that the
5199         method name is one of the valid indexer names.
5200
5201 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5202  
5203         * support.cs (SeekableStreamReader): Keep track of stream byte
5204         positions and don't mix them with character offsets to the buffer.
5205
5206         Patch from Gustavo Giráldez
5207
5208 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5209
5210         * interface.cs (InterfaceSetGetBase): Removed double member
5211         initialization, base class does it as well.
5212
5213 2004-03-13  Martin Baulig  <martin@ximian.com>
5214
5215         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5216         when compiling corlib.
5217
5218 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5219
5220         * convert.cs (ExplicitConversion): We were reporting an error on
5221         certain conversions (object_type source to a value type, when the
5222         expression was `null') before we had a chance to pass it through
5223         the user defined conversions.
5224
5225         * driver.cs: Replace / and \ in resource specifications to dots.
5226         Fixes 50752
5227
5228         * class.cs: Add check for duplicate operators.  Fixes 52477
5229
5230 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5231
5232         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5233         that are in the middle of the statements, not only at the end.
5234         Fixes #54987
5235
5236         * class.cs (TypeContainer.AddField): No longer set the
5237         `HaveStaticConstructor' flag, now we call it
5238         `UserDefineStaticConstructor' to diferentiate the slightly
5239         semantic difference.
5240
5241         The situation is that we were not adding BeforeFieldInit (from
5242         Modifiers.TypeAttr) to classes that could have it.
5243         BeforeFieldInit should be set to classes that have no static
5244         constructor. 
5245
5246         See:
5247
5248         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5249
5250         And most importantly Zoltan's comment:
5251
5252         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5253
5254         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5255          before its static fields are used', i.e. initialization does not need
5256          to be triggered by the first access to the type. Setting this flag
5257          helps the JIT to compile better code, since it can run the static
5258          constructor at JIT time, and does not need to generate code to call it
5259          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5260          this flag for lots of classes like String. 
5261          
5262          csc sets this flag if the type does not have an explicit static 
5263          constructor. The reasoning seems to be that if there are only static
5264          initalizers for a type, and no static constructor, then the programmer
5265          does not care when this initialization happens, so beforefieldinit
5266          can be used.
5267          
5268          This bug prevents the AOT compiler from being usable, since it 
5269          generates so many calls to mono_runtime_class_init that the AOT code
5270          is much slower than the JITted code. The JITted code is faster, 
5271          because it does not generate these calls if the vtable is type is
5272          already initialized, which is true in the majority of cases. But the
5273          AOT compiler can't do this."
5274
5275 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5276
5277         * class.cs (MethodData.Emit): Refactor the code so symbolic
5278         information is generated for destructors;  For some reasons we
5279         were taking a code path that did not generate symbolic information
5280         before. 
5281
5282 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5283
5284         * class.cs: Create a Constructor.CheckBase method that
5285         takes care of all validation type code. The method
5286         contains some code that was moved from Define.
5287
5288         It also includes new code that checks for duplicate ctors.
5289         This fixes bug #55148.
5290
5291 2004-03-09  Joshua Tauberer <tauberer@for.net>
5292
5293         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5294         a { ... }-style array creation invokes EmitStaticInitializers
5295         which is not good for reference-type arrays.  String, decimal
5296         and now null constants (NullCast) are not counted toward
5297         static initializers.
5298
5299 2004-03-05  Martin Baulig  <martin@ximian.com>
5300
5301         * location.cs (SourceFile.HasLineDirective): New public field;
5302         specifies whether the file contains or is referenced by a "#line"
5303         directive.
5304         (Location.DefineSymbolDocuments): Ignore source files which
5305         either contain or are referenced by a "#line" directive.        
5306
5307 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5308
5309         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5310         direct access to our parent, so check the method inline there.
5311
5312 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5313
5314         * expression.cs (Invocation.EmitCall): Miguel's last commit
5315         caused a regression. If you had:
5316
5317             T t = null;
5318             t.Foo ();
5319
5320         In Foo the implict this would be null.
5321
5322 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5323
5324         * expression.cs (Invocation.EmitCall): If the method is not
5325         virtual, do not emit a CallVirt to it, use Call.
5326
5327         * typemanager.cs (GetFullNameSignature): Improve the method to
5328         cope with ".ctor" and replace it with the type name.
5329
5330         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5331         as an argument the ConstructorBuilder where it is being defined,
5332         to catch the recursive constructor invocations.
5333
5334 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
5335
5336         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
5337         routines to check if a type is an enumerable/enumerator allow
5338         classes that implement the IEnumerable or IEnumerator interfaces.
5339
5340         * class.cs (Property, Operator): Implement IIteratorContainer, and
5341         implement SetYields.
5342
5343         (Property.Define): Do the block swapping for get_methods in the
5344         context of iterators.   We need to check if Properties also
5345         include indexers or not.
5346
5347         (Operator): Assign the Block before invoking the
5348         OperatorMethod.Define, so we can trigger the Iterator code
5349         replacement. 
5350
5351         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
5352         Property and Operator classes are not created when we parse the
5353         declarator but until we have the block completed, so we use a
5354         singleton SimpleIteratorContainer.Simple to flag whether the
5355         SetYields has been invoked.
5356
5357         We propagate this setting then to the Property or the Operator to
5358         allow the `yield' to function.
5359
5360 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
5361
5362         * codegen.cs: Implemented attribute support for modules.
5363         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
5364         Assembly/Module functionality.
5365
5366         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
5367         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
5368         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
5369
5370 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
5371
5372         * interface.cs (FindMembers): The operation is performed on all base
5373         interfaces and not only on the first. It is required for future CLS Compliance patch.
5374
5375 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
5376
5377         * statement.cs, codegen.cs:
5378         This patch deals with patterns such as:
5379
5380         public class List : IEnumerable {
5381
5382                 public MyEnumerator GetEnumerator () {
5383                         return new MyEnumerator(this);
5384                 }
5385
5386                 IEnumerator IEnumerable.GetEnumerator () {
5387                         ...
5388                 }
5389                 
5390                 public struct MyEnumerator : IEnumerator {
5391                         ...
5392                 }
5393         }
5394
5395         Before, there were a few things we did wrong:
5396         1) we would emit callvirt on a struct, which is illegal
5397         2) we emited ldarg when we needed to emit ldarga
5398         3) we would mistakenly call the interface methods on an enumerator
5399         type that derived from IEnumerator and was in another assembly. For example:
5400
5401         public class MyEnumerator : IEnumerator
5402
5403         Would have the interface methods called, even if there were public impls of the
5404         method. In a struct, this lead to invalid IL code.
5405
5406 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
5407
5408         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
5409           renamed to Emit.
5410
5411         * delegate.cs (Define): Fixed crash when delegate type is undefined.
5412
5413 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
5414
5415         * cs-parser.jay: Fix small regression: we were not testing V2
5416         compiler features correctly.
5417
5418         * interface.cs: If the emit context is null, then create one
5419
5420 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
5421
5422         * decl.cs (GetSignatureForError): New virtual method to get full name
5423           for error messages.
5424
5425         * attribute.cs (IAttributeSupport): New interface for attribute setting.
5426           Now it is possible to rewrite ApplyAttributes method to be less if/else.
5427
5428         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
5429           Duplicated members and code in these classes has been removed.
5430           Better encapsulation in these classes.
5431
5432 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
5433
5434         * assign.cs (Assign.DoResolve): When dealing with compound
5435         assignments, there is a new rule in ECMA C# 2.4 (might have been
5436         there before, but it is documented here) that states that in:
5437
5438         a op= b;
5439
5440         If b is of type int, and the `op' is a shift-operator, then the
5441         above is evaluated as:
5442
5443         a = (int) a op b 
5444
5445         * expression.cs (Binary.ResolveOperator): Instead of testing for
5446         int/uint/long/ulong, try to implicitly convert to any of those
5447         types and use that in pointer arithmetic.
5448
5449         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
5450         method to print information for from the type, not from the
5451         null-method we were given.
5452
5453 2004-02-01  Duncan Mak  <duncan@ximian.com>
5454
5455         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
5456         parsing for cmd, fixes bug #53694.
5457
5458 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
5459
5460         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
5461         in the member name duplication tests. Property and operator name duplication
5462         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
5463
5464 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
5465
5466         * interface.cs (PopulateMethod): Fixed crash when interface method
5467         returns not existing type (error test cs0246-3.cs).
5468
5469 2004-02-02  Ravi Pratap M <ravi@ximian.com>
5470
5471         * cs-parser.jay (interface_accessors): Re-write actions to also
5472         store attributes attached to get and set methods. Fix spelling
5473         while at it.
5474
5475         (inteface_property_declaration): Modify accordingly.
5476
5477         (InterfaceAccessorInfo): New helper class to store information to pass
5478         around between rules that use interface_accessors.
5479
5480         * interface.cs (Emit): Apply attributes on the get and set
5481         accessors of properties and indexers too.
5482
5483         * attribute.cs (ApplyAttributes): Modify accordingly to use the
5484         right MethodBuilder when applying attributes to the get and set accessors.
5485
5486 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
5487
5488         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
5489
5490 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
5491
5492         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
5493
5494 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
5495
5496         * cs-parser.jay: Remove YIELD token, instead use the new grammar
5497         changes that treat `yield' specially when present before `break'
5498         or `return' tokens.
5499
5500         * cs-tokenizer.cs: yield is no longer a keyword.
5501
5502 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
5503
5504         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
5505         setting for default constructors.
5506         For default constructors are almost every time set wrong Modifier. The
5507         generated IL code has been alright. But inside mcs this values was
5508         wrong and this was reason why several of my CLS Compliance tests
5509         failed.
5510
5511 2004-01-22  Martin Baulig  <martin@ximian.com>
5512
5513         * cs-parser.jay (namespace_or_type_name): Return an Expression,
5514         not a QualifiedIdentifier.  This is what `type_name_expression'
5515         was previously doing.
5516         (type_name_expression): Removed; the code is now in
5517         `namespace_or_type_name'.
5518         (qualified_identifier): Removed, use `namespace_or_type_name'
5519         instead.
5520         (QualifiedIdentifier): Removed this class.      
5521
5522 2004-01-22  Martin Baulig  <martin@ximian.com>
5523
5524         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
5525         not a string as alias name.
5526
5527 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
5528
5529         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
5530         #52730 bug, and instead compute correctly the need to use a
5531         temporary variable when requesting an address based on the
5532         static/instace modified of the field and the constructor.
5533  
5534 2004-01-21  Martin Baulig  <martin@ximian.com>
5535
5536         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
5537         class and namespace before looking up aliases.  Fixes #52517.
5538
5539 2004-01-21  Martin Baulig  <martin@ximian.com>
5540
5541         * flowanalysis.cs (UsageVector.Merge): Allow variables being
5542         assinged in a 'try'; fixes exception4.cs.
5543
5544 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5545         * class.cs : Implemented parameter-less constructor for TypeContainer
5546
5547         * decl.cs: Attributes are now stored here. New property OptAttributes
5548
5549         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
5550
5551         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
5552
5553 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5554
5555         * typemanager.cs (CSharpSignature): Now reports also inner class name.
5556           (CSharpSignature): New method for indexer and property signature.
5557
5558 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5559
5560         * pending.cs (IsVirtualFilter): Faster implementation.
5561
5562 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5563
5564         * typemanager.cs: Avoid inclusion of same assembly more than once.
5565
5566 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5567
5568         * cs-parser.jay: Fixed problem where the last assembly attribute
5569           has been applied also to following declaration (class, struct, etc.)
5570           
5571 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5572
5573         * class.cs: Added error CS0538, CS0539 reporting.
5574         Fixed crash on Microsoft runtime when field type is void.
5575
5576         * cs-parser.jay: Added error CS0537 reporting.
5577
5578         * pending.cs: Added error CS0535 reporting.
5579         Improved error report for errors CS0536, CS0534.
5580
5581 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
5582
5583         Merge a few bits from the Anonymous Method MCS tree.
5584
5585         * statement.cs (ToplevelBlock): New class for toplevel methods,
5586         will hold anonymous methods, lifted variables.
5587
5588         * cs-parser.jay: Create toplevel blocks for delegates and for
5589         regular blocks of code. 
5590
5591 2004-01-20  Martin Baulig  <martin@ximian.com>
5592
5593         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
5594         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
5595         and `NeedExplicitReturn'; added `IsLastStatement'.
5596         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
5597         have a `ReturnLabel' or we're not unreachable.
5598
5599         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
5600         child's reachability; don't just override ours with it.  Fixes
5601         #58058 (lluis's example).
5602         (FlowBranching): Added public InTryOrCatch(), InCatch(),
5603         InFinally(), InLoop(), InSwitch() and
5604         BreakCrossesTryCatchBoundary() methods.
5605
5606         * statement.cs (Return): Do all error checking in Resolve().
5607         Unless we are the last statement in a top-level block, always
5608         create a return label and jump to it.
5609         (Break, Continue): Do all error checking in Resolve(); also make
5610         sure we aren't leaving a `finally'.
5611         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
5612         statement in a top-level block.
5613         (Block.Flags): Added `IsDestructor'.
5614         (Block.IsDestructor): New public property.
5615
5616 2004-01-20  Martin Baulig  <martin@ximian.com>
5617
5618         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
5619
5620 2004-01-20  Martin Baulig  <martin@ximian.com>
5621
5622         * statement.cs (Statement.ResolveUnreachable): New public method.
5623         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
5624         (Block.Resolve): Resolve unreachable statements.
5625
5626 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
5627
5628         * expression.cs: We need to fix the case where we do
5629         not have a temp variable here.
5630
5631         * assign.cs: Only expression compound assignments need
5632         temporary variables.
5633
5634 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
5635
5636         * flowanalysis.cs: Reduce memory allocation in a few ways:
5637           - A block with no variables should not allocate a bit
5638             vector for itself.
5639           - A method with no out parameters does not need any tracking
5640             for assignment of the parameters, so we need not allocate
5641             any data for it.
5642           - The arrays:
5643                 public readonly Type[] VariableTypes;
5644                 public readonly string[] VariableNames;
5645             Are redundant. The data is already stored in the variable
5646             map, so we need not allocate another array for it.
5647           - We need to add alot of checks for if (params | locals) == null
5648             due to the first two changes.
5649
5650 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
5651
5652         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
5653         implement IMemoryLocation, we store a copy on a local variable and
5654         take the address of it.  Patch from Benjamin Jemlich
5655
5656         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
5657         to use a special "type_name_expression" rule which reduces the
5658         number of "QualifiedIdentifier" classes created, and instead
5659         directly creates MemberAccess expressions.
5660
5661 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
5662
5663         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
5664         that fixes #52853.  Null literal assignment to ValueType
5665
5666         * class.cs (MethodData.Emit): Instead of checking the name of the
5667         method to determine if its a destructor, create a new derived
5668         class from Method called Destructor, and test for that.  
5669
5670         * cs-parser.jay: Create a Destructor object instead of a Method.  
5671
5672         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
5673
5674         Fixes: 52933
5675
5676 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
5677
5678         * expression.cs (Binary.ResolveOperator): Perform an implicit
5679         conversion from MethodGroups to their delegate types on the
5680         Addition operation.
5681
5682         * delegate.cs: Introduce a new class DelegateCreation that is the
5683         base class for `NewDelegate' and `ImplicitDelegateCreation',
5684         factor some code in here.
5685
5686         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
5687         conversion from MethodGroups to compatible delegate types. 
5688
5689         * ecore.cs (Expression.Resolve): Do not flag error 654
5690         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
5691         we allow conversions from MethodGroups to delegate types now.
5692
5693         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
5694         assignments in v2 either.
5695
5696 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
5697
5698         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
5699         static read-only fields in ctors.
5700
5701         Applied patch from Benjamin Jemlich 
5702
5703         * expression.cs (UnaryMutator): Avoid leaking local variables. 
5704
5705 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
5706
5707         * cs-tokenizer.cs (IsCastToken): Allow the various native types
5708         here to return true, as they can be used like this:
5709
5710                 (XXX) int.MEMBER ()
5711
5712         Fixed 49836 and all the other dups
5713
5714 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
5715
5716         * driver.cs: Implement /win32res and /win32icon.
5717
5718 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
5719
5720         * cs-parser.jay: Add a rule to improve error handling for the
5721         common mistake of placing modifiers after the type.
5722
5723 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
5724
5725         * cs-parser.jay (interface_event_declaration): Catch
5726         initialization of events on interfaces, and report cs0068
5727
5728         * cs-parser.jay (interface_event_declaration): Catch
5729         initialization of events. 
5730
5731         * ecore.cs: Better report missing constructors.
5732
5733         * expression.cs (Binary.ResolveOperator): My previous bug fix had
5734         the error reporting done in the wrong place.  Fix.
5735
5736         * expression.cs (Binary.ResolveOperator): Catch the 
5737         operator + (E x, E y) error earlier, and later allow for implicit
5738         conversions in operator +/- (E e, U x) from U to the underlying
5739         type of E.
5740
5741         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
5742         52596, if the container class is abstract, the default constructor
5743         is protected otherwise its public (before, we were always public).
5744
5745         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
5746         fixed statement.
5747
5748         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
5749         Jemlich that fixes bug #52597, MCS was generating invalid code for
5750         idisposable structs.   Thanks to Ben for following up with this
5751         bug as well.
5752
5753 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
5754
5755         * driver.cs: Allow assemblies without code to be generated, fixes
5756         52230.
5757
5758 2004-01-07  Nick Drochak <ndrochak@gol.com>
5759
5760         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
5761
5762 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
5763
5764         * cs-parser.jay: Add rules to improve error reporting if fields or
5765         methods are declared at the namespace level (error 116)
5766
5767         * Add rules to catch event add/remove
5768
5769 2004-01-04  David Sheldon <dave-mono@earth.li>
5770
5771   * expression.cs: Added matching ")" to error message for 
5772   CS0077
5773
5774 2004-01-03 Todd Berman <tberman@gentoo.org>
5775
5776         * ecore.cs, attribute.cs:
5777         Applying fix from #52429.
5778
5779 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5780
5781         * ecore.cs, expression.cs, statement.cs:
5782         Total rewrite of how we handle branching. We
5783         now handle complex boolean expressions with fewer
5784         jumps. As well if (x == 0) no longer emits a ceq.
5785
5786         if (x is Foo) is much faster now, because we generate
5787         better code.
5788
5789         Overall, we get a pretty big improvement on our benchmark
5790         tests. The code we generate is smaller and more readable.
5791
5792         I did a full two-stage bootstrap. The patch was reviewed
5793         by Martin and Miguel.
5794
5795 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5796
5797         * cs-parser.jay: Make primary_expression not take a QI.
5798         we dont need this because the member_access rule covers
5799         us here. So we replace the rule with just IDENTIFIER.
5800
5801         This has two good effects. First, we remove a s/r conflict.
5802         Second, we allocate many fewer QualifiedIdentifier objects.
5803
5804 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5805
5806         * attribute.cs: Handle MarshalAs attributes as pseudo, and
5807         set the correct information via SRE. This prevents
5808         hanging on the MS runtime. Fixes #29374.
5809
5810 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5811
5812         * convert.cs: correctly handle conversions to value types
5813         from Enum and ValueType as unboxing conversions.
5814
5815         Fixes bug #52569. Patch by Benjamin Jemlich.
5816
5817 2004-01-02  Ravi Pratap  <ravi@ximian.com>
5818
5819         * expression.cs (BetterConversion): Prefer int -> uint
5820         over int -> ulong (csc's behaviour). This fixed bug #52046.
5821
5822 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5823
5824         * decl.cs (MemberCache.FindMembers): now returns a
5825         MemberInfo [].
5826
5827         * typemanager.cs: In general, go with with ^^.
5828         (CopyNewMethods): take an IList.
5829         (RealMemberLookup): Only allocate an arraylist
5830         if we copy from two sets of methods.
5831
5832         This change basically does two things:
5833         1) Fewer array lists allocated due to CopyNewMethods.
5834         2) the explicit cast in MemberList costed ALOT.
5835
5836 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
5837
5838         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
5839         a hashtable to avoid needless string allocations when an identifier is
5840         used more than once (the common case).
5841
5842 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
5843
5844         * pending.cs: MS's TypeBuilder.GetInterfaces ()
5845         is broken, it will not return anything. So, we
5846         have to use the information we have in mcs to
5847         do the task.
5848
5849         * typemanager.cs: Add a cache for GetInterfaces,
5850         since this will now be used more often (due to ^^)
5851
5852         (GetExplicitInterfaces) New method that gets the
5853         declared, not effective, interfaces on a type
5854         builder (eg, if you have interface IFoo, interface
5855         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
5856         { IBar }.
5857
5858         This patch makes MCS able to bootstrap itself on
5859         Windows again.
5860
5861 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
5862
5863         * expression.cs: Remove the Nop's that Miguel put
5864         in by mistake.
5865
5866 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5867
5868         * report.cs, codegen.cs: Give the real stack trace to
5869         the error when an exception is thrown.
5870
5871 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5872
5873         * decl.cs: only allocate hashtables for ifaces if 
5874         it is an iface!
5875
5876 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5877
5878         * expression.cs: fix the error from cs0121-2.cs
5879         (a parent interface has two child interfaces that
5880         have a function with the same name and 0 params
5881         and the function is called through the parent).
5882
5883 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5884
5885         * class.cs, rootcontext.cs, typmanager.cs: do not
5886         leak pointers.
5887
5888 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5889
5890         * codegen.cs: remove stack for the ec flow branching.
5891         It is already a linked list, so no need.
5892
5893 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5894
5895         * Makefile: Allow custom profiler here.
5896
5897 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
5898
5899         * typemanager.cs (LookupType):
5900           - Use a static char [], because split takes
5901             a param array for args, so it was allocating
5902             every time.
5903           - Do not store true in a hashtable, it boxes.
5904
5905 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
5906
5907         * flowanalysis.cs: bytify common enums.
5908
5909 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
5910
5911         * modifiers.cs: Add a new set of flags for the
5912         flags allowed on explicit interface impls.
5913         * cs-parser.jay: catch the use of modifiers in
5914         interfaces correctly.
5915         * class.cs: catch private void IFoo.Blah ().
5916
5917         All related to bug #50572.
5918
5919 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
5920
5921         * decl.cs: Rewrite the consistant accessability checking.
5922         Accessability is not linear, it must be implemented in
5923         a tableish way. Fixes #49704.
5924
5925 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
5926
5927         * expression.cs: Handle negation in a checked context.
5928         We must use subtraction from zero. Fixes #38674.
5929
5930 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5931
5932         * class.cs: Ignore static void main in DLLs.
5933         * rootcontext.cs: Handle the target type here,
5934         since we are have to access it from class.cs
5935         * driver.cs: account for the above.
5936
5937 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5938
5939         * report.cs: Give line numbers and files if available.
5940
5941 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
5942
5943         * driver.cs: Implement /addmodule.
5944
5945         * typemanager.cs:  Change 'modules' field so it now contains Modules not
5946         ModuleBuilders.
5947
5948 2003-12-20  Martin Baulig  <martin@ximian.com>
5949
5950         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
5951         (FieldBase.IsAssigned): Removed this field.
5952         (FieldBase.SetAssigned): New public method.
5953         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
5954
5955 2003-12-20  Martin Baulig  <martin@ximian.com>
5956
5957         * expression.cs (LocalVariableReference.DoResolve): Don't set
5958         `vi.Used' if we're called from DoResolveLValue().
5959
5960         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
5961         returns the usage vector it just merged into the current one -
5962         pass this one to UsageWarning().
5963         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
5964         of the `EmitContext', don't call this recursively on our children.
5965
5966 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
5967
5968         * driver.cs: Implement /target:module.
5969
5970 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
5971
5972         * support.cs (CharArrayHashtable): New helper class.
5973
5974         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
5975         char arrays, not strings, so we can avoid creating a string in
5976         consume_identifier if the identifier is a keyword.
5977
5978 2003-12-16  Martin Baulig  <martin@ximian.com>
5979
5980         * statement.cs (LocalInfo.Assigned): Removed this property.
5981         (LocalInfo.Flags): Removed `Assigned'.
5982         (LocalInfo.IsAssigned): New public method; takes the EmitContext
5983         and uses flow analysis.
5984         (Block.UsageWarning): Made this method private.
5985         (Block.Resolve): Call UsageWarning() if appropriate.
5986
5987         * expression.cs (LocalVariableReference.DoResolve): Always set
5988         LocalInfo.Used here.
5989
5990 2003-12-13  Martin Baulig  <martin@ximian.com>
5991
5992         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
5993         any value here; we're now using flow analysis to figure out
5994         whether a statement/block returns a value.
5995
5996 2003-12-13  Martin Baulig  <martin@ximian.com>
5997
5998         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
5999         working again.
6000         (FlowBranching.MergeFinally): Don't call
6001         `branching.CheckOutParameters()' here, this is called in
6002         MergeTopBlock().
6003         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6004         when adding the `finally' vector.       
6005
6006 2003-12-13  Martin Baulig  <martin@ximian.com>
6007
6008         * flowanalysis.cs
6009         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6010         actually work and also fix #48962.
6011
6012 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6013
6014         * decl.cs: Do not check System.Object for nested types,
6015         since we know it does not have any. Big bang for buck:
6016
6017         BEFORE:
6018            Run 1:   8.35 seconds
6019            Run 2:   8.32 seconds
6020            corlib:  17.99 seconds
6021         AFTER:
6022            Run 1:   8.17 seconds
6023            Run 2:   8.17 seconds
6024            corlib:  17.39 seconds
6025
6026 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6027
6028         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6029         time we are returning 0 members, so we save alot here.
6030
6031 2003-12-11  Martin Baulig  <martin@ximian.com>
6032
6033         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6034         `MergeChild()', also just take the `FlowBranching' as argument;
6035         call Merge() on it and return the result.
6036         (FlowBranching.Merge): We don't need to do anything if we just
6037         have one sibling.
6038
6039 2003-12-11  Martin Baulig  <martin@ximian.com>
6040
6041         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6042         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6043         Maurer for this idea.
6044
6045 2003-12-11  Martin Baulig  <martin@ximian.com>
6046
6047         * flowanalysis.cs (MergeResult): This class is now gone; we now
6048         use the `UsageVector' for this.  The reason for this is that if a
6049         branching just has one sibling, we don't need to "merge" them at
6050         all - that's the next step to do.
6051         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6052         `MergeResult'.
6053
6054 2003-12-11  Martin Baulig  <martin@ximian.com>
6055
6056         Reworked flow analyis and made it more precise and bug-free.  The
6057         most important change is that we're now using a special `Reachability'
6058         class instead of having "magic" meanings of `FlowReturns'.  I'll
6059         do some more cleanups and optimizations and also add some more
6060         documentation this week.
6061
6062         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6063         largely reworked this class.
6064         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6065         the new `Reachability' class instead of having "magic" values here.
6066         (FlowBranching): We're now using an instance of `Reachability'
6067         instead of having separate `Returns', `Breaks' etc. fields.
6068
6069         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6070         based on flow analysis; ignore the return value of block.Emit ().
6071
6072 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6073
6074         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6075         if they are private.
6076
6077 2003-12-09  Martin Baulig  <martin@ximian.com>
6078
6079         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6080         call them directly on the UsageVector.
6081
6082 2003-12-09  Martin Baulig  <martin@ximian.com>
6083
6084         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6085         Changed return type from `FlowReturns' to `Reachability'.
6086
6087 2003-12-09  Martin Baulig  <martin@ximian.com>
6088
6089         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6090         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6091         `Reachable' fields with a single `Reachability' one.
6092
6093 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6094
6095         * class.cs (FindMembers): Remove foreach's.
6096
6097         Bootstrap times:
6098
6099         BEFORE
6100                 Run 1:   8.74 seconds
6101                 Run 2:   8.71 seconds
6102
6103         AFTER
6104                 Run 1:   8.64 seconds
6105                 Run 2:   8.58 seconds
6106
6107
6108 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6109
6110         * cs-parser.jay:
6111         * gen-treedump.cs:
6112         * statement.cs:
6113         This patch does a few things:
6114                 1. EmptyStatement is now a singleton, so it is never reallocated.
6115                 2. All blah is EmptyStatement constructs have been changed to
6116                    blah == EmptyStatement.Value, which is much faster and valid
6117                    now that EmptyStatement is a singleton.
6118                 3. When resolving a block, rather than allocating a new array for
6119                    the non-empty statements, empty statements are replaced with
6120                    EmptyStatement.Value
6121                 4. Some recursive functions have been made non-recursive.
6122         Mainly the performance impact is from (3), however (1) and (2) are needed for
6123         this to work. (4) does not make a big difference in normal situations, however
6124         it makes the profile look saner.
6125
6126         Bootstrap times:
6127
6128         BEFORE
6129         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6130         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6131         Total memory allocated: 56397 KB
6132
6133         AFTER
6134         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6135         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6136         Total memory allocated: 55666 KB
6137
6138 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6139
6140         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6141         than the hashtable in a hashtable version
6142
6143         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6144         we always end up concating a string. This results in a huge perf
6145         loss, because many strings have to be tracked by the GC. In this
6146         patch, we first use a hashtable that works with two keys, so that
6147         the strings do not need to be concat'ed.
6148
6149         Bootstrap times:
6150         BEFORE
6151                 Run 1:   8.74 seconds
6152                 Run 2:   8.71 seconds
6153
6154         AFTER
6155                 Run 1:   8.65 seconds
6156                 Run 2:   8.56 seconds
6157
6158 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6159
6160         * Makefile: Add a new target `do-time' that does a quick and simple
6161         profile, leaving easy to parse output.
6162
6163 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6164
6165         * codegen.cs (Init): Create the dynamic assembly with 
6166         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6167
6168 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6169
6170         * support.cs: Make the PtrHashtable use only one
6171         instance of its comparer.
6172
6173 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6174
6175         * typemanager.cs: Fix lookup of GetNamespaces.
6176
6177 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6178
6179         * expression.cs: Removed redundant line.
6180
6181         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6182         ArrayLists, use for loops with bounds.  
6183
6184         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6185         arraylist.
6186
6187         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6188         arraylists, use for loop with bounds.
6189
6190         The above three changes give us a 0.071 second performance
6191         improvement out of 3.294 seconds down to 3.223.  On my machine
6192         the above changes reduced the memory usage by 1,387 KB during
6193         compiler bootstrap.
6194
6195         * cs-parser.jay (QualifiedIdentifier): New class used to represent
6196         QualifiedIdentifiers.  Before we created a new string through
6197         concatenation, and mostly later on, the result would be
6198         manipulated by DecomposeQI through string manipulation.
6199
6200         This reduced the compiler memory usage for bootstrapping from
6201         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6202         compile times in 0.05 seconds.
6203
6204 2003-11-28  Dick Porter  <dick@ximian.com>
6205
6206         * support.cs: Do string compares with the Invariant culture.
6207
6208         * rootcontext.cs: 
6209         * gen-treedump.cs: 
6210         * expression.cs: 
6211         * driver.cs: 
6212         * decl.cs: 
6213         * codegen.cs: 
6214         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
6215         the comparison is done with the Invariant culture.
6216
6217 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
6218
6219         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
6220         GetEnumerator method.
6221
6222         (ProbeCollectionType): Iterate starting at the most specific type
6223         upwards looking for a GetEnumerator
6224
6225         * expression.cs: Shift count can be up to 31 for int/uint and 63
6226         for long/ulong.
6227
6228 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
6229
6230         * statement.cs (Block.LookupLabel): Also look for the label on the
6231         children blocks.  Use a hash table to keep track of visited
6232         nodes. 
6233
6234         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
6235         we actually did transform the other operand, otherwise fall back
6236         to the common codepath that casts to long.
6237
6238         * cs-tokenizer.cs: Use the same code pattern as the int case.
6239         Maybe I should do the parsing myself, and avoid depending on the
6240         Parse routines to get this done.
6241
6242 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
6243
6244         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6245         which fixes bug 51347.  This time test it.
6246
6247         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
6248         attributes for example can not tell the difference between these.
6249         The difference was only a syntax feature of the language. 
6250
6251         * attribute.cs: Apply attributes to delegates.
6252
6253         * delegate.cs: Call the apply attributes method.
6254
6255 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
6256
6257         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
6258         comparing 0 vs Byte.MinValue, not the value
6259
6260         (ImplicitConversionRequired): When reporting a conversion error,
6261         use error 31 to print out the constant error instead of the
6262         simpler 29.
6263
6264         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6265         which fixes bug 51347.
6266
6267 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
6268
6269         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
6270         which fixes the -warnaserror command line option.
6271
6272 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
6273
6274         * cfold.cs (DoNumericPromotions): During constant folding of
6275         additions on UIntConstant, special case intconstants with
6276         IntConstants like we do on the expression binary operator. 
6277
6278 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
6279
6280         * convert.cs (ImplicitReferenceConversion): We were missing a case
6281         (System.Enum are not value types or class types, so we need to
6282         classify them separatedly).
6283
6284         * driver.cs: We do not support error 2007.
6285
6286 2003-11-12 Jackson Harper <jackson@ximian.com>
6287
6288         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
6289         system directory. Also use the full file name so users can
6290         libraries names mscorlib-o-tron.dll in a non system dir.
6291
6292 2003-11-10  Martin Baulig  <martin@ximian.com>
6293
6294         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
6295         (TypeManager.InitCoreTypes): Initialize them here, but instead of
6296         calling `ResolveType()' on them, directly assign their `Type'.
6297
6298 2003-11-08  Martin Baulig  <martin@ximian.com>
6299
6300         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
6301         return value and the `out parent' parameter.
6302         (TypeContainer.DefineType): Moved the CS0644 check into
6303         GetClassBases().  Don't pass the interface types to the
6304         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
6305         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
6306
6307         * ecore.cs (TypeExpr.IsAttribute): New property.
6308         (TypeExpr.GetInterfaces): New method.
6309
6310         * interface.cs (Interface.GetInterfaceTypeByName): Return a
6311         TypeExpr instead of a Type.
6312         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
6313         (Interface.DefineType): Don't pass the interface types to the
6314         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
6315         them later and then call `TypeBulider.AddInterfaceImplementation()'.
6316
6317         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
6318         instead of a `Type[]'.
6319         (TypeManager.RegisterBuilder): Likewise.
6320         (TypeManager.AddUserInterface): Likewise.
6321         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
6322         `Type[]' and also return a `TypeExpr[]'.
6323         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
6324
6325 2003-11-08  Martin Baulig  <martin@ximian.com>
6326
6327         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
6328         Expression.     
6329
6330 2003-11-08  Martin Baulig  <martin@ximian.com>
6331
6332         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
6333         TypeManager.ResolveExpressionTypes().
6334
6335         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
6336         instead of an Expression.
6337         (TypeExpr): This is now an abstract base class for `TypeExpression'.
6338         (TypeExpression): New public class; formerly known as `TypeExpr'.
6339
6340         * expression.cs (ComposedCast): Derive from TypeExpr.
6341
6342         * typemanager.cs (TypeManager.system_*_expr): These are now
6343         TypExpr's instead of Expression's.
6344         (TypeManager.ResolveExpressionTypes): New public static function;
6345         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
6346         of them.        
6347
6348 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
6349
6350         * expression.cs (New.DoResolve): Do not dereference value that
6351         might be a null return.
6352
6353         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
6354         sure that the constant value has the right type.  Fixes an
6355         unreported bug, similar to 50425.
6356
6357         * const.cs (Const.LookupConstantValue): Call
6358         ImplicitStandardConversionExists before doing a conversion to
6359         avoid havng the TypeManager.ChangeType do conversions.
6360
6361         Reduced the number of casts used
6362
6363         (Const.ChangeType): New routine to enable reuse of the constant
6364         type changing code from statement.
6365
6366         * typemanager.cs (ChangeType): Move common initialization to
6367         static global variables.
6368
6369         Fixes #50425.
6370
6371         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
6372         every value type to go through, even if it was void.  Fix that. 
6373
6374         * cs-tokenizer.cs: Use is_identifier_start_character on the start
6375         character of the define, and the is_identifier_part_character for
6376         the rest of the string.
6377
6378 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
6379
6380         * expression.cs (UnaryMutator.EmitCode): When I updated
6381         LocalVariableReference.DoResolve, I overdid it, and dropped an
6382         optimization done on local variable references.
6383
6384 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
6385
6386         * ecore.cs: Convert the return from Ldlen into an int.
6387
6388 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
6389
6390         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
6391         the accessibility, this is a special case for toplevel non-public
6392         classes (internal for instance).
6393
6394 2003-10-20  Nick Drochak <ndrochak@gol.com>
6395
6396         * ecore.cs: Fix typo and build.  Needed another right paren.
6397
6398 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
6399
6400         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
6401         `internal' case regular and protected, but not allowing protected
6402         to be evaluated later.  Bug 49840
6403
6404 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
6405
6406         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
6407         to kb.Nlast, and not the kb.nFirst to isolate the switch
6408         statement.
6409
6410         Extract the underlying type, so enumerations of long/ulong are
6411         treated like long/ulong.
6412
6413 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
6414
6415         * expression.cs (New): Overload the meaning of RequestedType to
6416         track the possible creation of the NewDelegate type, since
6417         DoResolve is invoked more than once for new constructors on field
6418         initialization.
6419
6420         See bugs: #48800 and #37014
6421
6422         * cs-parser.jay (declare_local_constants): Take an arraylist
6423         instead of a single constant.
6424
6425         (local_constant_declaration): It should take a
6426         constant_declarators, not a constant_declarator.  Fixes 49487
6427
6428         * convert.cs: Fix error report.
6429
6430 2003-10-13 Jackson Harper <jackson@ximian.com>
6431
6432         * typemanager.cs (TypeToCoreType): Add float and double this fixes
6433         bug #49611
6434
6435 2003-10-09  Martin Baulig  <martin@ximian.com>
6436
6437         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
6438         to the .ctor.
6439         (MethodCore.DoDefineParameters): Removed the TypeContainer
6440         argument; use the DeclSpace which was passed to the .ctor instead.
6441         (MethodCore.CheckParameter): Take a DeclSpace instead of a
6442         TypeContainer; we only need a DeclSpace here.
6443
6444 2003-10-09  Martin Baulig  <martin@ximian.com>
6445
6446         * class.cs (MethodData): Added additional `DeclSpace ds' argument
6447         to the .ctor.
6448         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
6449         EmitContext's .ctor.    
6450
6451 2003-10-09  Martin Baulig  <martin@ximian.com>
6452
6453         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
6454         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
6455         AsAccessible(), moved them as well.
6456
6457         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
6458
6459 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
6460
6461         * cs-parser.jay : Renamed yyName to yyNames related to jay.
6462
6463 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
6464
6465         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
6466         generation for >=, as spotted by Paolo, bug 48679.  
6467         Patch from David Waite.
6468
6469         * cs-tokenizer.cs: Add handling for #pragma.
6470
6471         * cs-parser.jay: Allow for both yield and yield return in the
6472         syntax.  The anti-cobolization of C# fight will go on!
6473
6474         * class.cs (TypeBuilder.DefineType): Catch error condition here
6475         (Parent.DefineType erroring out and returning null).
6476
6477         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
6478         coping with enumerations variables, we were mistakenly processing
6479         them as a regular value type instead of built-in types.  Fixes the
6480         bug #48063
6481
6482         * typemanager.cs (IsBuiltinOrEnum): New method.
6483
6484 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
6485
6486         * cs-parser.jay: Upgrade: yield now needs the return clause.
6487
6488 2003-09-19  Martin Baulig  <martin@ximian.com>
6489
6490         * decl.cs (MemberCache.SetupCacheForInterface): Take a
6491         `MemberCache parent' argument.  Normally, an interface doesn't
6492         have a parent type except System.Object, but we use this in gmcs
6493         for generic type parameters.
6494
6495 2003-09-18  Martin Baulig  <martin@ximian.com>
6496
6497         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
6498         on `type.IsInterface'; don't check whether the type has a parent
6499         to determine whether it's an interface.
6500
6501 2003-09-15  Martin Baulig  <martin@ximian.com>
6502
6503         * class.cs (TypeContainer.DefineType): Added an error flag to
6504         avoid reporting duplicate CS0146's ("class definition is
6505         circular.").
6506
6507         * driver.cs (Driver.MainDriver): Abort if
6508         RootContext.ResolveTree() reported any errors.
6509
6510 2003-09-07  Martin Baulig  <martin@ximian.com>
6511
6512         * report.cs (Error, Warning): Added overloaded versions which take
6513         a `params object[] args' and call String.Format().
6514
6515 2003-09-07  Martin Baulig  <martin@ximian.com>
6516
6517         * decl.cs (DeclSpace..ctor): Don't call
6518         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
6519         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
6520         (DeclSpace.RecordDecl): New method.
6521
6522         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
6523
6524 2003-09-02  Ravi Pratap  <ravi@ximian.com>
6525
6526         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
6527         value attributes to be applied to ParameterBuilders.
6528
6529         * class.cs (MethodCore.LabelParameters): Make static and more
6530         generic so that it can be used from other places - like interface
6531         methods, for instance.
6532
6533         * interface.cs (Interface.Emit): Call LabelParameters before
6534         emitting attributes on the InterfaceMethod.
6535
6536 2003-08-26  Martin Baulig  <martin@ximian.com>
6537
6538         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
6539         resolving aliases; fixes #47927.
6540
6541 2003-08-26  Martin Baulig  <martin@ximian.com>
6542
6543         * statement.cs (Using.DoResolve): This is internally emitting a
6544         try/finally clause, so we need to set ec.NeedExplicitReturn if we
6545         do not always return.  Fixes #47681.
6546
6547 2003-08-26  Martin Baulig  <martin@ximian.com>
6548
6549         * decl.cs (MemberCore): Moved WarningNotHiding(),
6550         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
6551         into MemberBase.
6552         (AdditionResult): Make this nested in DeclSpace.
6553         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
6554         argument; call NamespaceEntry.Define() unless we're nested in a
6555         class or struct.
6556
6557         * namespace.cs (Namespace.DefineName): New public function.  This
6558         is called from DeclSpace's .ctor to add 
6559         (Namespace.Lookup): Include DeclSpaces in the lookup.
6560
6561         * class.cs (Operator): Derive from MemberBase, not MemberCore.
6562
6563         * const.cs (Const): Derive from MemberBase, not MemberCore.     
6564
6565 2003-08-25  Martin Baulig  <martin@ximian.com>
6566
6567         * convert.cs (Convert.ExplicitReferenceConversion): When
6568         converting from an interface type to a class, unbox if the target
6569         type is a struct type.  Fixes #47822.
6570
6571 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6572
6573         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
6574         #47854.
6575
6576 2003-08-22  Martin Baulig  <martin@ximian.com>
6577
6578         * class.cs (TypeManager.DefineType): When defining a nested type,
6579         call DefineType() on our parent; fixes #47801.
6580
6581 2003-08-22  Martin Baulig  <martin@ximian.com>
6582
6583         * class.cs (MethodData.Define): While checking if a method is an
6584         interface implementation, improve the test a bit more to fix #47654.
6585
6586 2003-08-22  Martin Baulig  <martin@ximian.com>
6587
6588         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
6589         correctly; fixes #47722.
6590
6591 2003-08-22  Martin Baulig  <martin@ximian.com>
6592
6593         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
6594         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
6595
6596         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
6597
6598 2003-08-22  Martin Baulig  <martin@ximian.com>
6599
6600         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
6601         can only be assigned in static constructors.  Fixes #47161.
6602
6603 2003-08-22  Martin Baulig  <martin@ximian.com>
6604
6605         Rewrote and improved the flow analysis code.
6606
6607         * flowbranching.cs (FlowBranching): Make this class abstract.
6608         (FlowBranching.CreateBranching): New static function to create a
6609         new flow branching.
6610         (FlowBranchingBlock, FlowBranchingException): New classes.
6611         (FlowBranching.UsageVector.Type): New public readonly field.
6612         (FlowBranching.UsageVector.Breaks): Removed the setter.
6613         (FlowBranching.UsageVector.Returns): Removed the setter.
6614         (FlowBranching.UsageVector): Added Break(), Return(),
6615         NeverReachable() and Throw() methods to modify the reachability.
6616         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
6617         done by FlowBranching.Merge().
6618         (FlowBranching.UsageVector.MergeChild): New method; merges the
6619         merge result into the current vector.
6620         (FlowBranching.Merge): New abstract method to merge a branching.
6621
6622 2003-08-12  Martin Baulig  <martin@ximian.com>
6623
6624         * expression.cs (Indirection.CacheTemporaries): Create the
6625         LocalTemporary with the pointer type, not its element type.
6626
6627 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
6628
6629         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
6630         token was a keyword or not.
6631
6632         Add `error' options where an IDENTIFIER was expected;  Provide
6633         CheckToken and CheckIdentifierToken convenience error reporting
6634         functions. 
6635
6636         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
6637
6638         * decl.cs: Rename `NamespaceEntry Namespace' public field into
6639         NameSpaceEntry NameSpaceEntry.
6640
6641         (LookupInterfaceOrClass): Avoid creating a full qualified name
6642         from namespace and name: avoid doing lookups when we know the
6643         namespace is non-existant.   Use new Tree.LookupByNamespace which
6644         looks up DeclSpaces based on their namespace, name pair.
6645
6646         * driver.cs: Provide a new `parser verbose' to display the
6647         exception thrown during parsing.  This is turned off by default
6648         now, so the output of a failure from mcs is more graceful.
6649
6650         * namespace.cs: Track all the namespaces defined in a hashtable
6651         for quick lookup.
6652
6653         (IsNamespace): New method
6654
6655 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
6656
6657         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
6658         we know that we need to concatenate (full typename can never be
6659         null). 
6660
6661         * class.cs: ditto.
6662
6663         * statement.cs: Use a bitfield;  Do not initialize to null things
6664         which are done by the constructor by default.
6665
6666         * cs-parser.jay: bug fix, parameter was 4, not 3.
6667
6668         * expression.cs: Just use the property;
6669
6670         * statement.cs: No need for GetVariableInfo method.
6671
6672 2003-08-08  Martin Baulig  <martin@ximian.com>
6673
6674         * flowanalysis.cs (FlowReturns): This is now nested in the
6675         `FlowBranching' class.
6676         (MyBitVector): Moved this here from statement.cs.
6677         (FlowBranching.SiblingType): New enum type.
6678         (FlowBranching.CreateSibling): Added `SiblingType' argument.
6679
6680 2003-08-07  Martin Baulig  <martin@ximian.com>
6681
6682         * flowanalysis.cs (FlowBranchingType): This is now nested in the
6683         `FlowBranching' class and called `BranchingType'.
6684
6685 2003-08-07  Martin Baulig  <martin@ximian.com>
6686
6687         * flowanalysis.cs: Moved all the control flow analysis code into
6688         its own file.
6689
6690 2003-08-07  Martin Baulig  <martin@ximian.com>
6691
6692         * assign.cs (Assign.DoResolve): `target' must either be an
6693         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
6694         #37319.
6695
6696 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
6697
6698         * expression.cs (BinaryMethod): This kind of expression is created by the
6699         Binary class if it determines that the operator has to be handled
6700         by a method.
6701
6702         (BinaryDelegate): This kind of expression is created if we are
6703         dealing with a + or - operator on delegates.
6704
6705         (Binary): remove method, argumetns, and DelegateOperator: when
6706         dealing with methods, 
6707
6708         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
6709
6710         * statement.cs (Block): use bitfields for the three extra booleans
6711         we had in use.   Remove unused topblock parameter.
6712
6713         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
6714
6715         * assign.cs: Drop extra unneeded tests.
6716
6717 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
6718
6719         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
6720
6721         * statement.cs (Foreach): Use VariableStorage instead of
6722         LocalBuilders.   
6723
6724         * codegen.cs (VariableStorage): New class used by clients that
6725         require a variable stored: locals or fields for variables that
6726         need to live across yield.
6727
6728         Maybe provide a convenience api for EmitThis+EmitLoad?
6729
6730         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
6731         these bad boys.
6732
6733 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
6734
6735         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
6736         RemapParameterLValue): New methods that are used to turn a
6737         precomputed FieldInfo into an expression like this:
6738
6739                 instance.FieldInfo
6740
6741         The idea is to use this instead of making LocalVariableReference
6742         have more than one meaning.
6743
6744         * cs-parser.jay: Add error production to BASE.
6745
6746         * ecore.cs: Deal with TypeManager.GetField returning null, which
6747         is now a valid return value.
6748
6749         (FieldExprNoAddress): New expression for Fields whose address can
6750         not be taken.
6751
6752         * expression.cs (LocalVariableReference): During the resolve
6753         phases, create new expressions if we are in a remapping context.
6754         Remove code that dealt with remapping here.
6755
6756         (ParameterReference): same.
6757
6758         (ProxyInstance): New expression, like the `This' expression, but
6759         it is born fully resolved.  We know what we are doing, so remove
6760         the errors that are targeted to user-provided uses of `this'.
6761
6762         * statement.cs (Foreach): our variable is now stored as an
6763         Expression;  During resolution, follow the protocol, dont just
6764         assume it will return this.
6765
6766 2003-08-06  Martin Baulig  <martin@ximian.com>
6767
6768         * support.cs (SeekableStreamReader.cs): New public class.
6769
6770         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
6771         SeekableStreamReader instead of the normal StreamReader.
6772
6773 2003-08-04  Martin Baulig  <martin@ximian.com>
6774
6775         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
6776         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
6777         deambiguate casts and delegate invocations.
6778         (parenthesized_expression): Use the new tokens to ensure this is
6779         not a cast of method invocation.
6780
6781         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
6782         when reading a `)' and Deambiguate_CloseParens () was previously
6783         called.
6784
6785         * expression.cs (ParenthesizedExpression): New class.  This is
6786         just used for the CS0075 test.
6787         (Binary.DoResolve): Check for CS0075.   
6788
6789 2003-07-29  Ravi Pratap  <ravi@ximian.com>
6790
6791         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
6792         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
6793         reference comparison.
6794
6795         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
6796         examine the ReturnType for equality - this is necessary in the
6797         cases of implicit and explicit operators whose signature also
6798         includes the return type.
6799
6800 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
6801
6802         * namespace.cs: Cache the result of the namespace computation,
6803         instead of computing it every time.
6804
6805 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
6806
6807         * decl.cs: Use a global arraylist that we reuse over invocations
6808         to avoid excesive memory consumption.  Reduces memory usage on an
6809         mcs compile by one meg (45 average).
6810
6811         * typemanager.cs (LookupTypeReflection): In .NET pointers are
6812         private, work around that.
6813
6814 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
6815
6816         * literal.cs (IntLiteral): Define Zero and One static literals. 
6817
6818         * cs-parser.jay (integer_literal): use static literals to reduce
6819         memory usage for the most used literals (0, 1 and -1).  211kb
6820         reduced in memory usage.
6821
6822         Replace all calls to `new ArrayList' with `new
6823         ArrayList(4)' which is a good average number for most allocations,
6824         and also requires only 16 bytes of memory for its buffer by
6825         default. 
6826
6827         This reduced MCS memory usage in seven megabytes for the RSS after
6828         bootstrapping.
6829
6830 2003-07-28  Ravi Pratap  <ravi@ximian.com>
6831
6832         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
6833         handle params methods the correct way by forming only one
6834         applicable set with params and normal methods in them. Earlier we
6835         were looking at params methods only if we found no normal methods
6836         which was not the correct thing to do.
6837
6838         (Invocation.BetterFunction): Take separate arguments indicating
6839         when candidate and the best method are params methods in their
6840         expanded form.
6841
6842         This fixes bugs #43367 and #46199.
6843
6844         * attribute.cs: Documentation updates.
6845
6846         (CheckAttribute): Rename to CheckAttributeTarget.
6847         (GetValidPlaces): Rename to GetValidTargets.
6848
6849         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
6850         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
6851
6852         Fixes bug #44468.
6853
6854 2003-07-28  Martin Baulig  <martin@ximian.com>
6855
6856         * class.cs (TypeContainer.DefineMembers): Use the base type's full
6857         name when looking up the base class of a nested class.  Fixes #46977.
6858
6859 2003-07-26  Martin Baulig  <martin@ximian.com>
6860
6861         * expression.cs (Indexers.Indexer): New nested struct; contains
6862         getter, setter and the indexer's type.
6863         (Indexers.Properties): This is now an ArrayList of
6864         Indexers.Indexer's.
6865         (IndexerAccess.DoResolveLValue): Correctly set the type if the
6866         indexer doesn't have any getters.
6867
6868         * assign.cs (Assign.DoResolve): Also do the implicit conversions
6869         for embedded property and indexer assignments.
6870
6871 2003-07-26  Martin Baulig  <martin@ximian.com>
6872
6873         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
6874         preprocessor directive is not the first non-whitespace character
6875         on a line.
6876
6877 2003-07-26  Martin Baulig  <martin@ximian.com>
6878
6879         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
6880         namespace parsing, follow the spec more closely.
6881
6882         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
6883         NamespaceEntry.Lookup().
6884
6885 2003-07-25  Martin Baulig  <martin@ximian.com>
6886
6887         * MethodCore.cs (OverridesSomething): New public field; it's set
6888         from TypeContainer.DefineMembers if this method overrides
6889         something (which doesn't need to be a method).  Fix #39462.
6890
6891 2003-07-25  Ravi Pratap  <ravi@ximian.com>
6892
6893         * typemanager.cs (GetMembers): Ensure that the list of members is
6894         reversed. This keeps things in sync.
6895
6896         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
6897         find an AttributeUsage attribute.
6898
6899         * expression.cs (Invocation.OverloadResolve): Perform the check
6900         which disallows Invoke to be directly called on a Delegate.
6901
6902         (Error_InvokeOnDelegate): Report error cs1533.
6903
6904 2003-07-25  Martin Baulig  <martin@ximian.com>
6905
6906         * expression.cs (Indexers.GetIndexersForType): Only look in the
6907         interface hierarchy if the requested type is already an
6908         interface.  Fixes #46788 while keeping #46502 fixed.
6909
6910 2003-07-25  Martin Baulig  <martin@ximian.com>
6911
6912         * class.cs (TypeContainer.DefineMembers): Check whether all
6913         readonly fields have been assigned and report warning CS0649 if
6914         not.
6915
6916         * statement.cs (LocalInfo.IsFixed): Always return true if this is
6917         a valuetype.
6918
6919 2003-07-24  Ravi Pratap  <ravi@ximian.com>
6920
6921         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
6922         returned from GetMethods to make things consistent with the
6923         assumptions MCS makes about ordering of methods.
6924
6925         This should comprehensively fix bug #45127 and it does :-)
6926
6927         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
6928         ordering is actually reverse.
6929
6930         * Clean up some debug messages I left lying around.
6931
6932         * interface.cs (Populate*): Get rid of code which emits attributes
6933         since the stage in which we emit attributes is the 'Emit' stage,
6934         not the define stage.
6935
6936         (Emit): Move attribute emission for interface members here.
6937
6938 2003-07-22  Ravi Pratap  <ravi@ximian.com>
6939
6940         * expression.cs (Invocation.OverloadResolve): Follow the spec more
6941         closely: we eliminate methods in base types when we have an
6942         applicable method in a top-level type.
6943
6944         Please see section 14.5.5.1 for an exact description of what goes
6945         on. 
6946
6947         This fixes bug #45127 and a host of other related to corlib compilation.
6948
6949         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
6950         array is the method corresponding to the top-level type (this is
6951         because of the changes made to icall.c) so we change this
6952         accordingly.
6953
6954         (MethodGroupExpr.Name): This too.
6955
6956         * typemanager.cs (GetElementType): New method which does the right
6957         thing when compiling corlib. 
6958
6959         * everywhere: Make use of the above in the relevant places.
6960
6961 2003-07-22  Martin Baulig  <martin@ximian.com>
6962
6963         * cs-parser.jay (invocation_expression): Moved
6964         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
6965         `cast_expression', but create a InvocationOrCast which later
6966         resolves to either an Invocation or a Cast.
6967
6968         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
6969         method; call this before EmitStatement() to make sure that this
6970         expression can be used as a statement.
6971
6972         * expression.cs (InvocationOrCast): New class; resolves to either
6973         an Invocation or a Cast.
6974
6975         * statement.cs (StatementExpression): Call ResolveStatement() on
6976         the ExpressionStatement before emitting it.
6977
6978 2003-07-21  Martin Baulig  <martin@ximian.com>
6979
6980         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
6981         `ref' and `out' attributes match; fixes #46220.
6982         (MemberAccess.ResolveMemberAccess): You can't reference a type
6983         through an expression; fixes #33180.
6984         (Indexers.GetIndexersForType): Don't return the indexers from
6985         interfaces the class implements; fixes #46502.
6986
6987 2003-07-21  Martin Baulig  <martin@ximian.com>
6988
6989         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
6990         CS0661 checks; fixes bug #30442.
6991
6992 2003-07-21  Martin Baulig  <martin@ximian.com>
6993
6994         * decl.cs (AdditionResult): Added `Error'.
6995
6996         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
6997
6998         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
6999         makes cs0031.cs actually work.
7000
7001 2003-07-20  Martin Baulig  <martin@ximian.com>
7002
7003         * namespace.cs: Fixed that bug which caused a crash when compiling
7004         the debugger's GUI.
7005
7006 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7007
7008         * typemanager.cs (LookupTypeReflection): Never expose types which
7009         are NotPublic, NestedPrivate, NestedAssembly, or
7010         NestedFamANDAssem.  We used to return these, and later do a check
7011         that would report a meaningful error, but the problem is that we
7012         would not get the real match, if there was a name override.
7013
7014 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
7015
7016         * namespace.cs (Namespace, Name): Do not compute the namespace
7017         name dynamically, compute it in the constructor.  This reduced
7018         memory usage by 1697 KB.
7019
7020         * driver.cs: Use --pause to pause at the end.
7021
7022 2003-07-17  Peter Williams  <peter@newton.cx>
7023
7024         * Makefile: Change the name of the test target so that it doesn't
7025         conflict with the recursive test target.
7026
7027 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
7028
7029         * expression.cs (LocalVariableReference.Emit, EmitAssign,
7030         AddressOf): Do not use EmitThis, that was wrong, use the actual
7031         this pointer.
7032
7033 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
7034
7035         * class.cs (MethodData.Define): While checking if a method is an
7036         interface implementation, improve the test: If we are not public
7037         (use new test here: use the computed MethodAttributes directly,
7038         instead of the parsed modifier flags) check if the `implementing'
7039         method comes from an interface or not.
7040
7041         * pending.cs (VerifyPendingMethods): Slightly better error
7042         message.
7043
7044         * makefile: add test target that does the mcs bootstrap.
7045
7046 2003-07-16  Ravi Pratap  <ravi@ximian.com>
7047
7048         * interface.cs (Define): Do nothing here since there are no
7049         members to populate etc. Move the attribute emission out of here
7050         since this was just totally the wrong place to put it. Attribute
7051         application happens during the 'Emit' phase, not in the 'Define'
7052         phase.
7053
7054         (Emit): Add this method and move the attribute emission here
7055
7056         * rootcontext.cs (EmitCode): Call the Emit method on interface
7057         types too.
7058
7059 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7060
7061         * expression.cs (OverloadResolve): Report error only if Location
7062         is not 'Null' which means that there was a probe going on.
7063
7064 2003-07-14  Martin Baulig  <martin@ximian.com>
7065
7066         * expression.cs (ConditionalLogicalOperator): New public class to
7067         implement user defined conditional logical operators.
7068         This is section 14.11.2 in the spec and bug #40505.
7069
7070 2003-07-14  Martin Baulig  <martin@ximian.com>
7071
7072         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
7073
7074 2003-07-14  Martin Baulig  <martin@ximian.com>
7075
7076         * codegen.cs (EmitContext.InFixedInitializer): New public field.
7077
7078         * ecore.cs (IVariable.VerifyFixed): New interface method.
7079
7080         * expression.cs (Unary.ResolveOperator): When resolving the `&'
7081         operator, check whether the variable is actually fixed.  Fixes bug
7082         #36055.  Set a variable definitely assigned when taking its
7083         address as required by the spec.
7084
7085         * statement.cs (LocalInfo.IsFixed): New field.
7086         (LocalInfo.MakePinned): Set `IsFixed' to true.
7087
7088 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7089
7090         * attribute.cs (Attribute.Resolve): While doing a Member lookup
7091         for .ctors, ensure that we only ask for members declared in the
7092         attribute type (BindingFlags.DeclaredOnly).
7093
7094         Fixes bug #43632.
7095
7096         * expression.cs (Error_WrongNumArguments): Report error 1501
7097         correctly the way CSC does.
7098
7099 2003-07-13  Martin Baulig  <martin@ximian.com>
7100
7101         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
7102         lookup on the fully qualified name, to make things like "X.X" work
7103         where "X.X" is a fully qualified type name, but we also have a
7104         namespace "X" in the using list.  Fixes #41975.
7105
7106 2003-07-13  Martin Baulig  <martin@ximian.com>
7107
7108         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
7109         function. If we're a CompoundAssign, we need to create an embedded
7110         CompoundAssign, not an embedded Assign.
7111         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
7112         Fixes #45854.
7113
7114 2003-07-13  Martin Baulig  <martin@ximian.com>
7115
7116         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
7117         work to fix bug #46088.
7118
7119 2003-07-13  Ravi Pratap <ravi@ximian.com>
7120
7121         * class.cs (Operator.Emit): Do not emit attributes here - it is
7122         taken care of by the Method class that we delegate too. This takes
7123         care of bug #45876.
7124
7125 2003-07-10  Martin Baulig  <martin@ximian.com>
7126
7127         * expression.cs (TypeOfVoid): New class.
7128         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
7129
7130 2003-07-10  Martin Baulig  <martin@ximian.com>
7131
7132         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
7133         bug #35957.
7134
7135 2003-07-10  Martin Baulig  <martin@ximian.com>
7136
7137         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
7138         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
7139
7140         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
7141
7142         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
7143
7144 2003-07-10  Martin Baulig  <martin@ximian.com>
7145
7146         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
7147         of decimal.  Fixes #42850.
7148
7149         NOTE: I also fixed the created byte blob, but this doesn't work on
7150         the MS runtime and csc never produces any byte blobs for decimal
7151         arrays.
7152
7153 2003-07-10  Martin Baulig  <martin@ximian.com>
7154
7155         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
7156         structs; fixes #32068.
7157         (Block.AddChildVariableNames): Fixed #44302.
7158
7159 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7160
7161         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
7162
7163 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7164
7165         * attribute.cs: And this test is onger needed.
7166
7167 2003-07-08  Martin Baulig  <martin@ximian.com>
7168
7169         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
7170         inaccessible types.  Fixes #36313.
7171
7172         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
7173
7174         * namespace.cs (NamespaceEntry): Create implicit entries for all
7175         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
7176         implicit entries for N1.N2 and N1.
7177
7178 2003-07-08  Martin Baulig  <martin@ximian.com>
7179
7180         Rewrote the handling of namespaces to fix a lot of the issues
7181         wrt. `using' aliases etc.
7182
7183         * namespace.cs (Namespace): Splitted this class into a
7184         per-assembly `Namespace' and a per-file `NamespaceEntry'.
7185
7186         * typemanager.cs (TypeManager.IsNamespace): Removed.
7187         (TypeManager.ComputeNamespaces): Only compute namespaces from
7188         loaded assemblies here, not the namespaces from the assembly we're
7189         currently compiling.
7190
7191 2003-07-08  Martin Baulig  <martin@ximian.com>
7192
7193         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
7194
7195 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7196
7197         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
7198         already fixed it.  
7199
7200         I thought about the memory savings here, but LookupTypeReflection
7201         is used under already very constrained scenarios.  Compiling
7202         corlib or mcs only exposes one hit, so it would not really reduce
7203         any memory consumption.
7204
7205 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7206
7207         * typemanager.cs: fixes bug #45889 by only adding public types from
7208         other assemblies to the list of known types.
7209
7210 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7211
7212         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
7213         on the type we resolved.
7214
7215 2003-07-05  Martin Baulig  <martin@ximian.com>
7216
7217         * pending.cs (PendingImplementation.ParentImplements): Don't
7218         create the proxy if the parent is abstract.
7219
7220         * class.cs (TypeContainer.DefineIndexers): Process explicit
7221         interface implementations first.  Fixes #37714.
7222
7223 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
7224
7225         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
7226         defined recursively;  but since we modify the input parameters
7227         (left is set to `this' temporarily), we reset this value if the
7228         left_is_explicit is false, which gives the original semantics to
7229         the code.  
7230
7231         * literal.cs (NullPointer): new class used to represent a null
7232         literal in a pointer context.
7233
7234         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
7235         type is a pointer, use a NullPointer object instead of a
7236         NullLiteral.   Closes 43687
7237
7238         (ExplicitConversion): Convert pointer values using
7239         the conv opcode to the proper type.
7240
7241         * ecore.cs (New): change ValueTypeVariable property into a method,
7242         that returns whether the valuetype is suitable for being used.
7243
7244         * expression.cs (Binary.DoNumericPromotions): Only return if we
7245         the int constant was a valid uint, and we can return both left and
7246         right as uints.  If not, we continue processing, to trigger the
7247         type conversion.  This fixes 39018.
7248
7249         * statement.cs (Block.EmitMeta): During constant resolution, set
7250         the CurrentBlock property on the emitcontext, so that we resolve
7251         constants propertly.
7252
7253 2003-07-02  Martin Baulig  <martin@ximian.com>
7254
7255         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
7256         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
7257
7258         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
7259         than emitting it here.
7260
7261         * statement.cs: Fixed some more flow analysis bugs.
7262
7263 2003-07-02  Martin Baulig  <martin@ximian.com>
7264
7265         * class.cs (MethodData.Define): When implementing interface
7266         methods, set Final unless we're Virtual.
7267
7268         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
7269         check work for interface methods.
7270
7271 2003-07-01  Martin Baulig  <martin@ximian.com>
7272
7273         * ecore.cs (EmitContext.This): Replaced this property with a
7274         GetThis() method which takes a Location argument.  This ensures
7275         that we get the correct error location for a CS0188.
7276
7277 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
7278
7279         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
7280         ImplicitStandardConversion.
7281
7282         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
7283
7284 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
7285
7286         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
7287         optimization.
7288
7289 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
7290
7291         * class.cs (Constructor.Define): Turn off initlocals for unsafe
7292         constructors.
7293
7294         (MethodData.Define): Turn off initlocals for unsafe methods.
7295
7296 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
7297
7298         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
7299         complete;  Fixes #37521.
7300
7301         * delegate.cs: Use Modifiers.TypeAttr to compute the
7302         TypeAttributes, instead of rolling our own.  This makes the flags
7303         correct for the delegates.
7304
7305 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
7306
7307         * class.cs (Constructor.Define): Set the private flag for static
7308         constructors as well.
7309
7310         * cs-parser.jay (statement_expression): Set the return value to
7311         null, to avoid a crash when we catch an error.
7312
7313 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
7314
7315         * cs-parser.jay: Applied patch from Jackson that adds support for
7316         extern and unsafe modifiers to destructor declarations.
7317
7318         * expression.cs: Report error 21 if the user is trying to index a
7319         System.Array.
7320
7321         * driver.cs: Add an error message, suggested by the bug report.
7322
7323         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
7324         if we do not have a ": this ()" constructor initializer.  Fixes 45149
7325
7326 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
7327
7328         * namespace.cs: Add some information to reduce FAQs.
7329
7330 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
7331
7332         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
7333         underlying enumeration types.  Fixes #43915.
7334
7335         * expression.cs: Treat ushort/short as legal values to be used in
7336         bitwise operations.
7337
7338 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
7339
7340         * delegate.cs: transfer custom attributes for paramenters from
7341         the delegate declaration to Invoke and BeginInvoke.
7342
7343 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
7344
7345         * attribute.cs: handle custom marshalers and emit marshal info
7346         for fields, too.
7347
7348 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
7349
7350         * makefile.gnu: Added anonymous.cs to the compiler sources.
7351
7352 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
7353
7354         * iterators.cs: Change the name of the proxy class to include two
7355         underscores.
7356
7357         * cs-parser.jay: Update grammar to include anonymous methods.
7358
7359         * anonymous.cs: new file.
7360
7361 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
7362
7363         * class.cs (Field.Define): Add missing test for pointers and
7364         safety. 
7365
7366 2003-05-27  Ravi Pratap  <ravi@ximian.com>
7367
7368         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
7369         we use the stobj opcode.
7370
7371         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
7372         since it wasn't the correct fix. 
7373
7374         It still is puzzling that we are required to use stobj for IntPtr
7375         which seems to be a ValueType.
7376
7377 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
7378
7379         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
7380         during regular simple name resolution.   Now, the trick is that
7381         instead of returning for processing the simplename, we do a
7382         TypeManager.LookupType (ie, a rooted lookup as opposed to a
7383         contextual lookup type).   If a match is found, return that, if
7384         not, return for further composition.
7385
7386         This fixes long-standing 30485.
7387
7388         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7389         using the address to initialize an object, do an Stobj instead of
7390         using the regular Stelem.
7391
7392         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
7393         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
7394         Because if we are a BaseIndexerAccess that value will be true.
7395         Fixes 43643.
7396
7397         * statement.cs (GotoCase.Resolve): Return after reporting an
7398         error, do not attempt to continue. 
7399
7400         * expression.cs (PointerArithmetic.Emit): If our operand is a
7401         long, convert our constants to match the operand before
7402         multiplying.  Convert to I type before adding.   Fixes 43670.
7403
7404 2003-05-14  Ravi Pratap  <ravi@ximian.com>
7405
7406         * enum.cs (ImplicitConversionExists) : Rename to
7407         ImplicitEnumConversionExists to remove ambiguity. 
7408
7409         * ecore.cs (NullCast): New type of cast expression class which
7410         basically is very similar to EmptyCast with the difference being
7411         it still is a constant since it is used only to cast a null to
7412         something else
7413         (eg. (string) null)
7414
7415         * convert.cs (ImplicitReferenceConversion): When casting a null
7416         literal, we return a NullCast.
7417
7418         * literal.cs (NullLiteralTyped): Remove - I don't see why this
7419         should be around anymore.
7420
7421         The renaming (reported was slightly wrong). Corrections:
7422
7423         ConvertImplicitStandard -> ImplicitConversionStandard
7424         ConvertExplicitStandard -> ExplicitConversionStandard
7425
7426         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
7427         before passing them in !
7428
7429         * convert.cs (ImplicitConversionStandard): When comparing for
7430         equal expr and target types, ensure that expr is not a
7431         NullLiteral.
7432
7433         In general, we must not be checking (expr_type ==
7434         target_type) in the top level conversion methods
7435         (ImplicitConversion, ExplicitConversion etc). This checking is
7436         done in the methods that they delegate to.
7437
7438 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
7439
7440         * convert.cs: Move Error_CannotConvertType,
7441         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
7442         ImplicitNumericConversion, ImplicitConversionExists,
7443         ImplicitUserConversionExists, StandardConversionExists,
7444         FindMostEncompassedType, FindMostSpecificSource,
7445         FindMostSpecificTarget, ImplicitUserConversion,
7446         ExplicitUserConversion, GetConversionOperators,
7447         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
7448         TryImplicitIntConversion, Error_CannotConvertImplicit,
7449         ConvertImplicitRequired, ConvertNumericExplicit,
7450         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
7451         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
7452         its own file.
7453
7454         Perform the following renames:
7455
7456         StandardConversionExists -> ImplicitStandardConversionExists
7457         ConvertImplicit -> ImplicitConversion
7458         ConvertImplicitStandard -> ImplicitStandardConversion
7459         TryImplicitIntConversion -> ImplicitIntConversion
7460         ConvertImplicitRequired -> ImplicitConversionRequired
7461         ConvertNumericExplicit -> ExplicitNumericConversion
7462         ConvertReferenceExplicit -> ExplicitReferenceConversion
7463         ConvertExplicit -> ExplicitConversion
7464         ConvertExplicitStandard -> ExplicitStandardConversion
7465
7466 2003-05-19  Martin Baulig  <martin@ximian.com>
7467
7468         * statement.cs (TypeInfo.StructInfo): Made this type protected.
7469         (TypeInfo): Added support for structs having structs as fields.
7470
7471         * ecore.cs (FieldExpr): Implement IVariable.
7472         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
7473         VariableInfo for the field.
7474
7475 2003-05-18  Martin Baulig  <martin@ximian.com>
7476
7477         * expression.cs (This.DoResolve): Report a CS0027 if we're
7478         emitting a field initializer.
7479
7480 2003-05-18  Martin Baulig  <martin@ximian.com>
7481
7482         * expression.cs (This.ResolveBase): New public function.
7483         (This.DoResolve): Check for CS0188.
7484
7485         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
7486         This.Resolve().
7487
7488         * ecore.cs (MethodGroupExpr.DoResolve): Set the
7489         `instance_expression' to null if we don't have any non-static
7490         methods.
7491
7492 2003-05-18  Martin Baulig  <martin@ximian.com>
7493
7494         Reworked the way how local variables and parameters are handled by
7495         the flow analysis code.
7496
7497         * statement.cs (TypeInfo, VariableMap): New public classes.
7498         (VariableInfo): New public class.  This is now responsible for
7499         checking whether a variable has been assigned.  It is used for
7500         parameters and local variables.
7501         (Block.EmitMeta): Take the InternalParameters as argument; compute
7502         the layout of the flow vectors here.
7503         (Block.LocalMap, Block.ParameterMap): New public properties.
7504         (FlowBranching): The .ctor doesn't get the InternalParameters
7505         anymore since Block.EmitMeta() now computes the layout of the flow
7506         vector.
7507         (MyStructInfo): This class is now known as `StructInfo' and nested
7508         in `TypeInfo'; we don't access this directly anymore.
7509
7510         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
7511         property and removed IsAssigned(), IsFieldAssigned(),
7512         SetAssigned() and SetFieldAssigned(); we now call them on the
7513         VariableInfo so we don't need to duplicate this code everywhere.
7514
7515         * expression.cs (ParameterReference): Added `Block block' argument
7516         to the .ctor.
7517         (LocalVariableReference, ParameterReference, This): The new
7518         VariableInfo class is now responsible for all the definite
7519         assignment stuff.
7520
7521         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
7522         IsParameterAssigned, SetParameterAssigned): Removed.
7523
7524 2003-05-18  Martin Baulig  <martin@ximian.com>
7525
7526         * typemanager.cs (InitCoreTypes): Try calling
7527         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
7528         the 3-args-version.  Corlib now also needs our `void_type'.
7529         (GetMethod): Added overloaded version which takes an optional
7530         `bool report_errors' to allow lookups of optional methods.
7531
7532 2003-05-12  Martin Baulig  <martin@ximian.com>
7533
7534         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
7535         only used for locals and not for parameters.
7536
7537 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
7538
7539         * support.cs (InternalParameters.ParameterType): Return the
7540         ExternalType of the parameter.
7541
7542         * parameter.cs (Parameter.ExternalType): drop the two arguments,
7543         they were unused.
7544
7545 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
7546
7547         * class.cs (MethodData.Define): Do not set the `newslot' on
7548         interface members, if they are also flagged as "override".
7549
7550         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
7551         better code for ++i and i++.  This only works for static fields
7552         and local variables.
7553
7554         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
7555         want to pull the DeclSpace out of the builder_to_declspace instead
7556         of the TypeBuilder (like in TypeContainer.FindMembers).
7557
7558         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
7559         instead of LookupTypeContainer.  Fixes the crash on .NET for
7560         looking up interface members.
7561
7562         * const.cs: Create our own emit context during the Definition
7563         stage, so that constants are evaluated in the proper context, when
7564         a recursive definition happens.
7565
7566 2003-05-11  Martin Baulig  <martin@ximian.com>
7567
7568         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
7569         new block for a switch section.
7570         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
7571         the adding/lookup in the switch block.  Fixes #39828.
7572
7573 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
7574
7575         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
7576         functionality: I needed to convert the data after I had performed
7577         the add/sub operation into the operands type size.
7578
7579         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
7580         pass the type for the box operation, otherwise the resulting
7581         object would have been of type object.
7582
7583         (BoxedCast): Add constructor to specify the type to box as.
7584
7585 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
7586
7587         * iterators.cs: I was reusing the `count' variable inadvertently,
7588         take steps to not allow this to happen.
7589
7590 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
7591
7592         * attribute.cs (Attribute.Resolve): Params attributes are encoded
7593         by creating an array at the point where the params starts and
7594         putting all those arguments there, then adjusting the size of the
7595         array.
7596
7597 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
7598
7599         * expression.cs (New.AddressOf): Implement interface
7600         IMemoryLocation.  This is used when the `new' operator is used in
7601         the context of an invocation to a method on a value type.
7602
7603         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
7604         example. 
7605
7606         * namespace.cs: Also check the using aliases here.
7607
7608         * driver.cs: Move the test for using validity after the types have
7609         been entered, so we do a single pass that also includes the using
7610         aliases. 
7611
7612         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
7613         in the regular case.   CreateSiblingForFinally is doing extra
7614         error checking.
7615
7616         * attribute.cs (GetAttributeArgumentExpression): Store the result
7617         on an out value, and use the return value to indicate failure
7618         instead of using null (which is a valid return for Constant.GetValue).
7619
7620         * statement.cs: Perform the analysis flow for the increment
7621         portion after the statement, because this will be the real flow of
7622         execution.  Fixes #42385
7623
7624         * codegen.cs (EmitContext.EmitArgument,
7625         EmitContext.EmitStoreArgument): New helper functions when the
7626         RemapToProxy flag is set.
7627
7628         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
7629         function.
7630
7631         Add support for remapping parameters. 
7632
7633         * iterators.cs: Propagate parameter values;  Store parameter
7634         values in the proxy classes.
7635
7636 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
7637
7638         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
7639         need a proxy reference;  I do not know what I was thinking
7640
7641         * cs-parser.jay (constructor_initializer): catch another error,
7642         and display nice message.
7643
7644         (field_declaration): catch void field declaration
7645         to flag a better error. 
7646
7647         * class.cs (MemberBase.CheckBase): Report an error instead of a
7648         warning if a new protected member is declared in a struct. 
7649         (Field.Define): catch the error of readonly/volatile.
7650
7651         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
7652
7653         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
7654         volatile variable is taken
7655
7656 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
7657
7658         * statement.cs (Fixed.Resolve): Report an error if we are not in
7659         an unsafe context.
7660
7661 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
7662
7663         * typemanager.cs: reuse the code that handles type clashes for
7664         delegates and enumerations.
7665
7666         * class.cs (Report28): Always report.
7667
7668         * expression.cs (EncodeAsAttribute): Allow nulls here.
7669
7670 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
7671
7672         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
7673         the functionality for testing whether an expression is valid for
7674         an attribute here.  Also handle the case of arrays of elements
7675         being stored. 
7676
7677         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
7678         encoding a linear array into an array of objects that are suitable
7679         to be passed to an CustomAttributeBuilder.
7680
7681         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
7682
7683         * ecore.cs: (FieldExpr): Handle field remapping here.
7684
7685         * iteratators.cs: Pass the instance variable (if the method is an
7686         instance method) to the constructors, so we can access the field
7687         variables on the class.
7688
7689         TODO: Test this with structs.  I think the THIS variable on
7690         structs might have to be a pointer, and not a refenrece
7691
7692 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
7693
7694         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
7695         local variables to fields in a proxy class.
7696
7697         * iterators.cs (PopulateProxy): Rename our internal fields to
7698         <XXX>.  
7699         Create a <THIS> field if we are an instance method, so we can
7700         reference our parent container variables.
7701         (MapVariable): Called back from the EmitContext code to enter a
7702         new variable to field mapping into the proxy class (we just create
7703         a FieldBuilder).
7704
7705         * expression.cs
7706         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
7707         for using the remapped locals to fields.
7708
7709         I placed the code here, because that gives the same semantics to
7710         local variables, and only changes the Emit code.
7711
7712         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
7713         statements inside iterators.
7714         (VariableInfo): Add a FieldBuilder for the cases when we are
7715         remapping local variables to fields in a proxy class
7716
7717         * ecore.cs (SimpleNameResolve): Avoid testing two times for
7718         current_block != null.
7719
7720         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
7721         not cope with strings, as it has been moved to the
7722         TableSwitchEmit.  Fixed bug in switch generation.
7723
7724         * expression.cs (New.DoResolve): Provide more context for the user
7725         when reporting an error.
7726
7727         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
7728         pointers. 
7729
7730         * expression.cs (MemberAccess.DoResolve): When we get a type back,
7731         check the permissions for it.  Note than in a type-resolution
7732         context the check was already present in DeclSpace.ResolveType,
7733         but was missing from the MemberAccess.
7734
7735         (ArrayCreation.CheckIndices): warn if the user has
7736         more nested levels of expressions, but there are no more
7737         dimensions specified.  Avoids crash on bug 41906.
7738
7739 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
7740
7741         * statement.cs (Block): replace Implicit bool, for a generic
7742         flags.   
7743         New flag: `Unchecked'.  This is used during the EmitMeta phase
7744         (which is out-of-line with the regular Resolve/Emit process for a
7745         statement, as this is done ahead of time, but still gets a chance
7746         to call constant resolve).
7747
7748         (Block.Flags): new enum for adding a new flag.
7749
7750         (Block.EmitMeta): track the state of unchecked.
7751
7752         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
7753         to enable constant resolution to work there as well.
7754
7755 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
7756
7757         * typemanager.cs (ienumerable_type): Also look up
7758         System.Collections.IEnumerable. 
7759
7760 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
7761
7762         TODO: Test more than one conditional per method.
7763
7764         * class.cs (Indexer.Define): Report the location where the user is
7765         referencing the unsupported feature.
7766
7767         (MethodData): Overload the use of `conditionals' to
7768         minimize the creation of needless ArrayLists.   This saves roughly
7769         212kb on my machine.
7770
7771         (Method): Implement the new IIteratorContainer interface.
7772         (Method.SetYields): Implement the method by setting the ModFlags
7773         to contain METHOD_YIELDS.
7774
7775         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
7776         which just got set to null.
7777
7778         * iterators.cs: New file.
7779
7780         (Yield, YieldBreak): New statements.
7781
7782         * statement.cs (Return.Resolve): Flag an error if we are used in
7783         an iterator method.
7784
7785         * codegen.cs (InIterator): New flag set if the code is being
7786         compiled in an iterator method.
7787
7788         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
7789         internal modifier, and we just use it to avoid adding extra
7790         fields, as this is seldom used.  
7791
7792         * cs-parser.jay: Add yield_statement (yield and yield break).
7793
7794         * driver.cs: New flag -v2 to turn on version 2 features. 
7795
7796         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
7797         hashtable when v2 is enabled.
7798
7799 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
7800
7801         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
7802         there is already a namespace defined with this name.
7803
7804         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
7805         people upgraded their corlibs.
7806
7807         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
7808         always use fully qualified types, no need to use the compiler
7809         front end.
7810
7811         (TypeManager.IsNamespace): Use binarysearch.
7812
7813         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
7814         AddDelegate): I did not quite use the new IsValid API properly: I
7815         have to pass the short-name and the fullname.  I was passing only
7816         the basename instead of the fullname sometimes. 
7817
7818         (TypeContainer.DefineType): call NamespaceClash.
7819
7820         * interface.cs (Interface.DefineType): use NamespaceClash before
7821         defining the type.
7822
7823         * delegate.cs (Delegate.DefineType): use NamespaceClash before
7824         defining the type.
7825
7826         * enum.cs: (Enum.DefineType): use NamespaceClash before
7827         defining the type.
7828
7829         * typemanager.cs (: 3-line patch that gives us some tasty 11%
7830         speed increase.  First, use the negative_hits cache when we get a
7831         negative.  Second, add the type with its full original name
7832         instead of the new . and + encoded name (reflection uses + to
7833         separate type from a nested type).  Use LookupTypeReflection
7834         directly which bypasses the type->name hashtable (that we already
7835         know does not contain the type.
7836
7837         * decl.cs (DeclSpace.ResolveTypeExpr): track the
7838         location/container type. 
7839
7840         * driver.cs: When passing utf8, use directly the UTF8Encoding.
7841
7842 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
7843
7844         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
7845
7846         * delegate.cs (NewDelegate.Resolve): Test whether an instance
7847         method is being referenced in the method group from a static
7848         context, and report error 120 if so.
7849
7850         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
7851         Error118. 
7852
7853         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
7854         is created, we create the A namespace).
7855
7856         * cs-parser.jay: A namespace also introduces a DeclarationFound.
7857         Fixes #41591
7858
7859 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
7860
7861         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
7862         invocation to ModuleBuilder.GetType with the same values will
7863         return a new type instance, so we need to cache its return
7864         values. 
7865
7866         * expression.cs (Binary.ResolveOperator): Only allow the compare
7867         operators on enums if they are of the same type.
7868
7869         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
7870         types of ValueType on their own case.  Before we were giving them
7871         the same treatment as objects.
7872
7873         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
7874         fullname.  Short name is used to compare against container name.
7875         Fullname is used to check against defined namespace names.
7876
7877         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
7878         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
7879
7880         (Method.CheckBase): Call parent.
7881         (MemberBase.CheckBase): Check for protected members on sealed
7882         classes.
7883         (PropertyBase.CheckBase): Call parent.
7884         (Field.Define): Call parent.
7885
7886         * report.cs: Negative error codes are now mapped to 8000 - code,
7887         so that the display is render more nicely.
7888
7889         * typemanager.cs: Do not use try/catch, instead report a regular
7890         error. 
7891
7892         (GetPointerType, GetReferenceType): These methods provide
7893         mechanisms to obtain the T* and T& from a T.  We had the code
7894         previously scattered around the code base, and it also used
7895         TypeManager.LookupType that would go through plenty of caches.
7896         This one goes directly to the type source.
7897
7898         In some places we did the Type.GetType followed by
7899         ModuleBuilder.GetType, but not in others, so this unifies the
7900         processing as well.
7901
7902         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
7903         statements now that we have namespace information.
7904
7905         * typemanager.cs (IsNamespace): New method, returns whether the
7906         string presented is a namespace or not.
7907
7908         (ComputeNamespaces): New public entry point, computes the list of
7909         available namespaces, using the GetNamespaces API call in Mono, or
7910         the slower version in MS.NET.   
7911
7912         Now before we start the semantic analysis phase, we have a
7913         complete list of namespaces including everything that the user has
7914         provided.
7915
7916         Deleted old code to cache namespaces in .nsc files.
7917
7918 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
7919
7920         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
7921         class/struct location definition Location for the implicit
7922         constructor location.
7923
7924         (Operator.Define): Use the location of the operator for the
7925         implicit Method definition.
7926
7927         (Constructor.Emit): use the constructor location for the implicit
7928         base initializer constructor.
7929
7930         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
7931         and the Expression class now contains two new methods:
7932
7933         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
7934         isolate type lookup from the rest of the resolution process.
7935
7936         Since we use Expressions to hold type definitions due to the way
7937         we parse the input we have historically overloaded Resolve to
7938         perform the Type lookups if a special flag is passed.  Now this is
7939         eliminated and two methods take their place. 
7940
7941         The differences in the two methods between xStep and xTerminal is
7942         that xStep is involved in our current lookup system that uses
7943         SimpleNames to compose a name, while xTerminal is used just to
7944         catch the case where the simplename lookup failed.
7945
7946 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
7947
7948         * expression.cs (ResolveMemberAccess): Remove redundant code.
7949         TypeExpr expressions are always born fully resolved.
7950
7951         * interface.cs (PopulateMethod): Do not lookup the types twice.
7952         We were doing it once during SemanticAnalysis and once during
7953         PopulateMethod.
7954
7955         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
7956         in local variable type definitions, were being returned as a
7957         SimpleName (we decomposed everything into a string), that is
7958         because primary_expression was being used instead of a type in the
7959         grammar (reduce/reduce conflicts).
7960
7961         The part that was wrong is that we converted the expression into a
7962         string (an oversimplification in one hand, compounded with primary
7963         expressions doing string concatenation).
7964
7965         So things like:
7966
7967         A.B.C [] x;
7968
7969         Would return "A.B.C[]" as a SimpleName.  This stopped things like
7970         using clauses from working on this particular context.  And a type
7971         was being matched directly against "A.B.C[]".
7972
7973         We now use the correct approach, and allow for ComposedCast to be
7974         part of the unary expression.  So the "A.B.C []" become a composed
7975         cast of "A.B.C" (as a nested group of MemberAccess with a
7976         SimpleName at the end) plus the rank composition "[]". 
7977
7978         Also fixes 35567
7979
7980 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
7981
7982         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
7983         for the access level checking.
7984
7985         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
7986         `TypeContainer container', because I kept getting confused when I
7987         was debugging this code.
7988
7989         * expression.cs (Indexers): Instead of tracking getters/setters,
7990         we now track them in parallel.  We create one arraylist less, but
7991         most importantly it is possible now for the LValue code to find a
7992         matching get for a set.
7993
7994         (IndexerAccess.DoResolveLValue): Update the code.
7995         GetIndexersForType has been modified already to extract all the
7996         indexers from a type.  The code assumed it did not.
7997
7998         Also make the code set the correct return type for the indexer.
7999         This was fixed a long time ago for properties, but was missing for
8000         indexers.  It used to be void_type.
8001
8002         (Binary.Emit): Test first for doubles instead of
8003         floats, as they are more common.
8004
8005         (Binary.EmitBranchable): Use the .un version of the branch opcodes
8006         when dealing with floats and the <=, >= operators.  This fixes bug
8007         #39314 
8008
8009         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
8010         to load the array value by emitting a load on the foreach variable
8011         type.  This was incorrect.  
8012
8013         We now emit the code to load an element using the the array
8014         variable type, and then we emit the conversion operator.
8015
8016         Fixed #40176
8017
8018 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
8019
8020         * attribute.cs: Avoid allocation of ArrayLists in the common case.
8021
8022 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
8023
8024         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
8025         test for protection before we test for signatures. 
8026
8027         (MethodSignature.ToString): implement.
8028
8029         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
8030         to the case where we reduced into a LongConstant.
8031
8032         * decl.cs (CheckAccessLevel): If the type is an array, we can not
8033         depend on whether the information is acurrate, because the
8034         Microsoft runtime will always claim that the array type is public,
8035         regardless of the real state.
8036
8037         If the type is a pointer, another problem happens: the type is
8038         reported as non-public in Microsoft.  
8039
8040         In both cases we have to call CheckAccessLevel recursively with
8041         the underlying type as the argument to be tested.
8042
8043 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
8044
8045         * assign.cs (Assign.Emit): If we are dealing with a compound
8046         assignment expression, we should use the code path that stores the
8047         intermediate result in a temporary value.  This fixes #40903.
8048
8049         *expression.cs (Indirection.ToString): Provide ToString method for
8050         debugging. 
8051
8052 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
8053
8054         * class.cs: Null out fields holding references to Block objects so
8055         they can be garbage collected.
8056
8057         * expression.cs (OverloadResolve): Remove unused local.
8058
8059 2003-04-07  Martin Baulig  <martin@ximian.com>
8060
8061         * codegen.cs (EmitContext.CurrentFile): New public field.
8062         (EmitContext.Mark): Use the CurrentFile to check whether the
8063         location is in the correct file.
8064         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
8065
8066 2003-04-07  Martin Baulig  <martin@ximian.com>
8067
8068         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
8069
8070         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
8071         location.  [FIXME: The location argument which gets passed to this
8072         method is sometimes wrong!]
8073
8074 2003-04-07  Nick Drochak <ndrochak@gol.com>
8075
8076         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
8077
8078 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
8079
8080         * expression.cs (Indirection.EmitAssign): We were using the
8081         temporary, but returning immediately instead of continuing the
8082         EmitAssing flow.
8083
8084 2003-04-06  Martin Baulig  <martin@ximian.com>
8085
8086         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
8087         if it's a nested child, but also deriving from the outer class.
8088         See test 190.cs.
8089
8090         * typemanager.cs (IsNestedChildOf): Make this work if it's a
8091         nested child, but also deriving from the outer class.  See
8092         test-190.cs.
8093         (FilterWithClosure): We may access private members of the outer
8094         class if we're a nested child and deriving from the outer class.
8095         (RealMemberLookup): Only set `closure_private_ok' if the
8096         `original_bf' contained BindingFlags.NonPublic.
8097
8098 2003-04-05  Martin Baulig  <martin@ximian.com>
8099
8100         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
8101
8102 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
8103
8104         * class.cs (Event.Define): Do not allow abstract events to have
8105         initializers. 
8106
8107 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
8108
8109         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
8110         block in event declarations.
8111
8112         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
8113         value type, get its address.
8114
8115         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
8116         leaving a class on the stack instead of a boolean value (int
8117         0/1).  Change the code so we compare against null, and then the
8118         result against zero.
8119
8120         * class.cs (TypeContainer.GetClassBases): We were checking for the
8121         parent class being sealed too late.
8122
8123         * expression.cs (Binary.Emit): For <= and >= when dealing with
8124         floating point values, use cgt.un and clt.un instead of cgt and
8125         clt alone.
8126
8127 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
8128
8129         * statement.cs: Apply the same optimization as MS: skip the 
8130         GetEnumerator returning an IEnumerator, and use the one returning a 
8131         CharEnumerator instead. This allows us to avoid the try-finally block 
8132         and the boxing.
8133
8134 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
8135
8136         * cs-parser.jay: Attributes cannot be applied to
8137                          namespaces. Fixes #40473
8138
8139 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8140
8141         * class.cs:
8142         (Add*): check if the name is valid using the full name for constants,
8143         fields, properties and events.
8144
8145 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
8146
8147         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
8148         char constants to be part of the enumeration.
8149
8150         * expression.cs (Conditional.DoResolve): Add support for operator
8151         true. Implements the missing functionality from 14.12
8152
8153         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
8154         operator true/false as required by the spec.
8155
8156         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
8157         implicit conversion to boolean.
8158
8159         * statement.cs (Statement.ResolveBoolean): A boolean expression is
8160         also one where the type implements `operator true'. 
8161
8162         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
8163         get an expression that will invoke operator true based on an
8164         expression.  
8165
8166         (GetConversionOperators): Removed the hack that called op_True
8167         here.  
8168
8169         (Expression.ResolveBoolean): Move this from Statement.
8170
8171 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
8172
8173         * ecore.cs (FieldExpr): do not allow initialization of initonly
8174         fields on derived classes
8175
8176 2003-03-13  Martin Baulig  <martin@ximian.com>
8177
8178         * statement.cs (Block.Emit): Call ig.BeginScope() and
8179         ig.EndScope() when compiling with debugging info; call
8180         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
8181
8182 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
8183
8184         * expression.cs (Indexers): Do not construct immediately, allow
8185         for new members to be appended as we go.  Fixes 38143
8186
8187 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8188
8189         * expression.cs: save/restore context when resolving an unchecked
8190         expression.
8191
8192 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
8193
8194         * cfold.cs: Catch division by zero in modulus operator during
8195         constant folding.
8196
8197 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
8198
8199         * interface.cs (Interface.DefineMembers): Avoid defining members
8200         twice. 
8201
8202 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
8203
8204         * driver.cs: handle the +/- options for -noconfig
8205
8206         * statement.cs (Unckeched.Resolve): Also track the state of
8207         unchecked in the Resolve phase.
8208
8209 2003-02-27  Martin Baulig  <martin@ximian.com>
8210
8211         * ecore.cs (Expression.MemberLookup): Don't create a
8212         MethodGroupExpr for something which is not a method.  Fixes #38291.
8213
8214 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
8215
8216         * class.cs (MemberBase.CheckParameters): Also check that the type
8217         is unmanaged if it is a pointer.
8218
8219         * expression.cs (SizeOf.Resolve): Add location information.
8220
8221         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
8222         a managed type is declared.
8223
8224         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
8225         parameter modifiers as well.  Fixes bug 38606
8226
8227         * class.cs: Very sad.  Am backing out the speed up changes
8228         introduced by the ArrayList -> Array in the TypeContainer, as they
8229         were not actually that much faster, and introduced a bug (no error
8230         reports on duplicated methods).
8231
8232         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
8233         source first, this will guarantee that we have a valid expression
8234         before calling in lower levels functions that will require a
8235         resolved object.  Then use this original_source in the
8236         target.ResolveLValue instead of the original source that was
8237         passed to us.
8238
8239         Another change.  Use target.Resolve instead of LValueResolve.
8240         Although we are resolving for LValues, we will let the Assign code
8241         take care of that (it will be called again from Resolve).  This
8242         basically allows code like this:
8243
8244         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
8245         class Y { void A (X x) { x [0] += o; }
8246
8247         The problem was that the indexer was trying to resolve for
8248         set_Item (idx, object o) and never finding one.  The real set_Item
8249         was set_Item (idx, X).  By delaying the process we get the right
8250         semantics. 
8251
8252         Fixes bug 36505
8253
8254 2003-02-23  Martin Baulig  <martin@ximian.com>
8255
8256         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
8257         while calling DoEmit ().
8258
8259         * codegen.cs (EmitContext.Mark): Don't mark locations in other
8260         source files; if you use the #line directive inside a method, the
8261         compiler stops emitting line numbers for the debugger until it
8262         reaches the end of the method or another #line directive which
8263         restores the original file.
8264
8265 2003-02-23  Martin Baulig  <martin@ximian.com>
8266
8267         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
8268
8269 2003-02-23  Martin Baulig  <martin@ximian.com>
8270
8271         * statement.cs (Block.AddChildVariableNames): We need to call this
8272         recursively, not just for our immediate children.
8273
8274 2003-02-23  Martin Baulig  <martin@ximian.com>
8275
8276         * class.cs (Event.Define): Always make the field private, like csc does.
8277
8278         * typemanager.cs (TypeManager.RealMemberLookup): Make events
8279         actually work, fixes bug #37521.
8280
8281 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
8282
8283         * delegate.cs: When creating the various temporary "Parameters"
8284         classes, make sure that we call the ComputeAndDefineParameterTypes
8285         on those new parameters (just like we do with the formal ones), to
8286         allow them to be resolved in the context of the DeclSpace.
8287
8288         This fixes the bug that Dick observed in Bugzilla #38530.
8289
8290 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
8291
8292         * expression.cs (ResolveMemberAccess): When resolving a constant,
8293         do not attempt to pull a constant if the value was not able to
8294         generate a valid constant.
8295
8296         * const.cs (LookupConstantValue): Do not report more errors than required.
8297
8298 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8299
8300         * expression.cs: fixes bug #38328.
8301
8302 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8303
8304         * class.cs: Changed all the various members that can be part of a
8305         class from being an ArrayList to be an Array of the right type.
8306         During the DefineType type_list, interface_list, delegate_list and
8307         enum_list are turned into types, interfaces, delegates and enums
8308         arrays.  
8309
8310         And during the member population, indexer_list, event_list,
8311         constant_list, field_list, instance_constructor_list, method_list,
8312         operator_list and property_list are turned into their real arrays.
8313
8314         Although we could probably perform this operation earlier, for
8315         good error reporting we need to keep the lists and remove the
8316         lists for longer than required.
8317
8318         This optimization was triggered by Paolo profiling the compiler
8319         speed on the output of `gen-sample-program.pl' perl script. 
8320
8321         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
8322         not crash in methods like MemberLookupFailed that use this field.  
8323
8324         This problem arises when the compiler fails to resolve a type
8325         during interface type definition for example.
8326
8327 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8328
8329         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
8330         inherit from System.Object, so we have to stop at null, not only
8331         when reaching System.Object.
8332
8333 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
8334
8335         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
8336         DeclaredOnly because the parent indexer might have had a different
8337         name, but did not loop until the top of the hierarchy was reached.
8338
8339         The problem this one fixes is 35492: when a class implemented an
8340         indexer from an interface, we were getting the interface method
8341         (which was abstract) and we were flagging an error (can not invoke
8342         abstract method).
8343
8344         This also keeps bug 33089 functioning, and test-148 functioning.
8345
8346         * typemanager.cs (IsSpecialMethod): The correct way of figuring
8347         out if a method is special is to see if it is declared in a
8348         property or event, or whether it is one of the predefined operator
8349         names.   This should fix correctly #36804.
8350
8351 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
8352
8353         The goal here is to remove the dependency on EmptyCast.Peel ().
8354         Killing it completely.
8355
8356         The problem is that currently in a number of places where
8357         constants are expected, we have to "probe" for an EmptyCast, and
8358         Peel, which is not the correct thing to do, as this will be
8359         repetitive and will likely lead to errors. 
8360
8361         The idea is to remove any EmptyCasts that are used in casts that
8362         can be reduced to constants, so we only have to cope with
8363         constants. 
8364
8365         This bug hunt was triggered by Bug 37363 and the desire to remove
8366         the duplicate pattern where we were "peeling" emptycasts to check
8367         whether they were constants.  Now constants will always be
8368         constants.
8369
8370         * ecore.cs: Use an enumconstant here instead of wrapping with
8371         EmptyCast.  
8372
8373         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
8374         throwing me off.  By handling this we can get rid of a few hacks.
8375
8376         * statement.cs (Switch): Removed Peel() code.
8377
8378 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
8379
8380         * class.cs: Location information for error 508
8381
8382         * expression.cs (New.DoResolve): Add a guard against double
8383         resolution of an expression.  
8384
8385         The New DoResolve might be called twice when initializing field
8386         expressions (see EmitFieldInitializers, the call to
8387         GetInitializerExpression will perform a resolve on the expression,
8388         and later the assign will trigger another resolution
8389
8390         This leads to bugs (#37014)
8391
8392         * delegate.cs: The signature for EndInvoke should contain any ref
8393         or out parameters as well.  We were not doing this in the past. 
8394
8395         * class.cs (Field.Define): Do not overwrite the type definition
8396         inside the `volatile' group.  Turns out that volatile enumerations
8397         were changing the type here to perform a validity test, which
8398         broke conversions. 
8399
8400 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
8401
8402         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
8403         and structs, we do not want to load the instance variable
8404
8405         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
8406         enum_type has to be handled like an object reference (implicit
8407         conversions exists from this to object), but the regular IsClass
8408         and IsValueType tests will never return true for this one.
8409
8410         Also we use TypeManager.IsValueType instead of type.IsValueType,
8411         just for consistency with the rest of the code (this is only
8412         needed if we ever use the construct exposed by test-180.cs inside
8413         corlib, which we dont today).
8414
8415 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
8416
8417         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
8418         just InternalCall.
8419
8420 2003-02-09  Martin Baulig  <martin@ximian.com>
8421
8422         * namespace.cs (Namespace..ctor): Added SourceFile argument.
8423         (Namespace.DefineNamespaces): New static public method; this is
8424         called when we're compiling with debugging to add all namespaces
8425         to the symbol file.
8426
8427         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
8428         pass it to the Namespace's .ctor.
8429
8430         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
8431         and MethodBase arguments; pass the namespace ID to the symwriter;
8432         pass the MethodBase instead of the token to the symwriter.
8433         (SymbolWriter.DefineNamespace): New method to add a namespace to
8434         the symbol file.
8435
8436 2003-02-09  Martin Baulig  <martin@ximian.com>
8437
8438         * symbolwriter.cs: New file.  This is a wrapper around
8439         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
8440         methods here in near future.
8441
8442 2003-02-09  Martin Baulig  <martin@ximian.com>
8443
8444         * codegen.cs (EmitContext.Mark): Just pass the arguments to
8445         ILGenerator.MarkSequencePoint() which are actually used by the
8446         symbol writer.
8447
8448 2003-02-09  Martin Baulig  <martin@ximian.com>
8449
8450         * location.cs (SourceFile): New public sealed class.  This
8451         contains the name and an index which is used in the location's token.
8452         (Location): Reserve an appropriate number of bits in the token for
8453         the source file instead of walking over that list, this gives us a
8454         really huge performance improvement when compiling with debugging.
8455
8456         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
8457         `SourceFile' argument instead of a string.
8458         (Driver.ProcessFile): Add all the files via Location.AddFile(),
8459         but don't parse/tokenize here, we need to generate the list of all
8460         source files before we do that.
8461         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
8462         the files.
8463
8464         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
8465         instead of a string.
8466
8467         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
8468         of a string.
8469
8470 2003-02-09  Martin Baulig  <martin@ximian.com>
8471
8472         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
8473         filename on `#line default'.
8474
8475 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
8476
8477         * statement.cs: don't clear the pinned var when the fixed statement
8478         returns from the method (fixes bug#37752).
8479
8480 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
8481
8482         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
8483         to IsValueType.
8484
8485 2003-02-07  Martin Baulig  <martin@ximian.com>
8486
8487         * driver.cs: Removed the `--debug-args' command line argument.
8488
8489         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
8490         automatically by the AsssemblyBuilder.
8491         (CodeGen.InitializeSymbolWriter): We don't need to call any
8492         initialization function on the symbol writer anymore.  This method
8493         doesn't take any arguments.
8494
8495 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
8496
8497         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
8498         from referenced assemblies as well.
8499
8500 2003-02-02  Martin Baulig  <martin@ximian.com>
8501
8502         * class.cs (MethodData.Emit): Generate debugging info for external methods.
8503
8504 2003-02-02  Martin Baulig  <martin@ximian.com>
8505
8506         * class.cs (Constructor.Emit): Open the symbol writer before
8507         emitting the constructor initializer.
8508         (ConstructorInitializer.Emit): Call ec.Mark() to allow
8509         single-stepping through constructor initializers.
8510
8511 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
8512
8513         * class.cs: Handle error 549: do not allow virtual methods in
8514         sealed classes. 
8515
8516 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
8517
8518         * decl.cs: Check access levels when resolving types
8519
8520 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
8521
8522         * statement.cs: Add parameters and locals set in catch blocks that might 
8523         return to set vector
8524
8525 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
8526
8527         * class.cs (Operator): Set the SpecialName flags for operators.
8528
8529         * expression.cs (Invocation.DoResolve): Only block calls to
8530         accessors and operators on SpecialName methods.
8531
8532         (Cast.TryReduce): Handle conversions from char constants.
8533
8534
8535 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
8536
8537         * statement.cs: small memory and time optimization in FlowBranching.
8538
8539 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
8540
8541         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
8542         problem that the last fix but in the other sid (Set).
8543
8544         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
8545         access when there is no indexer in the hierarchy.
8546
8547 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
8548
8549         * class.cs: Combine some if statements.
8550
8551 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8552
8553         * driver.cs: fixed bug #37187.
8554
8555 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
8556
8557         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
8558         any indexer, it's needed to build a list with all the indexers in the
8559         hierarchy (AllGetters), else we have problems. Fixes #35653.
8560
8561 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
8562
8563         * class.cs (MethodData.Define): It is wrong for an interface
8564         implementation to be static in both cases: explicit and implicit.
8565         We were only handling this in one case.
8566
8567         Improve the if situation there to not have negations.
8568
8569         * class.cs (Field.Define): Turns out that we do not need to check
8570         the unsafe bit on field definition, only on usage.  Remove the test.
8571
8572 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8573
8574         * driver.cs: use assembly.Location instead of Codebase (the latest
8575         patch made mcs fail when using MS assemblies).
8576
8577 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
8578
8579         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
8580         get the path to *corlib.dll.
8581
8582 2003-01-21  Nick Drochak <ndrochak@gol.com>
8583
8584         * cs-tokenizer.cs:
8585         * pending.cs:
8586         * typemanager.cs: Remove compiler warnings
8587
8588 2003-01-20  Duncan Mak  <duncan@ximian.com>
8589
8590         * AssemblyInfo.cs: Bump the version number to 0.19.
8591
8592 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8593
8594         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
8595
8596 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
8597
8598         * class.cs (Constructor::Emit): Emit debugging info for constructors.
8599
8600 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
8601
8602         * cs-parser.jay: Small fix: we were not comparing the constructor
8603         name correctly.   Thanks to Zoltan for the initial pointer.
8604
8605 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
8606
8607         * cs-tokenizer.cs: Set file name when specified with #line
8608
8609 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
8610
8611         * cs-parser.jay: Only perform the constructor checks here if we
8612         are named like the class;  This will help provider a better
8613         error.  The constructor path is taken when a type definition is
8614         not found, but most likely the user forgot to add the type, so
8615         report that rather than the constructor error.
8616
8617 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
8618
8619         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
8620         allocations.
8621
8622 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
8623
8624         * cs-parser.jay: Add cleanup call.
8625
8626 2003-01-13  Duncan Mak  <duncan@ximian.com>
8627
8628         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
8629         consistent with other methods.
8630
8631 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
8632
8633         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
8634
8635 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
8636
8637         * attribute.cs: only set GuidAttr to true when we have a
8638         GuidAttribute.
8639
8640 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8641
8642         * ecore.cs:
8643         * expression.cs:
8644         * typemanager.cs: fixes to allow mcs compile corlib with the new
8645         Type.IsSubclassOf fix.
8646
8647 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
8648
8649         * expression.cs (LocalVariableReference.DoResolve): Classify a
8650         constant as a value, not as a variable.   Also, set the type for
8651         the variable.
8652
8653         * cs-parser.jay (fixed_statement): take a type instead of a
8654         pointer_type, so we can produce a better error message later.
8655
8656         * statement.cs (Fixed.Resolve): Flag types that are not pointers
8657         as an error.  
8658
8659         (For.DoEmit): Make inifinite loops have a
8660         non-conditional branch back.
8661
8662         (Fixed.DoEmit): First populate the pinned variables, then emit the
8663         statement, then clear the variables.  Before I was emitting the
8664         code once for each fixed piece.
8665
8666
8667 2003-01-08  Martin Baulig  <martin@ximian.com>
8668
8669         * statement.cs (FlowBranching.MergeChild): A break in a
8670         SWITCH_SECTION does not leave a loop.  Fixes #36155.
8671
8672 2003-01-08  Martin Baulig  <martin@ximian.com>
8673
8674         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
8675         lives in the same number space than `param_map'.  Fixes #36154.
8676
8677 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
8678
8679         * cs-parser.jay (constructor_declaration): Set the
8680         Constructor.ModFlags before probing for it.  This makes the
8681         compiler report 514, 515 and 132 (the code was there, but got
8682         broken). 
8683
8684         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
8685         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
8686         (GotoCase.Resolve): Set `Returns' to ALWAYS.
8687
8688 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
8689
8690         * enum.cs: create the enum static fields using the enum type.
8691
8692 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
8693
8694         * class.cs: don't try to create the ParamBuilder for the return
8695         type if it's not needed (and handle it breaking for the ms runtime
8696         anyway).
8697
8698 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
8699
8700         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
8701
8702 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
8703
8704         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
8705         the command.   This showed up while compiling the JANET source
8706         code, which used \r as its only newline separator.
8707
8708 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
8709
8710         * class.cs (Method.Define): If we are an operator (because it
8711         reuses our code), then set the SpecialName and HideBySig.  #36128
8712
8713 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
8714
8715         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
8716         exception, report error 120 `object reference required'.
8717
8718         * driver.cs: Add --pause option, used during to measure the size
8719         of the process as it goes with --timestamp.
8720
8721         * expression.cs (Invocation.DoResolve): Do not allow methods with
8722         SpecialName to be invoked.
8723
8724 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
8725
8726         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
8727         number before adding it.
8728
8729 2002-12-21  Ravi Pratap  <ravi@ximian.com>
8730
8731         * ecore.cs (StandardImplicitConversion): When in an unsafe
8732         context, we allow conversion between void * to any other pointer
8733         type. This fixes bug #35973.
8734
8735 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
8736
8737         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
8738         is not thrown when extensionless outputs are used 
8739
8740 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8741
8742         * rootcontext.cs: fixed compilation of corlib.
8743
8744 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
8745
8746         * attribute.cs (Attributes.Contains): Add new method.
8747
8748         * class.cs (MethodCore.LabelParameters): if the parameter is an
8749         `out' parameter, check that no attribute `[In]' has been passed.
8750
8751         * enum.cs: Handle the `value__' name in an enumeration.
8752
8753 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
8754
8755         * decl.cs: Added special case to allow overrides on "protected
8756         internal" methods
8757
8758 2002-12-18  Ravi Pratap  <ravi@ximian.com>
8759
8760         * attribute.cs (Attributes.AddAttributeSection): Rename to this
8761         since it makes much more sense.
8762
8763         (Attributes.ctor): Don't require a Location parameter.
8764
8765         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
8766
8767         * attribute.cs (ApplyAttributes): Remove extra Location parameters
8768         since we already have that information per attribute.
8769
8770         * everywhere : make appropriate changes.
8771
8772         * class.cs (LabelParameters): Write the code which actually
8773         applies attributes to the return type. We can't do this on the MS
8774         .NET runtime so we flag a warning in the case an exception is
8775         thrown.
8776
8777 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
8778
8779         * const.cs: Handle implicit null conversions here too.
8780
8781 2002-12-17  Ravi Pratap  <ravi@ximian.com>
8782
8783         * class.cs (MethodCore.LabelParameters): Remove the extra
8784         Type [] parameter since it is completely unnecessary. Instead
8785         pass in the method's attributes so that we can extract
8786         the "return" attribute.
8787
8788 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
8789
8790         * cs-parser.jay (parse): Use Report.Error to flag errors instead
8791         of ignoring it and letting the compile continue.
8792
8793         * typemanager.cs (ChangeType): use an extra argument to return an
8794         error condition instead of throwing an exception.
8795
8796 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
8797
8798         * expression.cs (Unary.TryReduce): mimic the code for the regular
8799         code path.  Perform an implicit cast in the cases where we can
8800         implicitly convert to one of the integral types, and then reduce
8801         based on that constant.   This fixes bug #35483.
8802
8803 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8804
8805         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
8806
8807 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8808
8809         * namespace.cs: fixed bug #35489.
8810
8811 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
8812
8813         * class.cs: Remove some dead code.
8814
8815         * cs-parser.jay: Estimate the number of methods needed
8816         (RootContext.MethodCount);
8817
8818         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
8819         numbers instead of StringBuilders.
8820
8821         * support.cs (PtrHashtable): Add constructor with initial size;
8822         We can now reduce reallocations of the method table.
8823
8824 2002-12-10  Ravi Pratap  <ravi@ximian.com>
8825
8826         * attribute.cs (ApplyAttributes): Keep track of the emitted
8827         attributes on a per-target basis. This fixes bug #35413.
8828
8829 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
8830
8831         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
8832         default to the Windows 1252 encoding.
8833
8834         (UnixParseOption): Support version, thanks to Alp for the missing
8835         pointer. 
8836
8837         * AssemblyInfo.cs: Add nice assembly information.
8838
8839         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
8840         (bug 35169).
8841
8842         * cs-parser.jay: Allow a trailing comma before the close bracked
8843         in the attribute_section production.
8844
8845         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
8846         address of the instance was being taken, I will take this out,
8847         because we take the address of the object immediately here.
8848
8849 2002-12-09  Ravi Pratap  <ravi@ximian.com>
8850
8851         * typemanager.cs (AreMultipleAllowed): Take care of the most
8852         obvious case where attribute type is not in the current assembly -
8853         stupid me ;-)
8854
8855 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
8856
8857         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
8858         definitions, instead of doing that afterwards.  
8859
8860         Also we use a nice little hack, depending on the constructor, we
8861         know if we are a "composed" name or a simple name.  Hence, we
8862         avoid the IndexOf test, and we avoid 
8863
8864         * codegen.cs: Add code to assist in a bug reporter to track down
8865         the source of a compiler crash. 
8866
8867 2002-12-07  Ravi Pratap  <ravi@ximian.com>
8868
8869         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
8870         types have been emitted for a given element and flag an error
8871         if something which does not have AllowMultiple set is used more
8872         than once.
8873
8874         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
8875         attribute types and their corresponding AllowMultiple properties
8876
8877         (AreMultipleAllowed): Check the property for a given type.
8878
8879         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
8880         property in the case we have a TypeContainer.
8881
8882         (Attributes.AddAttribute): Detect duplicates and just skip on
8883         adding them. This trivial fix catches a pretty gross error in our
8884         attribute emission - global attributes were being emitted twice!
8885
8886         Bugzilla bug #33187 is now fixed.
8887
8888 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
8889
8890         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
8891         instead of pp_and).
8892
8893         * expression.cs (Binary.ResolveOperator): I can only use the
8894         Concat (string, string, string) and Concat (string, string,
8895         string, string) if the child is actually a concatenation of
8896         strings. 
8897
8898 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
8899
8900         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
8901         context where we need a 2-character lookahead.
8902
8903         * pending.cs (PendingImplementation): Rework so we can keep track
8904         of interface types all the time, and flag those which were
8905         implemented by parents as optional.
8906
8907 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
8908
8909         * expression.cs (Binary.ResolveOperator): Use
8910         String.Concat(string,string,string) or
8911         String.Concat(string,string,string,string) when possible. 
8912
8913         * typemanager: More helper methods.
8914
8915
8916 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
8917
8918         * pending.cs: remove the bogus return from GetMissingInterfaces()
8919         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
8920
8921 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8922
8923         * namespace.cs: avoid duplicated 'using xxx' being added to
8924         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
8925         when we get more than one 'using' statement for the same namespace.
8926         Report a CS0105 warning for it.
8927
8928 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
8929
8930         * cs-tokenizer.cs (consume_identifier): use read directly, instead
8931         of calling getChar/putback, uses internal knowledge of it.    
8932
8933         (xtoken): Reorder tokenizer so most common patterns are checked
8934         first.  This reduces the compilation time in another 5% (from 8.11s
8935         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
8936
8937         The parsing time is 22% of the compilation in mcs, and from that
8938         64% is spent on the tokenization process.  
8939
8940         I tried using a binary search for keywords, but this is slower
8941         than the hashtable.  Another option would be to do a couple of
8942         things:
8943
8944                 * Not use a StringBuilder, instead use an array of chars,
8945                   with a set value.  Notice that this way we could catch
8946                   the 645 error without having to do it *afterwards*.
8947
8948                 * We could write a hand-parser to avoid the hashtable
8949                   compares altogether.
8950
8951         The identifier consumption process takes 37% of the tokenization
8952         time.  Another 15% is spent on is_number.  56% of the time spent
8953         on is_number is spent on Int64.Parse:
8954
8955                 * We could probably choose based on the string length to
8956                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
8957                   computations. 
8958
8959         Another 3% is spend on wrapping `xtoken' in the `token' function.
8960
8961         Handle 0xa0 as whitespace (#34752)
8962
8963 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
8964
8965         * typemanager.cs (IsCLRType): New routine to tell whether a type
8966         is one of the builtin types.  
8967
8968         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
8969         typecode in more places instead of doing pointer comparissions.
8970         We could leverage some knowledge about the way the typecodes are
8971         laid out.
8972
8973         New code to cache namespaces in assemblies, it is currently not
8974         invoked, to be used soon.
8975
8976         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
8977
8978         * expression.cs (Binary.ResolveOperator): specially handle
8979         strings, and do not perform user-defined operator overloading for
8980         built-in types.
8981
8982 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
8983
8984         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
8985         internalcall as it is a pretty simple operation;  Avoid whenever
8986         possible to call Char.IsLetter.
8987
8988         (consume_identifier): Cut by half the number of
8989         hashtable calls by merging the is_keyword and GetKeyword behavior.
8990
8991         Do not short-circuit, because if we do, we
8992         report errors (ie, #if false && true would produce an invalid
8993         directive error);
8994
8995
8996 2002-11-24  Martin Baulig  <martin@ximian.com>
8997
8998         * expression.cs (Cast.TryReduce): If we're in checked syntax,
8999         check constant ranges and report a CS0221.  Fixes #33186.
9000
9001 2002-11-24  Martin Baulig  <martin@ximian.com>
9002
9003         * cs-parser.jay: Make this work for uninitialized variable
9004         declarations in the `for' initializer.  Fixes #32416.
9005
9006 2002-11-24  Martin Baulig  <martin@ximian.com>
9007
9008         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
9009         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
9010
9011 2002-11-24  Martin Baulig  <martin@ximian.com>
9012
9013         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
9014         argument; if true, we also check for user-defined conversions.
9015         This is only needed if both arguments are of a user-defined type.
9016         Fixes #30443, added test-175.cs.
9017         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
9018
9019         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
9020
9021 2002-11-24  Martin Baulig  <martin@ximian.com>
9022
9023         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
9024         function to get the store opcode.
9025         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
9026         only emit the Ldelema if the store opcode is Stobj.  You must run
9027         both test-34 and test-167 to test this.  Fixes #34529.
9028
9029 2002-11-23  Martin Baulig  <martin@ximian.com>
9030
9031         * ecore.cs (Expression.MemberLookup): Added additional
9032         `qualifier_type' argument which is used when we're being called
9033         from MemberAccess.DoResolve() and null if we're called from a
9034         SimpleName lookup.
9035         (Expression.MemberLookupFailed): New method to report errors; this
9036         does the CS1540 check and reports the correct error message.
9037
9038         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
9039         argument for the CS1540 check and redone the way how we're dealing
9040         with private members.  See the comment in the source code for details.
9041         (FilterWithClosure): Reverted this back to revision 1.197; renamed
9042         `closure_start_type' to `closure_qualifier_type' and check whether
9043         it's not null.  It was not this filter being broken, it was just
9044         being called with the wrong arguments.
9045
9046         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
9047         and pass it the correct `qualifier_type'; this also does the error
9048         handling for us.
9049
9050 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
9051
9052         * expression.cs (Invocation.EmitParams): If the we are dealing
9053         with a non-built-in value type, load its address as well.
9054
9055         (ArrayCreation): Use a a pretty constant instead
9056         of the hardcoded value 2.   Use 6 instead of 2 for the number of
9057         static initializers.  
9058
9059         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
9060         because they are not really value types, just glorified integers. 
9061
9062         * driver.cs: Do not append .exe, the CSC compiler does not do it.
9063
9064         * ecore.cs: Remove redundant code for enumerations, make them use
9065         the same code path as everything else, fixes the casting issue
9066         with enumerations in Windows.Forms.
9067
9068         * attribute.cs: Do only cast to string if it is a string, the
9069         validation happens later.
9070
9071         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
9072         people upgrade their corlibs.
9073
9074         * ecore.cs: Oops, enumerations were not following the entire code path
9075
9076 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
9077
9078         * typemanager.cs (FilterWithClosure): Commented out the test for
9079         1540 in typemanager.cs, as it has problems when accessing
9080         protected methods from a parent class (see test-174.cs). 
9081
9082         * attribute.cs (Attribute.ValidateGuid): new method.
9083         (Attribute.Resolve): Use above.
9084
9085 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
9086
9087         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
9088
9089         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
9090         handling for enumerations, as we only needed the TypeContainer
9091         functionality to begin with (this is required for the fix below to
9092         work for enums that reference constants in a container class for
9093         example). 
9094
9095         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
9096
9097         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
9098         a valid TypeBuilder to perform lookups on.o
9099
9100         * class.cs (InheritableMemberSignatureCompare): Use true in the
9101         call to GetGetMethod and GetSetMethod, because we are comparing
9102         the signature, and we need to get the methods *even* if they are
9103         private. 
9104
9105         (PropertyBase.CheckBase): ditto.
9106
9107         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
9108         GotoCase.Resolve): Use Peel on EmpytCasts.
9109
9110         * ecore.cs (EmptyCast): drop child, add Peel method.
9111
9112 2002-11-17  Martin Baulig  <martin@ximian.com>
9113
9114         * ecore.cs (EmptyCast.Child): New public property.
9115
9116         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
9117         label resolved to an EmptyCast.  Fixes #34162.
9118         (GotoCase.Resolve): Likewise.
9119         (Block.EmitMeta): Likewise.
9120
9121 2002-11-17  Martin Baulig  <martin@ximian.com>
9122
9123         * expression.cs (Invocation.BetterConversion): Prefer int over
9124         uint; short over ushort; long over ulong for integer literals.
9125         Use ImplicitConversionExists instead of StandardConversionExists
9126         since we also need to check for user-defined implicit conversions.
9127         Fixes #34165.  Added test-173.cs.
9128
9129 2002-11-16  Martin Baulig  <martin@ximian.com>
9130
9131         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
9132         with the `true' and `false' literals.  Fixes #33151.
9133
9134 2002-11-16  Martin Baulig  <martin@ximian.com>
9135
9136         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
9137         October 22nd; don't do the cs1540 check for static members.
9138
9139         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
9140         now using our own filter here and doing the cs1540 check again.
9141
9142 2002-11-16  Martin Baulig  <martin@ximian.com>
9143
9144         * support.cs (InternalParameters): Don't crash if we don't have
9145         any fixed parameters.  Fixes #33532.
9146
9147 2002-11-16  Martin Baulig  <martin@ximian.com>
9148
9149         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
9150         when looking up static methods to make this work on Windows.
9151         Fixes #33773.
9152
9153 2002-11-16  Martin Baulig  <martin@ximian.com>
9154
9155         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
9156         a setter rather than using PropertyInfo.CanWrite.
9157
9158 2002-11-15  Nick Drochak  <ndrochak@gol.com>
9159
9160         * class.cs: Allow acces to block member by subclasses. Fixes build
9161         breaker.
9162
9163 2002-11-14  Martin Baulig  <martin@ximian.com>
9164
9165         * class.cs (Constructor.Emit): Added the extern/block check.
9166         Fixes bug #33678.
9167
9168 2002-11-14  Martin Baulig  <martin@ximian.com>
9169
9170         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
9171         iteration while looking for indexers, this is needed because the
9172         indexer may have a different name in our base classes.  Fixed the
9173         error reporting (no indexers at all, not get accessor, no
9174         overloaded match).  Fixes bug #33089.
9175         (IndexerAccess.DoResolveLValue): Likewise.
9176
9177 2002-11-14  Martin Baulig  <martin@ximian.com>
9178
9179         * class.cs (PropertyBase.CheckBase): Make this work for multiple
9180         indexers.  Fixes the first part of bug #33089.
9181         (MethodSignature.InheritableMemberSignatureCompare): Added support
9182         for properties.
9183
9184 2002-11-13  Ravi Pratap  <ravi@ximian.com>
9185
9186         * attribute.cs (Attribute.Resolve): Catch the
9187         NullReferenceException and report it since it isn't supposed to
9188         happen. 
9189
9190 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
9191
9192         * expression.cs (Binary.EmitBranchable): Also handle the cases for
9193         LogicalOr and LogicalAnd that can benefit from recursively
9194         handling EmitBranchable.  The code now should be nice for Paolo.
9195
9196 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
9197
9198         * typemanager.cs (LookupType): Added a negative-hit hashtable for
9199         the Type lookups, as we perform quite a number of lookups on
9200         non-Types.  This can be removed once we can deterministically tell
9201         whether we have a type or a namespace in advance.
9202
9203         But this might require special hacks from our corlib.
9204
9205         * TODO: updated.
9206
9207         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
9208         and double which avoids a conversion from an integer to a double.
9209
9210         * expression.cs: tiny optimization, avoid calling IsConstant,
9211         because it effectively performs the lookup twice.
9212
9213 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
9214
9215         But a bogus return here to keep the semantics of the old code
9216         until the Mono runtime is fixed.
9217
9218         * pending.cs (GetMissingInterfaces): New method used to remove all
9219         the interfaces that are already implemented by our parent
9220         classes from the list of pending methods. 
9221
9222         * interface.cs: Add checks for calls after ResolveTypeExpr.
9223
9224 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
9225
9226         * class.cs (Class.Emit): Report warning 67: event not used if the
9227         warning level is beyond 3.
9228
9229         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
9230         being a NullLiteral.
9231
9232         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
9233         specifiers. 
9234
9235         * class.cs (TypeContainer.GetClassBases): Cover a missing code
9236         path that might fail if a type can not be resolved.
9237
9238         * expression.cs (Binary.Emit): Emit unsigned versions of the
9239         operators. 
9240
9241         * driver.cs: use error 5.
9242
9243 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
9244
9245         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
9246
9247 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
9248
9249         * cs-parser.jay (switch_section): A beautiful patch from Martin
9250         Baulig that fixed 33094.
9251
9252 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
9253
9254         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
9255         Check whether the base is abstract and report an error if so.
9256
9257         * expression.cs (IndexerAccess.DoResolveLValue,
9258         IndexerAccess.DoResolve): ditto. 
9259
9260         (Invocation.DoResolve): ditto.
9261
9262         (Invocation.FullMethodDesc): Improve the report string.
9263
9264         * statement.cs (Block): Eliminate IsVariableDefined as it is
9265         basically just a wrapper for GetVariableInfo.
9266
9267         * ecore.cs (SimpleName): Use new 
9268
9269         * support.cs (ReflectionParamter.ParameterType): We unwrap the
9270         type, as we return the actual parameter ref/unref state on a
9271         different call.
9272
9273 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
9274
9275         * support.cs: Return proper flags REF/OUT fixing the previous
9276         commit.  
9277
9278         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
9279         not used to mean `ref' but `ref or out' in ParameterReference
9280
9281         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
9282         full type signature instead of calling TypeManger.CSharpName
9283         ourselves. 
9284
9285         * support.cs (InternalParameters.ParameterDesc): Do not compare
9286         directly to the modflags, because REF/OUT will actually be bitsets
9287         if set. 
9288
9289         * delegate.cs (VerifyMethod): Check also the modifiers.
9290
9291         * cs-tokenizer.cs: Fix bug where floating point values with an
9292         exponent where a sign was missing was ignored.
9293
9294         * driver.cs: Allow multiple assemblies to be specified in a single
9295         /r: argument
9296
9297 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
9298
9299         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
9300         because identifiers after a parenthesis would end up in this kind
9301         of production, and we needed to desamiguate it for having casts
9302         like:
9303
9304                 (UserDefinedType *) xxx
9305
9306 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
9307
9308         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
9309         we should set on the Bindingflags.NonPublic, but not turn on
9310         private_ok.  private_ok controls whether a Private member is
9311         returned (this is chekced on the filter routine), while the
9312         BindingFlags.NonPublic just controls whether private/protected
9313         will be allowed.   This fixes the problem part of the problem of
9314         private properties being allowed to be used in derived classes.
9315
9316         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
9317         so we can call the children DoResolveLValue method (this will
9318         properly signal errors on lvalue assignments to base properties)
9319
9320         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
9321         getter are null, and we have a property info, we know that this
9322         happened because the lookup failed, so we report an error 122 for
9323         protection level violation.
9324
9325         We also silently return if setter and getter are null in the
9326         resolve functions, this condition only happens if we have flagged
9327         the error before.  This is the other half of the problem. 
9328
9329         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
9330         not have accessibility information, that is why we were returning
9331         true in the filter function in typemanager.cs.
9332
9333         To properly report 122 (property is inaccessible because of its
9334         protection level) correctly, we report this error in ResolveAccess
9335         by failing if both the setter and the getter are lacking (ie, the
9336         lookup failed). 
9337
9338         DoResolve and DoLResolve have been modified to check for both
9339         setter/getter being null and returning silently, the reason being
9340         that I did not want to put the knowledge about this error in upper
9341         layers, like:
9342
9343         int old = Report.Errors;
9344         x = new PropertyExpr (...);
9345         if (old != Report.Errors)
9346                 return null;
9347         else
9348                 return x;
9349
9350         So the property expr is returned, but it is invalid, so the error
9351         will be flagged during the resolve process. 
9352
9353         * class.cs: Remove InheritablePropertySignatureCompare from the
9354         class, as we no longer depend on the property signature to compute
9355         whether it is possible to implement a method or not.
9356
9357         The reason is that calling PropertyInfo.GetGetMethod will return
9358         null (in .NET, in Mono it works, and we should change this), in
9359         cases where the Get Method does not exist in that particular
9360         class.
9361
9362         So this code:
9363
9364         class X { public virtual int A { get { return 1; } } }
9365         class Y : X { }
9366         class Z : Y { public override int A { get { return 2; } } }
9367
9368         Would fail in Z because the parent (Y) would not have the property
9369         defined.  So we avoid this completely now (because the alternative
9370         fix was ugly and slow), and we now depend exclusively on the
9371         method names.
9372
9373         (PropertyBase.CheckBase): Use a method-base mechanism to find our
9374         reference method, instead of using the property.
9375
9376         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
9377         routines are gone now.
9378
9379         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
9380         names, they were incorrectly named.
9381
9382         * cs-tokenizer.cs: Return are more gentle token on failure. 
9383
9384         * pending.cs (PendingImplementation.InterfaceMethod): This routine
9385         had an out-of-sync index variable, which caused it to remove from
9386         the list of pending methods the wrong method sometimes.
9387
9388 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
9389
9390         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
9391         CanWrite, because those refer to this particular instance of the
9392         property, and do not take into account the fact that we can
9393         override single members of a property.
9394
9395         Constructor requires an EmitContext.  The resolution process does
9396         not happen here, but we need to compute the accessors before,
9397         because the resolution does not always happen for properties.
9398
9399         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
9400         subclass, before we did not update this flag, but we did update
9401         bindingflags. 
9402
9403         (GetAccessors): Drop this routine, as it did not work in the
9404         presence of partially overwritten set/get methods. 
9405
9406         Notice that this broke the cs1540 detection, but that will require
9407         more thinking. 
9408
9409 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9410
9411         * class.cs:
9412         * codegen.cs:
9413         * driver.cs: issue a warning instead of an error if we don't support
9414         debugging for the platform. Also ignore a couple of errors that may
9415         arise when trying to write the symbols. Undo my previous patch.
9416
9417 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9418
9419         * driver.cs: ignore /debug switch except for Unix platforms.
9420
9421 2002-10-23  Nick Drochak  <ndrochak@gol.com>
9422
9423         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
9424
9425 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
9426
9427         * driver.cs: Do not make mcs-debug conditional, so we do not break
9428         builds that use it.
9429
9430         * statement.cs (UsageVector.MergeChildren): I would like Martin to
9431         review this patch.  But basically after all the children variables
9432         have been merged, the value of "Breaks" was not being set to
9433         new_breaks for Switch blocks.  I think that it should be set after
9434         it has executed.  Currently I set this to the value of new_breaks,
9435         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
9436         conservative, but I do not understand this code very well.
9437
9438         I did not break anything in the build, so that is good ;-)
9439
9440         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
9441
9442 2002-10-20  Mark Crichton  <crichton@gimp.org>
9443
9444         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
9445
9446 2002-10-20  Nick Drochak  <ndrochak@gol.com>
9447
9448         * cfold.cs: Fixed compile blocker.
9449
9450 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
9451
9452         * driver.cs: I was chekcing the key, not the file.
9453
9454 2002-10-19  Ravi Pratap  <ravi@ximian.com>
9455
9456         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
9457         message that we were generating - we just need to silently return
9458         a null.
9459
9460 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
9461
9462         * class.cs (Event.Define): Change my previous commit, as this
9463         breaks the debugger.  This is a temporary hack, as it seems like
9464         the compiler is generating events incorrectly to begin with.
9465
9466         * expression.cs (Binary.ResolveOperator): Added support for 
9467         "U operator - (E x, E y)"
9468
9469         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
9470         y)".
9471
9472         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
9473         init-only variables, but this path did not take into account that
9474         there might be also instance readonly variables.  Correct this
9475         problem. 
9476
9477         This fixes bug 32253
9478
9479         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
9480         delegates as well.
9481
9482         * driver.cs: Change the extension for modules to `netmodule'
9483
9484         * cs-parser.jay: Improved slightly the location tracking for
9485         the debugger symbols.
9486
9487         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
9488         modifiers that were specified instead of the hardcoded value
9489         (FamAndAssem).  This was basically ignoring the static modifier,
9490         and others.  Fixes 32429.
9491
9492         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
9493         fixed a bug in the process (32476)
9494
9495         * expression.cs (ArrayAccess.EmitAssign): Patch from
9496         hwang_rob@yahoo.ca that fixes bug 31834.3
9497
9498 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
9499
9500         * driver.cs: Make the module extension .netmodule.
9501
9502 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
9503
9504         * driver.cs: Report an error if the resource file is not found
9505         instead of crashing.
9506
9507         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
9508         false, like Emit does.
9509
9510 2002-10-16  Nick Drochak  <ndrochak@gol.com>
9511
9512         * typemanager.cs: Remove unused private member.  Also reported mcs
9513         bug to report this as a warning like csc.
9514
9515 2002-10-15  Martin Baulig  <martin@gnome.org>
9516
9517         * statement.cs (Statement.Emit): Made this a virtual method; emits
9518         the line number info and calls DoEmit().
9519         (Statement.DoEmit): New protected abstract method, formerly knows
9520         as Statement.Emit().
9521
9522         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
9523
9524 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
9525
9526         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
9527         have fixed a remaining problem: not every AddXXXX was adding a
9528         fully qualified name.  
9529
9530         Now everyone registers a fully qualified name in the DeclSpace as
9531         being defined instead of the partial name.  
9532
9533         Downsides: we are slower than we need to be due to the excess
9534         copies and the names being registered this way.  
9535
9536         The reason for this is that we currently depend (on the corlib
9537         bootstrap for instance) that types are fully qualified, because
9538         we dump all the types in the namespace, and we should really have
9539         types inserted into the proper namespace, so we can only store the
9540         basenames in the defined_names array.
9541
9542 2002-10-10  Martin Baulig  <martin@gnome.org>
9543
9544         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
9545         from bug #31834, see the bug report for a testcase which is
9546         miscompiled.
9547
9548 2002-10-10  Martin Baulig  <martin@gnome.org>
9549
9550         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
9551         flow analysis code for this.
9552
9553         * statement.cs (Do, While, For): Tell the flow analysis code about
9554         infinite loops.
9555         (FlowBranching.UsageVector): Added support for infinite loops.
9556         (Block.Resolve): Moved the dead code elimination here and use flow
9557         analysis to do it.
9558
9559 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
9560
9561         * class.cs (Field.Define): Catch cycles on struct type
9562         definitions. 
9563
9564         * typemanager.cs (IsUnmanagedtype): Do not recursively check
9565         fields if the fields are static.  We only need to check instance
9566         fields. 
9567
9568         * expression.cs (As.DoResolve): Test for reference type.
9569
9570         * statement.cs (Using.ResolveExpression): Use
9571         ConvertImplicitRequired, not ConvertImplicit which reports an
9572         error on failture
9573         (Using.ResolveLocalVariableDecls): ditto.
9574
9575         * expression.cs (Binary.ResolveOperator): Report errors in a few
9576         places where we had to.
9577
9578         * typemanager.cs (IsUnmanagedtype): Finish implementation.
9579
9580 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
9581
9582         * expression.cs: Use StoreFromPtr instead of extracting the type
9583         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
9584
9585         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
9586         an enumeration value to a System.Enum, but System.Enum is not a
9587         value type, but an class type, so we need to box.
9588
9589         (Expression.ConvertExplicit): One codepath could return
9590         errors but not flag them.  Fix this.  Fixes #31853
9591
9592         * parameter.cs (Resolve): Do not allow void as a parameter type.
9593
9594 2002-10-06  Martin Baulig  <martin@gnome.org>
9595
9596         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
9597         if it's a class type and not a struct.  Fixes #31815.
9598
9599 2002-10-06  Martin Baulig  <martin@gnome.org>
9600
9601         * statement.cs: Reworked the flow analysis code a bit to make it
9602         usable for dead code elimination.
9603
9604 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9605
9606         * cs-parser.jay: allow empty source files. Fixes bug #31781.
9607
9608 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
9609
9610         * expression.cs (ComposedCast.DoResolveType): A quick workaround
9611         to fix the test 165, will investigate deeper.
9612
9613 2002-10-04  Martin Baulig  <martin@gnome.org>
9614
9615         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
9616         finally blocks actually work.
9617         (Try.Resolve): We don't need to create a sibling for `finally' if
9618         there is no finally block.
9619
9620 2002-10-04  Martin Baulig  <martin@gnome.org>
9621
9622         * class.cs (Constructor.Define): The default accessibility for a
9623         non-default constructor is private, not public.
9624
9625 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
9626
9627         * class.cs (Constructor): Make AllowedModifiers public, add
9628         EXTERN.
9629
9630         * cs-parser.jay: Perform the modifiers test here, as the
9631         constructor for the Constructor class usually receives a zero
9632         because of the way we create it (first we create, later we
9633         customize, and we were never checking the modifiers).
9634
9635         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
9636         is a version of LookupTypeReflection that includes the type-name
9637         cache.  This can be used as a fast path for functions that know
9638         the fully qualified name and are only calling into *.GetType() to
9639         obtain a composed type.
9640
9641         This is also used by TypeManager.LookupType during its type
9642         composition.
9643
9644         (LookupType): We now also track the real type name, as sometimes
9645         we can get a quey for the real type name from things like
9646         ComposedCast.  This fixes bug 31422.
9647
9648         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
9649         complete type fullname, it does not have to go through the type
9650         resolution system to obtain the composed version of the type (for
9651         obtaining arrays or pointers).
9652
9653         (Conditional.Emit): Use the EmitBoolExpression to
9654         generate nicer code, as requested by Paolo.
9655
9656         (ArrayCreation.CheckIndices): Use the patch from
9657         hwang_rob@yahoo.ca to validate the array initializers. 
9658
9659 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
9660
9661         * class.cs (ConstructorInitializer.Emit): simplify code by using
9662         Invocation.EmitCall, and at the same time, fix the bugs in calling
9663         parent constructors that took variable arguments. 
9664
9665         * ecore.cs (Expression.ConvertNumericExplicit,
9666         Expression.ImplicitNumericConversion): Remove the code that
9667         manually wrapped decimal (InternalTypeConstructor call is now gone
9668         as well).
9669
9670         * expression.cs (Cast.TryReduce): Also handle decimal types when
9671         trying to perform a constant fold on the type.
9672
9673         * typemanager.cs (IsUnmanagedtype): Partially implemented.
9674
9675         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
9676         that only turned off an error report, and did nothing else. 
9677
9678 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
9679
9680         * driver.cs: Handle and ignore /fullpaths
9681
9682 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
9683
9684         * expression.cs (Binary.ResolveOperator): Catch the case where
9685         DoNumericPromotions returns true, 
9686
9687         (Binary.DoNumericPromotions): Simplify the code, and the tests.
9688
9689 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
9690
9691         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
9692         report error 70.
9693
9694 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
9695
9696         * ecore.cs (ConvertNumericExplicit): It is not enough that the
9697         conversion exists, but it is also required that the conversion be
9698         performed.  This manifested in "(Type64Enum) 2".  
9699
9700         * class.cs (TypeManager.AddMethod): The fix is not to change
9701         AddEnum, because that one was using a fully qualified name (every
9702         DeclSpace derivative does), but to change the AddMethod routine
9703         that was using an un-namespaced name.  This now correctly reports
9704         the duplicated name.
9705
9706         Revert patch until I can properly fix it.  The issue
9707         is that we have a shared Type space across all namespaces
9708         currently, which is wrong.
9709
9710         Options include making the Namespace a DeclSpace, and merge
9711         current_namespace/current_container in the parser.
9712
9713 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
9714
9715         * cs-parser.jay: Improve error reporting when we get a different
9716         kind of expression in local_variable_type and
9717         local_variable_pointer_type. 
9718
9719         Propagate this to avoid missleading errors being reported.
9720
9721         * ecore.cs (ImplicitReferenceConversion): treat
9722         TypeManager.value_type as a target just like object_type.   As
9723         code like this:
9724
9725         ValueType v = 1;
9726
9727         Is valid, and needs to result in the int 1 being boxed before it
9728         is assigned to the value type v.
9729
9730         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
9731         to validate the enumeration name.
9732
9733         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
9734         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
9735         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
9736
9737         * ecore.cs (TryImplicitIntConversion): When doing an
9738         implicit-enumeration-conversion, check if the type is 64-bits and
9739         perform a conversion before passing to EnumConstant.
9740
9741 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
9742
9743         * decl.cs (Error_AmbiguousTypeReference); New routine used to
9744         report ambiguous type references.  Unlike the MS version, we
9745         report what the ambiguity is.   Innovation at work ;-)
9746
9747         (DeclSpace.FindType): Require a location argument to
9748         display when we display an ambiguous error.
9749
9750         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
9751
9752         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
9753
9754         * expression.cs (EmitDynamicInitializers): Apply patch from
9755         hwang_rob@yahoo.ca that fixes the order in which we emit our
9756         initializers. 
9757
9758 2002-09-21  Martin Baulig  <martin@gnome.org>
9759
9760         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
9761         delegate takes no arguments.
9762
9763 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
9764
9765         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
9766         from integers.
9767
9768         * expression.cs: Extract the underlying type.
9769
9770         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
9771
9772         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
9773
9774 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
9775
9776         * class.cs (TypeContainer.DefineType): We can not use the nice
9777         PackingSize with the size set to 1 DefineType method, because it
9778         will not allow us to define the interfaces that the struct
9779         implements.
9780
9781         This completes the fixing of bug 27287
9782
9783         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
9784         means also structs.  This fixes part of the problem. 
9785         (Expresion.ImplicitReferenceConversionExists): ditto.
9786
9787         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
9788         error if there were no errors reported during the type lookup
9789         process, to avoid duplicates or redundant errors.  Without this
9790         you would get an ambiguous errors plus a type not found.  We have
9791         beaten the user enough with the first error.  
9792
9793         (DeclSparce.FindType): Emit a warning if we have an ambiguous
9794         reference. 
9795
9796         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
9797         during the resolution process, stop the lookup, this avoids
9798         repeated error reports (same error twice).
9799
9800         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
9801
9802         * typemanager.cs (LookupType): Redo the type lookup code to match
9803         the needs of System.Reflection.  
9804
9805         The issue is that System.Reflection requires references to nested
9806         types to begin with a "+" sign instead of a dot.  So toplevel
9807         types look like: "NameSpace.TopLevelClass", and nested ones look
9808         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
9809         levels. 
9810
9811 2002-09-19  Martin Baulig  <martin@gnome.org>
9812
9813         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
9814         says that a method always returns or always throws an exception,
9815         don't report the CS0161.
9816
9817         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
9818         set `Returns = new_returns'.
9819
9820 2002-09-19  Martin Baulig  <martin@gnome.org>
9821
9822         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
9823         to an enum constant, check for a CS0176.
9824
9825 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
9826
9827         * class.cs (TypeContainer.CheckPairedOperators): Now we check
9828         for operators that must be in pairs and report errors.
9829
9830         * ecore.cs (SimpleName.DoResolveType): During the initial type
9831         resolution process, when we define types recursively, we must
9832         check first for types in our current scope before we perform
9833         lookups in the enclosing scopes.
9834
9835         * expression.cs (MakeByteBlob): Handle Decimal blobs.
9836
9837         (Invocation.VerifyArgumentsCompat): Call
9838         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
9839         I thought we were supposed to always call this, but there are a
9840         few places in the code where we dont do it.
9841
9842 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
9843
9844         * driver.cs: Add support in -linkres and -resource to specify the
9845         name of the identifier.
9846
9847 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
9848
9849         * ecore.cs (StandardConversionExists): Sync with the conversion
9850         code: allow anything-* to void* conversions.
9851
9852         (FindMostSpecificSource): Use an Expression argument
9853         instead of a Type, because we might be handed over a Literal which
9854         gets a few more implicit conversions that plain types do not.  So
9855         this information was being lost.
9856
9857         Also, we drop the temporary type-holder expression when not
9858         required.
9859
9860 2002-09-17  Martin Baulig  <martin@gnome.org>
9861
9862         * class.cs (PropertyBase.CheckBase): Don't check the base class if
9863         this is an explicit interface implementation.
9864
9865 2002-09-17  Martin Baulig  <martin@gnome.org>
9866
9867         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
9868         different `IndexerName' attributes.
9869
9870         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
9871         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
9872         virtual CommonResolve().
9873
9874 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
9875
9876         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
9877         and convert that to the UnderlyingType.
9878
9879         * statement.cs (Foreach.Resolve): Indexers are just like variables
9880         or PropertyAccesses.
9881
9882         * cs-tokenizer.cs (consume_string): Track line numbers and columns
9883         inside quoted strings, we were not doing this before.
9884
9885 2002-09-16  Martin Baulig  <martin@gnome.org>
9886
9887         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
9888         resolve it.  This is needed for the definite assignment check of the
9889         instance expression, fixes bug #29846.
9890         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
9891
9892 2002-09-16  Nick Drochak  <ndrochak@gol.com>
9893
9894         * parameter.cs: Fix compile error.  Cannot reference static member
9895         from an instance object.  Is this an mcs bug?
9896
9897 2002-09-14  Martin Baulig  <martin@gnome.org>
9898
9899         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
9900         multiple times.  Fixes bug #30295, added test-166.cs.
9901
9902 2002-09-14  Martin Baulig  <martin@gnome.org>
9903
9904         * statement.cs (Block.Emit): Don't emit unreachable code.
9905         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
9906         `break' statements.
9907         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
9908
9909 2002-09-14  Martin Baulig  <martin@gnome.org>
9910
9911         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
9912         is set.
9913
9914 2002-09-14  Martin Baulig  <martin@gnome.org>
9915
9916         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
9917         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
9918         be false on the ms runtime.
9919
9920 2002-09-13  Martin Baulig  <martin@gnome.org>
9921
9922         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
9923         the CS0038 error message.
9924
9925 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
9926
9927         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
9928         constant inside, return it.
9929
9930 2002-09-12  Martin Baulig  <martin@gnome.org>
9931
9932         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
9933         implicit conversion can be done between enum types.
9934
9935         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
9936         check whether an implicit conversion to the current enum's UnderlyingType
9937         exists and report an error if not.
9938
9939         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
9940         without debugging support.
9941
9942         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
9943         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
9944
9945 2002-09-12  Martin Baulig  <martin@gnome.org>
9946
9947         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
9948
9949         * ecore.cs (IMemberExpr.DeclaringType): New property.
9950         (SimpleName.SimpleNameResolve): Check whether we're accessing a
9951         nonstatic member of an outer type (CS0038).
9952
9953 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
9954
9955         * driver.cs: Activate the using-error detector at warning level
9956         4 (at least for MS-compatible APIs).
9957
9958         * namespace.cs (VerifyUsing): Small buglett fix.
9959
9960         * pending.cs (PendingImplementation): pass the container pointer. 
9961
9962         * interface.cs (GetMethods): Allow for recursive definition.  Long
9963         term, I would like to move every type to support recursive
9964         definitions, not the current ordering mechanism that we have right
9965         now.
9966
9967         The situation is this: Attributes are handled before interfaces,
9968         so we can apply attributes to interfaces.  But some attributes
9969         implement interfaces, we will now handle the simple cases
9970         (recursive definitions will just get an error).  
9971
9972         * parameter.cs: Only invalidate types at the end if we fail to
9973         lookup all types.  
9974
9975 2002-09-09  Martin Baulig  <martin@gnome.org>
9976
9977         * ecore.cs (PropertyExpr.Emit): Also check for
9978         TypeManager.system_int_array_get_length so this'll also work when
9979         compiling corlib.  Fixes #30003.
9980
9981 2002-09-09  Martin Baulig  <martin@gnome.org>
9982
9983         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
9984         and throw an exception if we can't get the type's size.  Fixed #30040,
9985         added test-165.cs.
9986
9987 2002-09-09  Martin Baulig  <martin@gnome.org>
9988
9989         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
9990
9991         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
9992         context.  Fixes bug #30027.
9993
9994         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
9995         virtual functions.  Fixes bug #30043, added test-164.cs.
9996
9997 2002-09-08  Ravi Pratap  <ravi@ximian.com>
9998
9999         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
10000
10001 2002-09-08  Nick Drochak  <ndrochak@gol.com>
10002
10003         * driver.cs: Use an object to get the windows codepage since it's not a
10004         static property.
10005
10006 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
10007
10008         * statement.cs (For.Emit): for infinite loops (test == null)
10009         return whether there is a break inside, not always "true".
10010
10011         * namespace.cs (UsingEntry): New struct to hold the name of the
10012         using definition, the location where it is defined, and whether it
10013         has been used in a successful type lookup.
10014
10015         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
10016         strings.
10017
10018         * decl.cs: ditto.
10019
10020 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10021
10022         * attribute.cs : Fix incorrect code which relied on catching
10023         a NullReferenceException to detect a null being passed in
10024         where an object was expected.
10025
10026 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
10027
10028         * statement.cs (Try): flag the catch variable as assigned
10029
10030         * expression.cs (Cast): Simplified by using ResolveType instead of
10031         manually resolving.
10032
10033         * statement.cs (Catch): Fix bug by using ResolveType.
10034
10035 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10036
10037         * expression.cs (BetterConversion): Special case for when we have
10038         a NullLiteral as the argument and we have to choose between string
10039         and object types - we choose string the way csc does.
10040
10041         * attribute.cs (Attribute.Resolve): Catch the
10042         NullReferenceException and report error #182 since the Mono
10043         runtime no more has the bug and having this exception raised means
10044         we tried to select a constructor which takes an object and is
10045         passed a null.
10046
10047 2002-09-05  Ravi Pratap  <ravi@ximian.com>
10048
10049         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
10050         message (1502, 1503) when we can't locate a method after overload
10051         resolution. This is much more informative and closes the bug
10052         Miguel reported.
10053
10054         * interface.cs (PopulateMethod): Return if there are no argument
10055         types. Fixes a NullReferenceException bug.
10056
10057         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
10058         expressions too. Previously we were checking only in one place for
10059         positional arguments leaving out named arguments.
10060
10061         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
10062         type to the enum type is not allowed. Remove code corresponding to
10063         that.
10064
10065         (ConvertNumericExplicit): Allow explicit conversions from
10066         the underlying type to enum type. This precisely follows the spec
10067         and closes a bug filed by Gonzalo.
10068
10069 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10070
10071         * compiler.csproj:
10072         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
10073
10074 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
10075
10076         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
10077         it was important that we stored the right value after the
10078         reduction in `converted'.
10079
10080 2002-09-04  Martin Baulig  <martin@gnome.org>
10081
10082         * location.cs (Location.SymbolDocument): Use full pathnames for the
10083         source files.
10084
10085 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
10086
10087         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
10088         of the expression resolve mechanism, because that will catch the
10089         SimpleName error failures.
10090
10091         (Conditional): If we can not resolve the
10092         expression, return, do not crash.
10093
10094 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10095
10096         * cs-tokenizer.cs:
10097         (location): display token name instead of its number.
10098
10099 2002-08-28  Martin Baulig  <martin@gnome.org>
10100
10101         * expression.cs (Binary.ResolveOperator): Don't silently return
10102         but return an error if an operator cannot be applied between two
10103         enum types.
10104
10105 2002-08-28  Martin Baulig  <martin@gnome.org>
10106
10107         * class.cs (Constructor.Define): Set the permission attributes
10108         correctly instead of making all constructors public.
10109
10110 2002-08-28  Martin Baulig  <martin@gnome.org>
10111
10112         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
10113         for private members before reporting a CS0103; if we find anything,
10114         it's a CS0122.
10115
10116 2002-08-28  Martin Baulig  <martin@gnome.org>
10117
10118         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
10119         to check whether `closure_start_type == closure_invocation_type',
10120         we also need to check whether `m.DeclaringType == closure_invocation_type'
10121         before bypassing the permission checks.  We might be accessing
10122         protected/private members from the base class.
10123         (TypeManager.RealMemberLookup): Only set private_ok if private
10124         members were requested via BindingFlags.NonPublic.
10125
10126         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
10127
10128         * expression.cs (MemberAccess.ResolveMemberAccess): Set
10129         MethodGroupExpr.IsExplicitImpl if appropriate.
10130         (Invocation.DoResolve): Don't report the CS0120 for explicit
10131         interface implementations.
10132
10133 2002-08-27  Martin Baulig  <martin@gnome.org>
10134
10135         * expression.cs (Invocation.DoResolve): If this is a static
10136         method and we don't have an InstanceExpression, we must report
10137         a CS0120.
10138
10139 2002-08-25  Martin Baulig  <martin@gnome.org>
10140
10141         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
10142         `==' between a valuetype and an object.
10143
10144 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
10145
10146         * ecore.cs (TypeExpr): Provide a ToString method.
10147
10148 2002-08-24  Martin Baulig  <martin@gnome.org>
10149
10150         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
10151         now called proggie.dbg and it's a binary file.
10152
10153 2002-08-23  Martin Baulig  <martin@gnome.org>
10154
10155         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
10156
10157 2002-08-23  Martin Baulig  <martin@gnome.org>
10158
10159         * struct.cs (MyStructInfo.ctor): Make this work with empty
10160         structs; it's not allowed to use foreach() on null.
10161
10162 2002-08-23  Martin Baulig  <martin@gnome.org>
10163
10164         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
10165         writer the full pathname of the generated assembly.
10166
10167 2002-08-23  Martin Baulig  <martin@gnome.org>
10168
10169         * statements.cs (FlowBranching.UsageVector.MergeChildren):
10170         A `finally' block never returns or breaks; improved handling of
10171         unreachable code.
10172
10173 2002-08-23  Martin Baulig  <martin@gnome.org>
10174
10175         * statement.cs (Throw.Resolve): Allow `throw null'.
10176
10177 2002-08-23  Martin Baulig  <martin@gnome.org>
10178
10179         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
10180         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
10181         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
10182         MemberLookup would return a wrong event if this is an explicit
10183         interface implementation and the class has an event with the same
10184         name.
10185
10186 2002-08-23  Martin Baulig  <martin@gnome.org>
10187
10188         * statement.cs (Block.AddChildVariableNames): New public method.
10189         (Block.AddChildVariableName): Likewise.
10190         (Block.IsVariableNameUsedInChildBlock): Likewise.
10191         (Block.AddVariable): Check whether a variable name has already
10192         been used in a child block.
10193
10194         * cs-parser.jay (declare_local_variables): Mark all variable names
10195         from the current block as being used in a child block in the
10196         implicit block.
10197
10198 2002-08-23  Martin Baulig  <martin@gnome.org>
10199
10200         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
10201         find the symbol writer.
10202
10203         * driver.cs: csc also allows the arguments to /define being
10204         separated by commas, not only by semicolons.
10205
10206 2002-08-23  Martin Baulig  <martin@gnome.org>
10207
10208         * interface.cs (Interface.GetMembers): Added static check for events.
10209
10210 2002-08-15  Martin Baulig  <martin@gnome.org>
10211
10212         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
10213         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
10214
10215         * ecore.cs (Expression.MemberLookup): Added documentation and explained
10216         why the MethodData.EmitDestructor() change was necessary.
10217
10218 2002-08-20  Martin Baulig  <martin@gnome.org>
10219
10220         * class.cs (TypeContainer.FindMembers): Added static check for events.
10221
10222         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
10223
10224         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
10225         use Type.GetEvents(), not Type.FindMembers().
10226
10227 2002-08-20  Martin Baulig  <martin@gnome.org>
10228
10229         * decl.cs (MemberCache): Added a special method cache which will
10230         be used for method-only searched.  This ensures that a method
10231         search will return a MethodInfo with the correct ReflectedType for
10232         inherited methods.      
10233
10234 2002-08-20  Martin Baulig  <martin@gnome.org>
10235
10236         * decl.cs (DeclSpace.FindMembers): Made this public.
10237
10238 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10239
10240         * delegate.cs: fixed build on windows.
10241         [FIXME:  Filed as bug #29150: MCS must report these errors.]
10242
10243 2002-08-19  Ravi Pratap  <ravi@ximian.com>
10244
10245         * ecore.cs (StandardConversionExists): Return a false
10246         if we are trying to convert the void type to anything else
10247         since that is not allowed.
10248
10249         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
10250         we flag error 70 in the event an event is trying to be accessed
10251         directly from outside the declaring type.
10252
10253 2002-08-20  Martin Baulig  <martin@gnome.org>
10254
10255         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
10256         MemberCache from typemanager.cs to decl.cs.
10257
10258 2002-08-19  Martin Baulig  <martin@gnome.org>
10259
10260         * class.cs (TypeContainer): Implement IMemberContainer.
10261         (TypeContainer.DefineMembers): Create the MemberCache.
10262         (TypeContainer.FindMembers): Do better BindingFlags checking; only
10263         return public members if BindingFlags.Public was given, check
10264         whether members are static.
10265
10266 2002-08-16  Martin Baulig  <martin@gnome.org>
10267
10268         * decl.cs (DeclSpace.Define): Splitted this in Define and
10269         DefineMembers.  DefineMembers is called first and initializes the
10270         MemberCache.
10271
10272         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
10273         DefineMembers() on all our DeclSpaces.
10274
10275         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
10276         but call DefineMembers() on all nested interfaces.  We call their
10277         Define() in our new Define() function.
10278
10279         * interface.cs (Interface): Implement IMemberContainer.
10280         (Interface.Define): Moved all code except the attribute stuf to
10281         DefineMembers().
10282         (Interface.DefineMembers): Initialize the member cache.
10283
10284         * typemanager.cs (IMemberFinder): Removed this interface, we don't
10285         need this anymore since we can use MemberCache.FindMembers directly.
10286
10287 2002-08-19  Martin Baulig  <martin@gnome.org>
10288
10289         * typemanager.cs (MemberCache): When creating the cache for an
10290         interface type, add all inherited members.
10291         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
10292         to `out bool used_cache' and documented it.
10293         (TypeManager.MemberLookup): If we already used the cache in the first
10294         iteration, we don't need to do the interfaces check.
10295
10296 2002-08-19  Martin Baulig  <martin@gnome.org>
10297
10298         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
10299         here from IMemberFinder and don't implement this interface anymore.
10300         (DeclSpace.MemberCache): Moved here from IMemberFinder.
10301
10302         * typemanager.cs (IMemberFinder): This interface is now only used by
10303         classes which actually support the member cache.
10304         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
10305         since we only put DeclSpaces into this Hashtable.
10306         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
10307         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
10308
10309 2002-08-16  Martin Baulig  <martin@gnome.org>
10310
10311         * typemanager.cs (ICachingMemberFinder): Removed.
10312         (IMemberFinder.MemberCache): New property.
10313         (TypeManager.FindMembers): Merged this with RealFindMembers().
10314         This function will never be called from TypeManager.MemberLookup()
10315         so we can't use the cache here, just the IMemberFinder.
10316         (TypeManager.MemberLookup_FindMembers): Check whether the
10317         IMemberFinder has a MemberCache and call the cache's FindMembers
10318         function.
10319         (MemberCache): Rewrote larger parts of this yet another time and
10320         cleaned it up a bit.
10321
10322 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
10323
10324         * driver.cs (LoadArgs): Support quoting.
10325
10326         (Usage): Show the CSC-like command line arguments.
10327
10328         Improved a few error messages.
10329
10330 2002-08-15  Martin Baulig  <martin@gnome.org>
10331
10332         * typemanager.cs (IMemberContainer.Type): New property.
10333         (IMemberContainer.IsInterface): New property.
10334
10335         The following changes are conditional to BROKEN_RUNTIME, which is
10336         defined at the top of the file.
10337
10338         * typemanager.cs (MemberCache.MemberCache): Don't add the base
10339         class'es members, but add all members from TypeHandle.ObjectType
10340         if we're an interface.
10341         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
10342         is the current type.
10343         (MemberCache.CacheEntry.Container): Removed this field.
10344         (TypeHandle.GetMembers): Include inherited members.
10345
10346 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10347
10348         * typemanager.cs: fixed compilation and added a comment on a field that
10349         is never used.
10350
10351 2002-08-15  Martin Baulig  <martin@gnome.org>
10352
10353         * class.cs (ConstructorInitializer.Resolve): In the
10354         Expression.MemberLookup call, use the queried_type as
10355         invocation_type.
10356
10357         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
10358         declared' attribute, it's always true.
10359         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
10360         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
10361         temporary wrapper for FindMembers which tells MemberLookup whether
10362         members from the base classes are included in the return value.
10363         This will go away soon.
10364         (TypeManager.MemberLookup): Use this temporary hack here; once the
10365         new MemberCache is completed, we don't need to do the DeclaredOnly
10366         looping here anymore since the MemberCache will take care of this.
10367         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
10368         (MemberCache): When creating the MemberCache for a class, get
10369         members from the current class and all its base classes.
10370         (MemberCache.CacheEntry.Container): New field.  This is a
10371         temporary hack until the Mono runtime is fixed to distinguish
10372         between ReflectedType and DeclaringType.  It allows us to use MCS
10373         with both the MS runtime and the unfixed Mono runtime without
10374         problems and without accecting performance.
10375         (MemberCache.SearchMembers): The DeclaredOnly looping from
10376         TypeManager.MemberLookup is now done here.      
10377
10378 2002-08-14  Martin Baulig  <martin@gnome.org>
10379
10380         * statement.cs (MyStructInfo.MyStructInfo): Don't call
10381         Type.GetFields on dynamic types but get the fields from the
10382         corresponding TypeContainer.
10383         (MyStructInfo.GetStructInfo): Added check for enum types.
10384
10385         * typemanager.cs (MemberList.IsSynchronized): Implemented.
10386         (MemberList.SyncRoot): Implemented.
10387         (TypeManager.FilterWithClosure): No need to check permissions if
10388         closure_start_type == closure_invocation_type, don't crash if
10389         closure_invocation_type is null.
10390
10391 2002-08-13  Martin Baulig  <martin@gnome.org>
10392
10393         Rewrote TypeContainer.FindMembers to use a member cache.  This
10394         gives us a speed increase of about 35% for the self-hosting MCS
10395         build and of about 15-20% for the class libs (both on GNU/Linux).
10396
10397         * report.cs (Timer): New class to get enhanced profiling.  This
10398         whole class is "TIMER" conditional since it remarkably slows down
10399         compilation speed.
10400
10401         * class.cs (MemberList): New class.  This is an IList wrapper
10402         which we're now using instead of passing MemberInfo[]'s around to
10403         avoid copying this array unnecessarily.
10404         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
10405         (ICachingMemberFinder, IMemberContainer): New interface.
10406         (TypeManager.FilterWithClosure): If `criteria' is null, the name
10407         has already been checked, otherwise use it for the name comparision.
10408         (TypeManager.FindMembers): Renamed to RealMemberFinder and
10409         provided wrapper which tries to use ICachingMemberFinder.FindMembers
10410         if possible.  Returns a MemberList, not a MemberInfo [].
10411         (TypeHandle): New class, implements IMemberContainer.  We create
10412         one instance of this class per type, it contains a MemberCache
10413         which is used to do the member lookups.
10414         (MemberCache): New class.  Each instance of this class contains
10415         all members of a type and a name-based hash table.
10416         (MemberCache.FindMembers): This is our new member lookup
10417         function.  First, it looks up all members of the requested name in
10418         the hash table.  Then, it walks this list and sorts out all
10419         applicable members and returns them.
10420
10421 2002-08-13  Martin Baulig  <martin@gnome.org>
10422
10423         In addition to a nice code cleanup, this gives us a performance
10424         increase of about 1.4% on GNU/Linux - not much, but it's already
10425         half a second for the self-hosting MCS compilation.
10426
10427         * typemanager.cs (IMemberFinder): New interface.  It is used by
10428         TypeManager.FindMembers to call FindMembers on a TypeContainer,
10429         Enum, Delegate or Interface.
10430         (TypeManager.finder_to_member_finder): New PtrHashtable.
10431         (TypeManager.finder_to_container): Removed.
10432         (TypeManager.finder_to_delegate): Removed.
10433         (TypeManager.finder_to_interface): Removed.
10434         (TypeManager.finder_to_enum): Removed.
10435
10436         * interface.cs (Interface): Implement IMemberFinder.
10437
10438         * delegate.cs (Delegate): Implement IMemberFinder.
10439
10440         * enum.cs (Enum): Implement IMemberFinder.
10441
10442         * class.cs (TypeContainer): Implement IMemberFinder.
10443
10444 2002-08-12  Martin Baulig  <martin@gnome.org>
10445
10446         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
10447
10448 2002-08-12  Martin Baulig  <martin@gnome.org>
10449
10450         * ecore.cs (ITypeExpression): New interface for expressions which
10451         resolve to a type.
10452         (TypeExpression): Renamed to TypeLookupExpression.
10453         (Expression.DoResolve): If we're doing a types-only lookup, the
10454         expression must implement the ITypeExpression interface and we
10455         call DoResolveType() on it.
10456         (SimpleName): Implement the new ITypeExpression interface.
10457         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
10458         hack, the situation that we're only looking up types can't happen
10459         anymore when this method is called.  Moved the type lookup code to
10460         DoResolveType() and call it.
10461         (SimpleName.DoResolveType): This ITypeExpression interface method
10462         is now doing the types-only lookup.
10463         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
10464         (ResolveFlags): Added MaskExprClass.
10465
10466         * expression.cs (MemberAccess): Implement the ITypeExpression
10467         interface.
10468         (MemberAccess.DoResolve): Added support for a types-only lookup
10469         when we're called via ITypeExpression.DoResolveType().
10470         (ComposedCast): Implement the ITypeExpression interface.
10471
10472         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
10473         Expression.Resolve() with ResolveFlags.Type instead.
10474
10475 2002-08-12  Martin Baulig  <martin@gnome.org>
10476
10477         * interface.cs (Interface.Define): Apply attributes.
10478
10479         * attribute.cs (Attribute.ApplyAttributes): Added support for
10480         interface attributes.
10481
10482 2002-08-11  Martin Baulig  <martin@gnome.org>
10483
10484         * statement.cs (Block.Emit): Only check the "this" variable if we
10485         do not always throw an exception.
10486
10487         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
10488         whether the property has a set accessor.
10489
10490 2002-08-11  Martin Baulig  <martin@gnome.org>
10491
10492         Added control flow analysis support for structs.
10493
10494         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
10495         with control flow analysis turned off.
10496         (IVariable): New interface.
10497         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
10498         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
10499         (FieldExpr.DoResolve): Resolve the instance expression with flow
10500         analysis turned off and do the definite assignment check after the
10501         resolving when we know what the expression will resolve to.
10502
10503         * expression.cs (LocalVariableReference, ParameterReference):
10504         Implement the new IVariable interface, only call the flow analysis
10505         code if ec.DoFlowAnalysis is true.
10506         (This): Added constructor which takes a Block argument.  Implement
10507         the new IVariable interface.
10508         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
10509         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
10510         This does the definite assignment checks for struct members.
10511
10512         * class.cs (Constructor.Emit): If this is a non-static `struct'
10513         constructor which doesn't have any initializer, call
10514         Block.AddThisVariable() to tell the flow analysis code that all
10515         struct elements must be initialized before control returns from
10516         the constructor.
10517
10518         * statement.cs (MyStructInfo): New public class.
10519         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
10520         argument to this indexer.  If non-zero, check an individual struct
10521         member, not the whole struct.
10522         (FlowBranching.CheckOutParameters): Check struct members.
10523         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
10524         overloaded versions of these methods which take an additional
10525         `int field_idx' argument to check struct members.
10526         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
10527         overloaded versions of these methods which take an additional
10528         `string field_name' argument to check struct member.s
10529         (VariableInfo): Implement the IVariable interface.
10530         (VariableInfo.StructInfo): New public property.  Returns the
10531         MyStructInfo instance of the variable if it's a struct or null.
10532         (Block.AddThisVariable): New public method.  This is called from
10533         Constructor.Emit() for non-static `struct' constructor which do
10534         not have any initializer.  It creates a special variable for the
10535         "this" instance variable which will be checked by the flow
10536         analysis code to ensure that all of the struct's fields are
10537         initialized before control returns from the constructor.
10538         (UsageVector): Added support for struct members.  If a
10539         variable/parameter is a struct with N members, we reserve a slot
10540         in the usage vector for each member.  A struct is considered fully
10541         initialized if either the struct itself (slot 0) or all its
10542         members are initialized.
10543
10544 2002-08-08  Martin Baulig  <martin@gnome.org>
10545
10546         * driver.cs (Driver.MainDriver): Only report an error CS5001
10547         if there were no compilation errors.
10548
10549         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
10550         `UnsafeContext' property to determine whether the parent is in
10551         unsafe context rather than checking the parent's ModFlags:
10552         classes nested in an unsafe class are unsafe as well.
10553
10554 2002-08-08  Martin Baulig  <martin@gnome.org>
10555
10556         * statement.cs (UsageVector.MergeChildren): Distinguish between
10557         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
10558         we return.  Added test17() and test18() to test-154.cs.
10559
10560 2002-08-08  Martin Baulig  <martin@gnome.org>
10561
10562         * typemanager.cs (TypeManager.FilterWithClosure): If we have
10563         Family access, make sure the invoking type isn't a subclass of the
10564         queried type (that'd be a CS1540).
10565
10566         * ecore.cs (Expression.MemberLookup): Added overloaded version of
10567         this method which takes an additional `Type invocation_type'.
10568
10569         * expression.cs (BaseAccess.DoResolve): Use the base type as
10570         invocation and query type.
10571         (MemberAccess.DoResolve): If the lookup failed and we're about to
10572         report a CS0122, try a lookup with the ec.ContainerType - if this
10573         succeeds, we must report a CS1540.
10574
10575 2002-08-08  Martin Baulig  <martin@gnome.org>
10576
10577         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
10578         (MethodGroupExpr): Implement the IMemberExpr interface.
10579
10580         * expression (MemberAccess.ResolveMemberAccess): No need to have
10581         any special code for MethodGroupExprs anymore, they're now
10582         IMemberExprs.   
10583
10584 2002-08-08  Martin Baulig  <martin@gnome.org>
10585
10586         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
10587         Family, FamANDAssem and FamORAssem permissions.
10588         (TypeManager.IsSubclassOrNestedChildOf): New public method.
10589
10590 2002-08-08  Martin Baulig  <martin@gnome.org>
10591
10592         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
10593         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
10594         or loop block.
10595
10596 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
10597
10598         * driver.cs: implemented /resource option to embed managed resources.
10599
10600 2002-08-07  Martin Baulig  <martin@gnome.org>
10601
10602         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
10603         (FieldBase.HasFieldInitializer): New public property.
10604         (FieldBase.GetInitializerExpression): New public method.  Resolves and
10605         returns the field initializer and makes sure it is only resolved once.
10606         (TypeContainer.EmitFieldInitializers): Call
10607         FieldBase.GetInitializerExpression to get the initializer, this ensures
10608         that it isn't resolved multiple times.
10609
10610         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
10611         the resolving process (SimpleName/MemberLookup) that we're currently
10612         emitting a field initializer (which must not access any instance members,
10613         this is an error CS0236).
10614
10615         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
10616         argument, if the `IsFieldInitializer' flag is set, we must report and
10617         error CS0236 and not an error CS0120.   
10618
10619 2002-08-07  Martin Baulig  <martin@gnome.org>
10620
10621         * ecore.cs (IMemberExpr): New public interface.
10622         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
10623         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
10624         if the expression is an IMemberExpr.
10625
10626         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
10627         to be null, implicitly default to `this' if we're non-static in
10628         this case.  Simplified the code a lot by using the new IMemberExpr
10629         interface.  Also fixed bug #28176 here.
10630
10631 2002-08-06  Martin Baulig  <martin@gnome.org>
10632
10633         * cs-parser.jay (SimpleLookup): Removed.  We need to create
10634         ParameterReferences during semantic analysis so that we can do a
10635         type-only search when resolving Cast, TypeOf and SizeOf.
10636         (block): Pass the `current_local_parameters' to the Block's
10637         constructor.
10638
10639         * class.cs (ConstructorInitializer): Added `Parameters parameters'
10640         argument to the constructor.
10641         (ConstructorInitializer.Resolve): Create a temporary implicit
10642         block with the parameters.
10643
10644         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
10645         references here if we aren't doing a type-only search.
10646
10647         * statement.cs (Block): Added constructor which takes a
10648         `Parameters parameters' argument.
10649         (Block.Parameters): New public property.
10650
10651         * support.cs (InternalParameters.Parameters): Renamed `parameters'
10652         to `Parameters' and made it public readonly.
10653
10654 2002-08-06  Martin Baulig  <martin@gnome.org>
10655
10656         * ecore.cs (Expression.Warning): Made this public as well.
10657
10658         * report.cs (Report.Debug): Print the contents of collections.
10659
10660 2002-08-06  Martin Baulig  <martin@gnome.org>
10661
10662         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
10663         used to tell Resolve() which kinds of expressions it may return.
10664         (Expression.Resolve): Added overloaded version of this method which
10665         takes a `ResolveFlags flags' argument.  This can be used to tell
10666         Resolve() which kinds of expressions it may return.  Reports a
10667         CS0118 on error.
10668         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
10669         ResolveFlags.SimpleName.
10670         (Expression.Error118): Added overloaded version of this method which
10671         takes a `ResolveFlags flags' argument.  It uses the flags to determine
10672         which kinds of expressions are allowed.
10673
10674         * expression.cs (Argument.ResolveMethodGroup): New public method.
10675         Resolves an argument, but allows a MethodGroup to be returned.
10676         This is used when invoking a delegate.
10677
10678         * TODO: Updated a bit.
10679
10680 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10681
10682         Fixed compilation with csc.
10683
10684         * ecore.cs: Expression.Error made public. Is this correct? Should
10685         Warning be made public too?
10686
10687         * expression.cs: use ea.Location instead of ea.loc.
10688         [FIXME:  Filed as bug #28607: MCS must report these errors.]
10689
10690 2002-08-06  Martin Baulig  <martin@gnome.org>
10691
10692         * ecore.cs (Expression.loc): Moved the location here instead of
10693         duplicating it in all derived classes.
10694         (Expression.Location): New public property.
10695         (Expression.Error, Expression.Warning): Made them non-static and
10696         removed the location argument.
10697         (Expression.Warning): Added overloaded version which takes an
10698         `int level' argument.
10699         (Expression.Error118): Make this non-static and removed the
10700         expression and location arguments.
10701         (TypeExpr): Added location argument to the constructor.
10702
10703         * expression.cs (StaticCallExpr): Added location argument to
10704         the constructor.
10705         (Indirection, PointerArithmetic): Likewise.
10706         (CheckedExpr, UnCheckedExpr): Likewise.
10707         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
10708         (StringPtr): Likewise.
10709
10710
10711 2002-08-05  Martin Baulig  <martin@gnome.org>
10712
10713         * expression.cs (BaseAccess.DoResolve): Actually report errors.
10714
10715         * assign.cs (Assign.DoResolve): Check whether the source
10716         expression is a value or variable.
10717
10718         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
10719         while resolving the corresponding blocks.
10720
10721         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
10722         an error, don't silently return null.
10723
10724         * statement.cs (Block.AddVariable): Do the error reporting here
10725         and distinguish between CS0128 and CS0136.
10726         (Block.DoResolve): Report all unused labels (warning CS0164).
10727         (LabeledStatement): Pass the location to the constructor.
10728         (LabeledStatement.HasBeenReferenced): New property.
10729         (LabeledStatement.Resolve): Set it to true here.
10730
10731         * statement.cs (Return.Emit): Return success even after reporting
10732         a type mismatch error (CS0126 or CS0127), this is what csc does and
10733         it avoids confusing the users with any consecutive errors.
10734
10735 2002-08-05  Martin Baulig  <martin@gnome.org>
10736
10737         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
10738
10739         * const.cs (Const.LookupConstantValue): Catch circular definitions.
10740
10741         * expression.cs (MemberAccess.DoResolve): Silently return if an
10742         error has already been reported.
10743
10744         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
10745         error has already been reported.
10746
10747 2002-08-05  Martin Baulig  <martin@gnome.org>
10748
10749         * statement.cs (UsageVector): Only initialize the `parameters'
10750         vector if we actually have any "out" parameters.
10751
10752 2002-08-05  Martin Baulig  <martin@gnome.org>
10753
10754         * expression.cs (Binary.ResolveOperator): When combining delegates,
10755         they must have the same type.
10756
10757 2002-08-05  Martin Baulig  <martin@gnome.org>
10758
10759         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
10760         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
10761         work with the ms runtime and we also don't need it: if we're a
10762         PropertyBuilder and not in the `indexer_arguments' hash, then we
10763         are a property and not an indexer.
10764
10765         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
10766         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
10767         since the latter one doesn't work with the ms runtime.
10768
10769 2002-08-03  Martin Baulig  <martin@gnome.org>
10770
10771         Fixed bugs #27998 and #22735.
10772
10773         * class.cs (Method.IsOperator): New public field.
10774         (Method.CheckBase): Report CS0111 if there's already a method
10775         with the same parameters in the current class.  Report CS0508 when
10776         attempting to change the return type of an inherited method.
10777         (MethodData.Emit): Report CS0179 if a method doesn't have a body
10778         and it's not marked abstract or extern.
10779         (PropertyBase): New abstract base class for Property and Indexer.
10780         (PropertyBase.CheckBase): Moved here from Property and made it work
10781         for indexers.
10782         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
10783         the same so we can reuse it there.
10784         (Property, Indexer): Derive from PropertyBase.
10785         (MethodSignature.inheritable_property_signature_filter): New delegate
10786         to find properties and indexers.
10787
10788         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
10789         argument and improved error reporting.
10790
10791         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
10792         EmptyReadOnlyParameters and made it a property.
10793
10794         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
10795         version of this method which takes a `PropertyInfo indexer'.
10796         (TypeManager.RegisterIndexer): New method.
10797
10798         * class.cs: Added myself as author of this file :-)
10799
10800 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10801
10802         * class.cs: fixed compilation on windoze.
10803
10804 2002-08-03  Martin Baulig  <martin@gnome.org>
10805
10806         * interface.cs (Interface.GetInterfaceBases): Check whether all
10807         base interfaces are at least as accessible than the current one.
10808
10809         * class.cs (TypeContainer.GetClassBases): Check whether base types
10810         are at least as accessible than the current type.
10811         (TypeContainer.AsAccessible): Implemented and made non-static.
10812         (MemberBase.CheckParameters): Report errors if the accessibility
10813         checks fail.
10814
10815         * delegate.cs (Delegate.Delegate): The default visibility is
10816         internal for top-level types and private for nested types.
10817         (Delegate.Define): Report errors if the accessibility checks fail.
10818
10819         * enum.cs (Enum.Enum): The default visibility is internal for
10820         top-level types and private for nested types.
10821         (Enum.DefineType): Compute the correct visibility.
10822
10823         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
10824         function which takes a `bool is_toplevel' instead of a TypeContainer.
10825
10826         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
10827         builtin type.
10828
10829 2002-08-02  Martin Baulig  <martin@gnome.org>
10830
10831         * expression.cs (LocalVariableReferenc): Added constructor which
10832         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
10833         (LocalVariableReference.IsReadOnly): New property.
10834         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
10835         variable is readonly, use our own readonly flag to do this; you can
10836         use the new constructor to get a writable reference to a read-only
10837         variable.
10838
10839         * cs-parser.jay (foreach_statement, using_statement): Get a writable
10840         reference to the local variable.
10841
10842 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
10843
10844         * rootcontext.cs (ResolveCore): Also include System.Exception
10845
10846         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
10847         we reach an EmptyStatement.
10848
10849         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
10850         is also fine.
10851
10852         * expression.cs (Binary.ResolveOperator): Check error result in
10853         two places.
10854
10855         use brtrue/brfalse directly and avoid compares to null.
10856
10857 2002-08-02  Martin Baulig  <martin@gnome.org>
10858
10859         * class.cs (TypeContainer.Define): Define all nested interfaces here.
10860         Fixes bug #28407, added test-155.cs.
10861
10862 2002-08-01  Martin Baulig  <martin@gnome.org>
10863
10864         * class.cs (Event.EmitDefaultMethod): Make this work with static
10865         events.  Fixes #28311, added verify-3.cs.
10866
10867 2002-08-01  Martin Baulig  <martin@gnome.org>
10868
10869         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
10870         `is_disposable' fields.
10871         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
10872         `hm.is_disposable' if we're using the collection pattern.
10873         (Foreach.EmitCollectionForeach): Use the correct type for the
10874         enumerator's local variable, only emit the try/finally block if
10875         necessary (fixes #27713).
10876
10877 2002-08-01  Martin Baulig  <martin@gnome.org>
10878
10879         * ecore.cs (Expression.report118): Renamed to Error118 and made
10880         it public static.
10881
10882         * statement.cs (Throw.Resolve): Check whether the expression is of
10883         the correct type (CS0118) and whether the type derives from
10884         System.Exception (CS0155).
10885         (Catch.Resolve): New method.  Do the type lookup here and check
10886         whether it derives from System.Exception (CS0155).
10887         (Catch.CatchType, Catch.IsGeneral): New public properties.
10888
10889         * typemanager.cs (TypeManager.exception_type): Added.
10890
10891 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
10892
10893         * driver.cs: Updated About function.
10894
10895 2002-07-31  Martin Baulig  <martin@gnome.org>
10896
10897         Implemented Control Flow Analysis.
10898
10899         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
10900         (EmitContext.CurrentBranching): Added.
10901         (EmitContext.StartFlowBranching): Added.
10902         (EmitContext.EndFlowBranching): Added.
10903         (EmitContext.KillFlowBranching): Added.
10904         (EmitContext.IsVariableAssigned): Added.
10905         (EmitContext.SetVariableAssigned): Added.
10906         (EmitContext.IsParameterAssigned): Added.
10907         (EmitContext.SetParameterAssigned): Added.
10908         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
10909         Added control flow analysis stuff here.
10910
10911         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
10912         resolve the expression as lvalue.
10913         (LocalVariableReference.DoResolve): Check whether the variable has
10914         already been assigned.
10915         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
10916         the parameter as assigned here.
10917         (ParameterReference.DoResolve): Check whether the parameter has already
10918         been assigned.
10919         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
10920         expression as lvalue.
10921
10922         * statement.cs (FlowBranching): New class for the flow analysis code.
10923         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
10924         (LabeledStatement.IsDefined): New public property.
10925         (LabeledStatement.AddUsageVector): New public method to tell flow
10926         analyis that the label may be reached via a forward jump.
10927         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
10928         flow analysis.
10929         (VariableInfo.Number): New public field.  This is used by flow analysis
10930         to number all locals of a block.
10931         (Block.CountVariables): New public property.  This is the number of
10932         local variables in this block (including the locals from all parent
10933         blocks).
10934         (Block.EmitMeta): Number all the variables.
10935
10936         * statement.cs: Added flow analysis support to all classes.
10937
10938 2002-07-31  Martin Baulig  <martin@gnome.org>
10939
10940         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
10941         To get debugging messages, compile mcs with /define:MCS_DEBUG and
10942         then use this argument.
10943
10944         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
10945
10946         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
10947         use this to specify /define options.
10948
10949 2002-07-29  Martin Baulig  <martin@gnome.org>
10950
10951         * statement.cs (Fixed): Moved all code that does variable lookups
10952         and resolvings from Emit to Resolve.
10953
10954         * statement.cs (For): Moved all code that does variable lookups
10955         and resolvings from Emit to Resolve.
10956
10957         * statement.cs (Using): Moved all code that does variable lookups
10958         and resolvings from Emit to Resolve.
10959
10960 2002-07-29  Martin Baulig  <martin@gnome.org>
10961
10962         * attribute.cs (Attribute.Resolve): Explicitly catch a
10963         System.NullReferenceException when creating the
10964         CustromAttributeBuilder and report a different warning message.
10965
10966 2002-07-29  Martin Baulig  <martin@gnome.org>
10967
10968         * support.cs (ParameterData.ParameterName): Added method to
10969         get the name of a parameter.
10970
10971         * typemanager.cs (TypeManager.IsValueType): New public method.
10972
10973 2002-07-29  Martin Baulig  <martin@gnome.org>
10974
10975         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
10976         is a flag which specifies that it's either ref or out.
10977         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
10978         the out parameter to `out Parameter.Modifier mod', also set the
10979         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
10980
10981         * support.cs (InternalParameters.ParameterModifier): Distinguish
10982         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
10983         Parameter.Modifier.ISBYREF flag if it's either ref or out.
10984
10985         * expression.cs (Argument.GetParameterModifier): Distinguish
10986         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
10987         Parameter.Modifier.ISBYREF flag if it's either ref or out.
10988
10989 2002-07-29  Martin Baulig  <martin@gnome.org>
10990
10991         * expression.cs (ParameterReference.ParameterReference): Added
10992         `Location loc' argument to the constructor.
10993
10994         * cs-parser.jay: Pass location to ParameterReference.
10995
10996 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
10997
10998         * statement.cs (Try): Initialize the location.
10999
11000         * cs-parser.jay: pass location to Try.
11001
11002         * expression.cs (Unary.Reduce): Change the prototype to return
11003         whether a constant fold could be performed or not.  The result is
11004         returned in an out parameters.  In the case of Indirection and
11005         AddressOf, we want to perform the full tests.
11006
11007 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
11008
11009         * statement.cs (Statement.Emit): Flag dead code.
11010
11011 2002-07-27  Andrew Birkett  <andy@nobugs.org>
11012
11013         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
11014
11015 2002-07-27  Martin Baulig  <martin@gnome.org>
11016
11017         * class.cs (MethodData.Define): Put back call to
11018         TypeManager.AddMethod(), accidentally commented this out.
11019
11020         * report.cs (Debug): New public method to print debugging information,
11021         this is `[Conditional ("DEBUG")]'.
11022
11023 2002-07-26  Martin Baulig  <martin@gnome.org>
11024
11025         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
11026         (switch_statement): Push the current_block to the switch_stack and
11027         pop it again when we're done with the switch.
11028         (switch_section): The new block is a child of the current_block.
11029         Fixes bug #24007, added test-152.cs.
11030
11031 2002-07-27  Martin Baulig  <martin@gnome.org>
11032
11033         * expression.cs (Invocation.EmitArguments): When calling a varargs
11034         function with only its fixed arguments, we need to pass an empty
11035         array.
11036
11037 2002-07-27  Martin Baulig  <martin@gnome.org>
11038
11039         Mono 0.13 has been released.
11040
11041 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
11042
11043         * driver.cs: Rename --resource to --linkres, because that is what
11044         we do currently, we dont support --resource yet.
11045
11046         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
11047
11048 2002-07-25  Martin Baulig  <martin@gnome.org>
11049
11050         * class.cs (MethodData): New public class.  This is a `method builder'
11051         class for a method or one accessor of a Property/Indexer/Event.
11052         (MethodData.GetMethodFlags): Moved here from MemberBase.
11053         (MethodData.ApplyAttributes): Likewise.
11054         (MethodData.ApplyObsoleteAttribute): Likewise.
11055         (MethodData.ApplyConditionalAttribute): Likewise.
11056         (MethodData.ApplyDllImportAttribute): Likewise.
11057         (MethodData.CheckAbstractAndExternal): Likewise.
11058         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
11059         (MethodData.Emit): Formerly known as Method.Emit().
11060         (MemberBase): Moved everything which was specific to a single
11061         accessor/method to MethodData.
11062         (Method): Create a new MethodData and call Define() and Emit() on it.
11063         (Property, Indexer, Event): Create a new MethodData objects for each
11064         accessor and call Define() and Emit() on them.
11065
11066 2002-07-25  Martin Baulig  <martin@gnome.org>
11067
11068         Made MethodCore derive from MemberBase to reuse the code from there.
11069         MemberBase now also checks for attributes.
11070
11071         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
11072         (MemberBase.GetMethodFlags): Moved here from class Method and marked
11073         as virtual.
11074         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
11075         `CallingConventions cc' and `Attributes opt_attrs' arguments.
11076         (MemberBase.ApplyAttributes): New virtual method; applies the
11077         attributes to a method or accessor.
11078         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
11079         (MemberBase.ApplyConditionalAttribute): Likewise.
11080         (MemberBase.ApplyDllImportAttribute): Likewise.
11081         (MemberBase.CheckAbstractAndExternal): Likewise.
11082         (MethodCore.ParameterTypes): This is now a property instead of a
11083         method, it's initialized from DoDefineParameters().
11084         (MethodCore.ParameterInfo): Removed the set accessor.
11085         (MethodCore.DoDefineParameters): New protected virtual method to
11086         initialize ParameterTypes and ParameterInfo.
11087         (Method.GetReturnType): We can now simply return the MemberType.
11088         (Method.GetMethodFlags): Override the MemberBase version and add
11089         the conditional flags.
11090         (Method.CheckBase): Moved some code from Define() here, call
11091         DoDefineParameters() here.
11092         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
11093         here to avoid some larger code duplication.
11094         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
11095         ensure that abstract and external accessors don't declare a body.
11096
11097         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
11098         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
11099         lookup in the attribute's parent classes, so we need to abort as soon
11100         as we found the first match.
11101         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
11102         the attribute has no arguments.
11103
11104         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
11105         of a Method.
11106
11107 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11108
11109         * cs-parser.jay: reverted previous patch.
11110
11111 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11112
11113         * cs-parser.jay: fixed bug #22119.
11114
11115 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11116
11117         * attribute.cs: fixed compilation. The error was:
11118         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
11119         be assigned to before control leaves the current method."
11120         [FIXME:  Filed as bug #28186: MCS must report this error.]
11121
11122 2002-07-25  Martin Baulig  <martin@gnome.org>
11123
11124         * attribute.cs (Attribute.Conditional_GetConditionName): New static
11125         method to pull the condition name ouf of a Conditional attribute.
11126         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
11127         the obsolete message and error flag out of an Obsolete attribute.
11128
11129         * class.cs (Method.GetMethodFlags): New public method to get the
11130         TypeManager.MethodFlags for this method.
11131         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
11132         private methods.
11133         (Method.Define): Get and apply the Obsolete and Conditional attributes;
11134         if we're overriding a virtual function, set the new private variable
11135         `parent_method'; call the new TypeManager.AddMethod().
11136
11137         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
11138         the MethodBuilder and the Method in a PtrHashtable.
11139         (TypeManager.builder_to_method): Added for this purpose.
11140         (TypeManager.MethodFlags): Added IsObsoleteError.
11141         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
11142         Obsolete and Conditional arguments in MethodBuilders.  If we discover
11143         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
11144         the message from the attribute.
11145
11146 2002-07-24  Martin Baulig  <martin@gnome.org>
11147
11148         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
11149         preprocessor directives, ensure that the argument to #define/#undef is
11150         exactly one identifier and that it's actually an identifier.
11151
11152         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
11153         did not work ....
11154
11155 2002-07-24  Martin Baulig  <martin@gnome.org>
11156
11157         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
11158         initialize it to TypeManager.object_type in the constructor.
11159         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
11160         of the `hm.get_current' method if we're using the collection pattern.
11161         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
11162         for the explicit conversion to make it work when we're using the collection
11163         pattern and the `Current' property has a different return type than `object'.
11164         Fixes #27713.
11165
11166 2002-07-24  Martin Baulig  <martin@gnome.org>
11167
11168         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
11169         does not match, but don't report any errors.  This method is called in
11170         order for all methods in a MethodGroupExpr until a matching method is
11171         found, so we don't want to bail out if the first method doesn't match.
11172         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
11173         matches, report the 123.  Fixes #28070.
11174
11175 2002-07-24  Martin Baulig  <martin@gnome.org>
11176
11177         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
11178         TypeManager.TypeToCoreType() to the top of the method so the
11179         following equality checks will work.  Fixes #28107.
11180
11181 2002-07-24  Martin Baulig  <martin@gnome.org>
11182
11183         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
11184         operand is of type uint, and the other operand is of type sbyte,
11185         short or int, the operands are converted to type long." -
11186         Actually do what this comment already told us.  Fixes bug #28106,
11187         added test-150.cs.
11188
11189 2002-07-24  Martin Baulig  <martin@gnome.org>
11190
11191         * class.cs (MethodBase): New abstract class.  This is now a base
11192         class for Property, Indexer and Event to avoid some code duplication
11193         in their Define() and DefineMethods() methods.
11194         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
11195         generic methods for Define() and DefineMethods().
11196         (FieldBase): Derive from MemberBase, not MemberCore.
11197         (Property): Derive from MemberBase, not MemberCore.
11198         (Property.DefineMethod): Moved all the code from this method to the
11199         new MethodBase.DefineAccessor(), just call it with appropriate
11200         argumetnts.
11201         (Property.Define): Call the new Property.DoDefine(), this does some
11202         sanity checks and we don't need to duplicate the code everywhere.
11203         (Event): Derive from MemberBase, not MemberCore.
11204         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
11205         accessors, this will also make them work with interface events.
11206         (Indexer): Derive from MemberBase, not MemberCore.
11207         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
11208         (Indexer.Define): Use the new MethodBase functions.
11209
11210         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
11211         argument to the constructor.
11212         (Interface.FindMembers): Added support for interface events.
11213         (Interface.PopluateEvent): Implemented.
11214
11215         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
11216
11217 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
11218
11219         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
11220         but this is required to check for a method name being the same as
11221         the containing class.  
11222
11223         Handle this now.
11224
11225 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11226
11227         * interface.cs: initialize variable.
11228
11229 2002-07-23  Martin Baulig  <martin@gnome.org>
11230
11231         Implemented the IndexerName attribute in interfaces.
11232
11233         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
11234         name if this is an explicit interface implementation.
11235         (Indexer.InterfaceIndexerName): New public variable.  If we're
11236         implementing an interface indexer, this is the IndexerName in that
11237         interface.  Otherwise, it's the IndexerName.
11238         (Indexer.DefineMethod): If we're implementing interface indexer,
11239         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
11240         and Pending.ImplementIndexer methods.
11241         (Indexer.Define): Also define the PropertyBuilder if we're
11242         implementing an interface indexer and this is neither an explicit
11243         interface implementation nor do the IndexerName match the one in
11244         the interface.
11245
11246         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
11247         If a method is defined here, then we always need to create a proxy
11248         for it.  This is used when implementing interface indexers.
11249         (Pending.IsInterfaceIndexer): New public method.
11250         (Pending.ImplementIndexer): New public method.
11251         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
11252         This is used when implementing interface indexers to define a proxy
11253         if necessary.
11254         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
11255         define a proxy if necessary.
11256
11257         * interface.cs (Interface.IndexerName): New public variable.
11258         (Interface.PopulateIndexer): Set the IndexerName.
11259         (Interface.DefineIndexers): New private method.  Populate all the
11260         indexers and make sure their IndexerNames match.
11261
11262         * typemanager.cs (IndexerPropertyName): Added support for interface
11263         indexers.
11264
11265 2002-07-22  Martin Baulig  <martin@gnome.org>
11266
11267         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
11268         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
11269         ret if HasReturnLabel.
11270         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
11271         variables.
11272
11273         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
11274         and set the ec.LoopBeginTryCatchLevel.
11275         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
11276         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
11277         the current ec.TryCatchLevel, the branch goes out of an exception
11278         block.  In this case, we need to use Leave and not Br.
11279
11280 2002-07-22  Martin Baulig  <martin@gnome.org>
11281
11282         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
11283         block unless the block does not always return or it is contained in
11284         another try { ... } catch { ... } block.  Fixes bug #26506.
11285         Added verify-1.cs to the test suite.
11286
11287 2002-07-22  Martin Baulig  <martin@gnome.org>
11288
11289         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
11290         then we do not always return.  Fixes bug #24985.
11291
11292 2002-07-22  Martin Baulig  <martin@gnome.org>
11293
11294         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
11295         lookup on a per-class level; ie. walk up the class hierarchy until we
11296         found at least one applicable method, then choose the best among them.
11297         Fixes bug #24463 and test-29.cs.
11298
11299 2002-07-22  Martin Baulig  <martin@gnome.org>
11300
11301         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
11302         return types of the methods.  The return type is not part of the
11303         signature and we must not check it to make the `new' modifier work.
11304         Fixes bug #27999, also added test-147.cs.
11305         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
11306
11307         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
11308         on the method's return type.
11309
11310 2002-07-21  Martin Baulig  <martin@gnome.org>
11311
11312         * assign.cs: Make this work if the rightmost source is a constant and
11313         we need to do an implicit type conversion.  Also adding a few more tests
11314         to test-38.cs which should have caught this.
11315
11316         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
11317         target in the makefile for this.  The makefile.gnu is primarily intended
11318         for end-users who don't want to debug the compiler.
11319
11320 2002-07-21  Martin Baulig  <martin@gnome.org>
11321
11322         * assign.cs: Improved the Assign class so it can now handle embedded
11323         assignments (X = Y = Z = something).  As a side-effect this'll now also
11324         consume less local variables.  test-38.cs now passes with MCS, added
11325         a few new test cases to that test.
11326
11327 2002-07-20  Martin Baulig  <martin@gnome.org>
11328
11329         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
11330         instructions.  Fixes bug #27977, also added test-146.cs.
11331
11332 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11333
11334         * cs-tokenizer.cs: fixed getHex ().
11335
11336 2002-07-19  Martin Baulig  <martin@gnome.org>
11337
11338         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
11339         not Type.GetType() to lookup the array type.  This is needed when
11340         we're constructing an array of a user-defined type.
11341         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
11342         single-dimensional arrays, but also for single-dimensial arrays of
11343         type decimal.
11344
11345 2002-07-19  Martin Baulig  <martin@gnome.org>
11346
11347         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
11348         this function is called, it's not allowed to share LocalBuilders
11349         among ILGenerators.
11350
11351 2002-07-19  Martin Baulig  <martin@gnome.org>
11352
11353         * expression.cs (Argument.Resolve): Report an error 118 when trying
11354         to pass a type as argument.
11355
11356 2002-07-18  Martin Baulig  <martin@gnome.org>
11357
11358         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
11359         Conv_R_Un for the signed `long' type.
11360
11361 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
11362
11363         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
11364         `expr' for the temporary result, as that will fail if we do
11365         multiple resolves on the same expression.
11366
11367 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
11368
11369         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
11370         ec.TypeContainer for looking up aliases. 
11371
11372         * class.cs (TypeContainer): Remove LookupAlias from here.
11373
11374         * decl.cs (DeclSpace); Move here.
11375
11376 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
11377
11378         * class.cs (FindMembers): Only call filter if the constructor
11379         bulider is not null.
11380
11381         Also handle delegates in `NestedTypes' now.  Now we will perform
11382         type lookups using the standard resolution process.  This also
11383         fixes a bug.
11384
11385         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
11386         This uses Expressions (the limited kind that can be parsed by the
11387         tree) instead of strings.
11388
11389         * expression.cs (ComposedCast.ToString): Implement, used to flag
11390         errors since now we have to render expressions.
11391
11392         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
11393         FormArrayType. 
11394
11395         * ecore.cs (SimpleName.ToString): ditto.
11396
11397         * cs-parser.jay: Instead of using strings to assemble types, use
11398         Expressions to assemble the type (using SimpleName, ComposedCast,
11399         MemberAccess).  This should fix the type lookups in declarations,
11400         because we were using a different code path for this.
11401
11402         * statement.cs (Block.Resolve): Continue processing statements
11403         even when there is an error.
11404
11405 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
11406
11407         * class.cs (Event.Define): Also remove the `remove' method from
11408         the list of pending items.
11409
11410         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
11411         generate more compact code. 
11412
11413 2002-07-17  Martin Baulig  <martin@gnome.org>
11414
11415         * const.cs (Const.LookupConstantValue): Add support for constant
11416         `unchecked' and `checked' expressions.
11417         Also adding test case test-140.cs for this.
11418
11419 2002-07-17  Martin Baulig  <martin@gnome.org>
11420
11421         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
11422         check whether mi.ReturnType implements the IEnumerator interface; the
11423         `==' and the IsAssignableFrom() will fail in this situation.
11424
11425 2002-07-16  Ravi Pratap  <ravi@ximian.com>
11426
11427         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
11428         here too.
11429
11430 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11431
11432         * expression.cs: fixed bug #27811.
11433
11434 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
11435
11436         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
11437         Molaro: when we are a ref, the value already contains a pointer
11438         value, do not take the address of it.
11439
11440 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
11441         * removed mb-parser.jay and mb-tokenizer.cs
11442
11443 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
11444
11445         * expression.cs: check against the building corlib void type.
11446
11447 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
11448
11449         * ecore.cs: fix for valuetype static readonly fields: when 
11450         initializing them, we need their address, not the address of a copy.
11451
11452 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
11453
11454         * typemanager.cs: register also enum_type in corlib.
11455
11456 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
11457
11458         * class.cs: allow calling this (but not base) initializers in structs.
11459
11460 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
11461
11462         * ecore.cs: make sure we compare against the building base types
11463         in GetTypeSize ().
11464
11465 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
11466
11467         * typemanager.cs: fix TypeToCoreType() to handle void and object
11468         (corlib gets no more typerefs after this change).
11469
11470 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
11471
11472         * expression.cs (ArrayCreation.EmitArrayArguments): use
11473         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
11474
11475         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
11476         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
11477         array indexes, the runtime actually forbids them.
11478
11479         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
11480         for array arguments here.
11481
11482         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
11483         instead of the default for ValueTypes.
11484
11485         (New.DoEmit): Use IsValueType instead of
11486         IsSubclassOf (value_type)
11487         (New.DoResolve): ditto.
11488         (Invocation.EmitCall): ditto.
11489
11490         * assign.cs (Assign): ditto.
11491
11492         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
11493         Statements *are* currently doing part of their resolution during
11494         Emit.  
11495
11496         Expressions do always resolve during resolve, but statements are
11497         only required to propagate resolution to their children.
11498
11499 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
11500
11501         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
11502
11503         (LoadAssembly): Do not add the dll if it is already specified
11504
11505         (MainDriver): Add the System directory to the link path at the end,
11506         after all the other -L arguments. 
11507
11508         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
11509         wrong opcode for loading bytes and bools (ldelem.i1 instead of
11510         ldelem.u1) and using the opposite for sbytes.
11511
11512         This fixes Digger, and we can finally run it.
11513
11514         * driver.cs (UnixParseOption): Move the option parsing here.  
11515         (CSCParseOption): Implement CSC-like parsing of options.
11516
11517         We now support both modes of operation, the old Unix way, and the
11518         new CSC-like way.  This should help those who wanted to make cross
11519         platform makefiles.
11520
11521         The only thing broken is that /r:, /reference: and /lib: are not
11522         implemented, because I want to make those have the same semantics
11523         as the CSC compiler has, and kill once and for all the confussion
11524         around this.   Will be doing this tomorrow.
11525
11526         * statement.cs (Unsafe.Resolve): The state is checked during
11527         resolve, not emit, so we have to set the flags for IsUnsfe here.
11528
11529 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
11530
11531         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
11532         not catch the Error_ObjectRefRequired in SimpleName (as it is
11533         possible to have a class/instance variable name that later gets
11534         deambiguated), we have to check this here.      
11535
11536 2002-07-10  Ravi Pratap  <ravi@ximian.com>
11537
11538         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
11539         make static and put into Expression.
11540
11541         (Event.Define): Register the private field of the event with the 
11542         TypeManager so that GetFieldFromEvent can get at it.
11543
11544         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
11545         keep track of the private field associated with an event which
11546         has no accessors.
11547
11548         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
11549         private field.
11550
11551         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
11552
11553 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
11554
11555         * expression.cs (Binary.EmitBranchable): this routine emits the
11556         Binary expression in a branchable context.  This basically means:
11557         we need to branch somewhere, not just get the value on the stack.
11558
11559         This works together with Statement.EmitBoolExpression.
11560
11561         * statement.cs (Statement.EmitBoolExpression): Use
11562         EmitBranchable. 
11563
11564 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
11565
11566         * statement.cs (For): Reduce the number of jumps in loops.
11567
11568         (For): Implement loop inversion for the For statement.
11569
11570         (Break): We can be breaking out of a Try/Catch controlled section
11571         (foreach might have an implicit try/catch clause), so we need to
11572         use Leave instead of Br.
11573
11574         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
11575         now).  If the instace expression supports IMemoryLocation, we use
11576         the AddressOf method from the IMemoryLocation to extract the
11577         address instead of emitting the instance.
11578
11579         This showed up with `This', as we were emitting the instance
11580         always (Emit) instead of the Address of This.  Particularly
11581         interesting when This is a value type, as we dont want the Emit
11582         effect (which was to load the object).
11583
11584 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
11585
11586         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
11587
11588         * statement.cs (Checked): Set the CheckedState during the resolve
11589         process too, as the ConvCast operations track the checked state on
11590         the resolve process, and not emit.
11591
11592         * cs-parser.jay (namespace_member_declaration): Flag that we have
11593         found a declaration when we do.  This is used to flag error 1529
11594
11595         * driver.cs: Report ok when we display the help only.
11596
11597 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
11598
11599         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
11600
11601 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
11602
11603         * cs-tokenizer.cs (define): We also have to track locally the
11604         defines.  AllDefines is just used for the Conditional Attribute,
11605         but we also need the local defines for the current source code. 
11606
11607 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
11608
11609         * statement.cs (While, For, Do): These loops can exit through a
11610         Break statement, use this information to tell whether the
11611         statement is the last piece of code.
11612
11613         (Break): Flag that we break.
11614
11615         * codegen.cs (EmitContexts): New `Breaks' state variable.
11616
11617 2002-07-03  Martin Baulig  <martin@gnome.org>
11618
11619         * class.cs (TypeContainer.MethodModifiersValid): Allow override
11620         modifiers in method declarations in structs.  Otherwise, you won't
11621         be able to override things like Object.Equals().
11622
11623 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
11624
11625         * class.cs (Method, Property, Indexer): Do not allow the public
11626         modifier to be used in explicit interface implementations.
11627
11628         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
11629         override modifiers in method declarations in structs
11630
11631 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
11632
11633         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
11634         integer or real overflow, report an error
11635
11636 2002-07-02  Martin Baulig  <martin@gnome.org>
11637
11638         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
11639         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
11640         to tell the runtime about our newly created System.Object and
11641         System.ValueType types.
11642
11643 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
11644
11645         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
11646         struct instead of Ldarg/Starg.
11647
11648 2002-07-02  Martin Baulig  <martin@gnome.org>
11649
11650         * expression.cs (Indirection.Indirection): Call
11651         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
11652
11653 2002-07-02  Martin Baulig  <martin@gnome.org>
11654
11655         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
11656         ValueType, call TypeManager.TypeToCoreType() on it.
11657         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
11658         the OpCodes.Newarr argument.
11659
11660 2002-07-02  Martin Baulig  <martin@gnome.org>
11661
11662         * expression.cs (Invocation.EmitCall): When compiling corlib,
11663         replace all calls to the system's System.Array type to calls to
11664         the newly created one.
11665
11666         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
11667         System.Array methods.
11668         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
11669         from the system's System.Array type which must be replaced.
11670
11671 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
11672
11673         * typemanager.cs: load unverifiable_code_ctor so we can build
11674         corlib using the correct type. Avoid using GetTypeCode() with
11675         TypeBuilders.
11676         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
11677         TypeManager.object_type to allow building corlib.
11678
11679 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
11680
11681         * ecore.cs: handle System.Enum separately in LoadFromPtr().
11682
11683 2002-07-01  Martin Baulig  <martin@gnome.org>
11684
11685         * class.cs: Make the last change actually work, we need to check
11686         whether `ifaces != null' to avoid a crash.
11687
11688 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
11689
11690         * class.cs: when we build structs without fields that implement
11691         interfaces, we need to add the interfaces separately, since there is
11692         no API to both set the size and add the interfaces at type creation
11693         time.
11694
11695 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
11696
11697         * expression.cs: the dimension arguments to the array constructors
11698         need to be converted if they are a long.
11699
11700 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
11701
11702         * class.cs: don't emit ldarg.0 if there is no parent constructor
11703         (fixes showstopper for corlib).
11704
11705 2002-06-29  Martin Baulig  <martin@gnome.org>
11706
11707         MCS now compiles corlib on GNU/Linux :-)
11708
11709         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
11710         ie. check for MethodImplOptions.InternalCall.
11711
11712         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
11713         and TypeManager.attribute_type are null, so we must explicitly check
11714         whether parent is not null to find out whether it's an attribute type.
11715         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
11716         and SetBuilder, not only if the property is neither abstract nor external.
11717         This is necessary to set the MethodImplOptions on the accessor methods.
11718         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
11719         SetBuilder, see Property.Emit().
11720
11721         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
11722         populate "System.Object", "System.ValueType" and "System.Attribute" since
11723         they've already been populated from BootCorlib_PopulateCoreTypes().
11724
11725 2002-06-29  Martin Baulig  <martin@gnome.org>
11726
11727         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
11728         is the NullLiteral, we also need to make sure that target_type is not
11729         an enum type.   
11730
11731 2002-06-29  Martin Baulig  <martin@gnome.org>
11732
11733         * rootcontext.cs (RootContext.ResolveCore): We must initialize
11734         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
11735         before calling BootstrapCorlib_ResolveDelegate ().
11736
11737 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11738
11739         * statement.cs: fixed build-breaker. All tests passed ok.
11740
11741 2002-06-27  Martin Baulig  <martin@gnome.org>
11742
11743         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
11744         for System.Decimal when compiling corlib.
11745
11746 2002-06-27  Martin Baulig  <martin@gnome.org>
11747
11748         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
11749         switch blocks which contain nothing but a default clause.
11750
11751 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
11752
11753        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
11754
11755 2002-06-27  Martin Baulig  <martin@gnome.org>
11756
11757         * ecore.cs (PropertyExpr.PropertyExpr): Call
11758         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
11759
11760         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
11761         is already a TypeBuilder.
11762
11763 2002-06-27  Martin Baulig  <martin@gnome.org>
11764
11765         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
11766         `target_type == TypeManager.array_type', not IsAssignableFrom() in
11767         the "from an array-type to System.Array" case.  This makes it work
11768         when compiling corlib.
11769
11770 2002-06-27  Martin Baulig  <martin@gnome.org>
11771
11772         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
11773         non-static PropertyExpr, set its InstanceExpression.  This makes
11774         the `ICollection.Count' property work in System/Array.cs.
11775
11776 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
11777
11778         * driver.cs: Made error handling more consistent.  Errors now
11779         tracked by Report class, so many methods which used to return int
11780         now return void.  Main() now prints success/failure and 
11781         errors/warnings message.
11782
11783         Renamed '--probe' compiler argument to '--expect-error'.  Removed
11784         the magic number return values (123 and 124).  Now, if the
11785         expected error occurs, the compiler exits with success (exit value
11786         0).  If the compilation completes without seeing that particular
11787         error, the compiler exits with failure (exit value 1).  The
11788         makefile in mcs/errors has been changed to handle the new behaviour.
11789
11790         * report.cs: Made 'expected error' number a property and renamed
11791         it from 'Probe' to 'ExpectedError'.
11792
11793         * genericparser.cs: Removed error handling support, since it is
11794         now all done by Report class.
11795
11796         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
11797         class, so parse() no longer returns an int.
11798
11799         * namespace.cs: Use Report.Error instead of GenericParser.error
11800
11801 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
11802
11803         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
11804         TypeContainer.AddOperator): At the front of the list put the
11805         explicit implementations, so they get resolved/defined first. 
11806
11807 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
11808
11809         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
11810         interface type is implemented by this TypeContainer.  Used during
11811         explicit interface implementation.
11812
11813         (Property.Define, Indexer.Define, Method.Define): Validate that
11814         the given interface in the explicit implementation is one of the
11815         base classes for the containing type.
11816
11817         Also if we are explicitly implementing an interface, but there is
11818         no match in the pending implementation table, report an error.
11819
11820         (Property.Define): Only define the property if we are
11821         not explicitly implementing a property from an interface.  Use the
11822         correct name also for those properties (the same CSC uses,
11823         although that is really not needed).
11824
11825         (Property.Emit): Do not emit attributes for explicitly implemented
11826         properties, as there is no TypeBuilder.
11827
11828         (Indexer.Emit): ditto.
11829
11830         Hiding then means that we do not really *implement* a pending
11831         implementation, which makes code fail.
11832
11833 2002-06-22  Martin Baulig  <martin@gnome.org>
11834
11835         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
11836         the return value of Object.GetType().  [FIXME: we need to do this whenever
11837         we get a type back from the reflection library].
11838
11839 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
11840
11841         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
11842
11843 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
11844
11845         * attribute.cs: Return null if we can not look up the type.
11846
11847         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
11848         the interface types found.
11849
11850         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
11851         interface types found.
11852
11853         * typemanager.cs (GetInterfaces): Make this routine returns alll
11854         the interfaces and work around the lame differences between
11855         System.Type and System.Reflection.Emit.TypeBuilder in the results
11856         result for GetInterfaces.
11857
11858         (ExpandInterfaces): Given an array of interface types, expand and
11859         eliminate repeated ocurrences of an interface.  This expands in
11860         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
11861         be IA, IB, IC.
11862
11863 2002-06-21  Martin Baulig  <martin@gnome.org>
11864
11865         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
11866         on System.Enum.
11867
11868 2002-06-21  Martin Baulig  <martin@gnome.org>
11869
11870         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
11871         and called with one of the core types, return the corresponding typebuilder for
11872         that type.
11873
11874         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
11875         element type.
11876
11877 2002-06-21  Martin Baulig  <martin@gnome.org>
11878
11879         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
11880         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
11881         (Expression.ConvertReferenceExplicit): Likewise.
11882
11883         * expression.cs (ElementAccess.DoResolve): Likewise.
11884         (ElementAccess.DoResolveLValue): Likewise.
11885
11886 2002-06-10  Martin Baulig  <martin@gnome.org>
11887
11888         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
11889         add the "value" parameter to the parameter list.
11890
11891         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
11892         to our caller.
11893
11894 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
11895
11896         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
11897         the argument to an int, uint, long or ulong, per the spec.  Also
11898         catch negative constants in array creation.
11899
11900 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
11901
11902         * class.cs: do not allow the same interface to appear twice in
11903         the definition list.
11904
11905 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
11906
11907         * ecore.cs: don't use ldlen with System.Array.
11908
11909 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
11910
11911         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
11912
11913 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
11914
11915         * modifiers.cs: produce correct field attributes for protected
11916         internal. Easy fix so miguel can work on ther harder stuff:-)
11917
11918 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
11919
11920         * pending.cs: New file.  Move the code from class.cs here.
11921         Support clearning the pending flag for all methods (when not doing
11922         explicit interface implementation).
11923
11924 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
11925
11926         * rootcontext.cs: added a couple more types needed to bootstrap.
11927
11928 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
11929
11930         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
11931         constructor in the type, instead of any constructor in the type
11932         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
11933         a bug in the Mono runtime when applying the params attribute). 
11934
11935 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
11936         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
11937
11938 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
11939
11940         * expression.cs (Unary.ResolveOperator): Use TypeManager
11941         to resolve the type.
11942
11943 2002-06-13  Ravi Pratap  <ravi@ximian.com>
11944
11945         * cs-parser.jay (enum_member_declaration): Pass in the attributes
11946         attached.
11947
11948         * enum.cs (AddEnumMember): Add support to store the attributes associated 
11949         with each member too.
11950
11951         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
11952         field builders too - this takes care of the enum member case.
11953
11954 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
11955
11956         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
11957         address-of operator on both value types and pointers.
11958
11959 2002-06-10  Martin Baulig  <martin@gnome.org>
11960
11961         * interface.cs (Interface.PopulateIndexer): Add the indexer's
11962         PropertyBuilder to the `property_builders' list.
11963
11964         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
11965         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
11966         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
11967         find any indexers which are inherited from an interface.
11968
11969 2002-06-09  Martin Baulig  <martin@gnome.org>
11970
11971         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
11972         the same type as the constant if necessary.  There's also a test-130.cs
11973         for this.
11974
11975         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
11976
11977         * typemanager.cs (TypeManager.ChangeType): Previously known as
11978         Enum.ChangeEnumType().
11979
11980 2002-06-09  Martin Baulig  <martin@gnome.org>
11981
11982         * expression.cs (Cast.TryReduce): Added support for consts.
11983
11984 2002-06-08  Ravi Pratap  <ravi@ximian.com>
11985
11986         * class.cs (Accessor): Hold attributes information so we can pass
11987         it along.
11988
11989         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
11990         Modify to pass in attributes attached to the methods.
11991
11992         (add_accessor_declaration, remove_accessor_declaration): Ditto.
11993
11994         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
11995         to handle the Accessor kind :-)
11996
11997         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
11998
11999 2002-06-08  Martin Baulig  <martin@gnome.org>
12000
12001         * expression.cs (Unary.TryReduceNegative): Added support for
12002         ULongConstants.
12003
12004 2002-06-08  Martin Baulig  <martin@gnome.org>
12005
12006         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
12007         name can't be found in the `defined_names' - the caller will do a
12008         MemberLookup in this case and thus find methods in System.Enum
12009         such as Enum.IsDefined().
12010
12011 2002-06-08  Martin Baulig  <martin@gnome.org>
12012
12013         * enum.cs (Enum.ChangeEnumType): This is a custom version of
12014         Convert.ChangeType() which works with TypeBuilder created types.
12015         (Enum.LookupEnumValue, Enum.Define): Use it here.
12016
12017         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
12018         `TypeBuilder.BaseType != null' check.
12019         (TypeContainer.FindMembers): Only lookup parent members if we
12020         actually have a parent.
12021         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
12022         (ConstructorInitializer.Resolve): Likewise.
12023
12024         * interface.cs (Interface.FindMembers): Added
12025         `TypeBuilder.BaseType != null' check.
12026
12027         * rootcontext.cs (RootContext.ResolveCore): Added
12028         "System.Runtime.CompilerServices.IndexerNameAttribute" to
12029         classes_second_stage.
12030
12031         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
12032         debug_type and trace_type when compiling with --nostdlib.       
12033
12034 2002-06-07  Martin Baulig  <martin@gnome.org>
12035
12036         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
12037         (AddField): Set it to true when adding a non-static field.
12038         (DefineType): Use `have_nonstatic_fields' to find out whether we
12039         have non-static fields, not `Fields != null'.
12040
12041 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
12042
12043         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
12044         dereferencing a null on the static-field code path)
12045
12046 2002-05-30  Martin Baulig  <martin@gnome.org>
12047
12048         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
12049         to take command line arguments.  Use reflection to call the new
12050         custom `Initialize' function on the symbol writer and pass it the
12051         command line arguments.
12052
12053         * driver.cs (--debug-args): New command line argument to pass command
12054         line arguments to the symbol writer.
12055
12056 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
12057
12058         * assign.cs (DoResolve): Forgot to do the implicit conversion to
12059         the target type for indexers and properties.  Thanks to Joe for
12060         catching this.
12061
12062 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
12063
12064         * typemanager.cs (MethodFlags): returns the method flags
12065         (Obsolete/ShouldIgnore) that control warning emission and whether
12066         the invocation should be made, or ignored. 
12067
12068         * expression.cs (Invocation.Emit): Remove previous hack, we should
12069         not do this on matching a base type, we should do this based on an attribute
12070
12071         Only emit calls to System.Diagnostics.Debug and
12072         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
12073         on the command line.
12074
12075         * rootcontext.cs: Global settings for tracing and debugging.
12076
12077         * cs-tokenizer.cs (define): New utility function to track
12078         defines.   Set the global settings for TRACE and DEBUG if found.
12079
12080 2002-05-25  Ravi Pratap  <ravi@ximian.com>
12081
12082         * interface.cs (Populate*): Pass in the TypeContainer as well as
12083         the DeclSpace as parameters so that we can create EmitContexts and
12084         then use that to apply attributes etc.
12085
12086         (PopulateMethod, PopulateEvent, PopulateProperty)
12087         (PopulateIndexer): Apply attributes everywhere.
12088
12089         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
12090         etc.
12091
12092         (ApplyAttributes): Update accordingly.
12093
12094         We now apply interface attributes for all members too.
12095
12096 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
12097
12098         * class.cs (Indexer.Define); Correctly check if we are explicit
12099         implementation (instead of checking the Name for a ".", we
12100         directly look up if the InterfaceType was specified).
12101
12102         Delay the creation of the PropertyBuilder.
12103
12104         Only create the PropertyBuilder if we are not an explicit
12105         interface implementation.   This means that explicit interface
12106         implementation members do not participate in regular function
12107         lookups, and hence fixes another major ambiguity problem in
12108         overload resolution (that was the visible effect).
12109
12110         (DefineMethod): Return whether we are doing an interface
12111         implementation. 
12112
12113         * typemanager.cs: Temporary hack until we get attributes in
12114         interfaces (Ravi is working on that) and we get IndexerName
12115         support in interfaces.
12116
12117         * interface.cs: Register the indexers as properties.
12118
12119         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
12120         warning, I have verified that this is a bug in the .NET runtime
12121         (JavaScript suffers of the same problem).
12122
12123         * typemanager.cs (MemberLookup): When looking up members for
12124         interfaces, the parent of an interface is the implicit
12125         System.Object (so we succeed in searches of Object methods in an
12126         interface method invocation.  Example:  IEnumerable x;  x.ToString
12127         ()) 
12128
12129 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
12130
12131         * class.cs (Event): Events should also register if they do
12132         implement the methods that an interface requires.
12133
12134         * typemanager.cs (MemberLookup); use the new GetInterfaces
12135         method. 
12136
12137         (GetInterfaces): The code used to lookup interfaces for a type is
12138         used in more than one place, factor it here. 
12139
12140         * driver.cs: Track the errors at the bottom of the file, we kept
12141         on going.
12142
12143         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
12144         instance if the method we are calling is static!
12145
12146 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
12147
12148         * attribute.cs (ApplyAttributes): Make this function filter out
12149         the IndexerName attribute (as that attribute in reality is never
12150         applied) and return the string constant for the IndexerName
12151         attribute. 
12152
12153         * class.cs (TypeContainer.Emit): Validate that all the indexers
12154         have the same IndexerName attribute, and if so, set the
12155         DefaultName attribute on the class. 
12156
12157         * typemanager.cs: The return value might contain other stuff (not
12158         only methods).  For instance, consider a method with an "Item"
12159         property and an Item method.
12160
12161         * class.cs: If there is a problem with the parameter types,
12162         return. 
12163
12164 2002-05-24  Ravi Pratap  <ravi@ximian.com>
12165
12166         * ecore.cs (ImplicitConversionExists): Wrapper function which also
12167         looks at user defined conversion after making a call to 
12168         StandardConversionExists - we need this for overload resolution.
12169
12170         * expression.cs : Update accordingly the various method calls.
12171
12172         This fixes 2 bugs filed against implicit user defined conversions 
12173
12174 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
12175
12176         * statement.cs: Track the result of the assignment.
12177
12178 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
12179
12180         * expression.cs (MemberAccess): Improved error reporting for
12181         inaccessible members.
12182
12183 2002-05-22  Martin Baulig  <martin@gnome.org>
12184
12185         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
12186         itself with debugging support.
12187
12188 2002-05-22  Martin Baulig  <martin@gnome.org>
12189
12190         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
12191         Removed, this isn't needed anymore.
12192
12193 2002-05-20  Martin Baulig  <martin@gnome.org>
12194
12195         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
12196         be underlying type for an enum.
12197
12198 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
12199
12200         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
12201         that splits out the loading of just the core types.
12202
12203         * rootcontext.cs (ResolveCore): Split the struct resolution in
12204         two, so we can load the enumeration underlying types before any
12205         enums are used.
12206
12207         * expression.cs (Is): Bandaid until we fix properly Switch (see
12208         bug #24985 for details).
12209
12210         * typemanager.cs (ImplementsInterface): The hashtable will contain
12211         a null if there are no interfaces implemented.
12212
12213 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
12214
12215         * cs-parser.jay (indexer_declarator): It is fine to have array
12216         parameters
12217
12218 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12219
12220         * typemanager.cs: (RegisterBuilder): New function used to register
12221         TypeBuilders that implement interfaces.  Since
12222         TypeBuilder.GetInterfaces (as usual) does not work with lame
12223         Reflection.Emit. 
12224         (AddUserType): register interfaces.
12225
12226         (ImplementsInterface): Use the builder_to_ifaces hash if we are
12227         dealing with TypeBuilder.  Also, arrays are showing up as
12228         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
12229         methods can not be invoked on them!
12230
12231         * ecore.cs (ExplicitReferenceConversionExists): Made public.
12232         (ImplicitReferenceConversionExists): Split out from
12233         StandardConversionExists. 
12234
12235         * expression.cs (As): We were only implementing one of the three
12236         cases for the as operator.  We now implement them all.
12237         (Is): Implement the various other cases for Is as well.
12238
12239         * typemanager.cs (CACHE): New define used to control if we want or
12240         not the FindMembers cache.  Seems to have a negative impact on
12241         performance currently
12242
12243         (MemberLookup): Nested types have full acess to
12244         enclosing type members
12245
12246         Remove code that coped with instance/static returns for events, we
12247         now catch this in RealFindMembers.
12248
12249         (RealFindMembers): only perform static lookup if the instance
12250         lookup did not return a type or an event.  
12251
12252 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12253
12254         * assign.cs (CompoundAssign): We pass more semantic information
12255         now to Compound Assignments than we did before: now we have all
12256         the information at hand, and now we resolve the target *before* we
12257         do the expression expansion, which allows the "CacheValue" method
12258         to have the effect we intended (before, a [x] += 1 would generate
12259         two differen ArrayAccess expressions from the ElementAccess,
12260         during the resolution process).
12261
12262         (CompoundAssign.DoResolve): Resolve target and original_source here.
12263
12264 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
12265
12266         * expression.cs (ArrayAccess): dropped debugging information. 
12267
12268         * typemanager.cs: Small bug fix: I was always returning i_members,
12269         instead of one of i_members or s_members (depending on which had
12270         the content).
12271
12272         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
12273         method is invoked before any code generation takes place, and it
12274         is a mechanism to inform that the expression will be invoked more
12275         than once, and that the method should use temporary values to
12276         avoid having side effects
12277
12278         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
12279
12280         * ecore.cs (Expression.CacheTemporaries): Provide empty default
12281         implementation.
12282
12283         * expression.cs (Indirection, ArrayAccess): Add support for
12284         CacheTemporaries in these two bad boys. 
12285
12286         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
12287         ldobj or ldind_ref.  
12288         (StoreFromPtr): Handle stobj as well.
12289
12290         * expression.cs (UnaryMutator): Share more code.
12291
12292         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
12293         down: I was not tracking the Filter function as well, which
12294         was affecting the results of the cache.
12295
12296 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
12297
12298         * attribute.cs: Remove the hack to handle the CharSet property on
12299         StructLayouts. 
12300
12301 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
12302
12303         * attribute.cs (DoResolve): More uglyness, we now only try to
12304         resolve the attribute partially, to extract the CharSet
12305         information (only if we are a StructLayout attribute).  Otherwise 
12306
12307         (GetExtraTypeInfo): Add some code to conditionally kill in the
12308         future this.   I am more and more convinced that the .NET
12309         framework has special code to handle the attribute setting on
12310         certain elements.
12311
12312         * expression.cs (IsParamsMethodApplicable): Revert my previous
12313         foreach change here, it was wrong.
12314
12315 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
12316
12317         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
12318         (pp_expr): do not abort on unknown input, just return.
12319         (eval): abort if there are pending chars.
12320
12321         * attribute.cs (Attribute.Resolve): Positional parameters are
12322         optional.  Deal with that case.
12323
12324         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
12325         the Ansi/Unicode/Auto information for the type.
12326
12327         (TypeContainer.DefineType): instantiate the EmitContext here, as
12328         we will be using it during the type definition (to resolve
12329         attributes) and during the emit phase.
12330
12331         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
12332         to pull type information out of the attributes
12333
12334         (Attribute.Resolve): track the constructor builder, and allow for
12335         multiple invocations (structs and classes will use this).
12336
12337         * ecore.cs (MemberLookupFinal): new version with all the
12338         parameters customizable.
12339
12340         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
12341         constructors.  Return if the result value is null (as the error
12342         would have been flagged already by MemberLookupFinal)
12343
12344         Do not allow instances of abstract classes or interfaces to be
12345         created.
12346
12347         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
12348         We have to compare the assembly property here when dealing with
12349         FamANDAssem and Assembly access modifiers, because we might be
12350         creating an assembly from *modules* (that means that we are not
12351         getting TypeBuilders for types defined in other modules that are
12352         part of this assembly).
12353
12354         (Method.Emit): If the method is marked abstract and has a body,
12355         emit an error. 
12356
12357         (TypeContainer.DefineMembers): If both the defined member and the
12358         parent name match are methods, then do not emit any warnings: let
12359         the Method.Define routine take care of flagging warnings.  But if
12360         there is a mismatch (method overrides something else, or method is
12361         overriwritten by something, then emit warning).
12362
12363         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
12364         set to null, this means `do not check for the return type on the
12365         signature'. 
12366
12367         (Method.Define): set the return type for the method signature to
12368         null, so that we get methods with the same name and parameters and
12369         different return types.  This is used to flag warning 114 (you are
12370         hiding a method, and you probably want to use the new/override
12371         keywords instead).
12372
12373         * typemanager.cs (MemberLookup): Implemented proper access
12374         control, closing a long standing set of bug reports.  The problem
12375         was that the Framework only has two bits: Public and NonPublic,
12376         and NonPublic includes private and protected methods, but we need
12377         to enforce the FamANDAssem, FamOrAssem and Family. 
12378
12379 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
12380
12381         * statement.cs (GotoCase): Return true: Ammounts to giving up
12382         knowledge on whether we return or not, and letting the other case
12383         be responsible for it.
12384
12385 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
12386
12387         * driver.cs: Do not load directories for each file processed, only
12388         do it if there is a pattern.
12389
12390         * ecore.cs: Report readonly assigns here as well, as we might have
12391         been resolved only by MemberAccess.
12392
12393         (SimpleName.SimpleNameResolve): Also be useful for LValue
12394         resolution.   We need this to propagate assign to local readonly variables
12395
12396         * typemanager.cs: Use a ptrhashtable for the criteria, because we
12397         do not want to reuse potential criteria memory.
12398
12399         * class.cs (MyEventBuilder): Set reflected_type;
12400
12401         * ecore.cs (Constantify): Added support for constifying bools.
12402
12403         (RootContext.LookupType): Added a cache for values looked up in
12404         the declaration space.
12405
12406         * typemanager.cs (FindMembers): Now is a front-end to
12407         RealFindMembers, and provides a two-level hashtable-based cache to
12408         the request.  
12409
12410         15% performance improvement: from 22.5 to 19.2 seconds.
12411
12412         * expression.cs (IsParamsMethodApplicable): use foreach.
12413         (Invocation.DoResolve): ditto.
12414         (New.DoResolve): ditto.
12415         (ArrayCreation.DoResolve): ditto.
12416
12417         * ecore.cs (FindMostEncompassingType): use foreach.
12418
12419         * delegate.cs (NewDelegate.DoResolve): Use foreach
12420
12421         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
12422         (RemoveMethods): use foreach.
12423
12424         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
12425         nested foreach statements instead of for, and also break out of
12426         the inner loop once a match is found.
12427
12428         (Invocation.OverloadResolve): Use foreach, simplify the code. 
12429
12430 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
12431
12432         * cfold.cs (BinaryFold): During an enumeration evaluation context,
12433         we actually unwrap the expression to allow for extra information
12434         to be extracted. 
12435
12436         * expression.cs: Use Shr_Un on unsigned operations. 
12437
12438 2002-05-08  Ravi Pratap  <ravi@ximian.com>
12439
12440         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
12441         applicable operators was not being considered correctly. This closes
12442         the bug Miguel reported.
12443
12444 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
12445
12446         * attribute.cs: check that the type derives from System.Attribute
12447         and report the correct error in that case (moved the duplicate code to
12448         its own method, too).
12449
12450 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
12451
12452         * attribute.cs: lookup attribute type name as the spec says: first the
12453         bare attribute name and then name + "Attribute" (nant compiles with
12454         mcs after this fix).
12455
12456 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
12457
12458         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
12459         Because of the way we parse things, we should try to see if a
12460         UIntConstant can fit in an integer.
12461
12462 2002-05-07  Ravi Pratap  <ravi@ximian.com>
12463
12464         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
12465         when we are in an explicit context.
12466
12467         (ConvertReferenceExplicit): When converting from Iface type S to Class
12468         T make sure the rules are implemented as an OR.
12469
12470         * parameter.cs (ParameterType): Make it a property for now although the
12471         purpose really isn't anything immediate.
12472
12473         * expression.cs (Is*Applicable): Do better checking on the parameter type
12474         of a ref/out parameter. The ones from the system assemblies are already 
12475         marked with the correct type so we don't need to do any correction.
12476
12477         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
12478         the object type is standard too so include that.
12479
12480 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
12481
12482         * ecore.cs (StandardConversionExists): Augment with missing code:
12483         deal with IntConstant, LongConstants and Enumerations.
12484
12485         * assign.cs: Report the error, instead of failing silently
12486
12487         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
12488         typecontainer that they are declared, because the
12489         typecontainer/namespace will have the list of using clauses that
12490         need to be applied.
12491
12492         Assembly Attributes were escaping the normal registration
12493         mechanism. 
12494
12495         (EmitCode): Apply attributes within an EmitContext that represents
12496         the container they were declared on.
12497
12498         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
12499
12500 2002-05-06  Ravi Pratap  <ravi@ximian.com>
12501
12502         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
12503         Revamp completely - make much cleaner as we now operate only
12504         on a set of Types.
12505
12506         (FindMostSpecificSource, FindMostSpecificTarget): New methods
12507         to implement the logic detailed in the spec more correctly.
12508
12509         (UserDefinedConversion): Update accordingly.
12510
12511 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
12512
12513         * statement.cs: Return flow analysis information up.
12514
12515         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
12516         and the default.
12517
12518         (token): Do not consume an extra character before calling
12519         decimal_digits.
12520
12521 2002-05-06  Piers Haken <piersh@friskit.com>
12522
12523         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
12524
12525 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
12526
12527         * class.cs (Constructor.Emit): Set the IsStatic flag in the
12528         EmitContext during the instance constructor initializer
12529         resolution, to stop access to instance variables.
12530
12531         This is mandated by the spec, last paragraph of the `constructor
12532         initializers' section. 
12533
12534 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
12535
12536         * cs-parser.jay, class.cs (Accessor): new class used to represent
12537         an accessor (get or set).  In the past we used `null' to represent
12538         a missing accessor.  But this is ambiguous because there was no
12539         way to tell in abstract indexers/properties if one of them was
12540         specified.
12541
12542         Now there is a way of addressing that.
12543
12544         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
12545         instead of FindMembers.
12546
12547         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
12548         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
12549
12550         * attribute.cs: Treat indexers and properties as the same in terms
12551         of applying attributes
12552
12553         * ecore.cs (FindMostEncompassedType): Use statically initialized
12554         EmptyExpressions()s like we do elsewhere to avoid creating useless
12555         objects (and we take this out of the tight loop).
12556
12557         (GetConversionOperators): Move the code to extract the actual
12558         operators to a separate routine to clean things up.
12559
12560 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
12561
12562         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
12563         events are always registered FieldBuilders.
12564
12565         * class.cs (FieldBase): New class shared by Fields 
12566
12567         * delegate.cs: If we are a toplevel delegate, use our full name.
12568         If we are a nested delegate, then only use our tail name.
12569
12570 2002-05-02  Ravi Pratap  <ravi@ximian.com>
12571
12572         * expression.cs (IsApplicable): Ensure that we add the "&" to
12573         ref/out types before comparing it with the type of the argument.
12574
12575         (IsParamsMethodApplicable): Ditto.
12576
12577         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
12578         silly me ;-)
12579
12580         * delegate.cs : Handle the case when we have more than one applicable
12581         method. Flag an error only when we finish checking all.
12582
12583 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
12584
12585         * expression.cs: Add support for boolean static initializers.
12586
12587 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
12588
12589         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
12590
12591         * parameter.cs (ComputeParameterTypes,
12592         ComputeAndDefineParameterTypes): Better error handling: now we
12593         clear the `types' cache if we fail during any of the type lookups.
12594         We also return the status code correctly to our caller
12595
12596         * delegate.cs: If we fail to define a delegate, abort the extra
12597         steps. 
12598
12599         * expression.cs (Binary.ResolveOperator): for
12600         operator==(object,object) and operator !=(object, object) we also
12601         have to verify that there is an implicit conversion from one to
12602         the other.
12603
12604         (ArrayAccess.DoResolve): Array Access can operate on
12605         non-variables. 
12606
12607 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
12608
12609         * assign.cs (CompoundAssign): A new class used as a "flag" that
12610         the assignment actually is happening as part of a compound
12611         assignment operator.
12612
12613         During compound assignment, a few new rules exist to enable things
12614         like:
12615
12616         byte b |= 1 + 2
12617
12618         From the spec:
12619
12620         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
12621         to the type of x) if y is implicitly convertible to the type of x,
12622         and the operator is a builtin operator and the return type of the
12623         operator is explicitly convertible to the type of x. 
12624
12625         * rootcontext.cs: Reset warning level to 2.  4 catches various
12626         "interesting" features in mcs, we must clean this up at some
12627         point, but currently am trying to kill other bugs ;-)
12628
12629         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
12630         in container classes as well.  
12631
12632         * expression.cs (Binary.ResolveOperator): Handle string case
12633         before anything else (as operator overloading does emit an error
12634         before doing anything else).
12635
12636         This code could go away when we move to a table driven model, but
12637         i could not come up with a good plan last night.
12638
12639 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
12640
12641         * typemanager.cs (CSharpName): reimplementation using regex.
12642         * class.cs: added null check for fields in Emit
12643         * rootcontext.cs: set warninglevel to 4
12644
12645 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
12646
12647         * typemanager.cs (CSharpName): reimplemented with Lupus
12648         suggestion.
12649
12650 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
12651
12652         * statement.cs (If): correclty implement Resolve, because we were
12653         not catching sem errors in there.  The same process is needed
12654         everywhere else. 
12655         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
12656
12657
12658         (Statement.Warning_DeadCodeFound): Factorize code.
12659         (While): Report dead code here too.
12660
12661         (Statement): Added Resolve virtual method to allow
12662         for resolution split from the emit code.
12663
12664 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
12665
12666         * statement.cs (EmitBoolExpression): No longer try to resolve the
12667         expression here.    
12668         (MakeBoolean): New utility function that resolve, implicitly
12669         converts to boolean and tags the expression. 
12670
12671
12672         (If, Do): Implement dead code elimination.
12673         (While): Implement loop inversion
12674
12675         (Do, While, For, If): Resolve the expression prior to calling our
12676         code generation.
12677
12678 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
12679
12680         * class.cs:
12681           - added method Report28 (warning: program has more than one entry point)
12682           - added method IsEntryPoint, implements paragraph 10.1 of the spec
12683           - modified method Method.Define, the part at the end of the method
12684
12685         * rootcontext.cs: added static public Location EntryPointLocation;
12686           
12687         * ../errors/cs0028.cs : Add test case for the above warning.              
12688
12689         * typemanager.cs:
12690           - modified method CSharpName to allow arrays of primitive type to
12691             be printed nicely (e.g. instead of System.Int32[][] it now prints
12692             int[][])
12693           - added method CSharpSignature: returns the signature of a method
12694             in string format to be used in reporting errors, warnings, etc.
12695
12696         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
12697         with String.Empty.
12698
12699 2002-04-26  Ravi Pratap  <ravi@ximian.com>
12700
12701         * delegate.cs (Define): Fix extremely silly bug where I was
12702         setting the type of the 'object' parameter of the BeginInvoke
12703         method to System.IAsyncResult instead of System.Object ;-)
12704
12705 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
12706
12707         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
12708         here. 
12709
12710         (Constructor.Emit): return if we fail to initialize the
12711         constructor.  Another door closed!  
12712
12713         * expression.cs (New.DoResolve): Improve error message (from -6 to
12714         1501).  Use DeclaredOnly lookup to find the exact constructor.
12715
12716         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
12717         loop.  This is useful.
12718
12719         * cs-parser.jay: Adjust the default parameters so that destructors
12720         have the proper signature.
12721
12722 2002-04-26  Martin Baulig  <martin@gnome.org>
12723
12724         * driver.cs (LoadAssembly): If `assembly' contains any characters
12725         which are only valid in path names and not in assembly names
12726         (currently slash, backslash and point), use Assembly.LoadFrom ()
12727         instead of Assembly.Load () on the `assembly' (before iteration
12728         over the link_paths).
12729
12730 2002-04-26  Martin Baulig  <martin@gnome.org>
12731
12732         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
12733
12734 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
12735
12736         * class.cs (Property): use the new typemanager.MemberLookup
12737
12738         (TypeContainer.MemberLookup): Implement using the
12739         TypeManager.MemberLookup now. 
12740
12741         * typemanager.cs: Make MemberLookup a function of the TypeManager,
12742         and return MemberInfos, so that these can be used without an
12743         EmitContext (what we had before).
12744
12745 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
12746
12747         * expression.cs: Fix the case where the argument to params if the
12748         type of the params.  I omitted handling this before.   Fixed
12749
12750 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
12751
12752         * driver.cs: Call BootCorlib_PopulateCoreType
12753
12754         * class.cs (Property.CheckBase): Check for properties only, not
12755         for all members. 
12756
12757         * interface.cs: Temporary hack: try/catch around the
12758         CustomAttributeBuilder, because I am getting an exception that I
12759         do not understand.
12760
12761         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
12762         types whose definitions are required to be there (attributes are
12763         defined before standard types).
12764
12765         Compute definitions as we boot the various types, as they are used
12766         immediately (value_type class will need object_type, but if we do
12767         not initialize object_type, we will pass a null, which will let
12768         the runtime pick the System.Object from the existing corlib, which
12769         is not what we want).
12770
12771 2002-04-22  Patrik Torstensson <totte@labs2.com>
12772
12773         * cs-tokenizer.cs: fixed a number of trim() issues.
12774
12775 2002-04-22  Ravi Pratap  <ravi@ximian.com>
12776
12777         * expression.cs (Argument.Type): Ensure that we return the correct
12778         type when we have out or ref parameters [in which case we 
12779         append a "&"].
12780
12781 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
12782
12783         * class.cs (Property, Indexer): Allow extern modifier in there. 
12784
12785         * typemanager.cs (InitBaseTypes): Initializes object_type and
12786         value_type, since those will be used early on during the bootstrap
12787         process to compile corlib.
12788
12789         (InitCoreTypes): Move code from here to InitBaseTypes.
12790
12791 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
12792
12793         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
12794         single-dimension arrays as using the ldlen opcode.  
12795
12796         Daniel Lewis discovered this optimization.  
12797
12798         * typemanager.cs: Add signature for System.Array::get_Length
12799
12800 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12801
12802         * statement.cs: report the error when the foreach does not apply to an
12803         array nor a collection.
12804
12805 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
12806
12807         * expression.cs: Add implicit conversions to the operator ~.
12808
12809         * constant.cs (DecimalConstant.Emit): Emit decimal value.
12810
12811         * typemanager.cs: Locate the decimal constructor.
12812
12813 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12814
12815         * attribute.cs: use the new property of TypeOf.
12816         * expression.cs: added 'get' property around typearg.
12817
12818         These changes fix a build breaker reported by NickD. Is this the
12819         correct way to fix?  If not, please, revert my changes and make it
12820         work :-).
12821
12822 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
12823
12824         * attribute.cs: Add support for typeof in attribute invocations.
12825         I am not sure that this is right though.
12826
12827 2002-04-14  Duncan Mak  <duncan@ximian.com>
12828
12829         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
12830         Binary.Operator.Division case.
12831
12832 2002-04-13  Ravi Pratap  <ravi@ximian.com>
12833
12834         * class.cs (DefineType): Ensure that we do a proper check on
12835         attribute types and also register it with the TypeManager.
12836
12837         (TypeContainer.Targets): The default for attribute types is
12838         AttributeTargets.All.
12839
12840         * attribute.cs (ApplyAttributes): Registering the attribute type
12841         is done elsewhere, not when we discover we have a Usage attribute.
12842
12843 2002-04-12  Ravi Pratap  <ravi@ximian.com>
12844
12845         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
12846         and get rid of is_delegate parameter.
12847
12848         * everywhere : update.
12849
12850 2002-04-12  Ravi Pratap  <ravi@ximian.com>
12851
12852         * cs-parser.jay (compilation_unit): Revamp completely to use
12853         some new ideas that I got from Rhys' grammar to solve the problems
12854         with assembly level attributes.
12855
12856         (outer_declaration): New grammar production.
12857
12858         (attribute_sections): Add.
12859
12860         (opt_attributes): Base on attribute_sections
12861
12862         (namespace_declaration): Allow opt_attributes to tackle the case
12863         when we have assembly level attributes - we are clever in this
12864         regard now ;-)
12865
12866         * attribute.cs (ApplyAttributes): Do not worry about assembly 
12867         attributes in the non-global context.
12868
12869         * rootcontext.cs (AddGlobalAttributes): Go back to using this
12870         instead of SetGlobalAttributes.
12871
12872         * class.cs, rootcontext.cs : Ensure we define and generate 
12873         attribute types before anything else.
12874
12875         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
12876         and flag the new error -20 for the case when the attribute type
12877         does not have valid targets specified. csc does not catch this.
12878
12879         * ../errors/errors.txt : update for error # -20
12880
12881 2002-04-11  Ravi Pratap  <ravi@ximian.com>
12882
12883         * support.cs (InternalParameters.ParameterModifier): Do some null
12884         checking and return sane values.
12885
12886         * class.cs (Method.Define): If we are a PInvoke method, ensure
12887         that we are static and extern. Report error # 601
12888
12889         * ../errors/cs0601.cs : Add test case for the above error.
12890
12891 2002-04-07  Ravi Pratap  <ravi@ximian.com>
12892
12893         * rootcontext.cs (attribute_types): We need to keep type of
12894         all attribute types separately and emit code for them first.
12895
12896         (RegisterAttribute) : Implement.
12897
12898         * class.cs (DefineType): Check if the current Type is a custom
12899         attribute type and register it accordingly.
12900
12901         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
12902         adding the first attribute twice and rename to
12903
12904         (SetGlobalAttributes): this.
12905
12906         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
12907         lookups.
12908
12909         * attribute.cs (ApplyAttributes): Take an additional argument telling us
12910         if we are processing global arguments. Hmm, I am unsure of this.
12911
12912 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12913
12914         * expression.cs: added static array of strings to avoid calling
12915         Enum.ToString () for Operator in Binary. Significant recover of
12916         performance.
12917
12918 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
12919
12920         * class.cs (FindMembers): Allow the Builders of the various
12921         members to be null.  If they are skip them.  This only happens
12922         during the PInvoke declaration.
12923
12924 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
12925
12926         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
12927         failure, so we do not keep going afterwards.
12928
12929         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
12930         wanted to pass `false' as the `is_delegate' argument.  If this is
12931         the case, why not use delegate_type == null to mean `is_delegate =
12932         false' and anything else as is_delegate = true.
12933
12934 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
12935
12936         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
12937         code for the section, not the beginning of the tests.
12938
12939 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
12940
12941         * cfold.cs: Handle operator + (Enum x, Underlying x) 
12942
12943         * expression.cs (Binary): same.  Warn about errors where we have
12944         Enum/Enum in operator + as well.
12945
12946 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
12947
12948         * statement.cs:
12949                 - added support for switch(bool)
12950                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
12951                 - add TableSwitchEmit() to handle table-based switch statements
12952
12953 2002-04-05  Ravi Pratap  <ravi@ximian.com>
12954
12955         * expression.cs (Invocation.OverloadResolve): Factor out code which
12956         does parameter compatibility checking with arguments so that we can 
12957         re-use the code even from Delegate.VerifyApplicability
12958
12959         (VerifyArgumentsCompat): Move above code here.
12960
12961         * delegate.cs (VerifyApplicability): Get rid of duplicate code
12962         and instead make a call to the above method.
12963
12964 2002-03-31  Ravi Pratap  <ravi@ximian.com>
12965
12966         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
12967         We use it to keep track of classes which are attribute types.
12968
12969 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
12970
12971         * delegate.cs (Delegate.Define): Correctly define the types in the
12972         presence of fixed and array parameters.
12973
12974         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
12975         doing FindMembers.
12976
12977         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
12978         include NonPublic after the first iteration.
12979
12980         * class.cs (Indexer.CheckBase): Only check if both parents are
12981         non-null. 
12982
12983         * cs-parser.jay (accessor_body): If empty, set to null.
12984
12985         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
12986         same code path here to resolve constants names that we did have in
12987         MemberAccess.DoResolve.  There is too much code duplicated here.
12988
12989 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
12990
12991         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
12992
12993         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
12994         to MakeUnionSet.
12995
12996         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
12997         tokens, numbers and strings.
12998
12999         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
13000         parenthesis.
13001
13002         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
13003         asyncronous parameters and the regular parameters.  
13004
13005         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
13006         specify the target directory.
13007
13008         * expression.cs: (This.DoResolve): Simplify
13009         (As.Emit): Optimize, do not generate IsInst if the expression is
13010         always of the given type.
13011
13012         (Is.DoResolve): Bug fix, we were reporting both always/never for
13013         the is expression.
13014
13015         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
13016         creating too many unnecessary arrays.
13017
13018 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
13019
13020         * class.cs (EmitFieldInitializer): Use Assign expression to assign
13021         fields instead of rolling our own initializer.   Takes care of all
13022         implicit conversions, and drops unnecessary static checks/argument.
13023
13024 2002-03-31  Dick Porter  <dick@ximian.com>
13025
13026         * driver.cs: use the GetDirectories() return values properly, and
13027         use "/" as path separator.
13028
13029 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
13030
13031         * expression.cs (Unary): Optimize - - expr into expr.
13032         (Binary): Optimize a + (-b) into a -b.
13033
13034         * codegen.cs (CodeGen): Made all methods static.
13035
13036 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
13037
13038         * rootcontext.cs: 
13039
13040         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
13041         TypeBuilder property.
13042
13043         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
13044         instead. 
13045
13046         * tree.cs: Removed the various RecordXXXX, and replaced with a
13047         single RecordDecl.  Removed all the accessor methods, and just
13048         left a single access point Type 
13049
13050         * enum.cs: Rename DefineEnum to DefineType.
13051
13052         * decl.cs: New abstract method `DefineType' used to unify the
13053         Defines for Enumerations, Interfaces, TypeContainers and
13054         Delegates.
13055
13056         (FindType): Moved LookupInterfaceOrClass here.  Moved the
13057         LookupBaseClasses method that used to live in class.cs and
13058         interface.cs here, and renamed to FindType.
13059
13060         * delegate.cs: Implement DefineType.  Take advantage of the
13061         refactored pattern for locating the parent builder without taking
13062         the parent_builder argument (which we know does not work if we are
13063         nested, and triggering a toplevel definition).
13064
13065 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13066
13067         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
13068         accessibility of a member has changed during override and report
13069         an error if so.
13070
13071         * class.cs (Method.Define, Property.Define): Only complain on
13072         overrides if the method is private, any other accessibility is
13073         fine (and since we just checked the permission is the same, we are
13074         good to go).
13075
13076         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
13077         and elif are processed always.  The other pre-processing
13078         directives are only processed if we are "taking" the path
13079
13080 2002-03-29  Martin Baulig  <martin@gnome.org>
13081
13082         * class.cs (Method.Emit): Only emit symbolic debugging info if the
13083         current location is not Null.
13084
13085         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
13086         a separate method so we can profile it.
13087
13088         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
13089         `span.Seconds' are just seconds, but no minutes or hours.
13090         (MainDriver): Profile the CodeGen.SaveSymbols calls.
13091
13092 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13093
13094         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
13095         Remove the gratuitous set of Final:
13096
13097                                 // If an interface implementation, then we can set Final.
13098                                 if (((flags & MethodAttributes.Abstract) == 0) &&
13099                                     implementing.DeclaringType.IsInterface)
13100                                         flags |= MethodAttributes.Final;
13101
13102         I do not know what I was smoking when I used that.
13103
13104
13105         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
13106         step into fixing the name resolution issues for delegates and
13107         unifying the toplevel name resolution.
13108
13109 2002-03-28  Martin Baulig  <martin@gnome.org>
13110
13111         * class.cs (Method.Emit): If we have a symbol writer, call its
13112         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
13113         tell it about the current method.
13114
13115         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
13116         writer that we're going to emit the first byte of IL code for a new
13117         statement (a new source line).
13118         (EmitContext.EmitTopBlock): If we have a symbol writer, call
13119         EmitContext.Mark() before emitting any code.
13120
13121         * location.cs (SymbolDocument): Return null when we're Null.
13122
13123         * statement.cs (Statement): Moved the `Location loc' variable here.
13124         (Statement.EmitBoolExpression): If we have a symbol writer, call
13125         ec.Mark() before emitting any code to tell it that we're at the
13126         beginning of a new statement.
13127         (StatementExpression): Added `Location' argument to the constructor.
13128         (Block): Added public readonly variable `StartLocation' and public
13129         variable `EndLocation'.  The latter is to be set using SetEndLocation().
13130         (Block): Added constructor which takes a start and end location.
13131         (Block.SetEndLocation): New method. This sets the end location.
13132         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
13133         local variables we create.
13134         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
13135         each statement and do also mark the begin and end of the block.
13136
13137         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
13138         tell it the current lexer.Location, use Location.Null for the end of the
13139         block.
13140         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
13141         current block, set its end location using SetEndLocation().
13142         (statement_expression): StatementExpression constructor now takes the
13143         lexer.Location as additional argument.
13144         (for_statement, declare_local_variables): Likewise.
13145         (declare_local_variables): When creating a new implicit block, use the
13146         new Block constructor and pass it the lexer.Location.
13147
13148 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13149
13150         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
13151         members also on the parent interfaces recursively.
13152
13153 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
13154
13155         * report.cs: Use new formats, since Gonzalo finished the missing
13156         bits. 
13157
13158         * expression.cs (Binary.ResolveOperator): added missing operator|
13159         operator& and operator^ for bool/bool.
13160
13161         * cs-parser.jay: CheckDef now takes a Location argument that is
13162         used to report errors more precisly (instead of reporting the end
13163         of a definition, we try to track something which is a lot closer
13164         to the source of the problem).
13165
13166         * cs-tokenizer.cs: Track global token use, so we can properly flag
13167         the use of #define/#undef after the first token has been seen.
13168
13169         Also, rename the reportXXXX to Error_DescriptiveName
13170
13171         * decl.cs (DeclSpace.IsTopLevel): Move property here from
13172         TypeContainer, so that Enum and Interface can use this too.
13173
13174         * class.cs (TypeContainer.LookupInterfaceOrClass,
13175         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
13176         `builder' argument.  Typically this was used to pass the parent
13177         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
13178         the definition).  
13179
13180         The problem is that a nested class could trigger the definition of
13181         a toplevel class, and the builder would be obviously wrong in that
13182         case. 
13183
13184         So we drop this argument, and we compute dynamically the
13185         TypeBuilder/ModuleBuilder (the correct information was available
13186         to us anyways from DeclSpace.Parent)
13187
13188         * interface.cs (Interface.DefineInterface): Drop builder
13189         parameter cleanup like class.cs
13190
13191         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
13192         like class.cs
13193
13194         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
13195         values. 
13196
13197         (Try.Emit): Propagate the returns value from the statement.
13198
13199         (Return.Emit): Even if we are leavning 
13200
13201         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
13202
13203         * modifiers.cs: Fix the computation of MethodAttributes flags.
13204
13205 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
13206
13207         * driver.cs: allow compilation of files that start with '/'.
13208         Add a default case when checking the argument of --target.
13209
13210 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
13211
13212         * interface.cs: Implement the same search algorithm for types in
13213         the interface code.
13214
13215         * delegate.cs: Do not allow multiple definition.
13216
13217         * Recovered ChangeLog that got accidentally amputated
13218
13219         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
13220
13221         * rootcontext.cs: Load manually enum to allow core classes to
13222         contain enumerations.
13223
13224         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
13225         Update to new static methods in TypeManager.
13226
13227         * typemanager.cs (GetMethod, GetConstructor): Use our
13228         implementation of FindMembers to find the members, since during
13229         corlib compilation, the types are TypeBuilders and GetMethod and
13230         GetConstructor do not work.
13231
13232         Make all methods in TypeManager static.
13233
13234         (InitCodeHelpers): Split the functionality from
13235         the InitCodeTypes function.
13236
13237         * driver.cs: Call InitCodeHelpers after we have populated the
13238         types. 
13239
13240         * cs-parser.jay (delegate_declaration): we did not used to compute
13241         the delegate name correctly for void delegates.
13242
13243 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
13244
13245         * rootcontext.cs (RootContext): Init the interface_resolve_order
13246         and type_container_resolve_order always.
13247
13248         (ResolveCore, BootstrapCorlib_ResolveClass,
13249         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
13250         compiler when compiling with --nostdlib
13251
13252         * class.cs (TypeContainer.DefineType): Check that our parent is
13253         not null.  This test is most important when we are bootstraping
13254         the core types.
13255
13256         * codegen.cs: Split out the symbol writing code.
13257
13258 2002-03-25  Martin Baulig  <martin@gnome.org>
13259
13260         * driver.cs (-g): Made -g an alias for --debug.
13261
13262 2002-03-24  Martin Baulig  <martin@gnome.org>
13263
13264         * codegen.cs (SymbolWriter): New public variable. Returns the
13265         current symbol writer.
13266         (CodeGen): Added `bool want_debugging_support' argument to the
13267          constructor. If true, tell the ModuleBuild that we want debugging
13268         support and ask it for the ISymbolWriter.
13269         (Save): If we have a symbol writer, call it's Close() method after
13270         saving the assembly.
13271
13272         * driver.c (--debug): New command line argument to create a
13273         debugger information file.
13274
13275         * location.cs (SymbolDocument): New public property. Returns an
13276         ISymbolDocumentWriter object for the current source file or null
13277         if we don't have a symbol writer.
13278
13279 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
13280
13281         * driver.cs (LoadAssembly): Correctly return when all the paths
13282         have been tried and not before.
13283
13284         * statement.cs (Switch.Emit): return the actual coverage for this
13285         statement (returns/not-returns)
13286
13287         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
13288         switch of the statement if we are the last switch section.  That
13289         kills two problems: try/catch problems (we used to emit an empty
13290         nop at the end) and switch statements where all branches would
13291         return. 
13292
13293 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
13294
13295         * driver.cs: Add default assemblies (the equivalent to the
13296         Microsoft CSC.RSP file)
13297
13298         * cs-tokenizer.cs: When updating `cols and setting it to zero,
13299         also update tokens_seen and set it to false.
13300
13301         * driver.cs: Implement --recurse for Mike.
13302
13303         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
13304         correctly splitting out the paths.
13305
13306 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
13307
13308         * interface.cs (Interface.PopulateProperty): Instead of using
13309         `parent' as the declaration space for the set parameters, use
13310         `this' 
13311
13312         * support.cs (InternalParameters): InternalParameters constructor
13313         takes a DeclSpace instead of a TypeContainer.
13314
13315         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
13316         types are being initialized, load the address of it before calling
13317         the function.  
13318
13319         (New): Provide a mechanism to disable the generation of local
13320         value type temporaries when the caller will be providing us with
13321         an address to store it.
13322
13323         (ArrayCreation.EmitDynamicInitializers): Use it.
13324
13325 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
13326
13327         * expression.cs (Invocation.EmitArguments): Only probe for array
13328         property if there is more than one argument.  Sorry about that.
13329
13330         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
13331         empty param arrays.
13332
13333         * class.cs (Method.LabelParameters): Fix incorrect code path that
13334         prevented the `ParamArrayAttribute' from being applied to the
13335         params attribute.
13336
13337 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
13338
13339         * support.cs (ReflectionParameters): Correctly compute whether the
13340         last argument is a params array.  Fixes the problem with
13341         string.Split ('a')
13342
13343         * typemanager.cs: Make the assemblies array always be non-null
13344         (empty, but non-null)
13345
13346         * tree.cs (RecordDecl): New function that abstracts the recording
13347         of names.  This reports error 101, and provides a pointer to the
13348         previous declaration.  Fixes a crash in the compiler.
13349
13350         * cs-parser.jay (constructor_declaration): Update to new grammar,
13351         and provide a constructor_body that can be empty.
13352
13353 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
13354
13355         * driver.cs: Add support for --resources.
13356
13357         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
13358         Make all types for the various array helper methods be integer.
13359
13360         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
13361         CheckState to ConvCast.
13362
13363         (ConvCast): Now it takes a `checked' state argument, to avoid
13364         depending on the emit context for the conversion, and just using
13365         the resolve time setting.
13366
13367         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
13368         instead of Invocation.EmitArguments.  We do not emit the original
13369         arguments, instead we emit those which have been converted to
13370         unsigned int expressions.
13371
13372         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
13373
13374         * codegen.cs: ditto.
13375
13376         * expression.cs (LocalVariableReference): Drop the use of the
13377         Store function that depended on the variable index.
13378
13379         * statement.cs (VariableInfo): Drop the `Idx' property from this
13380         class, as this is not taking into account the indexes for
13381         temporaries tat we generate during the execution, getting the
13382         indexes wrong.
13383
13384         * class.cs: First emit class initializers, then call the parent
13385         constructor. 
13386
13387         * expression.cs (Binary): Fix opcode emision.
13388         (UnaryMutator.EmitCode): Support checked code generation
13389
13390         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
13391         matches for events for both the Static and Instance scans,
13392         pointing to the same element.   Fix that.
13393
13394 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
13395
13396         * rootcontext.cs (ResolveTree): Always set the
13397         interface_resolve_order, because nested interfaces will be calling
13398         into us.
13399
13400         * class.cs (GetInterfaceOrClass): Track the same resolution
13401         process used by TypeManager.LookupType.  This fixes the nested
13402         type lookups in class declarations (separate path from
13403         LookupType). 
13404
13405         (TypeContainer.DefineType): Also define nested interfaces.
13406         (TypeContainer.RegisterOrder): New public function used to
13407         register the order in which child interfaces need to be closed.
13408
13409         Nested interfaces need to be closed after their parents have been
13410         created. 
13411
13412         * interface.cs (InterfaceAttr): Put all the logic for computing
13413         the interface attribute here. 
13414
13415         (DefineInterface): Register our interface order with the
13416         RootContext or with the TypeContainer depending on the case.
13417
13418 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
13419
13420         * cs-parser.jay: rework foreach statement to work with the new
13421         changes to the policy on SimpleNames.
13422
13423         * report.cs: support Stacktrace on warnings as well.
13424
13425         * makefile: drop --unsafe and /unsafe from the compile.
13426
13427 2002-03-13  Ravi Pratap  <ravi@ximian.com>
13428
13429         * ecore.cs (StandardConversionExists): Modify to take an Expression
13430         as the first parameter. Ensure we do null -> reference type conversion
13431         checking.
13432
13433         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
13434         temporary Expression objects.
13435
13436 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
13437
13438         * interface.cs: workaround bug in method overloading resolution
13439         (there is already a bugzilla bug for it).
13440
13441 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
13442
13443         We could also solve this problem by having a separate path for
13444         performing type lookups, instead of DoResolve, we could have a
13445         ResolveType entry point, and only participating pieces of the
13446         production (simplename, deref, array) would implement this. 
13447
13448         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
13449         signal SimpleName to only resolve type names and not attempt to
13450         resolve anything else.
13451
13452         * expression.cs (Cast): Set the flag.
13453
13454         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
13455
13456         * class.cs: Only report 108 if there is no `new' modifier.
13457
13458         * cs-parser.jay: rework foreach statement to work with the new
13459         changes to the policy on SimpleNames.
13460
13461         * report.cs: support Stacktrace on warnings as well.
13462
13463         * makefile: drop --unsafe and /unsafe from the compile.
13464
13465 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
13466
13467         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
13468         lookups here, instead of doing that at parse time.  This means
13469         that our grammar will not introduce `LocalVariableReferences' as
13470         expressions at this point.  That solves the problem of code like
13471         this:
13472
13473         class X {
13474            static void Main ()
13475            { int X = 1;
13476             { X x = null }}}
13477
13478         This is only half the fix.  The full fix requires parameters to
13479         also be handled in this way.
13480
13481         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
13482         makes the use more obvious of the DeclSpace.  The
13483         ec.TypeContainer.TypeBuilder is now only used to pull the
13484         TypeBuilder for it.
13485
13486         My theory is that I can get rid of the TypeBuilder completely from
13487         the EmitContext, and have typecasts where it is used (from
13488         DeclSpace to where it matters).  
13489
13490         The only pending problem is that the code that implements Aliases
13491         is on TypeContainer, and probably should go in DeclSpace.
13492
13493         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
13494         lookups here, instead of doing that at parse time.  This means
13495         that our grammar will not introduce `LocalVariableReferences' as
13496         expressions at this point.  That solves the problem of code like
13497         this:
13498
13499         class X {
13500            static void Main ()
13501            { int X = 1;
13502             { X x = null }}}
13503
13504         This is only half the fix.  The full fix requires parameters to
13505         also be handled in this way.
13506
13507         * class.cs (Property.DefineMethod): When implementing an interface
13508         method, set newslot, when implementing an abstract method, do not
13509         set the flag (before we tried never setting it, or always setting
13510         it, which is the difference).
13511         (Indexer.DefineMethod): same.
13512         (Method.DefineMethod): same.
13513
13514         * ecore.cs: Only set the status used flag if we get back a Field.
13515
13516         * attribute.cs: Temporary hack, so Paolo can keep working.
13517
13518 2002-03-08  Ravi Pratap  <ravi@ximian.com>
13519
13520         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
13521         the unmanaged type in the case we have a MarshalAs attribute.
13522
13523         (Resolve): Handle the case when we are parsing the special MarshalAs
13524         attribute [we need to store the unmanaged type to use later]
13525
13526         * typemanager.cs (marshal_as_attr_type): Built in type for the 
13527         MarshalAs Attribute.
13528
13529         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
13530         on parameters and accordingly set the marshalling info.
13531
13532 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
13533
13534         * class.cs: Optimizing slightly by removing redundant code after
13535         we switched to the `NoTypes' return value.
13536         (Property.DefineMethod): use NoTypes here too.
13537
13538         This fixes the bug I introduced in my last batch of changes.
13539
13540 2002-03-05  Ravi Pratap  <ravi@ximian.com>
13541
13542         * tree.cs (RecordEnum): Add. We now keep track of enums too.
13543
13544         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
13545         Enums since those are types too. 
13546
13547         * cs-parser.jay (enum_declaration): Record enums as we parse them.
13548
13549         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
13550         thanks to a call during the lookup process.
13551
13552 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
13553
13554         * statement.cs (Foreach): Lots of work to accomodate a particular
13555         kind of foreach statement that I had not kept in mind.  It is
13556         possible to have foreachs on classes that provide a GetEnumerator
13557         method that return objects that implement the "pattern" for using
13558         a foreach, there is no need to support GetEnumerator
13559         specifically. 
13560
13561         This is needed to compile nant.
13562
13563         * decl.cs: Only report 114 if the member is not `Finalize' and if
13564         the warning level is at least 2.
13565
13566         * class.cs: Moved the compare function from Method to
13567         MethodSignature. 
13568
13569         (MethodSignature.InheritableMemberSignatureCompare): Add new
13570         filter function that is used to extract inheritable methods from a
13571         class. 
13572
13573         (Method.Define): Use the new `inheritable_method_signature_filter'
13574         delegate
13575
13576         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
13577         command. 
13578
13579 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
13580
13581         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
13582
13583         * cs-parser.jay: Add opt_semicolon to the interface declaration.
13584
13585         * expression.cs: Pass location information to
13586         ConvertImplicitStandard. 
13587
13588         * class.cs: Added debugging code to track return values from
13589         interfaces. 
13590
13591 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
13592
13593         * expression.cs (Is.DoResolve): If either side of the `is' is an
13594         interface, do not flag the warning.
13595
13596         * ecore.cs (ImplicitReferenceConversion): We need a separate test
13597         for interfaces
13598
13599         * report.cs: Allow for --fatal to be used with --probe.
13600
13601         * typemanager.cs (NoTypes): Move the definition for the empty Type
13602         array here. 
13603
13604         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
13605         properties. 
13606         (TypeContainer.DefineProxy): New function used to proxy to parent
13607         implementations when implementing interfaces.
13608         (TypeContainer.ParentImplements): used to lookup if our parent
13609         implements a public function that is required by an interface.
13610         (TypeContainer.VerifyPendingMethods): Hook this up.
13611
13612         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
13613         `modules' and `assemblies' arraylists into arrays.  We only grow
13614         these are the very early start up of the program, so this improves
13615         the speedof LookupType (nicely measured).
13616
13617         * expression.cs (MakeByteBlob): Replaced unsafe code with
13618         BitConverter, as suggested by Paolo.
13619
13620         * cfold.cs (ConstantFold.Binary): Special case: perform constant
13621         folding of string concatenation, but if either side is a string,
13622         and the other is not, then return null, and let the runtime use
13623         the concatenation on the string plus the object (using
13624         `Object.ToString'). 
13625
13626 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
13627
13628         Constant Folding has been implemented now.
13629
13630         * expression.cs (Unary.Reduce): Do not throw an exception, catch
13631         the error instead on types that are not supported in one's
13632         complement. 
13633
13634         * constant.cs (Constant and all children): New set of functions to
13635         perform implict and explicit conversions.
13636
13637         * ecore.cs (EnumConstant): Implement the new functions to perform
13638         conversion by proxying to the child expression.
13639
13640         * codegen.cs: (ConstantCheckState): Constant evaluation has its
13641         own separate setting that can not be turned off from the command
13642         line using --unchecked or --checked and is only controlled using
13643         the checked/unchecked statements and expressions.  This setting is
13644         used by the constant folder to flag errors.
13645
13646         * expression.cs (CheckedExpr, UncheckedExpr): Set the
13647         ConstantCheckState as well.   
13648
13649         During Resolve, they also have to flag the state, because the
13650         constant folder runs completely in the Resolve phase.
13651
13652         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
13653         well.
13654
13655 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
13656
13657         * cfold.cs: New file, this file contains the constant folder.
13658
13659         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
13660         argument to track whether we are using the resulting address to
13661         load or store a value and provide better error messages. 
13662
13663         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
13664         new AddressOf arguments.
13665
13666         * statement.cs (Foreach.EmitCollectionForeach): Update
13667
13668         * expression.cs (Argument.Emit): Call AddressOf with proper
13669         arguments to track usage.
13670
13671         (New.DoEmit): Call AddressOf with new arguments.
13672
13673         (Unary.Emit): Adjust AddressOf call.
13674
13675 2002-03-01  Ravi Pratap  <ravi@ximian.com>
13676
13677         * cs-parser.jay (member_access): Change the case for pre-defined types
13678         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
13679         this suggestion.
13680
13681         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
13682         a method body.
13683
13684         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
13685         essentially like methods and apply attributes like MethodImplOptions to them too.
13686
13687         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
13688         not being null.
13689
13690         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
13691         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
13692         is the DeclSpace.
13693
13694         * Update code everywhere accordingly.
13695
13696         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
13697
13698         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
13699
13700 2002-02-28  Ravi Pratap  <ravi@ximian.com>
13701
13702         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
13703         try performing lookups against those instead of jumping straight into using
13704         the 'using' clauses.
13705
13706         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
13707
13708         (LookupType): Perform lookups in implicit parents too.
13709
13710         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
13711         sequence as RootContext.LookupType. 
13712
13713         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
13714         the various cases of namespace lookups into this method.
13715
13716 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
13717
13718         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
13719         in positional arguments)
13720
13721         * class.cs (Operator): Update the AllowedModifiers to contain
13722         extern. 
13723
13724         * cs-parser.jay: Update operator declaration to allow for the
13725         operator body to be empty.
13726
13727         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
13728         values. 
13729
13730 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
13731
13732         * class.cs (Method.Emit): Label parameters.
13733
13734         * driver.cs: Return 1 or 0 as the program exit code.
13735
13736 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
13737
13738         * expression.cs: Special case the `null' object when trying to
13739         auto-compute the type, as anything can be explicitly converted to
13740         that. 
13741
13742         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
13743         spotting this Paolo.
13744
13745         (Expression.ImplicitNumericConversion): Perform comparissions of
13746         the type using the underlying type in the case of an enumeration
13747         rather than using the enumeration type for the compare.
13748
13749         Cope with the underlying == type case, which is not possible to
13750         catch before. 
13751
13752         (Expression.ConvertNumericExplicit): Perform comparissions of
13753         the type using the underlying type in the case of an enumeration
13754         rather than using the enumeration type for the compare.
13755
13756         * driver.cs: If the user does not supply an extension, assume .exe
13757
13758         * cs-parser.jay (if_statement): Rewrote so that we can track the
13759         location for the if statement.
13760
13761         * expression.cs (Binary.ConstantFold): Only concat strings when
13762         the operation is "+", not everything ;-)
13763
13764         * statement.cs (Statement.EmitBoolExpression): Take a location
13765         argument. 
13766         (If, While, Do): Track location.
13767
13768         * expression.cs (Binary.ResolveOperator): In the object + string
13769         case, I was missing a call to ConvertImplicit
13770
13771 2002-02-25  Ravi Pratap  <ravi@ximian.com>
13772
13773         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
13774         Location arguments. Ensure we use RootContext.LookupType to do our work
13775         and not try to do a direct Type.GetType and ModuleBuilder.GetType
13776
13777         * interface.cs (PopulateMethod): Handle the type of the parameter being
13778         null gracefully.
13779
13780         * expression.cs (Invocation.BetterFunction): Handle the case when we 
13781         have a params method with no fixed arguments and a call is made with no
13782         arguments.
13783
13784 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
13785
13786         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
13787         the verbatim-string-literal
13788
13789         * support.cs (InternalParameters.ParameterModifier): handle null
13790         fixed parameters.
13791         (InternalParameters.ParameterType): ditto.
13792
13793         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
13794         duplicating the name of the variable parameter.
13795         (GetParameterByName): Fix bug where we were not looking up array
13796         paramters if they were the only present (thanks Paolo!).
13797         (GetParameterInfo): We only have an empty set of types if both
13798         fixed and array are set to null.
13799         (GetParameterInfo-idx): Handle FixedParameter == null
13800
13801         * cs-parser.jay: Handle the case where there is no catch
13802         statements (missing null test).
13803
13804 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
13805
13806         * driver.cs (MainDriver): Be conservative on our command line
13807         handling.
13808
13809         Catch DirectoryNotFoundException when calling GetFiles.
13810
13811         (SplitPathAndPattern): Used to split the input specification into
13812         a path and a pattern that we can feed to Directory.GetFiles.
13813
13814 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
13815
13816         * statement.cs (Fixed): Implement the last case of the Fixed
13817         statement (string handling).
13818
13819         * expression.cs (StringPtr): New class used to return a char * to
13820         a string;  Used by the Fixed statement.
13821
13822         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
13823
13824         * expression.cs (Binary.ResolveOperator): Remove redundant
13825         MemberLookup pn parent type.
13826         Optimize union call, we do not need a union if the types are the same.
13827         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
13828         type.
13829
13830         Specialize the use of MemberLookup everywhere, instead of using
13831         the default settings. 
13832
13833         (StackAlloc): Implement stackalloc keyword.
13834
13835         * cs-parser.jay: Add rule to parse stackalloc.
13836
13837         * driver.cs: Handle /h, /help, /?
13838
13839         * expression.cs (MakeByteBlob): Removed the hacks we had in place
13840         before we supported unsafe code.
13841
13842         * makefile: add --unsafe to the self compilation of mcs.
13843
13844 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
13845
13846         * expression.cs (PointerArithmetic): New class that is used to
13847         perform pointer arithmetic.
13848         (Binary.Resolve): Handle pointer arithmetic
13849         Handle pointer comparission.
13850         (ArrayPtr): Utility expression class that is used to take the
13851         address of an array.
13852
13853         (ElementAccess): Implement array access for pointers
13854
13855         * statement.cs (Fixed): Implement fixed statement for arrays, we
13856         are missing one more case before we are done.
13857
13858         * expression.cs (Indirection): Implement EmitAssign and set the
13859         ExprClass to Variable.  This allows pointer dereferences to be
13860         treated as variables, and to have values assigned to them.
13861
13862         * ecore.cs (Expression.StoreFromPtr): New utility function to
13863         store values dereferencing.
13864
13865 2002-02-20  Ravi Pratap  <ravi@ximian.com>
13866
13867         * expression.cs (Binary.ResolveOperator): Ensure that we are
13868         not trying to operate on a void type - this fixes the reported
13869         bug.
13870
13871         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
13872         the parent implementation is sealed.
13873
13874         * ../errors/cs0239.cs : Add.
13875
13876         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
13877
13878         * typemanager.cs (unverifiable_code_type): Corresponds to 
13879         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
13880         which have unsafe code in them.
13881
13882         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
13883         unsafe context.
13884
13885 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
13886
13887         * cs-tokenizer.cs: Add support for @"litreal strings"
13888
13889         Make tokenizer accept pre-processor directives
13890         on any column (remove the old C-like limitation). 
13891
13892         * rootcontext.cs (EmitCode): Emit any global attributes.
13893         (AddGlobalAttributes): Used to keep track of assembly attributes. 
13894
13895         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
13896
13897         * cs-parser.jay: Add support for global attributes.  
13898
13899 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
13900
13901         * expression.cs (Indirection): New helper class.  Unary will
13902         create Indirection classes to be able to implement the
13903         IMemoryLocation interface on it.
13904
13905 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
13906
13907         * cs-parser.jay (fixed_statement): reference the right statement.
13908
13909         * statement.cs (Fixed.Emit): Finish implementing the fixed
13910         statement for the &x case.
13911
13912 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
13913
13914         * class.cs (Property.Define, Method.Define): Remove newslot when
13915         `implementing'.  
13916
13917         * modifiers.cs: My use of NewSlot when `Abstract' was set was
13918         wrong.  NewSlot should only be used if the `new' keyword is present.
13919
13920         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
13921         locating our system dir.  Sorry about this.
13922
13923 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
13924
13925         * driver.cs (GetSystemDir): Compute correctly the location of our
13926         system assemblies.  I was using the compiler directory instead of
13927         the library directory.
13928
13929 2002-02-13  Ravi Pratap  <ravi@ximian.com>
13930
13931         * expression.cs (BetterFunction): Put back in what Miguel commented out
13932         since it is the correct fix. The problem is elsewhere ;-)
13933
13934         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
13935         parameters of the parms method are themselves compatible or not !
13936
13937         (StandardConversionExists): Fix very dangerous bug where we were forgetting
13938         to check that a class implements an interface before saying that an implicit
13939         conversion was allowed. Use ImplementsInterface to do the checking.
13940
13941 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
13942
13943         * class.cs (Method.Define): Track whether we are an explicit
13944         implementation or not.  And only call DefineMethodOverride if we
13945         are an explicit implementation.
13946
13947         (Property.DefineMethod): Ditto.
13948
13949 2002-02-11  Ravi Pratap  <ravi@ximian.com>
13950
13951         * expression.cs (BetterFunction): Catch hideous bug which was
13952          preventing us from detecting ambiguous calls due to implicit casts i.e
13953         cs0121.
13954
13955 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * support.cs (Pair): Remove un-needed method.  I figured why I was
13958         getting the error in cs-parser.jay, the variable in a foreach loop
13959         is readonly, and the compiler does not really treat this as a variable.
13960
13961         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
13962         instead of EQUALS in grammar.  
13963
13964         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
13965
13966         * expression.cs (Unary.DoResolve): Check whether the argument is
13967         managed or not.
13968
13969 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
13970
13971         * support.cs: Api for Pair to set a value.  Despite the fact that
13972         the variables are public the MS C# compiler refuses to compile
13973         code that accesses the field if the variable is part of a foreach
13974         statement. 
13975
13976         * statement.cs (Fixed): Begin implementation of the fixed
13977         statement.
13978
13979         (Block.AddVariable): Return the VariableInfo on success and null
13980         on failure instead of true/false. 
13981
13982         * cs-parser.jay (foreach): Catch errors on variables already
13983         defined (we were ignoring this value before) and properly unwind
13984         the block hierarchy
13985
13986         (fixed_statement): grammar for the fixed statement.
13987
13988 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
13989
13990         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
13991         pointer types to be incretemented.
13992
13993         (SizeOf): Implement.
13994
13995         * cs-parser.jay (pointer_member_access): Implement
13996         expr->IDENTIFIER production.
13997
13998         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
13999         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
14000         on safe contexts.
14001
14002         (Unary): Implement indirection.
14003
14004         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
14005         use in non-unsafe context).
14006
14007         (SimpleName.DoResolve): Check for pointers in field access on safe
14008         contexts. 
14009
14010         (Expression.LoadFromPtr): Factor the load-indirect code in this
14011         function.  This was duplicated in UnboxCast and ParameterReference
14012
14013 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
14014
14015         * expression.cs (ComposedCast): report an error if a pointer cast
14016         is used in a safe region.
14017
14018         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
14019         pointer type casts in unsafe context.
14020
14021         * codegen.cs (EmitContext): Set up IsUnsafe.
14022
14023         * cs-parser.jay (non_expression_type): Add productions for pointer
14024         casts. 
14025
14026         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
14027         code.  We should not use force into static mode if the method is
14028         not virtual.  Fixes bug in MIS
14029
14030         * statement.cs (Do.Emit, While.Emit, For.Emit,
14031         Statement.EmitBoolExpression): Add support to Do and While to
14032         propagate infinite loop as `I do return' semantics.
14033
14034         Improve the For case to also test for boolean constants.
14035
14036         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
14037         to the list of attributes we can add.
14038
14039         Remove `EmitContext' argument.
14040
14041         * class.cs (Method.Define): Apply parameter attributes.
14042         (Constructor.Define): Apply parameter attributes.
14043         (MethodCore.LabelParameters): Move here the core of labeling
14044         parameters. 
14045
14046         * support.cs (ReflectionParameters.ParameterModifier,
14047         InternalParameters.ParameterModifier): Use IsByRef on the type and
14048         only return the OUT bit for these parameters instead of in/out/ref
14049         flags.
14050
14051         This is because I miss-understood things.  The ParameterInfo.IsIn
14052         and IsOut represent whether the parameter has the [In] and [Out]
14053         attributes set.  
14054
14055 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
14056
14057         * ecore.cs (FieldExpr.Emit): Release temporaries.
14058
14059         * assign.cs (LocalTemporary.Release): new function.
14060
14061         * codegen.cs (EmitContext.GetTemporaryStorage,
14062         EmitContext.FreeTemporaryStorage): Rework the way we deal with
14063         temporary storage.  Now we can "put back" localbuilders when we
14064         are done with them
14065
14066 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
14067
14068         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
14069         need to make a copy of the variable to generate verifiable code.
14070
14071 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
14072
14073         * driver.cs: Compute dynamically the system directory.
14074
14075         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
14076         Slower, but more generally useful.  Used by the abstract
14077         registering implementation. 
14078
14079         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
14080         the rules for the special rule on Type/instances.  First check if
14081         we have the same name, and if so, try that special static path
14082         rather than the instance path.
14083
14084 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
14085
14086         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
14087         for, while and if.
14088
14089         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
14090         Enum, ValueType, Delegate or Array for non-corlib compiles.
14091
14092         * cs-tokenizer.cs: Catch long identifiers (645)
14093
14094         * typemanager.cs (IndexerPropetyName): Ravi never tested this
14095         piece of code.
14096
14097         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
14098         fix, we were returning too early, so we were not registering
14099         pending methods from abstract classes.
14100
14101         Do not register pending methods if the class is abstract.
14102
14103         * expression.cs (Conditional.DoResolve): Report circular implicit
14104         conversions when we neecd to compute it for conditional
14105         expressions. 
14106
14107         (Is.DoResolve): If the expression is always of the provided type,
14108         flag warning 183.  If the expression can not ever be of the
14109         provided type flag warning 184.
14110
14111         * class.cs: Catch 169 as well.
14112
14113         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
14114         read. 
14115
14116 2002-01-18  Nick Drochak  <ndrochak@gol.com>
14117
14118         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
14119
14120 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
14121
14122         * interface.cs: (PopulateMethod): Check for pointers being defined
14123         only if the unsafe context is active.
14124         (PopulateProperty): ditto.
14125         (PopulateIndexer): ditto.
14126
14127         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
14128         specified.  If pointers are present, make sure that they are
14129         present in an unsafe context.
14130         (Constructor, Constructor.Define): ditto.
14131         (Field, Field.Define): ditto.
14132         (Property, Property.Define): ditto.
14133         (Event, Event.Define): ditto.
14134
14135         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
14136         hashtable if there are classes or structs defined.
14137
14138         * expression.cs (LocalVariableReference.DoResolve): Simplify this
14139         code, as the constant resolution moved.
14140
14141         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
14142         the metadata, so we can flag error 133. 
14143
14144         * decl.cs (MemberCore.UnsafeOK): New function to test that a
14145         pointer is being declared in an unsafe context.
14146
14147 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
14148
14149         * modifiers.cs (Modifiers.Check): Require a Location argument.
14150         Report error 227 for Unsafe use.
14151
14152         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
14153
14154         * statement.cs (For.Emit): If the test is null, then report that
14155         we do `return', as we wont reach anything afterwards.
14156
14157         (Switch.SwitchGoverningType): Track the expression that matched
14158         the conversion.
14159
14160         * driver.cs: Allow negative numbers as an error code to flag.
14161
14162         * cs-parser.jay: Handle 1551.
14163
14164         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
14165
14166 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14167
14168         * cs-parser.jay: Report 1518 (type declaration can only contain
14169         class, struct, interface, enum or delegate)
14170
14171         (switch_label): Report 1523 (keywords `case' or `default' must
14172         preced code)
14173
14174         (opt_switch_sections): Report 1522 (empty switch)
14175
14176         * driver.cs: Report 1515 (response file specified multiple times)
14177         Report 1516 (Source file specified multiple times).
14178
14179         * expression.cs (Argument.Resolve): Signal 1510
14180
14181         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
14182         access not allowed in static code)
14183
14184 2002-01-11  Ravi Pratap  <ravi@ximian.com>
14185
14186         * typemanager.cs (IsPointerType): Utility method which we are going
14187         to need a lot.
14188
14189         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
14190         the object type, so we take care of that.
14191
14192         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
14193
14194         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
14195         added to non-params parameters :-)
14196
14197         * typemanager.cs (CSharpName): Include 'void' type too. 
14198
14199         (void_ptr_type): Include in the set of core types.
14200
14201         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
14202         duplicating code.
14203
14204         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
14205         an unsafe context.
14206
14207         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
14208         completely forgotten about it.
14209
14210 2002-01-10  Ravi Pratap  <ravi@ximian.com>
14211
14212         * cs-parser.jay (pointer_type): Add. This begins our implementation
14213         of parsing rules for unsafe code.
14214
14215         (unsafe_statement): Implement.
14216
14217         (embedded_statement): Modify to include the above.
14218
14219         * statement.cs (Unsafe): Implement new class for unsafe blocks.
14220
14221         * codegen.cs (EmitContext.InUnsafe): Add. This determines
14222         if the current context is an unsafe one.
14223
14224         * cs-parser.jay (local_variable_pointer_type): Since local variable types
14225         are handled differently, we need separate rules for them.
14226
14227         (local_variable_declaration): Update to use local_variable_pointer_type
14228         to allow variable declarations of unmanaged pointer types.
14229
14230         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
14231         in unsafe contexts.
14232
14233         * ../errors/cs0214.cs : Add.
14234
14235 2002-01-16  Nick Drochak  <ndrochak@gol.com>
14236
14237         * makefile: remove 'response' file when cleaning.
14238
14239 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14240
14241         * cs-parser.jay: Report 1524.
14242
14243 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
14244
14245         * typemanager.cs (RegisterMethod): drop checking if we have
14246         registered this from here
14247
14248 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
14249
14250         * class.cs (Method.EmitDestructor): Implement calling our base
14251         destructor. 
14252
14253         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
14254         value of InFinally.
14255
14256         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
14257         this routine and will wrap the call in a try/catch block.  Deal
14258         with the case.
14259
14260 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
14261
14262         * ecore.cs (Expression.MemberLookup): instead of taking a
14263         parameter `same_type' that was used to tell whether we could
14264         access private members we compute our containing type from the
14265         EmitContext.
14266
14267         (FieldExpr): Added partial support for volatile fields.  This does
14268         not work for volatile fields exposed from assemblies, as I can not
14269         figure out how to extract the modreq from it.
14270
14271         Updated all the source files to use this.
14272
14273         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
14274         because it is referenced by MemberLookup very often. 
14275
14276 2002-01-09  Ravi Pratap  <ravi@ximian.com>
14277
14278         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
14279         TypeBuilder.GetCustomAttributes to retrieve what we need.
14280
14281         Get rid of redundant default_member_attr_type as this is the same as
14282         default_member_type which already exists.
14283
14284         * interface.cs, attribute.cs : Update accordingly.
14285
14286 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
14287
14288         * typemanager.cs: Enable IndexerPropertyName again.  It does not
14289         work for TYpeBuilders though.  Ravi, can you please fix this?
14290
14291         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
14292
14293         * expression.cs (Argument.Emit): Handle the case of ref objects
14294         being passed to ref functions;  
14295
14296         (ParameterReference.EmitLoad): Loads the content of the pointer
14297         without dereferencing.
14298
14299 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14300
14301         * cs-tokenizer.cs: Implemented the pre-processing expressions.
14302
14303 2002-01-08  Ravi Pratap  <ravi@ximian.com>
14304
14305         * class.cs (Indexer.DefineMethod): Incorporate the interface
14306         type in the name of the method if we are doing explicit interface
14307         implementation.
14308
14309         * expression.cs (ConversionExists): Remove as it is completely obsolete.
14310
14311         (BetterConversion): Fix extremely trivial bug where we were referring to
14312         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
14313         again !
14314
14315         * ../errors/bug16.cs : Add although we have fixed it.
14316
14317 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14318
14319         * expression.cs (BaseIndexer): Begin implementation.
14320
14321         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
14322
14323         * cs-parser.jay (indexer_declarator): Use qualified_identifier
14324         production directly to remove a shift/reduce, and implement
14325         explicit interface implementation.
14326
14327         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
14328         after a floating point suffix.
14329
14330         * expression.cs (DoNumericPromotions): Improved the conversion for
14331         uint/uint.  If we have a constant, we avoid doing a typecast to a
14332         larger type.
14333
14334         * class.cs (Indexer): Implement explicit interface implementation
14335         for indexers.
14336
14337 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
14338
14339         * class.cs: make the default instance constructor public and hidebysig.
14340
14341 2001-01-03  Ravi Pratap  <ravi@ximian.com>
14342
14343         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
14344         so we can call it from elsewhere.
14345
14346         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
14347         we emit it internally if the class has a defined indexer; otherwise the user
14348         emits it by decorating the class definition with the DefaultMemberAttribute.
14349
14350         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
14351         attribute is not used on a type which defines an indexer.
14352
14353         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
14354         character when we skip whitespace.
14355
14356         * ../errors/cs0646.cs : Add.
14357
14358 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
14359
14360         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
14361         again. 
14362
14363         * makefile: Add practical target `mcs3.exe' which builds the third
14364         generation compiler. 
14365
14366         * expression.cs (New): Fix structures constructor calling.
14367
14368         * class.cs (Property, Method, Indexer): Emit Final flag on the
14369         method if we are an interface implementation and we are not
14370         abstract. 
14371
14372         * ecore.cs (PropertyExpr): New public field `IsBase', tells
14373         whether this property is referencing a `base' method.
14374
14375         * expression.cs (Invocation.EmitCall): take an extra argument:
14376         is_base, this is used to determine whether the `call' or
14377         `callvirt' opcode should be used.
14378
14379
14380         * delegate.cs: update EmitCall.
14381
14382         * class.cs (Method.Define): Set NewSlot for the cases where we are
14383         not implementing an interface method.
14384
14385         (Property.Define): ditto.
14386
14387 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
14388
14389         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
14390         'r'.  Allows mcs to parse itself fully.
14391
14392 2002-01-02  Ravi Pratap  <ravi@ximian.com>
14393
14394         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
14395         of the number of initializers that require the InitializeArray method.
14396
14397         (CheckIndices): Store the Expression in all cases - not the plain value. Also
14398         update the above field where necessary.
14399
14400         (MakeByteBlob): Update accordingly.
14401
14402         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
14403         greater than 2.
14404
14405         (EmitDynamicInitializers): Update in accordance with the new optimization.
14406
14407         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
14408         same OpCode applies.
14409
14410         * cs-parser.jay : Fix some glaring errors I introduced.
14411
14412 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
14413
14414         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
14415         so that we can check for name clashes there too.
14416
14417         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
14418         for interface indexers.
14419
14420         * interfaces.cs (Define): Emit the default member attribute.
14421
14422         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
14423         variable was being referred to while setting the value ;-)
14424
14425 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
14426
14427         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
14428         byte-by-byte information when we know the data is zero.
14429
14430         Make the block always a multiple of 4, because
14431         DefineInitializedData has a bug.
14432
14433         * assign.cs: Fix, we should assign from the temporary, not from
14434         the source. 
14435
14436         * expression.cs (MakeByteBlob): Fix my incorrect code.
14437
14438 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
14439
14440         * typemanager.cs (EnumToUnderlying): This function is used to get
14441         the underlying type from an enumeration, because it does not
14442         always work. 
14443
14444         * constant.cs: Use the I4_S form for values between -128 and 127.
14445
14446         * statement.cs (Block.LookupLabel): Looks up a label.
14447         (Block): Drop support for labeled blocks.
14448
14449         (LabeledStatement): New kind of statement that represents a label
14450         only.
14451
14452         (Goto): Finally implement this bad boy.
14453
14454         * cs-parser.jay: Update to reflect new mechanism to implement
14455         labels.
14456
14457 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
14458
14459         * codegen.cs (EmitContext.This): a codegen property that keeps the
14460         a single instance of this instead of creating many different this
14461         instances. 
14462
14463         * delegate.cs (Delegate.DoResolve): Update to use the property;
14464
14465         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
14466
14467         * expression.cs (BaseAccess.DoResolve): Ditto.
14468
14469 2001-12-29  Ravi Pratap  <ravi@ximian.com>
14470
14471         * typemanager.cs (methodimpl_attr_type): Add to hold the type
14472         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
14473
14474         (InitCoreTypes): Update accordingly.
14475
14476         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
14477         so we can quickly store the state.
14478
14479         (ApplyAttributes): Set the correct implementation flags
14480         for InternalCall methods.
14481
14482 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
14483
14484         * expression.cs (EmitCall): if a method is not virtual, then do
14485         not use callvirt on it.
14486
14487         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
14488         user defined stuff) requires the use of stobj, which takes an
14489         address on the stack instead of an array and an index.  So emit
14490         the Ldelema operation for it.
14491
14492         (EmitStoreOpcode): Use stobj for valuetypes.
14493
14494         (UnaryMutator.EmitCode): Use the right 1 value depending on
14495         whether we are dealing with int64/uint64, float or doubles.
14496
14497         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
14498         constructors that I implemented last night.
14499
14500         (Constructor.IsDefault): Fix to work properly for static
14501         constructors.
14502
14503         * cs-parser.jay (CheckDef): report method signature errors.
14504         Update error number 103 to be 132.
14505
14506         * decl.cs: New AdditionResult enumeration value: MethodExists.
14507         Although we do this check for methods later on in the semantic
14508         analysis, catching repeated default constructors is so easy that
14509         we catch these here. 
14510
14511         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
14512         promotions code.
14513
14514         (ParameterReference.EmitAssign, Emit): handle
14515         bools as bytes.
14516
14517         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
14518         (ArrayAccess.EmitStoreOpcode): ditto.
14519
14520         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
14521
14522         * expression.cs (MakeByteBlob): Complete all the missing types
14523         (uint, short, ushort, byte, sbyte)
14524
14525         * class.cs: Only init instance field initializers on instance
14526         constructors. 
14527
14528         Rename `constructors' to instance_constructors. 
14529
14530         (TypeContainer.AddConstructor): Only add constructors to the list
14531         if it is not static.
14532
14533         Make sure that we handle default_static_constructor independently
14534         everywhere where we handle instance_constructors
14535
14536 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
14537
14538         * class.cs: Do not lookup or create a base initializer for a
14539         static constructor.
14540
14541         (ConstructorInitializer.Resolve): use the proper type to lookup
14542         for constructors.
14543
14544         * cs-parser.jay: Report error 1585 (modifiers between type and name).
14545
14546         * enum.cs, interface.cs: Remove CloseType, this is taken care by
14547         in DeclSpace. 
14548
14549         * decl.cs: CloseType is now an virtual method, the default
14550         implementation just closes this type.
14551
14552 2001-12-28  Ravi Pratap  <ravi@ximian.com>
14553
14554         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
14555         to PreserveSig by default. Also emit HideBySig on such methods.
14556
14557         Basically, set the defaults to standard values.
14558
14559         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
14560         argument, if candidate is better, it can't be worse than the best !
14561
14562         (Invocation): Re-write bits to differentiate between methods being
14563         applicable in their expanded form and their normal form - for params
14564         methods of course.
14565
14566         Get rid of use_standard everywhere as only standard conversions are allowed
14567         in overload resolution. 
14568
14569         More spec conformance.
14570
14571 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
14572
14573         * driver.cs: Add --timestamp, to see where the compiler spends
14574         most of its time.
14575
14576         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
14577         `this' in static code.
14578
14579         (SimpleName.DoResolve): Implement in terms of a helper function
14580         that allows static-references to be passed upstream to
14581         MemberAccess.
14582
14583         (Expression.ResolveWithSimpleName): Resolve specially simple
14584         names when called by MemberAccess to implement the special
14585         semantics. 
14586
14587         (Expression.ImplicitReferenceConversion): Handle conversions from
14588         Null to reference types before others, as Null's type is
14589         System.Object. 
14590
14591         * expression.cs (Invocation.EmitCall): Handle the special case of
14592         calling methods declared on a reference type from a ValueType
14593         (Base classes System.Object and System.Enum)
14594
14595         (MemberAccess.Resolve): Only perform lookups on Enumerations if
14596         the left hand side is a TypeExpr, not on every enumeration. 
14597
14598         (Binary.Resolve): If types are reference types, then do a cast to
14599         object on operators != and == of both arguments.
14600
14601         * typemanager.cs (FindMembers): Extract instance and static
14602         members if requested.
14603
14604         * interface.cs (PopulateProperty): Use void_type instead of null
14605         as the return type for the setter method.
14606
14607         (PopulateIndexer): ditto.
14608
14609 2001-12-27  Ravi Pratap  <ravi@ximian.com>
14610
14611         * support.cs (ReflectionParameters): Fix minor bug where we
14612         were examining the wrong parameter for the ParamArray attribute.
14613
14614         Cope with requests for the type of the parameter at position
14615         greater than the params parameter's. We now return the element
14616         type of the params array as that makes more sense.
14617
14618         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
14619         accordingly as we no longer have to extract the element type
14620         ourselves.
14621
14622         (Invocation.OverloadResolve): Update.
14623
14624 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
14625
14626         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
14627         against IEnumerator, test whether the return value is a descendant
14628         of the IEnumerator interface.
14629
14630         * class.cs (Indexer.Define): Use an auxiliary method to implement
14631         the other bits of the method definition.  Begin support for
14632         explicit interface implementation.
14633
14634         (Property.DefineMethod): Use TypeManager.void_type instead of null
14635         for an empty return value.
14636
14637 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
14638
14639         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
14640         dealing with a FieldExpr which is composed of a FieldBuilder, in
14641         the code path we did extract the constant, but we should have
14642         obtained the underlying value to be able to cast it (otherwise we
14643         end up in an infinite loop, this is what Ravi was running into).
14644
14645         (ArrayCreation.UpdateIndices): Arrays might be empty.
14646
14647         (MemberAccess.ResolveMemberAccess): Add support for section
14648         14.5.4.1 that deals with the special case of E.I when E is a type
14649         and something else, that I can be a reference to a static member.
14650
14651         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
14652         handle a particular array type to create byte blobs, it is just
14653         something we dont generate byteblobs for.
14654
14655         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
14656         arguments. 
14657
14658         * location.cs (Push): remove the key from the hashtable that we
14659         are about to add.   This happens for empty files.
14660
14661         * driver.cs: Dispose files after we have parsed them.
14662
14663         (tokenize): new function that only runs the tokenizer on its
14664         input, for speed testing.
14665
14666 2001-12-26  Ravi Pratap  <ravi@ximian.com>
14667
14668         * class.cs (Event.Define): Define the private field only if there
14669         are no accessors defined.
14670
14671         * expression.cs (ResolveMemberAccess): If there is no associated
14672         field with the event, that means we have an event defined with its
14673         own accessors and we should flag error cs0070 since transforming
14674         ourselves into a field is not valid in that case.
14675
14676         * ecore.cs (SimpleName.DoResolve): Same as above.
14677
14678         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
14679         and charset to sane values.
14680
14681 2001-12-25  Ravi Pratap  <ravi@ximian.com>
14682
14683         * assign.cs (DoResolve): Perform check on events only if they 
14684         are being accessed outside the declaring type.
14685
14686         * cs-parser.jay (event_declarations): Update rules to correctly
14687         set the type of the implicit parameter etc.
14688
14689         (add_accessor, remove_accessor): Set current local parameters.
14690
14691         * expression.cs (Binary): For delegate addition and subtraction,
14692         cast the return value from the method into the appropriate delegate
14693         type.
14694
14695 2001-12-24  Ravi Pratap  <ravi@ximian.com>
14696
14697         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
14698         of these as the workaround is unnecessary.
14699
14700         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
14701         delegate data - none of that is needed at all.
14702
14703         Re-write bits to extract the instance expression and the delegate method
14704         correctly.
14705
14706         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
14707         on delegates too.
14708
14709         * attribute.cs (ApplyAttributes): New method to take care of common tasks
14710         of attaching attributes instead of duplicating code everywhere.
14711
14712         * everywhere : Update code to do attribute emission using the above method.
14713
14714 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
14715
14716         * expression.cs (IsParamsMethodApplicable): if there are not
14717         parameters, return immediately.
14718
14719         * ecore.cs: The 0 literal can be implicity converted to an enum
14720         type. 
14721
14722         (SimpleName.DoResolve): First lookup the type, then lookup the
14723         members. 
14724
14725         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
14726         want to get its address.  If the InstanceExpression is not
14727         addressable, store the result in a temporary variable, then get
14728         the address of it.
14729
14730         * codegen.cs: Only display 219 errors on warning level or above. 
14731
14732         * expression.cs (ArrayAccess): Make it implement the
14733         IMemoryLocation interface.
14734
14735         (Binary.DoResolve): handle the operator == (object a, object b)
14736         and operator != (object a, object b) without incurring into a
14737         BoxedCast (because 5 != o should never be performed).
14738
14739         Handle binary enumerator operators.
14740
14741         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
14742         value type, otherwise use Ldelem_ref.
14743
14744         Use precomputed names;
14745
14746         (AddressOf): Implement address of
14747
14748         * cs-parser.jay (labeled_statement): Fix recursive block
14749         addition by reworking the production.
14750
14751         * expression.cs (New.DoEmit): New has a special case:
14752                 
14753                  If we are dealing with a ValueType, we have a few
14754                  situations to deal with:
14755                 
14756                     * The target of New is a ValueType variable, that is
14757                       easy, we just pass this as the variable reference
14758                 
14759                     * The target of New is being passed as an argument,
14760                       to a boxing operation or a function that takes a
14761                       ValueType.
14762                 
14763                       In this case, we need to create a temporary variable
14764                       that is the argument of New.
14765
14766
14767 2001-12-23  Ravi Pratap  <ravi@ximian.com>
14768
14769         * rootcontext.cs (LookupType): Check that current_type is not null before
14770         going about looking at nested types.
14771
14772         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
14773         not implement the IAssignMethod interface any more.
14774
14775         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
14776         where we tranform them into FieldExprs if they are being resolved from within
14777         the declaring type.
14778
14779         * ecore.cs (SimpleName.DoResolve): Do the same here.
14780
14781         * assign.cs (DoResolve, Emit): Clean up code considerably. 
14782
14783         * ../errors/bug10.cs : Add.
14784
14785         * ../errors/cs0070.cs : Add.
14786
14787         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
14788
14789         * assign.cs : Get rid of EventIsLocal everywhere.
14790
14791 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
14792
14793         * ecore.cs (ConvertIntLiteral): finished the implementation.
14794
14795         * statement.cs (SwitchLabel): Convert the value we are using as a
14796         key before looking up the table.
14797
14798 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
14799
14800         * codegen.cs (EmitTopBlock): Require a Location argument now.
14801
14802         * cs-parser.jay (constructor_declarator): We need to setup
14803         current_local_parameters before we parse the
14804         opt_constructor_initializer, to allow the variables to be bound
14805         to the constructor arguments.
14806
14807         * rootcontext.cs (LookupType): First lookup nested classes in our
14808         class and our parents before we go looking outside our class.
14809
14810         * expression.cs (ConstantFold): Extract/debox the values at the
14811         beginnning. 
14812
14813         * rootcontext.cs (EmitCode): Resolve the constants first before we
14814         resolve the types.  This is not really needed, but it helps debugging.
14815
14816         * statement.cs: report location.
14817
14818         * cs-parser.jay: pass location to throw statement.
14819
14820         * driver.cs: Small bug fix.
14821
14822         * report.cs: Updated format to be 4-zero filled digits.
14823
14824 2001-12-22  Ravi Pratap  <ravi@ximian.com>
14825
14826         * expression.cs (CheckIndices): Fix minor bug where the wrong
14827         variable was being referred to ;-)
14828
14829         (DoEmit): Do not call EmitStaticInitializers when the 
14830         underlying type is System.Object.
14831
14832 2001-12-21  Ravi Pratap  <ravi@ximian.com>
14833
14834         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
14835         and do the usual workaround for SRE.
14836
14837         * class.cs (MyEventBuilder.EventType): New member to get at the type
14838         of the event, quickly.
14839
14840         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
14841
14842         * assign.cs (Assign.DoResolve): Handle the case when the target
14843         is an EventExpr and perform the necessary checks.
14844
14845         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
14846         interface.
14847
14848         (SimpleName.MemberStaticCheck): Include check for EventExpr.
14849
14850         (EventExpr): Set the type in the constructor itself since we 
14851         are meant to be born fully resolved.
14852
14853         (EventExpr.Define): Revert code I wrote earlier.
14854                 
14855         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
14856         instance expression is null. The instance expression is a This in that case
14857         or a null, depending on whether it is a static method or not.
14858
14859         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
14860         refers to more than one method.
14861
14862         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
14863         and accordingly flag errors.
14864
14865 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
14866
14867         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
14868
14869 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
14870
14871         * location.cs (ToString): Provide useful rutine.
14872
14873 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
14874
14875         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
14876         objects, return the actual integral boxed.
14877
14878         * statement.cs (SwitchLabel): define an ILLabel for each
14879         SwitchLabel. 
14880
14881         (Switch.CheckSwitch): If the value is a Literal, extract
14882         the underlying literal.
14883
14884         Also in the unused hashtable we had, add the SwitchLabel so we can
14885         quickly look this value up.
14886
14887         * constant.cs: Implement a bunch of new constants.  Rewrite
14888         Literal based on this.  Made changes everywhere to adapt to this.
14889
14890         * expression.cs (Expression.MakeByteBlob): Optimize routine by
14891         dereferencing array only once, and also copes with enumrations.
14892
14893         bytes are two bytes wide, not one.
14894
14895         (Cast): Perform constant conversions.
14896
14897         * ecore.cs (TryImplicitIntConversion): Return literals instead of
14898         wrappers to the literals here.
14899
14900         * expression.cs (DoNumericPromotions): long literals can converted
14901         to ulong implicity (this is taken care of elsewhere, but I was
14902         missing this spot).
14903
14904         * ecore.cs (Expression.Literalize): Make the return type Literal,
14905         to improve type checking.
14906
14907         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
14908
14909 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
14910
14911         * literal.cs: Revert code from ravi that checked the bounds.  The
14912         bounds are sane by the definition of the type itself. 
14913
14914         * typemanager.cs: Fix implementation of ImplementsInterface.  We
14915         need to actually look up in our parent hierarchy for interfaces
14916         implemented. 
14917
14918         * const.cs: Use the underlying type for enumerations
14919
14920         * delegate.cs: Compute the basename for the delegate creation,
14921         that should fix the delegate test case, and restore the correct
14922         Type Lookup semantics in rootcontext
14923
14924         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
14925         referencing a nested type with the Reflection API is using the "+"
14926         sign. 
14927
14928         * cs-parser.jay: Do not require EOF token at the end.
14929
14930 2001-12-20  Ravi Pratap  <ravi@ximian.com>
14931
14932         * rootcontext.cs (LookupType): Concatenate type names with
14933         a '.' instead of a '+' The test suite passes again.
14934
14935         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
14936         field of the enumeration.
14937
14938         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
14939         the case when the member is an EventExpr.
14940
14941         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
14942         static has an associated instance expression.
14943
14944         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
14945
14946         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
14947
14948         * class.cs (Event.Define): Register event and perform appropriate checks
14949         for error #111.
14950
14951         We define the Add and Remove methods even if the use provides none because
14952         in that case, we provide default implementations ourselves.
14953
14954         Define a private field of the type of the event. This is done by the CSC compiler
14955         and we should be doing it too ;-)
14956
14957         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
14958         More methods we use in code we generate.
14959
14960         (multicast_delegate_type, delegate_type): Two separate types since the distinction
14961         is important.
14962
14963         (InitCoreTypes): Update accordingly for the above.
14964
14965         * class.cs (Event.Emit): Generate code for default accessors that we provide
14966
14967         (EmitDefaultMethod): Do the job in the above.
14968
14969         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
14970         appropriate place.
14971
14972 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
14973
14974         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
14975         builders even if we were missing one.
14976
14977         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
14978         pass the Basename as our class name instead of the Name.  The
14979         basename will be correctly composed for us.
14980
14981         * parameter.cs (Paramters): Now takes a Location argument.
14982
14983         * decl.cs (DeclSpace.LookupType): Removed convenience function and
14984         make all the code call directly LookupType in RootContext and take
14985         this chance to pass the Location information everywhere.
14986
14987         * Everywhere: pass Location information.
14988
14989 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
14990
14991         * class.cs (Constructor.Define): Updated way of detecting the
14992         length of the parameters.
14993
14994         (TypeContainer.DefineType): Use basename as the type name for
14995         nested types.
14996
14997         (TypeContainer.Define): Do not recursively define types here, as
14998         definition is taken care in order by the RootContext.
14999
15000         * tree.cs: Keep track of namespaces in a per-file basis.
15001
15002         * parameter.cs (Parameter.ComputeSignature): Update to use
15003         DeclSpace. 
15004
15005         (Parameters.GetSignature): ditto.
15006
15007         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
15008         instead of a TypeContainer.
15009
15010         (Interface.SemanticAnalysis): Use `this' instead of our parent to
15011         resolve names.  Because we need to be resolve in our context, not
15012         our parents.
15013
15014         * driver.cs: Implement response files.
15015
15016         * class.cs (TypeContainer.DefineType): If we are defined, do not
15017         redefine ourselves.
15018
15019         (Event.Emit): Emit the code for add/remove handlers.
15020         (Event.Define): Save the MethodBuilders for add/remove.
15021
15022         * typemanager.cs: Use pair here too.
15023
15024         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
15025         DictionaryEntry requires the first argument to be non-null.  
15026
15027         (enum_declaration): Compute full name for registering the
15028         enumeration.
15029
15030         (delegate_declaration): Instead of using
15031         formal_parameter_list, use opt_formal_parameter_list as the list
15032         can be empty.
15033
15034         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
15035         (EventParsing): New property that controls whether `add' and
15036         `remove' are returned as tokens or identifiers (for events);
15037
15038 2001-12-19  Ravi Pratap  <ravi@ximian.com>
15039
15040         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
15041         use MyEventBuilder only and let it wrap the real builder for us.
15042
15043         (MyEventBuilder): Revamp constructor etc.
15044
15045         Implement all operations that we perform on EventBuilder in precisely the same
15046         way here too.
15047
15048         (FindMembers): Update to use the EventBuilder member.
15049
15050         (Event.Emit): Update accordingly.
15051
15052 2001-12-18  Ravi Pratap  <ravi@ximian.com>
15053
15054         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
15055         by calling the appropriate methods.
15056
15057         (GetCustomAttributes): Make stubs as they cannot possibly do anything
15058         useful.
15059
15060         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
15061
15062 2001-12-17  Ravi Pratap  <ravi@ximian.com>
15063
15064         * delegate.cs (Delegate.Populate): Check that the return type
15065         and various parameters types are indeed accessible.
15066
15067         * class.cs (Constructor.Define): Same here.
15068
15069         (Field.Define): Ditto.
15070
15071         (Event.Define): Ditto.
15072
15073         (Operator.Define): Check that the underlying Method defined itself
15074         correctly - so it's MethodBuilder should not be null.
15075
15076         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
15077         expression happens to be null.
15078
15079         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
15080         members but as of now we don't seem to be able to do anything really useful with it.
15081
15082         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
15083         not the EventBuilder.
15084
15085 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
15086
15087         * cs-tokenizer.cs: Add support for defines.
15088         Add support for #if, #elif, #else, #endif
15089
15090         (eval_var): evaluates a variable.
15091         (eval): stubbed for evaluating functions.
15092
15093         * cs-parser.jay: Pass the defines information
15094
15095         * driver.cs: Add --define command line option.
15096
15097         * decl.cs: Move MemberCore here.
15098
15099         Make it the base class for DeclSpace.  This allows us to catch and
15100         report 108 and 109 for everything now.
15101
15102         * class.cs (TypeContainer.Define): Extract all the members
15103         before populating and emit the warning 108 (new keyword required
15104         to override) instead of having each member implement this.
15105
15106         (MemberCore.Define): New abstract method, we will be using this in
15107         the warning reporting engine in Populate.
15108
15109         (Operator.Define): Adjust to new MemberCore protocol. 
15110
15111         * const.cs (Const): This does not derive from Expression, it is a
15112         temporary object we use to create fields, it is a MemberCore. 
15113
15114         * class.cs (Method.Define): Allow the entry point to be in a
15115         specific class.
15116
15117         * driver.cs: Rewrite the argument handler to clean it up a bit.
15118
15119         * rootcontext.cs: Made it just an auxiliary namespace feature by
15120         making everything static.
15121
15122         * driver.cs: Adapt code to use RootContext type name instead of
15123         instance variable.
15124
15125         * delegate.cs: Remove RootContext argument.
15126
15127         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
15128         argument. 
15129
15130         * class.cs (Event.Define): The lookup can fail.
15131
15132         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
15133
15134         * expression.cs: Resolve the this instance before invoking the code.
15135
15136 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
15137
15138         * cs-parser.jay: Add a production in element_access that allows
15139         the thing to become a "type" reference.  This way we can parse
15140         things like "(string [])" as a type.
15141
15142         Note that this still does not handle the more complex rules of
15143         casts. 
15144
15145
15146         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
15147
15148         * ecore.cs: (CopyNewMethods): new utility function used to
15149         assemble the list of methods from running FindMembers.
15150
15151         (MemberLookup): Rework FindMembers so that 
15152
15153 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
15154
15155         * class.cs (TypeContainer): Remove Delegates who fail to be
15156         defined.
15157
15158         * delegate.cs (Populate): Verify that we dont get null return
15159         values.   TODO: Check for AsAccessible.
15160
15161         * cs-parser.jay: Use basename to emit error 574 (destructor should
15162         have the same name as container class), not the full name.
15163
15164         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
15165         possible representation.  
15166
15167         Also implements integer type suffixes U and L.
15168
15169 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
15170
15171         * expression.cs (ArrayCreation.DoResolve): We need to do the
15172         argument resolution *always*.
15173
15174         * decl.cs: Make this hold the namespace.  Hold the root context as
15175         well.
15176         (LookupType): Move here.
15177
15178         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
15179
15180         * location.cs (Row, Name): Fixed the code, it was always returning
15181         references to the first file.
15182
15183         * interface.cs: Register properties defined through interfaces.
15184
15185         * driver.cs: Add support for globbing on the command line
15186
15187         * class.cs (Field): Make it derive from MemberCore as well.
15188         (Event): ditto.
15189
15190 2001-12-15  Ravi Pratap  <ravi@ximian.com>
15191
15192         * class.cs (Event::Define): Check that the type of the event is a delegate
15193         type else flag error #66.
15194
15195         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
15196         same.
15197
15198         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
15199         values of EntryPoint, CharSet etc etc.
15200
15201         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
15202
15203         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
15204         be null and we should ignore this. I am not sure if this is really clean. Apparently,
15205         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
15206         which needs this to do its work.
15207
15208         * ../errors/cs0066.cs : Add.
15209
15210 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
15211
15212         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
15213         helper functions.
15214
15215         * class.cs: (MethodSignature.MethodSignature): Removed hack that
15216         clears out the parameters field.
15217         (MemberSignatureCompare): Cleanup
15218
15219         (MemberCore): New base class used to share code between MethodCore
15220         and Property.
15221
15222         (RegisterRequiredImplementations) BindingFlags.Public requires
15223         either BindingFlags.Instace or Static.  Use instance here.
15224
15225         (Property): Refactored code to cope better with the full spec.
15226
15227         * parameter.cs (GetParameterInfo): Return an empty array instead
15228         of null on error.
15229
15230         * class.cs (Property): Abstract or extern properties have no bodies.
15231
15232         * parameter.cs (GetParameterInfo): return a zero-sized array.
15233
15234         * class.cs (TypeContainer.MethodModifiersValid): Move all the
15235         method modifier validation to the typecontainer so we can reuse
15236         this on properties.
15237
15238         (MethodCore.ParameterTypes): return an empty sized array of types.
15239
15240         (Property.Define): Test property modifier validity.
15241
15242         Add tests for sealed/override too.
15243
15244         (Method.Emit): abstract or extern methods have no bodies.
15245
15246 2001-12-14  Ravi Pratap  <ravi@ximian.com>
15247
15248         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
15249         thing.
15250
15251         (Method::Define, ::Emit): Modify accordingly.
15252
15253         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
15254
15255         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
15256
15257         * makefile: Pass in /unsafe.
15258
15259 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
15260
15261         * class.cs (MakeKey): Kill routine.
15262
15263         * class.cs (TypeContainer.Define): Correctly define explicit
15264         method implementations (they require the full interface name plus
15265         the method name).
15266
15267         * typemanager.cs: Deply the PtrHashtable here and stop using the
15268         lame keys.  Things work so much better.
15269
15270         This of course broke everyone who depended on `RegisterMethod' to
15271         do the `test for existance' test.  This has to be done elsewhere.
15272
15273         * support.cs (PtrHashtable): A hashtable that avoid comparing with
15274         the object stupid Equals method (because, that like fails all over
15275         the place).  We still do not use it.
15276
15277         * class.cs (TypeContainer.SetRequiredInterface,
15278         TypeContainer.RequireMethods): Killed these two routines and moved
15279         all the functionality to RegisterRequiredImplementations.
15280
15281         (TypeContainer.RegisterRequiredImplementations): This routine now
15282         registers all the implementations required in an array for the
15283         interfaces and abstract methods.  We use an array of structures
15284         which can be computed ahead of time to reduce memory usage and we
15285         also assume that lookups are cheap as most classes will not
15286         implement too many interfaces.
15287
15288         We also avoid creating too many MethodSignatures.
15289
15290         (TypeContainer.IsInterfaceMethod): Update and optionally does not
15291         clear the "pending" bit if we find that there are problems with
15292         the declaration.
15293
15294         (TypeContainer.VerifyPendingMethods): Update to report errors of
15295         methods that look like implementations but are not.
15296
15297         (TypeContainer.Define): Add support for explicit interface method
15298         implementation. 
15299
15300 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
15301
15302         * typemanager.cs: Keep track of the parameters here instead of
15303         being a feature of the TypeContainer.
15304
15305         * class.cs: Drop the registration of parameters here, as
15306         InterfaceMethods are also interface declarations.
15307
15308         * delegate.cs: Register methods with the TypeManager not only with
15309         the TypeContainer.  This code was buggy.
15310
15311         * interface.cs: Full registation here.
15312
15313 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
15314
15315         * expression.cs: Remove reducer for binary expressions, it can not
15316         be done this way.
15317
15318         * const.cs: Put here the code that used to go into constant.cs
15319
15320         * constant.cs: Put here the code for constants, this is a new base
15321         class for Literals.
15322
15323         * literal.cs: Make Literal derive from Constant.
15324
15325 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
15326
15327         * statement.cs (Return.Emit): Report error 157 if the user
15328         attempts to return from a finally block.
15329
15330         (Return.Emit): Instead of emitting a return, jump to the end of
15331         the function.
15332
15333         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
15334         LocalBuilder to store the result of the function.  ReturnLabel is
15335         the target where we jump.
15336
15337
15338 2001-12-09  Radek Doulik  <rodo@ximian.com>
15339
15340         * cs-parser.jay: remember alias in current namespace
15341
15342         * ecore.cs (SimpleName::DoResolve): use aliases for types or
15343         namespaces
15344
15345         * class.cs (LookupAlias): lookup alias in my_namespace
15346
15347         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
15348         aliases hashtable
15349         (LookupAlias): lookup alias in this and if needed in parent
15350         namespaces
15351
15352 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
15353
15354         * support.cs: 
15355
15356         * rootcontext.cs: (ModuleBuilder) Made static, first step into
15357         making things static.  I need this to avoid passing the
15358         TypeContainer when calling ParameterType.
15359
15360         * support.cs (InternalParameters.ParameterType): Remove ugly hack
15361         that did string manipulation to compute the type and then call
15362         GetType.  Use Parameter.ParameterType instead.
15363
15364         * cs-tokenizer.cs: Consume the suffix for floating values.
15365
15366         * expression.cs (ParameterReference): figure out whether this is a
15367         reference parameter or not.  Kill an extra variable by computing
15368         the arg_idx during emission.
15369
15370         * parameter.cs (Parameters.GetParameterInfo): New overloaded
15371         function that returns whether a parameter is an out/ref value or not.
15372
15373         (Parameter.ParameterType): The type of the parameter (base,
15374         without ref/out applied).
15375
15376         (Parameter.Resolve): Perform resolution here.
15377         (Parameter.ExternalType): The full type (with ref/out applied).
15378
15379         * statement.cs (Using.Emit, Using.EmitExpression): Implement
15380         support for expressions on the using statement.
15381
15382 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
15383
15384         * statement.cs (Using.EmitLocalVariableDecls): Split the
15385         localvariable handling of the using statement.
15386
15387         (Block.EmitMeta): Keep track of variable count across blocks.  We
15388         were reusing slots on separate branches of blocks.
15389
15390         (Try.Emit): Emit the general code block, we were not emitting it. 
15391
15392         Check the type of the declaration to be an IDisposable or
15393         something that can be implicity converted to it. 
15394
15395         Emit conversions if required.
15396
15397         * ecore.cs (EmptyExpression): New utility class.
15398         (Expression.ImplicitConversionExists): New utility function.
15399
15400 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
15401
15402         * statement.cs (Using): Implement.
15403
15404         * expression.cs (LocalVariableReference): Support read only variables.
15405
15406         * statement.cs: Remove the explicit emit for the Leave opcode.
15407         (VariableInfo): Add a readonly field.
15408
15409 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
15410
15411         * ecore.cs (ConvCast): new class used to encapsulate the various
15412         explicit integer conversions that works in both checked and
15413         unchecked contexts.
15414
15415         (Expression.ConvertNumericExplicit): Use new ConvCast class to
15416         properly generate the overflow opcodes.
15417
15418 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
15419
15420         * statement.cs: The correct type for the EmptyExpression is the
15421         element_type, not the variable type.  Ravi pointed this out.
15422
15423 2001-12-04  Ravi Pratap  <ravi@ximian.com>
15424
15425         * class.cs (Method::Define): Handle PInvoke methods specially
15426         by using DefinePInvokeMethod instead of the usual one.
15427
15428         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
15429         above to do the task of extracting information and defining the method.
15430
15431 2001-12-04  Ravi Pratap  <ravi@ximian.com>
15432
15433         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
15434         of the condition for string type.
15435
15436         (Emit): Move that here. 
15437
15438         (ArrayCreation::CheckIndices): Keep string literals in their expression
15439         form.
15440
15441         (EmitDynamicInitializers): Handle strings appropriately.
15442
15443 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
15444
15445         * codegen.cs (EmitContext): Replace multiple variables with a
15446         single pointer to the current Switch statement.
15447
15448         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
15449         EmitContext.
15450
15451 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
15452
15453         * statement.cs 
15454
15455         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
15456         default'.
15457
15458         (Foreach.Emit): Foreach on arrays was not setting
15459         up the loop variables (for break/continue).
15460
15461         (GotoCase): Semi-implented.
15462
15463 2001-12-03  Ravi Pratap  <ravi@ximian.com>
15464
15465         * attribute.cs (CheckAttribute): Handle system attributes by using
15466         Attribute.GetAttributes to examine information we need.
15467
15468         (GetValidPlaces): Same here.
15469
15470         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
15471
15472         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
15473
15474         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
15475
15476         (Method::Define): Set appropriate flags if we have a DllImport attribute.
15477
15478         (Method::Emit): Handle the case when we are a PInvoke method.
15479
15480 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
15481
15482         * expression.cs: Use ResolveWithSimpleName on compound names.
15483
15484 2001-12-02  Ravi Pratap  <ravi@ximian.com>
15485
15486         * constant.cs (EmitConstant): Make sure we resolve the associated expression
15487         before trying to reduce it.
15488
15489         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
15490
15491         * constant.cs (LookupConstantValue): Implement.
15492
15493         (EmitConstant): Use the above in emitting the constant.
15494
15495         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
15496         that are user-defined by doing a LookupConstantValue on them.
15497
15498         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
15499         too, like above.
15500
15501 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
15502
15503         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
15504
15505         (BaseAccess.DoResolve): Implement.
15506
15507         (MemberAccess.DoResolve): Split this routine into a
15508         ResolveMemberAccess routine that can be used independently
15509
15510 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
15511
15512         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
15513         As that share bits of the implementation.  Is returns a boolean,
15514         while As returns the Type that is being probed.
15515
15516 2001-12-01  Ravi Pratap  <ravi@ximian.com>
15517
15518         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
15519         instead of a Literal - much easier.
15520
15521         (EnumInTransit): Remove - utterly useless :-)
15522
15523         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
15524
15525         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
15526
15527         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
15528         chain when we have no associated expression.
15529
15530 2001-11-30  Ravi Pratap  <ravi@ximian.com>
15531
15532         * constant.cs (Define): Use Location while reporting the errror.
15533
15534         Also emit a warning when 'new' is used and there is no inherited
15535         member to hide.
15536
15537         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
15538         populated.
15539
15540         (LookupEnumValue): Implement to lookup an enum member's value and define it
15541         if necessary.
15542
15543         (Populate): Re-write accordingly to use the above routine.
15544
15545 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
15546
15547         * expression.cs (This): Fix prototype for DoResolveLValue to
15548         override the base class DoResolveLValue.
15549
15550         * cs-parser.cs: Report errors cs574 and cs575 (destructor
15551         declarations) 
15552
15553         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
15554         (we need to load the address of the field here).  This fixes
15555         test-22. 
15556
15557         (FieldExpr.DoResolveLValue): Call the DoResolve
15558         function to initialize the Instance expression.
15559
15560         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
15561         correctly the GetEnumerator operation on a value type.
15562
15563         * cs-parser.jay: Add more simple parsing error catches.
15564
15565         * statement.cs (Switch): Add support for string switches.
15566         Handle null specially.
15567
15568         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
15569
15570 2001-11-28  Ravi Pratap  <ravi@ximian.com>
15571
15572         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
15573
15574         (declare_local_constant): New helper function.
15575
15576         * statement.cs (AddConstant): Keep a separate record of constants
15577
15578         (IsConstant): Implement to determine if a variable is a constant.
15579
15580         (GetConstantExpression): Implement.
15581
15582         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
15583
15584         * statement.cs (IsVariableDefined): Re-write.
15585
15586 2001-11-27  Ravi Pratap  <ravi@ximian.com>
15587
15588         * class.cs (TypeContainer::FindMembers): Look for constants
15589         in the case when we are looking for MemberTypes.Field
15590
15591         * expression.cs (MemberAccess::DoResolve): Check that in the
15592         case we are a FieldExpr and a Literal, we are not being accessed
15593         by an instance reference.
15594
15595         * cs-parser.jay (local_constant_declaration): Implement.
15596
15597         (declaration_statement): Implement for constant declarations.
15598
15599 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
15600
15601         * statement.cs (Switch): Catch double defaults.
15602
15603         (Switch): More work on the switch() statement
15604         implementation.  It works for integral values now, need to finish
15605         string support.
15606
15607
15608 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
15609
15610         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
15611         integer literals into other integer literals.  To be used by
15612         switch. 
15613
15614 2001-11-24  Ravi Pratap  <ravi@ximian.com>
15615
15616         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
15617         some memory.
15618
15619         (EmitDynamicInitializers): Cope with the above since we extract data
15620         directly from ArrayData now.
15621
15622         (ExpectInitializers): Keep track of whether initializers are mandatory
15623         or not.
15624
15625         (Bounds): Make it a hashtable to prevent the same dimension being 
15626         recorded for every element in that dimension.
15627
15628         (EmitDynamicInitializers): Fix bug which prevented the Set array method
15629         from being found.
15630
15631         Also fix bug which was causing the indices to be emitted in the reverse
15632         order.
15633
15634 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
15635
15636         * expression.cs (ArrayCreation): Implement the bits that Ravi left
15637         unfinished.  They do not work, because the underlying code is
15638         sloppy.
15639
15640 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * cs-parser.jay: Remove bogus fixme.
15643
15644         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
15645         on Switch statement.
15646
15647 2001-11-23  Ravi Pratap  <ravi@ximian.com>
15648
15649         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
15650         the same. 
15651
15652         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
15653         parameter. Apparently, any expression is allowed. 
15654
15655         (ValidateInitializers): Update accordingly.
15656
15657         (CheckIndices): Fix some tricky bugs thanks to recursion.
15658
15659         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
15660         I was being completely brain-dead.
15661
15662         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
15663         and re-write acordingly.
15664
15665         (DelegateInvocation): Re-write accordingly.
15666
15667         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
15668
15669         (MakeByteBlob): Handle types more correctly.
15670
15671         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
15672         initialization from expressions but it is incomplete because I am a complete
15673         Dodo :-|
15674
15675 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
15676
15677         * statement.cs (If.Emit): Fix a bug that generated incorrect code
15678         on If.  Basically, we have to return `true' (ie, we do return to
15679         our caller) only if both branches of the if return.
15680
15681         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
15682         short-circuit operators, handle them as short circuit operators. 
15683
15684         (Cast.DoResolve): Resolve type.
15685         (Cast.Cast): Take an expression as the target type.
15686
15687         * cs-parser.jay (cast_expression): Remove old hack that only
15688         allowed a limited set of types to be handled.  Now we take a
15689         unary_expression and we resolve to a type during semantic
15690         analysis.
15691
15692         Use the grammar productions from Rhys to handle casts (this is
15693         not complete like Rhys syntax yet, we fail to handle that corner
15694         case that C# has regarding (-x), but we will get there.
15695
15696 2001-11-22  Ravi Pratap  <ravi@ximian.com>
15697
15698         * class.cs (EmitFieldInitializer): Take care of the case when we have a
15699         field which is an array type.
15700
15701         * cs-parser.jay (declare_local_variables): Support array initialization too.
15702
15703         * typemanager.cs (MakeKey): Implement.
15704
15705         (everywhere): Use the above appropriately.
15706
15707         * cs-parser.jay (for_statement): Update for array initialization while
15708         declaring variables.
15709
15710         * ecore.cs : The error message was correct, it's the variable's names that
15711         were misleading ;-) Make the code more readable.
15712
15713         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
15714         the correct type etc.
15715
15716         (ConvertExplicit): Handle Enum types by examining the underlying type.
15717
15718 2001-11-21  Ravi Pratap  <ravi@ximian.com>
15719
15720         * parameter.cs (GetCallingConvention): Always return
15721         CallingConventions.Standard for now.
15722
15723 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
15724
15725         * expression.cs (Binary.ResolveOperator): Update the values of `l'
15726         and `r' after calling DoNumericPromotions.
15727
15728         * ecore.cs: Fix error message (the types were in the wrong order).
15729
15730         * statement.cs (Foreach.ProbeCollectionType): Need to pass
15731         BindingFlags.Instance as well 
15732
15733         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
15734         implicit int literal conversion in an empty cast so that we
15735         propagate the right type upstream.
15736
15737         (UnboxCast): new class used to unbox value types.
15738         (Expression.ConvertExplicit): Add explicit type conversions done
15739         by unboxing.
15740
15741         (Expression.ImplicitNumericConversion): Oops, forgot to test for
15742         the target type before applying the implicit LongLiterals to ULong
15743         literal cast.
15744
15745 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
15746
15747         * cs-parser.jay (for_statement): Reworked the way For works: now
15748         we declare manually any variables that are introduced in
15749         for_initializer to solve the problem of having out-of-band code
15750         emition (that is what got for broken).
15751
15752         (declaration_statement): Perform the actual variable declaration
15753         that used to be done in local_variable_declaration here.
15754
15755         (local_variable_declaration): Do not declare anything, just pass
15756         the information on a DictionaryEntry
15757
15758 2001-11-20  Ravi Pratap  <ravi@ximian.com>
15759
15760         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
15761         re-write of the logic to now make it recursive.
15762
15763         (UpdateIndices): Re-write accordingly.
15764
15765         Store element data in a separate ArrayData list in the above methods.
15766
15767         (MakeByteBlob): Implement to dump the array data into a byte array.
15768
15769 2001-11-19  Ravi Pratap  <ravi@ximian.com>
15770
15771         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
15772         into CheckIndices.
15773
15774         * constant.cs (Define): Implement.
15775
15776         (EmitConstant): Re-write fully.
15777
15778         Pass in location info.
15779
15780         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
15781         respectively.
15782
15783         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
15784         DictionaryEntry since we need location info too.
15785
15786         (constant_declaration): Update accordingly.
15787
15788         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
15789         code into another method : UpdateIndices.
15790
15791 2001-11-18  Ravi Pratap  <ravi@ximian.com>
15792
15793         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
15794         some type checking etc.
15795
15796 2001-11-17  Ravi Pratap  <ravi@ximian.com>
15797
15798         * expression.cs (ArrayCreation::ValidateInitializers): Implement
15799         bits to provide dimension info if the user skips doing that.
15800
15801         Update second constructor to store the rank correctly.
15802
15803 2001-11-16  Ravi Pratap  <ravi@ximian.com>
15804
15805         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
15806         and try to implement.
15807
15808         * ../errors/cs0150.cs : Add.
15809
15810         * ../errors/cs0178.cs : Add.
15811
15812 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
15813
15814         * statement.cs: Implement foreach on multi-dimensional arrays. 
15815
15816         * parameter.cs (Parameters.GetParameterByName): Also lookup the
15817         name of the params argument.
15818
15819         * expression.cs: Use EmitStoreOpcode to get the right opcode while
15820         initializing the array.
15821
15822         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
15823         we can use this elsewhere.
15824
15825         * statement.cs: Finish implementation of foreach for single
15826         dimension arrays.
15827
15828         * cs-parser.jay: Use an out-of-band stack to pass information
15829         around, I wonder why I need this.
15830
15831         foreach_block: Make the new foreach_block the current_block.
15832
15833         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
15834         function used to return a static Parameters structure.  Used for
15835         empty parameters, as those are created very frequently.
15836
15837         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
15838
15839 2001-11-15  Ravi Pratap  <ravi@ximian.com>
15840
15841         * interface.cs : Default modifier is private, not public. The
15842         make verify test passes again.
15843
15844 2001-11-15  Ravi Pratap  <ravi@ximian.com>
15845
15846         * support.cs (ReflectionParameters): Fix logic to determine
15847         whether the last parameter is a params one. Test 9 passes again.
15848
15849         * delegate.cs (Populate): Register the builders we define with
15850         RegisterParameterForBuilder. Test 19 passes again.
15851
15852         * cs-parser.jay (property_declaration): Reference $6 instead
15853         of $$ to get at the location.
15854
15855         (indexer_declaration): Similar stuff.
15856
15857         (attribute): Ditto.
15858
15859         * class.cs (Property): Register parameters for the Get and Set methods
15860         if they exist. Test 23 passes again.
15861
15862         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
15863         call to EmitArguments as we are sure there aren't any params arguments. 
15864         Test 32 passes again.
15865
15866         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
15867         IndexOutOfRangeException. 
15868
15869         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
15870         Test 33 now passes again.
15871
15872 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
15873
15874         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
15875         broke a bunch of things.  Will have to come up with a better way
15876         of tracking locations.
15877
15878         * statement.cs: Implemented foreach for single dimension arrays.
15879
15880 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
15881
15882         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
15883         an error.  This removes the lookup from the critical path.
15884
15885         * cs-parser.jay: Removed use of temporary_loc, which is completely
15886         broken. 
15887
15888 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
15889
15890         * support.cs (ReflectionParameters.ParameterModifier): Report
15891         whether the argument is a PARAMS argument or not.
15892
15893         * class.cs: Set the attribute `ParamArrayAttribute' on the
15894         parameter argument.
15895
15896         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
15897         and cons_param_array_attribute (ConstructorInfo for
15898         ParamArrayAttribute)., 
15899
15900         * codegen.cs: Emit the return using the `Return' statement, that
15901         way we can report the error correctly for missing return values. 
15902
15903         * class.cs (Method.Emit): Clean up.
15904
15905         * expression.cs (Argument.Resolve): Take another argument: the
15906         location where this argument is used.  Notice that this is not
15907         part of the "Argument" class as to reduce the size of the
15908         structure (we know the approximate location anyways).
15909
15910         Test if the argument is a variable-reference, if not, then
15911         complain with a 206.
15912
15913         (Argument.Emit): Emit addresses of variables.
15914
15915         (Argument.FullDesc): Simplify.
15916
15917         (Invocation.DoResolve): Update for Argument.Resolve.
15918
15919         (ElementAccess.DoResolve): ditto.
15920
15921         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
15922         method should be virtual, as this method is always virtual.
15923
15924         (NewDelegate.DoResolve): Update for Argument.Resolve.
15925
15926         * class.cs (ConstructorInitializer.DoResolve): ditto.
15927
15928         * attribute.cs (Attribute.Resolve): ditto.
15929
15930 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
15931
15932         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
15933
15934         * expression.cs (ParameterReference): Drop IStackStorage and implement
15935         IAssignMethod instead. 
15936
15937         (LocalVariableReference): ditto.
15938
15939         * ecore.cs (FieldExpr): Drop IStackStorage and implement
15940         IAssignMethod instead. 
15941
15942 2001-11-13  Miguel de Icaza <miguel@ximian.com>
15943
15944         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
15945         enumerations that are used in heavily used structures derive from
15946         byte in a laughable and pathetic attempt to reduce memory usage.
15947         This is the kind of pre-optimzations that you should not do at
15948         home without adult supervision.
15949
15950         * expression.cs (UnaryMutator): New class, used to handle ++ and
15951         -- separatedly from the other unary operators.  Cleans up the
15952         code, and kills the ExpressionStatement dependency in Unary.
15953
15954         (Unary): Removed `method' and `Arguments' from this class, making
15955         it smaller, and moving it all to SimpleCall, so I can reuse this
15956         code in other locations and avoid creating a lot of transient data
15957         strucutres when not required.
15958
15959         * cs-parser.jay: Adjust for new changes.
15960
15961 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
15962
15963         * enum.cs (Enum.Populate): If there is a failure during
15964         definition, return
15965
15966         * cs-parser.jay (opt_enum_base): we used to catch type errors
15967         here, but this is really incorrect.  The type error should be
15968         catched during semantic analysis.
15969
15970 2001-12-11  Ravi Pratap  <ravi@ximian.com>
15971
15972         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
15973         current_local_parameters as expected since I, in my stupidity, had forgotten
15974         to do this :-)
15975
15976         * attribute.cs (GetValidPlaces): Fix stupid bug.
15977
15978         * class.cs (Method::Emit): Perform check on applicability of attributes.
15979
15980         (Constructor::Emit): Ditto.
15981
15982         (Field::Emit): Ditto.
15983
15984         (Field.Location): Store location information.
15985
15986         (Property, Event, Indexer, Operator): Ditto.
15987
15988         * cs-parser.jay (field_declaration): Pass in location for each field.
15989
15990         * ../errors/cs0592.cs : Add.
15991
15992 2001-11-12  Ravi Pratap  <ravi@ximian.com>
15993
15994         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
15995
15996         (InitCoreTypes): Update accordingly.
15997
15998         (RegisterAttrType, LookupAttr): Implement.
15999
16000         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
16001         info about the same.
16002
16003         (Resolve): Update to populate the above as necessary.
16004
16005         (Error592): Helper.
16006
16007         (GetValidPlaces): Helper to the above.
16008
16009         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
16010
16011         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
16012
16013 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16014
16015         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
16016
16017         * ../errors/cs0617.cs : Add.
16018
16019 2001-11-11  Ravi Pratap  <ravi@ximian.com>
16020
16021         * enum.cs (Emit): Rename to Populate to be more consistent with what
16022         we expect it to do and when exactly it is called.
16023
16024         * class.cs, rootcontext.cs : Update accordingly.
16025
16026         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
16027         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
16028
16029         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
16030
16031         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
16032         of a fieldinfo using the above, when dealing with a FieldBuilder.
16033
16034 2001-11-10  Ravi Pratap  <ravi@ximian.com>
16035
16036         * ../errors/cs0031.cs : Add.
16037
16038         * ../errors/cs1008.cs : Add.
16039
16040         * ../errrors/cs0543.cs : Add.
16041
16042         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
16043         enum type.
16044
16045         (FindMembers): Implement.
16046
16047         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
16048         enums and delegates too.
16049
16050         (enum_types): Rename to builder_to_enum.
16051
16052         (delegate_types): Rename to builder_to_delegate.
16053
16054         * delegate.cs (FindMembers): Implement.
16055
16056 2001-11-09  Ravi Pratap  <ravi@ximian.com>
16057
16058         * typemanager.cs (IsEnumType): Implement.
16059
16060         * enum.cs (Emit): Re-write parts to account for the underlying type
16061         better and perform checking etc.
16062
16063         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
16064         of the underlying type.
16065
16066         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
16067         value
16068
16069         * enum.cs (error31): Helper to report error #31.
16070
16071         * cs-parser.jay (enum_declaration): Store location of each member too.
16072
16073         * enum.cs (member_to_location): New hashtable. 
16074
16075         (AddEnumMember): Update location hashtable.
16076
16077         (Emit): Use the location of each member while reporting errors.
16078
16079 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16080
16081         * cs-parser.jay: A for_initializer if is a
16082         local_variable_declaration really ammount to have an implicit
16083         block with the variable declaration and no initializer for for.
16084
16085         * statement.cs (For.Emit): Cope with null initializers.
16086
16087         This fixes the infinite loop on for initializers.
16088
16089 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
16090
16091         * enum.cs: More cleanup.
16092
16093         * ecore.cs: Remove dead code.
16094
16095         * class.cs (Property.Emit): More simplification.
16096         (Event.Emit): ditto.
16097
16098         Reworked to have less levels of indentation.
16099
16100 2001-11-08  Ravi Pratap  <ravi@ximian.com>
16101
16102         * class.cs (Property): Emit attributes.
16103
16104         (Field): Ditto.
16105
16106         (Event): Ditto.
16107
16108         (Indexer): Ditto.
16109
16110         (Operator): Ditto.
16111
16112         * enum.cs (Emit): Ditto.
16113
16114         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
16115         Enums too.
16116
16117         * class.cs (Field, Event, etc.): Move attribute generation into the
16118         Emit method everywhere.
16119
16120         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
16121         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
16122         as we had no way of defining nested enums !
16123
16124         * rootcontext.cs : Adjust code accordingly.
16125
16126         * typemanager.cs (AddEnumType): To keep track of enum types separately.
16127
16128 2001-11-07  Ravi Pratap  <ravi@ximian.com>
16129
16130         * expression.cs (EvalConstantExpression): Move into ecore.cs
16131
16132         * enum.cs (Enum): Rename some members and make them public and readonly
16133         according to our convention.
16134
16135         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
16136         nothing else.
16137
16138         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
16139
16140         (Enum::Emit): Write a simple version for now which doesn't try to compute
16141         expressions. I shall modify this to be more robust in just a while.
16142
16143         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
16144
16145         (TypeContainer::CloseType): Create the Enum types too.
16146
16147         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
16148
16149         * expression.cs (EvalConstantExpression): Get rid of completely.
16150
16151         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
16152         user-defined values and other cases.
16153
16154         (IsValidEnumLiteral): Helper function.
16155
16156         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
16157         out there in the case we had a literal FieldExpr.
16158
16159         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
16160
16161         (Literalize): Revamp a bit to take two arguments.
16162
16163         (EnumLiteral): New class which derives from Literal to wrap enum literals.
16164
16165 2001-11-06  Ravi Pratap  <ravi@ximian.com>
16166
16167         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
16168
16169         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
16170
16171         (Resolve): Use the above to ensure we have proper initializers.
16172
16173 2001-11-05  Ravi Pratap  <ravi@ximian.com>
16174
16175         * expression.cs (Expression::EvalConstantExpression): New method to 
16176         evaluate constant expressions.
16177
16178         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
16179
16180 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
16181
16182         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
16183         in an array.
16184
16185         (Binary.ResolveOperator): Handle operator != (object a, object b)
16186         and operator == (object a, object b);
16187
16188         (Binary.DoNumericPromotions): Indicate whether the numeric
16189         promotion was possible.
16190
16191         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
16192         Implement.  
16193
16194         Made the ArrayAccess implement interface IAssignMethod instead of
16195         IStackStore as the order in which arguments are passed reflects
16196         this.
16197
16198         * assign.cs: Instead of using expr.ExprClass to select the way of
16199         assinging, probe for the IStackStore/IAssignMethod interfaces.
16200
16201         * typemanager.cs: Load InitializeArray definition.
16202
16203         * rootcontext.cs (RootContext.MakeStaticData): Used to define
16204         static data that can be used to initialize arrays. 
16205
16206 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
16207
16208         * expression.cs: Handle operator== and operator!= for booleans.
16209
16210         (Conditioal.Reduce): Implement reducer for the ?: operator.
16211
16212         (Conditional.Resolve): Implement dead code elimination.
16213
16214         (Binary.Resolve): Catch string literals and return a new
16215         concatenated string.
16216
16217         (Unary.Reduce): Implement reduction of unary expressions.
16218
16219         * ecore.cs: Split out the expression core handling here.
16220
16221         (Expression.Reduce): New method used to perform constant folding
16222         and CSE.  This is needed to support constant-expressions. 
16223
16224         * statement.cs (Statement.EmitBoolExpression): Pass true and false
16225         targets, and optimize for !x.
16226
16227 2001-11-04  Ravi Pratap  <ravi@ximian.com>
16228
16229         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
16230         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
16231         set custom atttributes.
16232
16233         * literal.cs (Literal::GetValue): New abstract method to return the actual
16234         value of the literal, cast as an object.
16235
16236         (*Literal): Implement GetValue method.
16237
16238         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
16239         expressions to the arraylist but objects of type Argument.
16240
16241         * class.cs (TypeContainer::Emit): Emit our attributes too.
16242
16243         (Method::Emit, Constructor::Emit): Ditto.
16244
16245         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
16246         to be ignoring earlier.
16247
16248 2001-11-03  Ravi Pratap  <ravi@ximian.com>
16249
16250         * attribute.cs (AttributeSection::Define): Implement to do the business
16251         of constructing a CustomAttributeBuilder.
16252
16253         (Attribute): New trivial class. Increases readability of code.  
16254
16255         * cs-parser.jay : Update accordingly.
16256
16257         (positional_argument_list, named_argument_list, named_argument): New rules
16258
16259         (attribute_arguments): Use the above so that we are more correct.
16260
16261 2001-11-02  Ravi Pratap  <ravi@ximian.com>
16262
16263         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
16264         to perform all checks for a method with a params parameter.
16265
16266         (Invocation::OverloadResolve): Update to use the above method and therefore
16267         cope correctly with params method invocations.
16268
16269         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
16270         params too.
16271
16272         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
16273         constructors in our parent too because we can't afford to miss out on 
16274         protected ones ;-)
16275
16276         * attribute.cs (AttributeSection): New name for the class Attribute
16277
16278         Other trivial changes to improve readability.
16279
16280         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
16281         use the new class names.
16282
16283 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16284
16285         * class.cs (Method::Define): Complete definition for params types too
16286
16287         (Indexer::Define): Ditto.
16288
16289         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
16290         Cope everywhere with a request for info about the array parameter.
16291
16292 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16293
16294         * tree.cs (RecordNamespace): Fix up to check for the correct key.
16295
16296         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
16297         local_variable_type to extract the string corresponding to the type.
16298
16299         (local_variable_type): Fixup the action to use the new helper method.
16300
16301         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
16302         go.
16303
16304         * expression.cs : Clean out code which uses the above.
16305
16306 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16307
16308         * typemanager.cs (RegisterMethod): Check if we already have an existing key
16309         and bale out if necessary by returning a false.
16310
16311         (RegisterProperty): Ditto.
16312
16313         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
16314         and print out appropriate error messages.
16315
16316         * interface.cs (everywhere): Ditto.
16317
16318         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
16319         location to constructor.
16320
16321         * class.cs (Property, Event, Indexer): Update accordingly.
16322
16323         * ../errors/cs111.cs : Added.
16324
16325         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
16326         of a method, as laid down by the spec.
16327
16328         (Invocation::OverloadResolve): Use the above method.
16329
16330 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16331
16332         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
16333         now take a TypeContainer and a Parameters object.
16334
16335         (ParameterData): Modify return type of ParameterModifier method to be 
16336         Parameter.Modifier and not a string.
16337
16338         (ReflectionParameters, InternalParameters): Update accordingly.
16339
16340         * expression.cs (Argument::GetParameterModifier): Same here.
16341
16342         * support.cs (InternalParameters::ParameterType): Find a better way of determining
16343         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
16344         symbol in it at all so maybe this is only for now.
16345
16346 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16347
16348         * support.cs (InternalParameters): Constructor now takes an extra argument 
16349         which is the actual Parameters class.
16350
16351         (ParameterDesc): Update to provide info on ref/out modifiers.
16352
16353         * class.cs (everywhere): Update call to InternalParameters to pass in
16354         the second argument too.
16355
16356         * support.cs (ParameterData): Add ParameterModifier, which is a method 
16357         to return the modifier info [ref/out etc]
16358
16359         (InternalParameters, ReflectionParameters): Implement the above.
16360
16361         * expression.cs (Argument::ParameterModifier): Similar function to return
16362         info about the argument's modifiers.
16363
16364         (Invocation::OverloadResolve): Update to take into account matching modifiers 
16365         too.
16366
16367         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
16368         a new SetFormalParameters object which we pass to InternalParameters.
16369
16370 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16371
16372         * expression.cs (NewArray): Merge into the ArrayCreation class.
16373
16374 2001-10-29  Ravi Pratap  <ravi@ximian.com>
16375
16376         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
16377         NewUserdefinedArray into one as there wasn't much of a use in having
16378         two separate ones.
16379
16380         * expression.cs (Argument): Change field's name to ArgType from Type.
16381
16382         (Type): New readonly property which returns the proper type, taking into 
16383         account ref/out modifiers.
16384
16385         (everywhere): Adjust code accordingly for the above.
16386
16387         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
16388         whether we are emitting for a ref or out parameter.
16389
16390         * expression.cs (Argument::Emit): Use the above field to set the state.
16391
16392         (LocalVariableReference::Emit): Update to honour the flag and emit the
16393         right stuff.
16394
16395         * parameter.cs (Attributes): Set the correct flags for ref parameters.
16396
16397         * expression.cs (Argument::FullDesc): New function to provide a full desc.
16398
16399         * support.cs (ParameterData): Add method ParameterDesc to the interface.
16400
16401         (ReflectionParameters, InternalParameters): Implement the above method.
16402
16403         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
16404         reporting errors.
16405
16406         (Invocation::FullMethodDesc): Ditto. 
16407
16408 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
16409
16410         * cs-parser.jay: Add extra production for the second form of array
16411         creation. 
16412
16413         * expression.cs (ArrayCreation): Update to reflect the above
16414         change. 
16415
16416         * Small changes to prepare for Array initialization.
16417
16418 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
16419
16420         * typemanager.cs (ImplementsInterface): interface might be null;
16421         Deal with this problem;
16422
16423         Also, we do store negative hits on the cache (null values), so use
16424         this instead of calling t.GetInterfaces on the type everytime.
16425
16426 2001-10-28  Ravi Pratap  <ravi@ximian.com>
16427
16428         * typemanager.cs (IsBuiltinType): New method to help determine the same.
16429
16430         * expression.cs (New::DoResolve): Get rid of array creation code and instead
16431         split functionality out into different classes.
16432
16433         (New::FormArrayType): Move into NewBuiltinArray.
16434
16435         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
16436         quite useless.
16437
16438         (NewBuiltinArray): New class to handle creation of built-in arrays.
16439
16440         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
16441         account creation of one-dimensional arrays.
16442
16443         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
16444
16445         (NewUserdefinedArray::DoResolve): Implement.
16446
16447         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
16448
16449         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
16450         we maintain inside the TypeManager. This is necessary to perform lookups on the
16451         module builder.
16452
16453         (LookupType): Update to perform GetType on the module builders too.     
16454
16455         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
16456
16457         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
16458
16459 2001-10-23  Ravi Pratap  <ravi@ximian.com>
16460
16461         * expression.cs (New::DoResolve): Implement guts of array creation.
16462
16463         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
16464
16465 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
16466
16467         * expression.cs: Fix bug I introduced lsat night that broke
16468         Delegates. 
16469
16470         (Expression.Resolve): Report a 246 error (can not resolve name)
16471         if we find a SimpleName in the stream.
16472
16473         (Expression.ResolveLValue): Ditto.
16474
16475         (Expression.ResolveWithSimpleName): This function is a variant of
16476         ResolveName, this one allows SimpleNames to be returned without a
16477         warning.  The only consumer of SimpleNames is MemberAccess
16478
16479 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
16480
16481         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
16482         might arrive here.  I have my doubts that this is correct.
16483
16484         * statement.cs (Lock): Implement lock statement.
16485
16486         * cs-parser.jay: Small fixes to support `lock' and `using'
16487
16488         * cs-tokenizer.cs: Remove extra space
16489
16490         * driver.cs: New flag --checked, allows to turn on integer math
16491         checking. 
16492
16493         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
16494         Threading.Monitor.Exit 
16495
16496 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
16497
16498         * expression.cs (IndexerAccess::DoResolveLValue): Set the
16499         Expression Class to be IndexerAccess.
16500
16501         Notice that Indexer::DoResolve sets the eclass to Value.
16502
16503 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
16504
16505         * class.cs (TypeContainer::Emit): Emit code for indexers.
16506
16507         * assign.cs (IAssignMethod): New interface implemented by Indexers
16508         and Properties for handling assignment.
16509
16510         (Assign::Emit): Simplify and reuse code. 
16511
16512         * expression.cs (IndexerAccess, PropertyExpr): Implement
16513         IAssignMethod, clean up old code. 
16514
16515 2001-10-22  Ravi Pratap  <ravi@ximian.com>
16516
16517         * typemanager.cs (ImplementsInterface): New method to determine if a type
16518         implements a given interface. Provides a nice cache too.
16519
16520         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
16521         method.
16522
16523         (ConvertReferenceExplicit): Ditto.
16524
16525         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
16526         various methods, with correct names etc.
16527
16528         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
16529         Operator.UnaryNegation.
16530
16531         * cs-parser.jay (operator_declarator): Be a little clever in the case where
16532         we have a unary plus or minus operator.
16533
16534         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
16535         UnaryMinus.
16536
16537         * everywhere : update accordingly.
16538
16539         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
16540         respectively.
16541
16542         * class.cs (Method::Define): For the case where we are implementing a method
16543         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
16544         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
16545
16546 2001-10-21  Ravi Pratap  <ravi@ximian.com>
16547
16548         * interface.cs (FindMembers): Implement to work around S.R.E
16549         lameness.
16550
16551         * typemanager.cs (IsInterfaceType): Implement.
16552
16553         (FindMembers): Update to handle interface types too.
16554
16555         * expression.cs (ImplicitReferenceConversion): Re-write bits which
16556         use IsAssignableFrom as that is not correct - it doesn't work.
16557
16558         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
16559         and accordingly override EmitStatement.
16560
16561         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
16562         using the correct logic :-)
16563
16564 2001-10-19  Ravi Pratap  <ravi@ximian.com>
16565
16566         * ../errors/cs-11.cs : Add to demonstrate error -11 
16567
16568 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
16569
16570         * assign.cs (Assign::Resolve): Resolve right hand side first, and
16571         then pass this as a hint to ResolveLValue.
16572
16573         * expression.cs (FieldExpr): Add Location information
16574
16575         (FieldExpr::LValueResolve): Report assignment to readonly
16576         variable. 
16577
16578         (Expression::ExprClassFromMemberInfo): Pass location information.
16579
16580         (Expression::ResolveLValue): Add new method that resolves an
16581         LValue. 
16582
16583         (Expression::DoResolveLValue): Default invocation calls
16584         DoResolve. 
16585
16586         (Indexers): New class used to keep track of indexers in a given
16587         Type. 
16588
16589         (IStackStore): Renamed from LValue, as it did not really describe
16590         what this did.  Also ResolveLValue is gone from this interface and
16591         now is part of Expression.
16592
16593         (ElementAccess): Depending on the element access type
16594
16595         * typemanager.cs: Add `indexer_name_type' as a Core type
16596         (System.Runtime.CompilerServices.IndexerNameAttribute)
16597
16598         * statement.cs (Goto): Take a location.
16599
16600 2001-10-18  Ravi Pratap  <ravi@ximian.com>
16601
16602         * delegate.cs (Delegate::VerifyDelegate): New method to verify
16603         if two delegates are compatible.
16604
16605         (NewDelegate::DoResolve): Update to take care of the case when
16606         we instantiate a delegate from another delegate.
16607
16608         * typemanager.cs (FindMembers): Don't even try to look up members
16609         of Delegate types for now.
16610
16611 2001-10-18  Ravi Pratap  <ravi@ximian.com>
16612
16613         * delegate.cs (NewDelegate): New class to take care of delegate
16614         instantiation.
16615
16616         * expression.cs (New): Split the delegate related code out into 
16617         the NewDelegate class.
16618
16619         * delegate.cs (DelegateInvocation): New class to handle delegate 
16620         invocation.
16621
16622         * expression.cs (Invocation): Split out delegate related code into
16623         the DelegateInvocation class.
16624
16625 2001-10-17  Ravi Pratap  <ravi@ximian.com>
16626
16627         * expression.cs (New::DoResolve): Implement delegate creation fully
16628         and according to the spec.
16629
16630         (New::DoEmit): Update to handle delegates differently.
16631
16632         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
16633         because of which we were printing out arguments in reverse order !
16634
16635         * delegate.cs (VerifyMethod): Implement to check if the given method
16636         matches the delegate.
16637
16638         (FullDelegateDesc): Implement.
16639
16640         (VerifyApplicability): Implement.
16641
16642         * expression.cs (Invocation::DoResolve): Update to accordingly handle
16643         delegate invocations too.
16644
16645         (Invocation::Emit): Ditto.
16646
16647         * ../errors/cs1593.cs : Added.
16648
16649         * ../errors/cs1594.cs : Added.
16650
16651         * delegate.cs (InstanceExpression, TargetMethod): New properties.
16652
16653 2001-10-16  Ravi Pratap  <ravi@ximian.com>
16654
16655         * typemanager.cs (intptr_type): Core type for System.IntPtr
16656
16657         (InitCoreTypes): Update for the same.
16658
16659         (iasyncresult_type, asynccallback_type): Ditto.
16660
16661         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
16662         correct.
16663
16664         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
16665         too.
16666
16667         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
16668         the builders for the 4 members of a delegate type :-)
16669
16670         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
16671         type.
16672
16673         * expression.cs (New::DoResolve): Implement guts for delegate creation.
16674
16675         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
16676
16677 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
16678
16679         * statement.cs (Break::Emit): Implement.   
16680         (Continue::Emit): Implement.
16681
16682         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
16683         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
16684         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
16685         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
16686         end loop
16687
16688         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
16689         properties that track the label for the current loop (begin of the
16690         loop and end of the loop).
16691
16692 2001-10-15  Ravi Pratap  <ravi@ximian.com>
16693
16694         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
16695         use of emitting anything at all.
16696
16697         * class.cs, rootcontext.cs : Get rid of calls to the same.
16698
16699         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
16700
16701         (Populate): Define the constructor correctly and set the implementation
16702         attributes.
16703
16704         * typemanager.cs (delegate_types): New hashtable to hold delegates that
16705         have been defined.
16706
16707         (AddDelegateType): Implement.
16708
16709         (IsDelegateType): Implement helper method.
16710
16711         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
16712
16713         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
16714         and accordingly handle it.
16715
16716         * delegate.cs (Populate): Take TypeContainer argument.
16717         Implement bits to define the Invoke method. However, I still haven't figured out
16718         how to take care of the native int bit :-(
16719
16720         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
16721         Qualify the name of the delegate, not its return type !
16722
16723         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
16724         conversion.
16725
16726         (StandardConversionExists): Checking for array types turns out to be recursive.
16727
16728         (ConvertReferenceExplicit): Implement array conversion.
16729
16730         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
16731
16732 2001-10-12  Ravi Pratap  <ravi@ximian.com>
16733
16734         * cs-parser.jay (delegate_declaration): Store the fully qualified
16735         name as it is a type declaration.
16736
16737         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
16738         readonly.
16739
16740         (DefineDelegate): Renamed from Define. Does the same thing essentially,
16741         as TypeContainer::DefineType.
16742
16743         (Populate): Method in which all the definition of the various methods (Invoke)
16744         etc is done.
16745
16746         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
16747         see.
16748
16749         (CloseDelegate): Finally creates the delegate.
16750
16751         * class.cs (TypeContainer::DefineType): Update to define delegates.
16752         (Populate, Emit and CloseType): Do the same thing here too.
16753
16754         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
16755         delegates in all these operations.
16756
16757 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
16758
16759         * expression.cs: LocalTemporary: a new expression used to
16760         reference a temporary that has been created.
16761
16762         * assign.cs: Handle PropertyAccess back here, so that we can
16763         provide the proper semantic access to properties.
16764
16765         * expression.cs (Expression::ConvertReferenceExplicit): Implement
16766         a few more explicit conversions. 
16767
16768         * modifiers.cs: `NEW' modifier maps to HideBySig.
16769
16770         * expression.cs (PropertyExpr): Make this into an
16771         ExpressionStatement, and support the EmitStatement code path. 
16772
16773         Perform get/set error checking, clean up the interface.
16774
16775         * assign.cs: recognize PropertyExprs as targets, and if so, turn
16776         them into toplevel access objects.
16777
16778 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
16779
16780         * expression.cs: PropertyExpr::PropertyExpr: use work around the
16781         SRE.
16782
16783         * typemanager.cs: Keep track here of our PropertyBuilders again to
16784         work around lameness in SRE.
16785
16786 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
16787
16788         * expression.cs (LValue::LValueResolve): New method in the
16789         interface, used to perform a second resolution pass for LValues. 
16790
16791         (This::DoResolve): Catch the use of this in static methods.
16792
16793         (This::LValueResolve): Implement.
16794
16795         (This::Store): Remove warning, assigning to `this' in structures
16796         is 
16797
16798         (Invocation::Emit): Deal with invocation of
16799         methods on value types.  We need to pass the address to structure
16800         methods rather than the object itself.  (The equivalent code to
16801         emit "this" for structures leaves the entire structure on the
16802         stack instead of a pointer to it). 
16803
16804         (ParameterReference::DoResolve): Compute the real index for the
16805         argument based on whether the method takes or not a `this' pointer
16806         (ie, the method is static).
16807
16808         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
16809         value types returned from functions when we need to invoke a
16810         method on the sturcture.
16811
16812
16813 2001-10-11  Ravi Pratap  <ravi@ximian.com>
16814
16815         * class.cs (TypeContainer::DefineType): Method to actually do the business of
16816         defining the type in the Modulebuilder or Typebuilder. This is to take
16817         care of nested types which need to be defined on the TypeBuilder using
16818         DefineNestedMethod.
16819
16820         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
16821         methods in RootContext, only ported to be part of TypeContainer.
16822
16823         (TypeContainer::GetInterfaceOrClass): Ditto.
16824
16825         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
16826
16827         * interface.cs (Interface::DefineInterface): New method. Does exactly
16828         what RootContext.CreateInterface did earlier, only it takes care of nested types 
16829         too.
16830
16831         (Interface::GetInterfaces): Move from RootContext here and port.
16832
16833         (Interface::GetInterfaceByName): Same here.
16834
16835         * rootcontext.cs (ResolveTree): Re-write.
16836
16837         (PopulateTypes): Re-write.
16838
16839         * class.cs (TypeContainer::Populate): Populate nested types too.
16840         (TypeContainer::Emit): Emit nested members too.
16841
16842         * typemanager.cs (AddUserType): Do not make use of the FullName property,
16843         instead just use the name argument passed in as it is already fully
16844         qualified.
16845
16846         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
16847         to TypeContainer mapping to see if a type is user-defined.
16848
16849         * class.cs (TypeContainer::CloseType): Implement. 
16850
16851         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
16852         the default constructor.
16853
16854         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
16855         twice.
16856
16857         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
16858
16859         * interface.cs (CloseType): Create the type here.
16860
16861         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
16862         the hierarchy.
16863
16864         Remove all the methods which are now in TypeContainer.
16865
16866 2001-10-10  Ravi Pratap  <ravi@ximian.com>
16867
16868         * delegate.cs (Define): Re-write bits to define the delegate
16869         correctly.
16870
16871 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
16872
16873         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
16874
16875         * expression.cs (ImplicitReferenceConversion): handle null as well
16876         as a source to convert to any reference type.
16877
16878         * statement.cs (Return): Perform any implicit conversions to
16879         expected return type.  
16880
16881         Validate use of return statement.  
16882
16883         * codegen.cs (EmitContext): Pass the expected return type here.
16884
16885         * class.cs (Method, Constructor, Property): Pass expected return
16886         type to EmitContext.
16887
16888 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
16889
16890         * expression.cs: Make DoResolve take an EmitContext instead of a
16891         TypeContainer.
16892
16893         Replaced `l' and `location' for `loc', for consistency.
16894
16895         (Error, Warning): Remove unneeded Tc argument.
16896
16897         * assign.cs, literal.cs, constant.cs: Update to new calling
16898         convention. 
16899
16900         * codegen.cs: EmitContext now contains a flag indicating whether
16901         code is being generated in a static method or not.
16902
16903         * cs-parser.jay: DecomposeQI, new function that replaces the old
16904         QualifiedIdentifier.  Now we always decompose the assembled
16905         strings from qualified_identifier productions into a group of
16906         memberaccesses.
16907
16908 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
16909
16910         * rootcontext.cs: Deal with field-less struct types correctly now
16911         by passing the size option to Define Type.
16912
16913         * class.cs: Removed hack that created one static field. 
16914
16915 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
16916
16917         * statement.cs: Moved most of the code generation here. 
16918
16919 2001-10-09  Ravi Pratap  <ravi@ximian.com>
16920
16921         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
16922         seem very right.
16923
16924         (ElementAccess): Remove useless bits for now - keep checks as the spec
16925         says.
16926
16927 2001-10-08  Ravi Pratap  <ravi@ximian.com>
16928
16929         * expression.cs (ElementAccess::DoResolve): Remove my crap code
16930         and start performing checks according to the spec.
16931
16932 2001-10-07  Ravi Pratap  <ravi@ximian.com>
16933
16934         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
16935         rank_specifiers instead.
16936
16937         (rank_specifiers): Change the order in which the rank specifiers are stored
16938
16939         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
16940
16941         * expression.cs (ElementAccess): Implement the LValue interface too.
16942
16943 2001-10-06  Ravi Pratap  <ravi@ximian.com>
16944
16945         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
16946         except that user defined conversions are not included.
16947
16948         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
16949         perform the conversion of the return type, if necessary.
16950
16951         (New::DoResolve): Check whether we are creating an array or an object
16952         and accordingly do the needful.
16953
16954         (New::Emit): Same here.
16955
16956         (New::DoResolve): Implement guts of array creation.
16957
16958         (New::FormLookupType): Helper function.
16959
16960 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
16961
16962         * codegen.cs: Removed most of the code generation here, and move the
16963         corresponding code generation bits to the statement classes. 
16964
16965         Added support for try/catch/finalize and throw.
16966
16967         * cs-parser.jay: Added support for try/catch/finalize.
16968
16969         * class.cs: Catch static methods having the flags override,
16970         virtual or abstract.
16971
16972         * expression.cs (UserCast): This user cast was not really doing
16973         what it was supposed to do.  Which is to be born in fully resolved
16974         state.  Parts of the resolution were being performed at Emit time! 
16975
16976         Fixed this code.
16977
16978 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
16979
16980         * expression.cs: Implicity convert the result from UserCast.
16981
16982 2001-10-05  Ravi Pratap  <ravi@ximian.com>
16983
16984         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
16985         prevented it from working correctly. 
16986
16987         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
16988         merely ConvertImplicit.
16989
16990 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
16991
16992         * typemanager.cs: Make the LookupTypeContainer function static,
16993         and not per-instance.  
16994
16995         * class.cs: Make static FindMembers (the one that takes a Type
16996         argument). 
16997
16998         * codegen.cs: Add EmitForeach here.
16999
17000         * cs-parser.jay: Make foreach a toplevel object instead of the
17001         inline expansion, as we need to perform semantic analysis on it. 
17002
17003 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17004
17005         * expression.cs (Expression::ImplicitUserConversion): Rename to
17006         UserDefinedConversion.
17007
17008         (Expression::UserDefinedConversion): Take an extra argument specifying 
17009         whether we look for explicit user conversions too.
17010
17011         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
17012
17013         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
17014
17015         (ExplicitUserConversion): Make it a call to UserDefinedConversion
17016         with the appropriate arguments.
17017
17018         * cs-parser.jay (cast_expression): Record location too.
17019
17020         * expression.cs (Cast): Record location info.
17021
17022         (Expression::ConvertExplicit): Take location argument.
17023
17024         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
17025         to determine if we are doing explicit conversions.
17026
17027         (UserCast::Emit): Update accordingly.
17028
17029         (Expression::ConvertExplicit): Report an error if everything fails.
17030
17031         * ../errors/cs0030.cs : Add.
17032
17033 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
17034
17035         * modifiers.cs: If the ABSTRACT keyword is present, also set the
17036         virtual and newslot bits. 
17037
17038         * class.cs (TypeContainer::RegisterRequiredImplementations):
17039         Record methods we need.
17040
17041         (TypeContainer::MakeKey): Helper function to make keys for
17042         MethodBases, since the Methodbase key is useless.
17043
17044         (TypeContainer::Populate): Call RegisterRequiredImplementations
17045         before defining the methods.   
17046
17047         Create a mapping for method_builders_to_methods ahead of time
17048         instead of inside a tight loop.
17049
17050         (::RequireMethods):  Accept an object as the data to set into the
17051         hashtable so we can report interface vs abstract method mismatch.
17052
17053 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17054
17055         * report.cs: Make all of it static.
17056
17057         * rootcontext.cs: Drop object_type and value_type computations, as
17058         we have those in the TypeManager anyways.
17059
17060         Drop report instance variable too, now it is a global.
17061
17062         * driver.cs: Use try/catch on command line handling.
17063
17064         Add --probe option to debug the error reporting system with a test
17065         suite. 
17066
17067         * report.cs: Add support for exiting program when a probe
17068         condition is reached.
17069
17070 2001-10-03  Ravi Pratap  <ravi@ximian.com>
17071
17072         * expression.cs (Binary::DoNumericPromotions): Fix the case when
17073         we do a forcible conversion regardless of type, to check if 
17074         ForceConversion returns a null.
17075
17076         (Binary::error19): Use location to report error.
17077
17078         (Unary::error23): Use location here too.
17079
17080         * ../errors/cs0019.cs : Check in.
17081
17082         * ../errors/cs0023.cs : Check in.
17083
17084         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
17085         case of a non-null MethodInfo object with a length of 0 !
17086
17087         (Binary::ResolveOperator): Flag error if overload resolution fails to find
17088         an applicable member - according to the spec :-)
17089         Also fix logic to find members in base types.
17090
17091         (Unary::ResolveOperator): Same here.
17092
17093         (Unary::report23): Change name to error23 and make first argument a TypeContainer
17094         as I was getting thoroughly confused between this and error19 :-)
17095
17096         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
17097         (::FindMostEncompassedType): Implement.
17098         (::FindMostEncompassingType): Implement.
17099         (::StandardConversionExists): Implement.
17100
17101         (UserImplicitCast): Re-vamp. We now need info about most specific
17102         source and target types so that we can do the necessary conversions.
17103
17104         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
17105         mathematical union with no duplicates.
17106
17107 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17108
17109         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
17110         in order from base classes to child classes, so that we can in
17111         child classes look up in our parent for method names and
17112         attributes (required for handling abstract, virtual, new, override
17113         constructs: we need to instrospect our base class, and if we dont
17114         populate the classes in order, the introspection might be
17115         incorrect.  For example, a method could query its parent before
17116         the parent has any methods and would determine that the parent has
17117         no abstract methods (while it could have had them)).
17118
17119         (RootContext::CreateType): Record the order in which we define the
17120         classes.
17121
17122 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
17123
17124         * class.cs (TypeContainer::Populate): Also method definitions can
17125         fail now, keep track of this.
17126
17127         (TypeContainer::FindMembers): Implement support for
17128         DeclaredOnly/noDeclaredOnly flag.
17129
17130         (Constructor::Emit) Return the ConstructorBuilder.
17131
17132         (Method::Emit) Return the MethodBuilder. 
17133         Check for abstract or virtual methods to be public.
17134
17135         * rootcontext.cs (RootContext::CreateType): Register all the
17136         abstract methods required for the class to be complete and the
17137         interface methods that must be implemented. 
17138
17139         * cs-parser.jay: Report error 501 (method requires body if it is
17140         not marked abstract or extern).
17141
17142         * expression.cs (TypeOf::Emit): Implement.
17143
17144         * typemanager.cs: runtime_handle_type, new global type.
17145
17146         * class.cs (Property::Emit): Generate code for properties.
17147
17148 2001-10-02  Ravi Pratap  <ravi@ximian.com>
17149
17150         * expression.cs (Unary::ResolveOperator): Find operators on base type
17151         too - we now conform exactly to the spec.
17152
17153         (Binary::ResolveOperator): Same here.
17154
17155         * class.cs (Operator::Define): Fix minor quirk in the tests.
17156
17157         * ../errors/cs0215.cs : Added.
17158
17159         * ../errors/cs0556.cs : Added.
17160
17161         * ../errors/cs0555.cs : Added.
17162
17163 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17164
17165         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
17166         single integer which is really efficient
17167
17168 2001-10-01  Ravi Pratap  <ravi@ximian.com>
17169
17170         *  expression.cs (Expression::ImplicitUserConversion): Use location
17171         even in the case when we are examining True operators.
17172  
17173         * class.cs (Operator::Define): Perform extensive checks to conform
17174         with the rules for operator overloading in the spec.
17175
17176         * expression.cs (Expression::ImplicitReferenceConversion): Implement
17177         some of the other conversions mentioned in the spec.
17178
17179         * typemanager.cs (array_type): New static member for the System.Array built-in
17180         type.
17181
17182         (cloneable_interface): For System.ICloneable interface.
17183
17184         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
17185         we start resolving the tree and populating types.
17186
17187         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
17188  
17189 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17190
17191         * expression.cs (Expression::ExprClassFromMemberInfo,
17192         Expression::Literalize): Create literal expressions from
17193         FieldInfos which are literals.
17194
17195         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
17196         type casts, because they were wrong.  The test suite in tests
17197         caught these ones.
17198
17199         (ImplicitNumericConversion): ushort to ulong requires a widening
17200         cast. 
17201
17202         Int32 constant to long requires widening cast as well.
17203
17204         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
17205         for integers because the type on the stack is not i4.
17206
17207 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
17208
17209         * expression.cs (report118): require location argument. 
17210
17211         * parameter.cs: Do not dereference potential null value.
17212
17213         * class.cs: Catch methods that lack the `new' keyword when
17214         overriding a name.  Report warnings when `new' is used without
17215         anything being there to override.
17216
17217         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
17218
17219         * class.cs: Only add constructor to hashtable if it is non-null
17220         (as now constructors can fail on define).
17221
17222         (TypeManager, Class, Struct): Take location arguments.
17223
17224         Catch field instance initialization in structs as errors.
17225
17226         accepting_filter: a new filter for FindMembers that is static so
17227         that we dont create an instance per invocation.
17228
17229         (Constructor::Define): Catch errors where a struct constructor is
17230         parameterless 
17231
17232         * cs-parser.jay: Pass location information for various new
17233         constructs. 
17234
17235         * delegate.cs (Delegate): take a location argument.
17236
17237         * driver.cs: Do not call EmitCode if there were problesm in the
17238         Definition of the types, as many Builders wont be there. 
17239
17240         * decl.cs (Decl::Decl): Require a location argument.
17241
17242         * cs-tokenizer.cs: Handle properly hex constants that can not fit
17243         into integers, and find the most appropiate integer for it.
17244
17245         * literal.cs: Implement ULongLiteral.
17246
17247         * rootcontext.cs: Provide better information about the location of
17248         failure when CreateType fails.
17249
17250 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
17251
17252         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
17253         as well.
17254
17255         * expression.cs (Binary::CheckShiftArguments): Add missing type
17256         computation.
17257         (Binary::ResolveOperator): Add type to the logical and and logical
17258         or, Bitwise And/Or and Exclusive Or code paths, it was missing
17259         before.
17260
17261         (Binary::DoNumericPromotions): In the case where either argument
17262         is ulong (and most signed types combined with ulong cause an
17263         error) perform implicit integer constant conversions as well.
17264
17265 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17266
17267         * expression.cs (UserImplicitCast): Method should always be
17268         non-null. 
17269         (Invocation::BetterConversion): Simplified test for IntLiteral.
17270
17271         (Expression::ImplicitNumericConversion): Split this routine out.
17272         Put the code that performs implicit constant integer conversions
17273         here. 
17274
17275         (Expression::Resolve): Become a wrapper around DoResolve so we can
17276         check eclass and type being set after resolve.
17277
17278         (Invocation::Badness): Remove this dead function
17279
17280         (Binary::ResolveOperator): Do not compute the expensive argumnets
17281         unless we have a union for it.
17282
17283         (Probe::Emit): Is needs to do an isinst and then
17284         compare against null.
17285
17286         (::CanConvert): Added Location argument.  If the Location argument
17287         is null (Location.Null), then we do not report errors.  This is
17288         used by the `probe' mechanism of the Explicit conversion.  We do
17289         not want to generate an error for something that the user
17290         explicitly requested to be casted.  But the pipeline for an
17291         explicit cast first tests for potential implicit casts.
17292
17293         So for now, if the Location is null, it means `Probe only' to
17294         avoid adding another argument.   Might have to revise this
17295         strategy later.
17296
17297         (ClassCast): New class used to type cast objects into arbitrary
17298         classes (used in Explicit Reference Conversions).
17299
17300         Implement `as' as well.
17301
17302         Reverted all the patches from Ravi below: they were broken:
17303
17304                 * The use of `level' as a mechanism to stop recursive
17305                   invocations is wrong.  That was there just to catch the
17306                   bug with a strack trace but not as a way of addressing
17307                   the problem.
17308
17309                   To fix the problem we have to *understand* what is going
17310                   on and the interactions and come up with a plan, not
17311                   just get things going.
17312
17313                 * The use of the type conversion cache that I proposed
17314                   last night had an open topic: How does this work across
17315                   protection domains.  A user defined conversion might not
17316                   be public in the location where we are applying the
17317                   conversion, a different conversion might be selected
17318                   (ie, private A->B (better) but public B->A (worse),
17319                   inside A, A->B applies, but outside it, B->A will
17320                   apply).
17321
17322                 * On top of that (ie, even if the above is solved),
17323                   conversions in a cache need to be abstract.  Ie, `To
17324                   convert from an Int to a Short use an OpcodeCast', not
17325                   `To convert from an Int to a Short use the OpcodeCast on
17326                   the variable 5' (which is what this patch was doing).
17327
17328 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17329
17330         * expression.cs (Invocation::ConversionExists): Re-write to use
17331         the conversion cache
17332
17333         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
17334         cache all conversions done, not just user-defined ones.
17335
17336         (Invocation::BetterConversion): The real culprit. Use ConversionExists
17337         to determine if a conversion exists instead of acutually trying to 
17338         perform the conversion. It's faster too.
17339
17340         (Expression::ConvertExplicit): Modify to use ConversionExists to check
17341         and only then attempt the implicit conversion.
17342
17343 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17344
17345         * expression.cs (ConvertImplicit): Use a cache for conversions
17346         already found. Check level of recursion and bail out if necessary.
17347
17348 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17349
17350         * typemanager.cs (string_concat_string_string, string_concat_object_object):
17351         Export standard methods that we expect for string operations.
17352
17353         * statement.cs (Block::UsageWarning): Track usage of variables and
17354         report the errors for not used variables.
17355
17356         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
17357         operator. 
17358
17359 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
17360
17361         * codegen.cs: remove unnneded code 
17362
17363         * expression.cs: Removed BuiltinTypeAccess class
17364
17365         Fix the order in which implicit conversions are
17366         done.  
17367
17368         The previous fixed dropped support for boxed conversions (adding a
17369         test to the test suite now)
17370
17371         (UserImplicitCast::CanConvert): Remove test for source being null,
17372         that code is broken.  We should not feed a null to begin with, if
17373         we do, then we should track the bug where the problem originates
17374         and not try to cover it up here.
17375
17376         Return a resolved expression of type UserImplicitCast on success
17377         rather than true/false.  Ravi: this is what I was talking about,
17378         the pattern is to use a static method as a "constructor" for
17379         objects. 
17380
17381         Also, do not create arguments until the very last minute,
17382         otherwise we always create the arguments even for lookups that
17383         will never be performed. 
17384
17385         (UserImplicitCast::Resolve): Eliminate, objects of type
17386         UserImplicitCast are born in a fully resolved state. 
17387
17388         * typemanager.cs (InitCoreTypes): Init also value_type
17389         (System.ValueType). 
17390
17391         * expression.cs (Cast::Resolve): First resolve the child expression.
17392
17393         (LValue): Add new method AddressOf to be used by
17394         the `&' operator.  
17395
17396         Change the argument of Store to take an EmitContext instead of an
17397         ILGenerator, because things like FieldExpr need to be able to call
17398         their children expression to generate the instance code. 
17399
17400         (Expression::Error, Expression::Warning): Sugar functions for
17401         reporting errors.
17402
17403         (Expression::MemberLookup): Accept a TypeContainer instead of a
17404         Report as the first argument.
17405
17406         (Expression::ResolvePrimary): Killed.  I still want to improve
17407         this as currently the code is just not right.
17408
17409         (Expression::ResolveMemberAccess): Simplify, but it is still
17410         wrong. 
17411
17412         (Unary::Resolve): Catch errors in AddressOf operators.
17413
17414         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
17415         index to a byte for the short-version, or the compiler will choose
17416         the wrong Emit call, which generates the wrong data.
17417
17418         (ParameterReference::Emit, ::Store): same.
17419
17420         (FieldExpr::AddressOf): Implement.
17421
17422         * typemanager.cs: TypeManager: made public variable instead of
17423         property.
17424
17425         * driver.cs: document --fatal.
17426
17427         * report.cs (ErrorMessage, WarningMessage): new names for the old
17428         Error and Warning classes.
17429
17430         * cs-parser.jay (member_access): Turn built-in access to types
17431         into a normal simplename
17432
17433 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17434
17435         * expression.cs (Invocation::BetterConversion): Fix to cope
17436         with q being null, since this was introducing a bug.
17437
17438         * expression.cs (ConvertImplicit): Do built-in conversions first.
17439
17440 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17441
17442         * expression.cs (UserImplicitCast::Resolve): Fix bug.
17443
17444 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17445
17446         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
17447         I had introduced long ago (what's new ?).
17448
17449         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
17450         the work of all the checking. 
17451         (ConvertImplicit): Call CanConvert and only then create object if necessary.
17452         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
17453
17454         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
17455         that is the right way. 
17456
17457         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
17458         overloading resolution. Use everywhere instead of cutting and pasting code.
17459
17460         (Binary::ResolveOperator): Use MakeUnionSet.
17461
17462         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
17463         we have to convert to bool types. Not complete yet.
17464
17465 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
17466
17467         * typemanager.cs (TypeManager::CSharpName): support ushort.
17468
17469         * expression.cs (Expression::TryImplicitIntConversion): Attempts
17470         to provide an expression that performsn an implicit constant int
17471         conversion (section 6.1.6).
17472         (Expression::ConvertImplicitRequired): Reworked to include
17473         implicit constant expression conversions.
17474
17475         (Expression::ConvertNumericExplicit): Finished.
17476
17477         (Invocation::Emit): If InstanceExpression is null, then it means
17478         that we perform a call on this.
17479
17480 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
17481
17482         * expression.cs (Unary::Emit): Remove some dead code.
17483         (Probe): Implement Resolve and Emit for `is'.
17484         (Expression::ConvertImplicitRequired): Attempt to do constant
17485         expression conversions here.  Maybe should be moved to
17486         ConvertImplicit, but I am not sure.
17487         (Expression::ImplicitLongConstantConversionPossible,
17488         Expression::ImplicitIntConstantConversionPossible): New functions
17489         that tell whether is it possible to apply an implicit constant
17490         expression conversion.
17491
17492         (ConvertNumericExplicit): Started work on explicit numeric
17493         conversions.
17494
17495         * cs-parser.jay: Update operator constants.
17496
17497         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
17498         (Parameters::GetSignature): Hook up VerifyArgs here.
17499         (Parameters::VerifyArgs): Verifies that no two arguments have the
17500         same name. 
17501
17502         * class.cs (Operator): Update the operator names to reflect the
17503         ones that the spec expects (as we are just stringizing the
17504         operator names).
17505
17506         * expression.cs (Unary::ResolveOperator): Fix bug: Use
17507         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
17508         previous usage did only work for our methods.
17509         (Expression::ConvertImplicit): Handle decimal implicit numeric
17510         conversions as well.
17511         (Expression::InternalTypeConstructor): Used to invoke constructors
17512         on internal types for default promotions.
17513
17514         (Unary::Emit): Implement special handling for the pre/post
17515         increment/decrement for overloaded operators, as they need to have
17516         the same semantics as the other operators.
17517
17518         (Binary::ResolveOperator): ditto.
17519         (Invocation::ConversionExists): ditto.
17520         (UserImplicitCast::Resolve): ditto.
17521
17522 2001-09-26  Ravi Pratap  <ravi@ximian.com>
17523
17524         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
17525         operator, return after emitting body. Regression tests pass again !
17526
17527         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
17528         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
17529         (Invocation::OverloadResolve): Ditto.
17530         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
17531
17532         * everywhere : update calls to the above methods accordingly.
17533
17534 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
17535
17536         * assign.cs (Assign): Make it inherit from ExpressionStatement.
17537
17538         * expression.cs (ExpressionStatement): New base class used for
17539         expressions that can appear in statements, so that we can provide
17540         an alternate path to generate expression that do not leave a value
17541         on the stack.
17542
17543         (Expression::Emit, and all the derivatives): We no longer return
17544         whether a value is left on the stack or not.  Every expression
17545         after being emitted leaves a single value on the stack.
17546
17547         * codegen.cs (EmitContext::EmitStatementExpression): Use the
17548         facilties of ExpressionStatement if possible.
17549
17550         * cs-parser.jay: Update statement_expression.
17551
17552 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
17553
17554         * driver.cs: Change the wording of message
17555
17556 2001-09-25  Ravi Pratap  <ravi@ximian.com>
17557
17558         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
17559         the type of the expression to the return type of the method if
17560         we have an overloaded operator match ! The regression tests pass again !
17561         (Unary::ResolveOperator): Ditto.
17562
17563         * expression.cs (Invocation::ConversionExists): Correct the member lookup
17564         to find "op_Implicit", not "implicit" ;-)
17565         (UserImplicitCast): New class to take care of user-defined implicit conversions.
17566         (ConvertImplicit, ForceConversion): Take TypeContainer argument
17567
17568         * everywhere : Correct calls to the above accordingly.
17569
17570         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
17571         (ConvertImplicit): Do user-defined conversion if it exists.
17572
17573 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
17574
17575         * assign.cs: track location.
17576         (Resolve): Use implicit conversions on assignment.
17577
17578         * literal.cs: Oops.  Not good, Emit of short access values should
17579         pass (Bytes) or the wrong argument will be selected.
17580
17581         * expression.cs (Unary::Emit): Emit code for -expr.
17582
17583         (Unary::ResolveOperator): Handle `Substract' for non-constants
17584         (substract from zero from the non-constants).
17585         Deal with Doubles as well. 
17586
17587         (Expression::ConvertImplicitRequired): New routine that reports an
17588         error if no implicit conversion exists. 
17589
17590         (Invocation::OverloadResolve): Store the converted implicit
17591         expressions if we make them
17592
17593 2001-09-24  Ravi Pratap  <ravi@ximian.com>
17594
17595         * class.cs (ConstructorInitializer): Take a Location argument.
17596         (ConstructorBaseInitializer): Same here.
17597         (ConstructorThisInitializer): Same here.
17598
17599         * cs-parser.jay : Update all calls accordingly.
17600
17601         * expression.cs (Unary, Binary, New): Take location argument.
17602         Update accordingly everywhere.
17603
17604         * cs-parser.jay : Update all calls to the above to take a location
17605         argument.
17606
17607         * class.cs : Ditto.
17608
17609 2001-09-24  Ravi Pratap  <ravi@ximian.com>
17610
17611         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
17612         (Invocation::BetterConversion): Same here
17613         (Invocation::ConversionExists): Ditto.
17614
17615         (Invocation::ConversionExists): Implement.
17616
17617 2001-09-22  Ravi Pratap  <ravi@ximian.com>
17618
17619         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
17620         Also take an additional TypeContainer argument.
17621
17622         * All over : Pass in TypeContainer as argument to OverloadResolve.
17623
17624         * typemanager.cs (CSharpName): Update to check for the string type and return
17625         that too.
17626
17627         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
17628         a given method.
17629
17630 2001-09-21  Ravi Pratap  <ravi@ximian.com>
17631
17632         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
17633         (Invocation::BetterFunction): Implement.
17634         (Invocation::BetterConversion): Implement.
17635         (Invocation::ConversionExists): Skeleton, no implementation yet.
17636
17637         Okay, things work fine !
17638
17639 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
17640
17641         * typemanager.cs: declare and load enum_type, delegate_type and
17642         void_type. 
17643
17644         * expression.cs (Expression::Emit): Now emit returns a value that
17645         tells whether a value is left on the stack or not.  This strategy
17646         might be reveted tomorrow with a mechanism that would address
17647         multiple assignments.
17648         (Expression::report118): Utility routine to report mismatches on
17649         the ExprClass.
17650
17651         (Unary::Report23): Report impossible type/operator combination
17652         utility function.
17653
17654         (Unary::IsIncrementableNumber): Whether the type can be
17655         incremented or decremented with add.
17656         (Unary::ResolveOperator): Also allow enumerations to be bitwise
17657         complemented. 
17658         (Unary::ResolveOperator): Implement ++, !, ~,
17659
17660         (Invocation::Emit): Deal with new Emit convetion.
17661
17662         * All Expression derivatives: Updated their Emit method to return
17663         whether they leave values on the stack or not.
17664
17665         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
17666         stack for expressions that are statements. 
17667
17668 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
17669
17670         * expression.cs (LValue): New interface.  Must be implemented by
17671         LValue objects.
17672         (LocalVariableReference, ParameterReference, FieldExpr): Implement
17673         LValue interface.
17674
17675         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
17676         interface for generating code, simplifies the code.
17677
17678 2001-09-20  Ravi Pratap  <ravi@ximian.com>
17679
17680         * expression.cs (everywhere): Comment out return statements in ::Resolve
17681         methods to avoid the warnings.
17682
17683 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
17684
17685         * driver.cs (parse): Report error 2001 if we can not open the
17686         source file.
17687
17688         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
17689         not resolve it.
17690
17691         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
17692         object. 
17693
17694         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
17695         otherwise nested blocks end up with the same index.
17696
17697         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
17698
17699         * expression.cs:  Instead of having FIXMEs in the Resolve
17700         functions, throw exceptions so it is obvious that we are facing a
17701         bug. 
17702
17703         * cs-parser.jay (invocation_expression): Pass Location information.
17704
17705         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
17706         Use a basename for those routines because .NET does not like paths
17707         on them. 
17708
17709         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
17710         already defined.
17711
17712 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
17713
17714         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
17715         are loading the correct data types (throws an exception if not).
17716         (TypeManager::InitCoreTypes): Use CoreLookupType
17717
17718         * expression.cs (Unary::ResolveOperator): return the child
17719         expression for expressions which are just +expr.
17720         (Unary::ResolveOperator): Return negative literals for -LITERAL
17721         expressions (otherwise they are Unary {Literal}).
17722         (Invocation::Badness): Take into account `Implicit constant
17723         expression conversions'.
17724
17725         * literal.cs (LongLiteral): Implement long literal class.
17726         (IntLiteral): export the `Value' of the intliteral. 
17727
17728 2001-09-19  Ravi Pratap  <ravi@ximian.com>
17729
17730         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
17731
17732         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
17733         instead of 'Operator'
17734
17735         * expression.cs (Binary::ResolveOperator): Update accordingly.
17736         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
17737         and 'Minus'
17738
17739         * cs-parser.jay (unary_expression): Update to use the new names.
17740
17741         * gen-treedump.cs (GetUnary): Same here.
17742
17743         * expression.cs (Unary::Resolve): Implement.
17744         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
17745         operators are found instead of making noise ;-)
17746         (Unary::ResolveOperator): New method to do precisely the same thing which
17747         Binary::ResolveOperator does for Binary expressions.
17748         (Unary.method, .Arguments): Add.
17749         (Unary::OperName): Implement.   
17750         (Unary::ForceConversion): Copy and Paste !
17751
17752         * class.cs (Operator::Define): Fix a small bug for the case when we have 
17753         a unary operator.
17754
17755         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
17756         for the inbuilt operators. Only overloading works for now ;-)
17757
17758 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
17759
17760         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
17761         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
17762
17763         * expression.cs (This::Emit): Implement. 
17764         (This::Resolve): Implement.
17765         (TypeOf:Resolve): Implement.
17766         (Expression::ResolveSimpleName): Add an implicit this to instance
17767         field references. 
17768         (MemberAccess::Resolve): Deal with Parameters and Fields. 
17769         Bind instance variable to Field expressions.
17770         (FieldExpr::Instance): New field used to track the expression that
17771         represents the object instance.
17772         (FieldExpr::Resolve): Track potential errors from MemberLookup not
17773         binding 
17774         (FieldExpr::Emit): Implement.
17775
17776         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
17777         the last instruction contains a return opcode to avoid generating
17778         the last `ret' instruction (this generates correct code, and it is
17779         nice to pass the peverify output).
17780
17781         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
17782         initializer for static and instance variables.
17783         (Constructor::Emit): Allow initializer to be null in the case of
17784         static constructors.  Only emit initializer for instance
17785         constructors. 
17786
17787         (TypeContainer::FindMembers): Return a null array if there are no
17788         matches.
17789
17790         Also fix the code for the MemberTypes.Method branch, as it was not
17791         scanning that for operators (or tried to access null variables before).
17792
17793         * assign.cs (Assign::Emit): Handle instance and static fields. 
17794
17795         * TODO: Updated.
17796
17797         * driver.cs: Stop compilation if there are parse errors.
17798
17799         * cs-parser.jay (constructor_declaration): Provide default base
17800         initializer for non-static constructors.
17801         (constructor_declarator): Do not provide a default base
17802         initializers if none was specified.
17803         Catch the fact that constructors should not have parameters.
17804
17805         * class.cs: Do not emit parent class initializers for static
17806         constructors, that should be flagged as an error.
17807
17808 2001-09-18  Ravi Pratap  <ravi@ximian.com>
17809
17810         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
17811         Move back code into TypeContainer::Populate.
17812
17813 2001-09-18  Ravi Pratap  <ravi@ximian.com>
17814
17815         * class.cs (TypeContainer::AddConstructor): Fix the check to
17816         compare against Name, not Basename. 
17817         (Operator::OpType): Change Plus and Minus to Add and Subtract.
17818
17819         * cs-parser.jay : Update accordingly.
17820
17821         * class.cs (TypeContainer::FindMembers): For the case where we are searching
17822         for methods, don't forget to look into the operators too.
17823         (RegisterMethodBuilder): Helper method to take care of this for
17824         methods, constructors and operators.
17825         (Operator::Define): Completely revamp.
17826         (Operator.OperatorMethod, MethodName): New fields.
17827         (TypeContainer::Populate): Move the registering of builders into
17828         RegisterMethodBuilder.
17829         (Operator::Emit): Re-write.
17830
17831         * expression.cs (Binary::Emit): Comment out code path to emit method
17832         invocation stuff for the case when we have a user defined operator. I am
17833         just not able to get it right !
17834
17835 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
17836
17837         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
17838         argument. 
17839
17840         (Expression::MemberLookup): Provide a version that allows to
17841         specify the MemberTypes and BindingFlags. 
17842
17843         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
17844         so it was not fetching variable information from outer blocks.
17845
17846         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
17847         Beforefieldinit as it was buggy.
17848
17849         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
17850         that Ravi put here.  
17851
17852         * class.cs (Constructor::Emit): Only emit if block is not null.
17853         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
17854         deal with this by semantically definining it as if the user had
17855         done it.
17856
17857         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
17858         constructors as we now "emit" them at a higher level.
17859
17860         (TypeContainer::DefineDefaultConstructor): Used to define the
17861         default constructors if none was provided.
17862
17863         (ConstructorInitializer): Add methods Resolve and Emit. 
17864
17865         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
17866
17867 2001-09-17  Ravi Pratap  <ravi@ximian.com>
17868
17869         * class.cs (TypeContainer::EmitDefaultConstructor): Register
17870         the default constructor builder with our hashtable for methodbuilders
17871         to methodcores.
17872
17873         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
17874         and argument_count is 0 in which case we have a match.
17875         (Binary::ResolveOperator): More null checking and miscellaneous coding
17876         style cleanup.
17877
17878 2001-09-17  Ravi Pratap  <ravi@ximian.com>
17879
17880         * rootcontext.cs (IsNameSpace): Compare against null.
17881
17882         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
17883
17884         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
17885         and Unary::Operator.
17886
17887         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
17888         accordingly.
17889
17890         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
17891         we have overloaded operators.
17892         (Binary::ResolveOperator): Implement the part which does the operator overload
17893         resolution.
17894
17895         * class.cs (Operator::Emit): Implement.
17896         (TypeContainer::Emit): Emit the operators we have too.
17897
17898         * expression.cs (Binary::Emit): Update to emit the appropriate code for
17899         the case when we have a user-defined operator.
17900
17901 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
17902
17903         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
17904
17905 2001-09-16  Ravi Pratap  <ravi@ximian.com>
17906
17907         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
17908         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
17909         (Constructor::Emit): Implement.
17910         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
17911         if we have no work to do. 
17912         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
17913         Emit method.
17914
17915         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
17916         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
17917
17918         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
17919         of parent.parent.
17920
17921 2001-09-15  Ravi Pratap  <ravi@ximian.com>
17922
17923         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
17924         in the source.
17925         (Tree::RecordNamespace): Method to do what the name says ;-)
17926         (Tree::Namespaces): Property to get at the namespaces hashtable.
17927
17928         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
17929         keep track.
17930
17931         * rootcontext.cs (IsNamespace): Fixed it :-)
17932
17933 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
17934
17935         * class.cs (TypeContainer::FindMembers): Add support for
17936         constructors. 
17937         (MethodCore): New class that encapsulates both the shared aspects
17938         of a Constructor and a Method.  
17939         (Method, Constructor): Factored pieces into MethodCore.
17940
17941         * driver.cs: Added --fatal which makes errors throw exceptions.
17942         Load System assembly as well as part of the standard library.
17943
17944         * report.cs: Allow throwing exceptions on errors for debugging.
17945
17946         * modifiers.cs: Do not use `parent', instead use the real type
17947         container to evaluate permission settings.
17948
17949         * class.cs: Put Ravi's patch back in.  He is right, and we will
17950         have to cope with the
17951
17952 2001-09-14  Ravi Pratap  <ravi@ximian.com>
17953
17954         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
17955         FamORAssem, not FamANDAssem.
17956
17957 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
17958
17959         * driver.cs: Added --parse option that only parses its input files
17960         and terminates.
17961
17962         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
17963         incorrect.  IsTopLevel is not used to tell whether an object is
17964         root_types or not (that can be achieved by testing this ==
17965         root_types).  But to see if this is a top-level *class* (not
17966         necessarly our "toplevel" container). 
17967
17968 2001-09-14  Ravi Pratap  <ravi@ximian.com>
17969
17970         * enum.cs (Enum::Define): Modify to call the Lookup method on the
17971         parent instead of a direct call to GetType.
17972
17973 2001-09-14  Ravi Pratap  <ravi@ximian.com>
17974
17975         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
17976         Modifiers.TypeAttr. This should just be a call to that method.
17977
17978         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
17979         object so that we can determine if we are top-level or not.
17980
17981         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
17982         TypeContainer too.
17983
17984         * enum.cs (Enum::Define): Ditto.
17985
17986         * modifiers.cs (FieldAttr): Re-write.
17987
17988         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
17989         (TypeContainer::HaveStaticConstructor): New property to provide access
17990         to precisely that info.
17991
17992         * modifiers.cs (MethodAttr): Re-write.
17993         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
17994
17995         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
17996         of top-level types as claimed.
17997
17998 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
17999
18000         * expression.cs (MemberLookup): Fruitless attempt to lookup
18001         constructors.  Maybe I need to emit default constructors?  That
18002         might be it (currently .NET emits this for me automatically).
18003         (Invocation::OverloadResolve): Cope with Arguments == null.
18004         (Invocation::EmitArguments): new function, shared by the new
18005         constructor and us.
18006         (Invocation::Emit): Handle static and instance methods.  Emit
18007         proper call instruction for virtual or non-virtual invocations.
18008         (New::Emit): Implement.
18009         (New::Resolve): Implement.
18010         (MemberAccess:Resolve): Implement.
18011         (MethodGroupExpr::InstanceExpression): used conforming to the spec
18012         to track instances.
18013         (FieldExpr::Resolve): Set type.
18014
18015         * support.cs: Handle empty arguments.
18016                 
18017         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
18018         SimpleLookup): Auxiliary routines to help parse a qualifier
18019         identifier.  
18020
18021         Update qualifier_identifier rule.
18022
18023         * codegen.cs: Removed debugging messages.
18024
18025         * class.cs: Make this a global thing, this acts just as a "key" to
18026         objects that we might have around.
18027
18028         (Populate): Only initialize method_builders_to_methods once.
18029
18030         * expression.cs (PropertyExpr): Initialize type from the
18031         PropertyType. 
18032
18033         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
18034         Resolve pattern.  Attempt to implicitly convert value to boolean.
18035         Emit code.
18036
18037         * expression.cs: Set the type for the int32/int32 argument case.
18038         (Binary::ResolveOperator): Set the return type to boolean for
18039         comparission operators
18040
18041         * typemanager.cs: Remove debugging print code.
18042
18043         (Invocation::Resolve): resolve type.
18044
18045         * class.cs: Allocate a MemberInfo of the correct size, as the code
18046         elsewhere depends on the test to reflect the correct contents.
18047
18048         (Method::) Keep track of parameters, due to System.Reflection holes
18049
18050         (TypeContainer::Populate): Keep track of MethodBuilders to Method
18051         mapping here.
18052
18053         (TypeContainer::FindMembers): Use ArrayList and then copy an array
18054         of the exact size and return that.
18055
18056         (Class::LookupMethodByBuilder): New function that maps
18057         MethodBuilders to its methods.  Required to locate the information
18058         on methods because System.Reflection bit us again.
18059
18060         * support.cs: New file, contains an interface ParameterData and
18061         two implementations: ReflectionParameters and InternalParameters
18062         used to access Parameter information.  We will need to grow this
18063         as required.
18064
18065         * expression.cs (Invocation::GetParameterData): implement a cache
18066         and a wrapper around the ParameterData creation for methods. 
18067         (Invocation::OverloadResolve): Use new code.
18068
18069 2001-09-13  Ravi Pratap  <ravi@ximian.com>
18070
18071         * class.cs (TypeContainer::EmitField): Remove and move into 
18072         (Field::Define): here and modify accordingly.
18073         (Field.FieldBuilder): New member.
18074         (TypeContainer::Populate): Update accordingly.
18075         (TypeContainer::FindMembers): Implement.
18076
18077 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18078
18079         * statement.cs: (VariableInfo::VariableType): New field to be
18080         initialized with the full type once it is resolved. 
18081
18082 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
18083
18084         * parameter.cs (GetParameterInfo): Use a type cache to compute
18085         things only once, and to reuse this information
18086
18087         * expression.cs (LocalVariableReference::Emit): Implement.
18088         (OpcodeCast::Emit): fix.
18089
18090         (ParameterReference::Resolve): Implement.
18091         (ParameterReference::Emit): Implement.
18092
18093         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
18094         that are expressions need to stay as Expressions.
18095
18096         * typemanager.cs (CSharpName): Returns the C# name of a type if
18097         possible. 
18098
18099         * expression.cs (Expression::ConvertImplicit): New function that
18100         implements implicit type conversions.
18101
18102         (Expression::ImplicitReferenceConversion): Implements implicit
18103         reference conversions.
18104
18105         (EmptyCast): New type for transparent casts.
18106
18107         (OpcodeCast): New type for casts of types that are performed with
18108         a sequence of bytecodes.
18109
18110         (BoxedCast): New type used for casting value types into reference
18111         types.  Emits a box opcode.
18112
18113         (Binary::DoNumericPromotions): Implements numeric promotions of
18114         and computation of the Binary::Type.
18115
18116         (Binary::EmitBranchable): Optimization.
18117
18118         (Binary::Emit): Implement code emission for expressions.
18119
18120         * typemanager.cs (TypeManager): Added two new core types: sbyte
18121         and byte.
18122
18123 2001-09-12  Ravi Pratap  <ravi@ximian.com>
18124
18125         * class.cs (TypeContainer::FindMembers): Method which does exactly
18126         what Type.FindMembers does, only we don't have to use reflection. No
18127         implementation yet.
18128
18129         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
18130         typecontainer objects as we need to get at them.
18131         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
18132
18133         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
18134         typecontainer object.
18135
18136         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
18137         of just a Report object.
18138
18139 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18140
18141         * class.cs (Event::Define): Go back to using the prefixes "add_" and
18142         "remove_"
18143         (TypeContainer::Populate): Now define the delegates of the type too.
18144         (TypeContainer.Delegates): Property to access the list of delegates defined
18145         in the type.
18146
18147         * delegates.cs (Delegate::Define): Implement partially.
18148
18149         * modifiers.cs (TypeAttr): Handle more flags.
18150
18151 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18152
18153         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
18154         and not <=
18155         (Operator::Define): Re-write logic to get types by using the LookupType method
18156         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
18157         (Indexer::Define): Ditto.
18158         (Event::Define): Ditto.
18159         (Property::Define): Ditto.
18160
18161 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18162
18163         * class.cs (TypeContainer::Populate): Now define operators too. 
18164         (TypeContainer.Operators): New property to access the list of operators
18165         in a type.
18166         (Operator.OperatorMethodBuilder): New member to hold the method builder
18167         for the operator we are defining.
18168         (Operator::Define): Implement.
18169
18170 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18171
18172         * class.cs (Event::Define): Make the prefixes of the accessor methods
18173         addOn_ and removeOn_ 
18174
18175         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
18176         of the location being passed in too. Ideally, this should go later since all
18177         error reporting should be done through the Report object.
18178
18179         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
18180         (Populate): Iterate thru the indexers we have and define them too.
18181         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
18182         for the get and set accessors.
18183         (Indexer::Define): Implement.
18184
18185 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
18186
18187         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
18188         my previous implementation, did not work.
18189
18190         * typemanager.cs: Add a couple of missing types (the longs).
18191
18192         * literal.cs: Use TypeManager.bool_type instead of getting it.
18193
18194         * expression.cs (EventExpr): New kind of expressions.
18195         (Expressio::ExprClassFromMemberInfo): finish
18196
18197 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
18198
18199         * assign.cs: Emit stores to static fields differently.
18200
18201 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18202
18203         * Merge in changes and adjust code to tackle conflicts. Backed out my
18204         code in Assign::Resolve ;-) 
18205
18206 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18207
18208         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
18209         instead Report.Error and also pass in the location.
18210         (CSharpParser::Lexer): New readonly property to return the reference
18211         to the Tokenizer object.
18212         (declare_local_variables): Use Report.Error with location instead of plain 
18213         old error.
18214         (CheckDef): Ditto.
18215
18216         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
18217         (Operator.CheckBinaryOperator): Ditto.
18218
18219         * cs-parser.jay (operator_declarator): Update accordingly.
18220
18221         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
18222         (CheckBinaryOperator): Same here.
18223
18224         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
18225         on the name without any prefixes of namespace names etc. This is because we
18226         already might have something already fully qualified like 
18227         'System.Console.WriteLine'
18228
18229         * assign.cs (Resolve): Begin implementation. Stuck ;-)
18230
18231 2001-09-07  Ravi Pratap  <ravi@ximian.com>
18232
18233         * cs-tokenizer.cs (location): Return a string which also contains
18234         the file name.
18235
18236         * expression.cs (ElementAccess): New class for expressions of the
18237         type 'element access.'
18238         (BaseAccess): New class for expressions of the type 'base access.'
18239         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
18240         respectively.
18241
18242         * cs-parser.jay (element_access): Implement action.
18243         (base_access): Implement actions.
18244         (checked_expression, unchecked_expression): Implement.
18245
18246         * cs-parser.jay (local_variable_type): Correct and implement.
18247         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
18248
18249         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
18250
18251         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
18252         name and the specifiers.
18253
18254         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
18255
18256         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
18257         making them all public ;-)
18258
18259         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
18260         class anyways.
18261
18262 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
18263
18264         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
18265         PropertyExprs.
18266         (FieldExpr, PropertyExprs): New resolved expressions.
18267         (SimpleName::MemberStaticCheck): Perform static checks for access
18268         to non-static fields on static methods. Maybe this should be
18269         generalized for MemberAccesses. 
18270         (SimpleName::ResolveSimpleName): More work on simple name
18271         resolution. 
18272
18273         * cs-parser.jay (primary_expression/qualified_identifier): track
18274         the parameter index.
18275
18276         * codegen.cs (CodeGen::Save): Catch save exception, report error.
18277         (EmitContext::EmitBoolExpression): Chain to expression generation
18278         instead of temporary hack.
18279         (::EmitStatementExpression): Put generic expression code generation.
18280
18281         * assign.cs (Assign::Emit): Implement variable assignments to
18282         local variables, parameters and fields.
18283
18284 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
18285
18286         * statement.cs (Block::GetVariableInfo): New method, returns the
18287         VariableInfo for a variable name in a block.
18288         (Block::GetVariableType): Implement in terms of GetVariableInfo
18289
18290         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
18291         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
18292
18293 2001-09-06  Ravi Pratap  <ravi@ximian.com>
18294
18295         * cs-parser.jay (operator_declaration): Continue on my quest : update
18296         to take attributes argument.
18297         (event_declaration): Ditto.
18298         (enum_declaration): Ditto.
18299         (indexer_declaration): Ditto.
18300
18301         * class.cs (Operator::Operator): Update constructor accordingly.
18302         (Event::Event): Ditto.
18303
18304         * delegate.cs (Delegate::Delegate): Same here.
18305
18306         * enum.cs (Enum::Enum): Same here.
18307
18308 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18309
18310         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
18311
18312         * ../tests/cs0658.cs : New file to demonstrate error 0658.
18313
18314         * attribute.cs (Attributes): New class to encapsulate all attributes which were
18315         being passed around as an arraylist.
18316         (Attributes::AddAttribute): Method to add attribute sections.
18317
18318         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
18319         (struct_declaration): Update accordingly.
18320         (constant_declaration): Update.
18321         (field_declaration): Update.
18322         (method_header): Update.
18323         (fixed_parameter): Update.
18324         (parameter_array): Ditto.
18325         (property_declaration): Ditto.
18326         (destructor_declaration): Ditto.
18327
18328         * class.cs (Struct::Struct): Update constructors accordingly.
18329         (Class::Class): Ditto.
18330         (Field::Field): Ditto.
18331         (Method::Method): Ditto.
18332         (Property::Property): Ditto.
18333         (TypeContainer::OptAttribute): update property's return type.
18334
18335         * interface.cs (Interface.opt_attributes): New member.
18336         (Interface::Interface): Update to take the extra Attributes argument.
18337
18338         * parameter.cs (Parameter::Parameter): Ditto.
18339
18340         * constant.cs (Constant::Constant): Ditto.
18341
18342         * interface.cs (InterfaceMemberBase): New OptAttributes field.
18343         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
18344         the attributes as a parameter.
18345         (InterfaceProperty): Update constructor call.
18346         (InterfaceEvent): Ditto.
18347         (InterfaceMethod): Ditto.
18348         (InterfaceIndexer): Ditto.
18349
18350         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
18351         pass the attributes too.
18352         (interface_event_declaration): Ditto.
18353         (interface_property_declaration): Ditto.
18354         (interface_method_declaration): Ditto.
18355         (interface_declaration): Ditto.
18356
18357 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
18358
18359         * class.cs (Method::Define): Track the "static Main" definition to
18360         create an entry point. 
18361
18362         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
18363         EntryPoint if we find it. 
18364
18365         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
18366         (EmitContext::ig): Make this variable public.
18367
18368         * driver.cs: Make the default output file be the first file name
18369         with the .exe extension.  
18370
18371         Detect empty compilations
18372
18373         Handle various kinds of output targets.  Handle --target and
18374         rename -t to --dumper.
18375
18376         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
18377         methods inherited from Expression return now an Expression.  This
18378         will is used during the tree rewriting as we resolve them during
18379         semantic analysis.
18380
18381         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
18382         the spec.  Missing entirely is the information about
18383         accessability of elements of it.
18384
18385         (Expression::ExprClassFromMemberInfo): New constructor for
18386         Expressions that creates a fully initialized Expression based on
18387         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
18388         a Type.
18389
18390         (Invocation::Resolve): Begin implementing resolution of invocations.
18391
18392         * literal.cs (StringLiteral):  Implement Emit.
18393
18394 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18395
18396         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
18397         member.
18398
18399 2001-09-04  Ravi Pratap  <ravi@ximian.com>
18400
18401         * cs-parser.jay (attribute_arguments): Implement actions.
18402         (attribute): Fix bug in production. Implement action.
18403         (attribute_list): Implement.
18404         (attribute_target): Implement.
18405         (attribute_target_specifier, opt_target_specifier): Implement
18406         (CheckAttributeTarget): New method to check if the attribute target
18407         is valid.
18408         (attribute_section): Implement.
18409         (opt_attributes): Implement.
18410
18411         * attribute.cs : New file to handle attributes.
18412         (Attribute): Class to hold attribute info.
18413
18414         * cs-parser.jay (opt_attribute_target_specifier): Remove production
18415         (attribute_section): Modify production to use 2 different rules to 
18416         achieve the same thing. 1 s/r conflict down !
18417         Clean out commented, useless, non-reducing dimension_separator rules.
18418
18419         * class.cs (TypeContainer.attributes): New member to hold list
18420         of attributes for a type.
18421         (Struct::Struct): Modify to take one more argument, the attribute list.
18422         (Class::Class): Ditto.
18423         (Field::Field): Ditto.
18424         (Method::Method): Ditto.
18425         (Property::Property): Ditto.
18426
18427         * cs-parser.jay (struct_declaration): Update constructor call to
18428         pass in the attributes too.
18429         (class_declaration): Ditto.
18430         (constant_declaration): Ditto.
18431         (field_declaration): Ditto.
18432         (method_header): Ditto.
18433         (fixed_parameter): Ditto.
18434         (parameter_array): Ditto.
18435         (property_declaration): Ditto.
18436
18437         * constant.cs (Constant::Constant): Update constructor similarly.
18438         Use System.Collections.
18439
18440         * parameter.cs (Parameter::Parameter): Update as above.
18441
18442 2001-09-02  Ravi Pratap  <ravi@ximian.com>
18443
18444         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
18445         (TypeContainer.delegates): New member to hold list of delegates.
18446
18447         * cs-parser.jay (delegate_declaration): Implement the action correctly 
18448         this time as I seem to be on crack ;-)
18449
18450 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
18451
18452         * rootcontext.cs (RootContext::IsNamespace): new function, used to
18453         tell whether an identifier represents a namespace.
18454
18455         * expression.cs (NamespaceExpr): A namespace expression, used only
18456         temporarly during expression resolution.
18457         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
18458         utility functions to resolve names on expressions.
18459
18460 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
18461
18462         * codegen.cs: Add hook for StatementExpressions. 
18463
18464         * class.cs: Fix inverted test for static flag in methods.
18465
18466 2001-09-02  Ravi Pratap  <ravi@ximian.com>
18467
18468         * class.cs (Operator::CheckUnaryOperator): Correct error number used
18469         to make it coincide with MS' number.
18470         (Operator::CheckBinaryOperator): Ditto.
18471
18472         * ../errors/errors.txt : Remove error numbers added earlier.
18473
18474         * ../errors/cs1019.cs : Test case for error # 1019
18475
18476         * ../errros/cs1020.cs : Test case for error # 1020
18477
18478         * cs-parser.jay : Clean out commented cruft.
18479         (dimension_separators, dimension_separator): Comment out. Ostensibly not
18480         used anywhere - non-reducing rule.
18481         (namespace_declarations): Non-reducing rule - comment out.
18482
18483         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
18484         with TypeContainer::AddEnum.
18485
18486         * delegate.cs : New file for delegate handling classes.
18487         (Delegate): Class for declaring delegates.
18488
18489         * makefile : Update.
18490
18491         * cs-parser.jay (delegate_declaration): Implement.
18492
18493 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
18494
18495         * class.cs (Event::Define): Implement.
18496         (Event.EventBuilder): New member.
18497
18498         * class.cs (TypeContainer::Populate): Update to define all enums and events
18499         we have.
18500         (Events): New property for the events arraylist we hold. Shouldn't we move to using
18501         readonly fields for all these cases ?
18502
18503 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
18504
18505         * class.cs (Property): Revamp to use the convention of making fields readonly.
18506         Accordingly modify code elsewhere.
18507
18508         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
18509         the Define method of the Property class.
18510
18511         * class.cs : Clean up applied patch and update references to variables etc. Fix 
18512         trivial bug.
18513         (TypeContainer::Populate): Update to define all the properties we have. Also
18514         define all enumerations.
18515
18516         * enum.cs (Define): Implement.
18517
18518 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
18519
18520         * cs-parser.jay (overloadable_operator): The semantic value is an
18521         enum of the Operator class.
18522         (operator_declarator): Implement actions.
18523         (operator_declaration): Implement.
18524
18525         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
18526         validity of definitions.
18527         (Operator::CheckBinaryOperator): Static method to check for binary operators
18528         (TypeContainer::AddOperator): New method to add an operator to a type.
18529
18530         * cs-parser.jay (indexer_declaration): Added line to actually call the
18531         AddIndexer method so it gets added ;-)
18532
18533         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
18534         already taken care of by the MS compiler ?  
18535
18536 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
18537
18538         * class.cs (Operator): New class for operator declarations.
18539         (Operator::OpType): Enum for the various operators.
18540
18541 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
18542
18543         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
18544         ostensibly handle this in semantic analysis.
18545
18546         * cs-parser.jay (general_catch_clause): Comment out
18547         (specific_catch_clauses, specific_catch_clause): Ditto.
18548         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
18549         (catch_args, opt_catch_args): New productions.
18550         (catch_clause): Rewrite to use the new productions above
18551         (catch_clauses): Modify accordingly.
18552         (opt_catch_clauses): New production to use in try_statement
18553         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
18554         and re-write the code in the actions to extract the specific and
18555         general catch clauses by being a little smart ;-)
18556
18557         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
18558         Hooray, try and catch statements parse fine !
18559
18560 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
18561
18562         * statement.cs (Block::GetVariableType): Fix logic to extract the type
18563         string from the hashtable of variables.
18564
18565         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
18566         I end up making that mistake ;-)
18567         (catch_clauses): Fixed gross error which made Key and Value of the 
18568         DictionaryEntry the same : $1 !!
18569
18570 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
18571
18572         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
18573
18574         * cs-parser.jay (event_declaration): Correct to remove the semicolon
18575         when the add and remove accessors are specified. 
18576
18577 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
18578
18579         * cs-parser.jay (IndexerDeclaration): New helper class to hold
18580         information about indexer_declarator.
18581         (indexer_declarator): Implement actions.
18582         (parsing_indexer): New local boolean used to keep track of whether
18583         we are parsing indexers or properties. This is necessary because 
18584         implicit_parameters come into picture even for the get accessor in the 
18585         case of an indexer.
18586         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
18587
18588         * class.cs (Indexer): New class for indexer declarations.
18589         (TypeContainer::AddIndexer): New method to add an indexer to a type.
18590         (TypeContainer::indexers): New member to hold list of indexers for the
18591         type.
18592
18593 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
18594
18595         * cs-parser.jay (add_accessor_declaration): Implement action.
18596         (remove_accessor_declaration): Implement action.
18597         (event_accessors_declaration): Implement
18598         (variable_declarators): swap statements for first rule - trivial.
18599
18600         * class.cs (Event): New class to hold information about event
18601         declarations.
18602         (TypeContainer::AddEvent): New method to add an event to a type
18603         (TypeContainer::events): New member to hold list of events.
18604
18605         * cs-parser.jay (event_declaration): Implement actions.
18606
18607 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
18608
18609         * cs-parser.jay (dim_separators): Implement. Make it a string
18610         concatenating all the commas together, just as they appear.
18611         (opt_dim_separators): Modify accordingly
18612         (rank_specifiers): Update accordingly. Basically do the same
18613         thing - instead, collect the brackets here.
18614         (opt_rank_sepcifiers): Modify accordingly.
18615         (array_type): Modify to actually return the complete type string
18616         instead of ignoring the rank_specifiers.
18617         (expression_list): Implement to collect the expressions
18618         (variable_initializer): Implement. We make it a list of expressions
18619         essentially so that we can handle the array_initializer case neatly too.
18620         (variable_initializer_list): Implement.
18621         (array_initializer): Make it a list of variable_initializers
18622         (opt_array_initializer): Modify accordingly.
18623
18624         * expression.cs (New::NType): Add enumeration to help us
18625         keep track of whether we have an object/delegate creation
18626         or an array creation.
18627         (New:NewType, New::Rank, New::Indices, New::Initializers): New
18628         members to hold data about array creation.
18629         (New:New): Modify to update NewType
18630         (New:New): New Overloaded contructor for the array creation
18631         case.
18632
18633         * cs-parser.jay (array_creation_expression): Implement to call
18634         the overloaded New constructor.
18635
18636 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
18637
18638         * class.cs (TypeContainer::Constructors): Return member
18639         constructors instead of returning null.
18640
18641 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
18642
18643         * typemanager.cs (InitCoreTypes): Initialize the various core
18644         types after we have populated the type manager with the user
18645         defined types (this distinction will be important later while
18646         compiling corlib.dll)
18647
18648         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
18649         on Expression Classification.  Now all expressions have a method
18650         `Resolve' and a method `Emit'.
18651
18652         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
18653         generation from working.     Also add some temporary debugging
18654         code. 
18655
18656 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
18657
18658         * codegen.cs: Lots of code generation pieces.  This is only the
18659         beginning, will continue tomorrow with more touches of polish.  We
18660         handle the fundamentals of if, while, do, for, return.  Others are
18661         trickier and I need to start working on invocations soon.
18662
18663         * gen-treedump.cs: Bug fix, use s.Increment here instead of
18664         s.InitStatement. 
18665
18666         * codegen.cs (EmitContext): New struct, used during code
18667         emission to keep a context.   Most of the code generation will be
18668         here. 
18669
18670         * cs-parser.jay: Add embedded blocks to the list of statements of
18671         this block.  So code generation proceeds in a top down fashion.
18672
18673 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
18674
18675         * statement.cs: Add support for multiple child blocks.
18676
18677 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
18678
18679         * codegen.cs (EmitCode): New function, will emit the code for a
18680         Block of code given a TypeContainer and its ILGenerator. 
18681
18682         * statement.cs (Block): Standard public readonly optimization.
18683         (Block::Block constructors): Link children. 
18684         (Block::Child): Child Linker.
18685         (Block::EmitVariables): Emits IL variable declarations.
18686
18687         * class.cs: Drop support for MethodGroups here, delay until
18688         Semantic Analysis.
18689         (Method::): Applied the same simplification that I did before, and
18690         move from Properties to public readonly fields.
18691         (Method::ParameterTypes): Returns the parameter types for the
18692         function, and implements a cache that will be useful later when I
18693         do error checking and the semantic analysis on the methods is
18694         performed.
18695         (Constructor::GetCallingConvention): Renamed from CallingConvetion
18696         and made a method, optional argument tells whether this is a class
18697         or a structure to apply the `has-this' bit.
18698         (Method::GetCallingConvention): Implement, returns the calling
18699         convention. 
18700         (Method::Define): Defines the type, a second pass is performed
18701         later to populate the methods.
18702
18703         (Constructor::ParameterTypes): implement a cache similar to the
18704         one on Method::ParameterTypes, useful later when we do semantic
18705         analysis. 
18706
18707         (TypeContainer::EmitMethod):  New method.  Emits methods.
18708
18709         * expression.cs: Removed MethodGroup class from here.
18710
18711         * parameter.cs (Parameters::GetCallingConvention): new method.
18712
18713 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
18714
18715         * class.cs (TypeContainer::Populate): Drop RootContext from the
18716         argument. 
18717
18718         (Constructor::CallingConvention): Returns the calling convention.
18719         (Constructor::ParameterTypes): Returns the constructor parameter
18720         types. 
18721
18722         (TypeContainer::AddConstructor): Keep track of default constructor
18723         and the default static constructor.
18724
18725         (Constructor::) Another class that starts using `public readonly'
18726         instead of properties. 
18727
18728         (Constructor::IsDefault): Whether this is a default constructor. 
18729
18730         (Field::) use readonly public fields instead of properties also.
18731
18732         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
18733         track of static constructors;  If none is used, turn on
18734         BeforeFieldInit in the TypeAttributes. 
18735
18736         * cs-parser.jay (opt_argument_list): now the return can be null
18737         for the cases where there are no arguments. 
18738
18739         (constructor_declarator): If there is no implicit `base' or
18740         `this', then invoke the default parent constructor. 
18741
18742         * modifiers.cs (MethodAttr): New static function maps a set of
18743         modifiers flags into a MethodAttributes enum
18744         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
18745         MethodAttr, TypeAttr to represent the various mappings where the
18746         modifiers are used.
18747         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
18748
18749 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
18750
18751         * parameter.cs (GetParameterInfo): Fix bug where there would be no
18752         method arguments.
18753
18754         * interface.cs (PopulateIndexer): Implemented the code generator
18755         for interface indexers.
18756
18757 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
18758
18759         * interface.cs (InterfaceMemberBase): Now we track the new status
18760         here.  
18761
18762         (PopulateProperty): Implement property population.  Woohoo!  Got
18763         Methods and Properties going today. 
18764
18765         Removed all the properties for interfaces, and replaced them with
18766         `public readonly' fields. 
18767
18768 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
18769
18770         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
18771         initialize their hashtables/arraylists only when they are needed
18772         instead of doing this always.
18773
18774         * parameter.cs: Handle refs and out parameters.
18775
18776         * cs-parser.jay: Use an ArrayList to construct the arguments
18777         instead of the ParameterCollection, and then cast that to a
18778         Parameter[] array.
18779
18780         * parameter.cs: Drop the use of ParameterCollection and use
18781         instead arrays of Parameters.
18782
18783         (GetParameterInfo): Use the Type, not the Name when resolving
18784         types. 
18785
18786 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
18787
18788         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
18789         and instead use public readonly fields.
18790
18791         * class.cs: Put back walking code for type containers.
18792
18793 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
18794
18795         * class.cs (MakeConstant): Code to define constants.
18796
18797         * rootcontext.cs (LookupType): New function.  Used to locate types 
18798
18799
18800 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
18801
18802         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
18803         this System.Reflection code is.  Kudos to Microsoft
18804
18805         * typemanager.cs: Implement a type cache and avoid loading all
18806         types at boot time.  Wrap in LookupType the internals.  This made
18807         the compiler so much faster.  Wow.  I rule!
18808
18809         * driver.cs: Make sure we always load mscorlib first (for
18810         debugging purposes, nothing really important).
18811
18812         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
18813         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
18814
18815         * rootcontext.cs: Lookup types on their namespace;  Lookup types
18816         on namespaces that have been imported using the `using' keyword.
18817
18818         * class.cs (TypeContainer::TypeAttr): Virtualize.
18819         (Class::TypeAttr): Return attributes suitable for this bad boy.
18820         (Struct::TypeAttr): ditto.
18821         Handle nested classes.
18822         (TypeContainer::) Remove all the type visiting code, it is now
18823         replaced with the rootcontext.cs code
18824
18825         * rootcontext.cs (GetClassBases): Added support for structs. 
18826
18827 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
18828
18829         * interface.cs, statement.cs, class.cs, parameter.cs,
18830         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
18831         Drop use of TypeRefs, and use strings instead.
18832
18833 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
18834
18835         * rootcontext.cs: 
18836
18837         * class.cs (Struct::Struct): set the SEALED flags after
18838         checking the modifiers.
18839         (TypeContainer::TypeAttr): new property, returns the
18840         TypeAttributes for a class.  
18841
18842         * cs-parser.jay (type_list): Oops, list production was creating a
18843         new list of base types.
18844
18845         * rootcontext.cs (StdLib): New property.
18846         (GetInterfaceTypeByName): returns an interface by type name, and
18847         encapsulates error handling here.
18848         (GetInterfaces): simplified.
18849         (ResolveTree): Encapsulated all the tree resolution here.
18850         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
18851         types. 
18852
18853         * driver.cs: Add support for --nostdlib, to avoid loading the
18854         default assemblies.
18855         (Main): Do not put tree resolution here. 
18856
18857         * rootcontext.cs: Beginning of the class resolution.
18858
18859 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
18860
18861         * rootcontext.cs: Provide better error reporting. 
18862
18863         * cs-parser.jay (interface_base): set our $$ to be interfaces.
18864
18865         * rootcontext.cs (CreateInterface): Handle the case where there
18866         are no parent interfaces.
18867
18868         (CloseTypes): Routine to flush types at the end.
18869         (CreateInterface): Track types.
18870         (GetInterfaces): Returns an array of Types from the list of
18871         defined interfaces.
18872
18873         * typemanager.c (AddUserType): Mechanism to track user types (puts
18874         the type on the global type hash, and allows us to close it at the
18875         end). 
18876
18877 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
18878
18879         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
18880         RecordInterface instead.
18881
18882         * cs-parser.jay: Updated to reflect changes above.
18883
18884         * decl.cs (Definition): Keep track of the TypeBuilder type that
18885         represents this type here.  Not sure we will use it in the long
18886         run, but wont hurt for now.
18887
18888         * driver.cs: Smaller changes to accomodate the new code.
18889
18890         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
18891         when done. 
18892
18893         * rootcontext.cs (CreateInterface):  New method, used to create
18894         the System.TypeBuilder type for interfaces.
18895         (ResolveInterfaces): new entry point to resolve the interface
18896         hierarchy. 
18897         (CodeGen): Property, used to keep track of the code generator.
18898
18899 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
18900
18901         * cs-parser.jay: Add a second production for delegate_declaration
18902         with `VOID'.
18903
18904         (enum_body): Put an opt_comma here instead of putting it on
18905         enum_body or enum_member_declarations so we can handle trailing
18906         commas on enumeration members.  Gets rid of a shift/reduce.
18907
18908         (type_list): Need a COMMA in the middle.
18909
18910         (indexer_declaration): Tell tokenizer to recognize get/set
18911
18912         * Remove old targets.
18913
18914         * Re-add the parser target.
18915
18916 2001-07-13  Simon Cozens <simon@simon-cozens.org>
18917
18918         * cs-parser.jay: Add precendence rules for a number of operators
18919         ot reduce the number of shift/reduce conflicts in the grammar.
18920
18921 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
18922
18923         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
18924         and put it here.
18925
18926         Get rid of old crufty code.
18927
18928         * rootcontext.cs: Use this to keep track of the parsed
18929         representation and the defined types available to the program. 
18930
18931         * gen-treedump.cs: adjust for new convention.
18932
18933         * type.cs: Split out the type manager, and the assembly builder
18934         from here. 
18935
18936         * typemanager.cs: the type manager will live here now.
18937
18938         * cil-codegen.cs: And the code generator here. 
18939
18940 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
18941
18942         * makefile: Fixed up for easy making.
18943
18944 2001-07-13  Simon Cozens <simon@simon-cozens.org>
18945
18946         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
18947         the 
18948
18949         (unary_expression): Expand pre_increment_expression and
18950         post_decrement_expression to reduce a shift/reduce.
18951
18952 2001-07-11  Simon Cozens
18953
18954         * cs-tokenizer.cs: Hex numbers should begin with a 0.
18955
18956         Improve allow_keyword_as_indent name.
18957
18958 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
18959
18960         * Adjustments for Beta2. 
18961
18962 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
18963
18964         * decl.cs: Added `Define' abstract method.
18965         (InTransit): new property, used to catch recursive definitions. 
18966
18967         * interface.cs: Implement `Define'. 
18968
18969         * modifiers.cs: Map Modifiers.constants to
18970         System.Reflection.TypeAttribute flags.
18971
18972         * class.cs: Keep track of types and user-defined types.
18973         (BuilderInit): New method for creating an assembly
18974         (ResolveType): New function to launch the resolution process, only
18975         used by interfaces for now.
18976
18977         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
18978         that are inserted into the name space. 
18979
18980 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
18981
18982         * ARGH.  I have screwed up my tree so many times due to the use of
18983         rsync rather than using CVS.  Going to fix this at once. 
18984
18985         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
18986         load types.
18987
18988 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
18989
18990         * Experiment successful: Use System.Type rather that our own
18991         version of Type.  
18992
18993 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
18994
18995         * cs-parser.jay: Removed nsAliases from here.
18996
18997         Use new namespaces, handle `using XXX;' 
18998
18999         * namespace.cs: Reimplemented namespace handling, use a recursive
19000         definition of the class.  Now we can keep track of using clauses
19001         and catch invalid using clauses.
19002
19003 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
19004
19005         * gen-treedump.cs: Adapted for all the renaming.
19006
19007         * expression.cs (Expression): this class now has a Type property
19008         which returns an expression Type.
19009
19010         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
19011         `Type', as this has a different meaning now in the base
19012
19013 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
19014
19015         * interface.cs, class.cs: Removed from all the sources the
19016         references to signature computation, as we can not do method
19017         signature computation during the parsing time, as we are not
19018         trying to solve at that point distinguishing:
19019
19020         class X {
19021                 void a (Blah x) {}
19022                 void a (NS.Blah x) {}
19023         }
19024
19025         Which depending on the context might be valid or not, as we do not
19026         know if Blah is the same thing as NS.Blah at that point.
19027
19028         * Redid everything so the code uses TypeRefs now instead of
19029         Types.  TypeRefs are just temporary type placeholders, that need
19030         to be resolved.  They initially have a pointer to a string and the
19031         current scope in which they are used.  This is used later by the
19032         compiler to resolve the reference to an actual Type. 
19033
19034         * DeclSpace is no longer a CIR.Type, and neither are
19035         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
19036         are all DeclSpaces, but no Types. 
19037
19038         * type.cs (TypeRefManager): This implements the TypeRef manager,
19039         which keeps track of all the types that need to be resolved after
19040         the parsing has finished. 
19041
19042 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
19043
19044         * ARGH.  We are going to have to store `foreach' as a class rather
19045         than resolving it, as we need to verify error 1579 after name
19046         resolution.   *OR* we could keep a flag that says `This request to
19047         IEnumerator comes from a foreach statement' which we can then use
19048         to generate the error.
19049
19050 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
19051
19052         * class.cs (TypeContainer.AddMethod): we now add methods to the
19053         MethodGroup instead of the method hashtable.  
19054
19055         * expression.cs: Add MethodGroup abstraction, which gets us one
19056         step closer to the specification in the way we handle method
19057         declarations.  
19058
19059         * cs-parser.jay (primary_expression): qualified_identifier now
19060         tried to match up an identifier to a local variable reference or
19061         to a parameter reference.
19062
19063         current_local_parameters is now a parser global variable that
19064         points to the current parameters for the block, used during name
19065         lookup.
19066
19067         (property_declaration): Now creates an implicit `value' argument to
19068         the set accessor.
19069
19070 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
19071
19072         * parameter.cs: Do not use `param' arguments as part of the
19073         signature, per the spec.
19074
19075 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
19076
19077         * decl.cs: Base class for classes, structs and interfaces.  This
19078         is the "Declaration Space" 
19079
19080         * cs-parser.jay: Use CheckDef for checking declaration errors
19081         instead of having one on each function.
19082
19083         * class.cs: Factor out some code for handling error handling in
19084         accordance to the "Declarations" section in the "Basic Concepts"
19085         chapter in the ECMA C# spec.
19086
19087         * interface.cs: Make all interface member classes derive from
19088         InterfaceMemberBase.
19089
19090 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
19091
19092         * Many things: all interfaces are parsed and generated in
19093         gen-treedump.  Support for member variables, constructors,
19094         destructors, properties, constants is there.
19095
19096         Beginning of the IL backend, but very little done, just there for
19097         testing purposes. 
19098
19099 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
19100
19101         * cs-parser.jay: Fix labeled statement.
19102
19103         * cs-tokenizer.cs (escape): Escape " and ' always.
19104         ref_line, ref_name: keep track of the line/filename as instructed
19105         by #line by the compiler.
19106         Parse #line.
19107
19108 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
19109
19110         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
19111         to match the values in System.CodeDOM.
19112
19113         Divid renamed to Divide.
19114
19115         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
19116         statements. 
19117         (Statements.set): remove.
19118
19119         * System.CodeDOM/CodeCatchClause.cs: always have a valid
19120         statements. 
19121
19122         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
19123         falseStatements always have valid values. 
19124
19125         * cs-parser.jay: Use System.CodeDOM now.
19126